-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it possible to run a nested Bazel in a repository rule and keep the Bazel server around #20447
Comments
@Wyverald I wrote a patch locally that adds a flag to |
I was more thinking along the lines of explicitly telling the outer Bazel to run an inner Bazel because telling software explicitly what to do in the first place is usually a much better option than making it figure that out from circumstantial evidence. Overnight, I had a thought that might even be classified as "productive". Let me start a GitHub discussion about it before it falls out of my brain. Yesterday, my stance about the flag @matts1 mentioned was that I don't like it but I don't see a better option, but now I think I do. |
Here is the proposal: #20464 |
If we're not willing to add a flag to We could add to |
Update: I successfully made the nested bazel server persist using crrev.com/c/5107290. I'm happy to mark this as closed - I'm reasonably comfortable with the current solution. |
Well this is genius; do I understand correctly that what you are doing is to start up a Bazel server "outside", which can then be accessed from within a |
That's correct, yes |
Well then I'd classify this as an "evil genius" kind of hack. Let's continue the discussion on #20464 because that particular solution doesn't look very easy to maintain. |
Description of the feature request:
Clover has the issue that in order to determine the source code that needs to be built, they need a binary written in Rust.
Repository fetching currently can't depend on executing Bazel actions (and it would be a momentous change to make that so) so the next best thing is to run a nested Bazel instance within a repository rule. This works, however, as it is, it cannot keep a Bazel server alive by design: we run repository rules under
process-wrapper
(see here), which makes sure that no processes are left alive using child subreapers. Obviously, this means that the Bazel server cannot be left alive, either.I don't particularly like poking a hole in this otherwise nice architectural boundary, but the alternatives are not nice, either:
So the best alternative I know of is to find a way to allow nested Bazel servers while limiting collateral damage in a clever way.
Which category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
No response
Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: