-
-
Notifications
You must be signed in to change notification settings - Fork 639
Set incompatible_strict_action_env #3160
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
base: main
Are you sure you want to change the base?
Set incompatible_strict_action_env #3160
Conversation
fd4e075 to
57d1645
Compare
|
@rickeylev I am currently working on bazelbuild/bazel#26587 and @meteorcloudy helped me to trigger https://buildkite.com/bazel/bcr-bazel-compatibility-test/builds/492 to test the flip. We found an issue in the rules_python windows build here which should be in https://github.com/bazel-contrib/rules_python/tree/main/examples/multi_python_versions. Now I am trying to reproduce this in this repo, but CI is still green. Am I setting the flag at the right spot? |
I don't think so. I think that error is coming from the bzlmod example, not multi_python_versions. Which makes sense, this is running the tests that modules have configured for BCR to test, right? Yeah, that'd be examples/bzlmod for rules_python. I updated the pr to set the flag in the bzlmod rc file, lets see how CI goes. |
|
Something that may be relevant to |
|
Thanks @rickeylev for helping out here. Now with CI being green again, do you have any suggestion how to reproduce the errors found here? |
|
Hm. The two suggestions I have are:
An oddity with the error is that it reports files missing or giving permission denied (either could mean the other, though). This is weird because those exe files should always exist (they're generated by bazel after all). I would expect more an error like: those exe's run, then fail to find python.exe (because, for some reason, they get it from PATH). My guess is its something to do with PATH, but that's just a guess. Maybe try having it print the PATH when things pass, print it when it fails, and then try to figure out what's missing, adding bits and pieces back to see the effect. |
|
Unfortunately I don't have a windows machine available, but I can make the PR and try to identify diffs in the env. |
f37df27 to
88eea7f
Compare
9c8b4b0 to
481ca9d
Compare
|
@rickeylev I tried to enable incompatible_strict_action_env as much as possible and now we have 2 actual failures:
The latter fails with |
481ca9d to
e8369c8
Compare
0e2e9bf to
bde22bf
Compare
bde22bf to
6f11729
Compare
6a81f79 to
dfed9aa
Compare
40cf1d5 to
2c683c4
Compare
|
To recap: So the basic problem is, on windows, the outer PATH value needs to be propagated down to tests. Is that about right? Thanks for trudging through this and figuring out the cause! I think we might be able to partially make this more seamless by having py_test return RunEnvironmentInfo.inherited_environment doc. This will, at the least, not require an explicit env_inherit setting on test targets. It also lets us keep it windows-specific (we can check if the target is windows, then only add it if so). There's some existing logic to create RunEnvironmentInfo, and some existing logic to detect the target OS (see common.bzl, maybe_add_test_execution_info). So, something like this:
The --action_env flag still needs to be passed (to tell bazel to propagate it), which isn't ideal, but as a global flag, is still tenable as a solution. |
|
f47ee12 should do what you suggested, but looks like Would you also accept the PR as we had it green to do a follow up to clean this up? |
Reproduce what we found in bazelbuild/bazel#26587 (comment)