-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
bazel: fix python stub paths #53988
Merged
Merged
bazel: fix python stub paths #53988
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Profpatsch
force-pushed
the
bazel-python-fix
branch
from
January 15, 2019 15:33
afe9540
to
8bcf942
Compare
Pushed a slight correction:
|
Profpatsch
force-pushed
the
bazel-python-fix
branch
from
January 15, 2019 15:58
8bcf942
to
1c9c881
Compare
Since the 0.21 upgrade, the host `$PATH` is not forwarded anymore by default to the sandboxes in charge to realize Bazel actions. This default change broke the `py_binary` rule among other things. Every python binary is wrapped in a stub in charge to setup the execution environment. Currently, this stub's shebang points to a `/usr/bin/env python` which cannot be resolved with the current `$PATH`. This results in breaking any build pipeline requiring the use of python at some point. On top of the incorrect shebang, the stub template is unable to find the actual python binary using `SearchPath`. This PR fixes those two things by re-writing the stub template shebang to the actual python binary and by substituting the faulty default python binary lookup to the right one.
Profpatsch
force-pushed
the
bazel-python-fix
branch
from
January 15, 2019 17:44
1c9c881
to
da8e049
Compare
@GrahamcOfBorg build bazel.tests |
Awesomesauce. Next step is to add tests for all other built-in languages as well. I’ll open an issue for that. |
10 tasks
@abbradar Can you open an issue and ping me in it? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Since the 0.21 upgrade, the host $PATH is not forwarded anymore by default to the sandboxes in charge to realize Bazel actions. This default change broke the py_binary rule among other things.
Every python binary is wrapped in a stub in charge to setup the execution environment. Currently, this stub's shebang points to a
/usr/bin/env python
which cannot be resolved with the current $PATH. This results in breaking any build pipeline requiring the use of python at some point. On top of the incorrect shebang, the stub template is unable to find the actual python binary using SearchPath.This PR fixes those two things by re-writing the stub template shebang to the actual python binary and by substituting the faulty default python binary lookup to the right one.
Notes:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)