py_binary
does not have runfiles created if called transitively through sh_binary
#2664
Labels
need: repro
Needs a minimal reproduction
🐞 bug report
Affected Rule
This issue discusses the behavior of a
py_binary
target.Is this a regression?
Haven't done a thorough search of past versions yet, but this does work correctly in bazel
6.4.0
and we are now seeing issues in bazel7.5.0
. During the switch, both systems were runningrules_python
version0.37.0
.Description
When a
py_binary
is invoked, the backend will create the necessary<target>.runfiles
directory that includes the relevant dependencies for running the target. There are cases in our system where it useful to wrap the calling of thispy_binary
behind ash_binary
as a data dependency. One such example is to make use of console scripts likeflake8
in the repository as if they were installed in a virtual environment. If one uses thepy_console_script_binary
target directly, all supplied paths to lint must be absolute since the current working directory is modified by bazel when running the target. By changing the working directory, we can get the benefit of having hermetic tooling as a drop-in replacement for something normally provided in a virtual environment.🔬 Minimal Reproduction
Attached a zip of a repro. Instructions to reproduce the behavior are in the README.
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
0.37.0
rules_python_runfiles_repro-main.zip
Anything else relevant?
Thanks for making
rules_python
😃 We're doing a lot of cool things with it!The text was updated successfully, but these errors were encountered: