-
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
Document effect of --incompatible_strict_action_env on autodetecting the Python interpreter #6817
Comments
See also #7026. The stub script uses the interpreter specified by the The long-term solution is for us to create a In the meantime, you can specify |
Just an update on how this would work with toolchains (#7375): There'll be a default Python toolchain that autodetects the Python interpreter on the system at execution time based on Under that system, this behavior is WAI and it's just a matter of documenting the effect of |
See #8536 for interference between the strict action env and the autodetecting toolchain. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post |
Description of the problem
Assume the following:
Now let's say that some rule
foo
's implementation has as one its actions to execute thecmd.py
. Whilebazel run //:cmd
works, executingcmd.py
as part of an action, surprisingly, does not always work. The reason is that thepython_binary
rule will create a stub based on python_stub_template.txt, but the first line of this stub grabs whateverpython
is on thePATH
. If--experimental_strict_action_env
is turned on, then this might not be the intendedpython
. In fact it's not even guaranteed that apython
exists.Consider the following scenario:
PATH=/bin:/usr/bin:/usr/local/bin
andpython
installed in/usr/local/bin
. The rule action in the implementation offoo
will fail, because python is not in thePATH
that--experimental_strict_action_env
uses (hardcoded to/bin:/usr/bin
).Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
NixOS
What's the output of
bazel info release
?bazel v0.18
The text was updated successfully, but these errors were encountered: