-
Notifications
You must be signed in to change notification settings - Fork 559
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
runfiles / PYTHONPATH issue when running a py_binary with proto deps from a custom rule #934
Comments
I added a few lines to
Then I built the package with
If you look at the environment generated by the rule,
Looking at just the first two cases where
The __path__ = __import__('pkgutil').extend_path(__path__, __name__) As a result, only the first If you build
You'll find that More info is available on this issue here: In your example repo, setting |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?" |
🐞 bug report
Affected Rule
The issue is caused by the rule: py_binary
Is this a regression?
Not as far as I can tell.
Description
A
py_binary
with proto deps doesn't seem to be trivially runnable as a tool from a custom rule - PYTHONPATH entries seem to end up missing (or possibly runfiles aren't built/propagated properly).🔬 Minimal Reproduction
https://github.com/illicitonion/repro-bazel-python-proto-import-error
See the README.md there for examples of commands which do and don't work. In particular, directly
bazel run
ing thepy_binary
works, but wrapping it in a trivial rule to run it does not.🌍 Your Environment
Operating System:
macOS
Output of
bazel version
:5.3.2
Rules_python version:
0.16.1
The text was updated successfully, but these errors were encountered: