-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Setting output_base causing issues with http_archive related rules #182
Comments
Is this because you haven't done a build before so things are downloading for the first time while also doing queries? Choosing the output base directly talks about using It might make more sense to see about running some other command to try and get the downloaded things resolved first so they can be shared after that. |
@laurentlb do you have any suggestions here on what to do? |
Yeah, I first thought this was because I wasn't pre-caching my repos, so I tried running the exact same command first without --output_base, and then again with --output_base. No matter what I did I was getting weird errors with http* rules and callstacks involving /DEFAULT.WORKSPACE.SUFFIX. I'll try to grab some time to get back to this and repro it again and get more details. I agree that the double installBase is bad, and should probably be avoided. It seems almost like there's some kind of bug with non-default outputBase and default installBase location. |
Depending on what you find, it might make sense to open up an issue on bazel itself with your details and reference some of the docs referenced here because either things aren't working as expected, or those docs need some revisiting to cover the issues you are running into. |
Ok. So, the error I get is this
No error if I leave out --output_base or if I change to --output_user_root. I don't think I have enough context to debug this further. My best guess is that the query is running inside the sandbox, and that by setting -output_base we're somehow putting installBase outside of that sandbox which is causing issues. That's a wild guess, but... ? I'll go ahead post this to core bazel and see if they have ideas. |
There is already an issue on this over there. Not exactly the same thing, but very, very close: |
I have the same issue using Bazel in vscode and found a workaround in bazelbuild/bazel#10653 (comment) if that helps anyone. |
Looks like this is the same issue as #216. I think the correct fix is in Bazel. I've put up a PR here: bazelbuild/bazel#21005 |
Closing this as duplicate of #216. The fix will be in Bazel 7.1.0. |
The on demand download rules wind up downloading to paths outside of output_base, which causes all sorts of bad behavior when "Queries Share Server" is not selected (and that setting is off by default).
I've found that setting --output_user_root instead of --output_base (in bazel_query.ts) fixes the issue quite nicely.
I can put together a pull request for this if you'd like (if it's an acceptable solution to the issue).
The text was updated successfully, but these errors were encountered: