-
Notifications
You must be signed in to change notification settings - Fork 558
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
Cannot use py_runtime
with the output of a sh_binary
#1612
Comments
A typical binary rule should just have one output (the executable). Is sh_binary one of those old, funny, rules (like py_binary 🙈 ) where it has two outputs: the executable and the main file? Looking at the I don't see a problem with changing it to |
Thanks for the quick response. I'm still pretty new to bazel, so I could potentially make the changes with guidance. I had some questions about this approach:
|
You can look at the
None. A single-file target is expressed the same way as a multiple-file target (they're both just
Maybe? That depends on what the target being passed as the interpreter needs at runtime. The only issue I can think of is that py_runtime and PyRuntimeInfo don't handle the runfiles of the in-build interpreter, they just take a plain set of files (via the I suggest first making py_runtime.interpreter accept a sh_binary, and then seeing what fails next. You'll likely need to merge |
Awesome, made some changes which allow
Unfortunately I instantly ran into this issue. My |
…the interpreter (#1621) This PR allows `py_runtime` to 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 --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
This was actually inaccurate on my part. I was getting confused by the fact that runfiles are all present in one directory, and not always in the same directory as the binary that they are for. The latest PR fixed our use case, thank you! |
🐞 bug report
Affected Rule
The issue is caused by the rule:
py_runtime
Is this a regression?
NoDescription
We're not able to use
py_runtime
with the output of ash_binary
. This is useful because we want to customize how python searches for dynamic libraries at runtime.🔬 Minimal Reproduction
https://github.com/snakethatlovesstaticlibs/bazel-py-runtime-repro
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
Related to bazelbuild/bazel#4286
The text was updated successfully, but these errors were encountered: