bazel: fix python stub paths#53988
Merged
Profpatsch merged 1 commit intoNixOS:masterfrom Jan 15, 2019
Merged
Conversation
afe9540 to
8bcf942
Compare
Member
|
Pushed a slight correction:
|
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.
1c9c881 to
da8e049
Compare
Member
|
@GrahamcOfBorg build bazel.tests |
Member
|
Awesomesauce. Next step is to add tests for all other built-in languages as well. I’ll open an issue for that. |
Member
10 tasks
Member
|
@abbradar Can you open an issue and ping me in it? |
This file contains hidden or 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
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 pythonwhich 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
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)