-
Notifications
You must be signed in to change notification settings - Fork 435
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
Build script env is overridden by use_default_shell_env in Bazel 6 #2665
Comments
This leads to errors that looks like;
|
Current workaround is to either patch rules_rust to disable |
This issue seems to have started manifesting with version 0.43. Any news on how to mitigate for Bazel 6? |
I'd be happy to review a change which added a config option in https://github.com/bazelbuild/rules_rust/blob/main/rust/settings/BUILD.bazel for making this behaviour optional, if someone wanted to prepare one? |
Hey @illicitonion I'm currently looking into this issue now and I'd like to make a PR. I've been doing some debugging and I can see that use_default_shell_env is set to True to pass the PATH to the tool according to the comment on My suggestion would be to then set the Also, I've been trying to reproduce the issue using Bazel 6.5.0 and 6.4.0 and trying to build different examples of the repo from crates_universe but I can't reproduce it. However, I can reproduce it easily in my own Bazel environment. Any suggestion of a test or example to use? Otherwise, I'll try to include one on the PR to prevent regression. |
I am running into this too. Honestly I'm so far down the yaks here I don't know if it's worth it, I was originally trying to work on #2859 but I ran into this just trying to get |
If people are downgrading to 0.42 to avoid this issue, doesn't that make it a little more serious than "I would welcome a PR" ? |
New versions of rules_rust no longer support Bazel 6, and are no longer tested against it, so our official recommendation for Bazel 6 support is: Use a version of rules_rust which works in Bazel 6 (which in this case sounds like it's 0.42). I'm happy to review something that makes Bazel 6 easier to use, if it doesn't have a large maintenance cost, but as (volunteer!) maintainers, we're not going to invest a lot of effort into Bazel 6 support. |
Aha thanks for the background! I'll see what it would take for us to upgrade Bazel. |
We have bumped into an issue where rust_build_script rule sets some custom environment variables alongside the
use_default_shell_env
.Attribute in ctx.actions.run
use_default_shell_env
overrides theenv
attribute due to bazelbuild/bazel#19317rules_rust/cargo/private/cargo_build_script.bzl
Lines 316 to 319 in df80ce6
The text was updated successfully, but these errors were encountered: