feat(py_runtime): Allow py_runtime to take an executable target as the interpreter#1621
Merged
rickeylev merged 7 commits intobazel-contrib:mainfrom Jan 8, 2024
Conversation
rickeylev
requested changes
Dec 18, 2023
Contributor
Author
|
Thanks for the review, I've also added a bare bones unit test |
d593067 to
c60b21f
Compare
7cf394f to
c60b21f
Compare
rickeylev
reviewed
Jan 8, 2024
Collaborator
rickeylev
left a comment
There was a problem hiding this comment.
This looks pretty good; almost there. Most is just cosmetic changes. Only real potential bug is the order of checks for the single-file vs executable cases.
I got a bit of time now, so I think I can resolve most of the requested changes and push them into this PR.
* Wrap changelog text * Make comment about allow_files more descriptive * Improve doc about interpreter attribute behavior * use helper_target()
* add tests for binaries with multiple and single outputs * switch to custom rule instead of using sh_binary * fix bug where single-output binary rules wouldn't have runfiles merged in. * puts the tests in a more alphabetical location
rickeylev
approved these changes
Jan 8, 2024
Collaborator
rickeylev
left a comment
There was a problem hiding this comment.
I think this is in good shape and can be merged.
The only thing I can think to add is an integration test to verify that using an sh_binary as described actually works, but that can be done in a separate PR if necessary.
Contributor
Author
|
Awesome, thank you for getting this over the line! |
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.
This PR allows
py_runtimeto accept an executable (e.g.sh_binary).This makes it easier to customize the interpreter binary used, as it allows
intercepting invocation of the interpreter. For example, it can be used to
change how the interpreter searches for dynamic libraries.
Related to #1612