-
Notifications
You must be signed in to change notification settings - Fork 556
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
import
paths from external Bazel modules are broken with Bazel 8.0.0
#2515
Comments
I wonder if this is an issue specifically with how I touched that code in the past, let me take a closer look. |
I came up with a fix for This fix is very hacky, though. I need to think about how to address this more cleanly.
|
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Tested locally against the minimal reproducer in that issue.
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Tested locally against the minimal reproducer in that issue.
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Tested locally against the minimal reproducer in that issue.
I have a draft PR, but I want to try adding a test for it. Won't get to it today, but hopefully early tomorrow! |
I think we could just point to the |
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Added a regression test, and tested locally against the minimal reproducer in that issue.
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Added a regression test, and tested locally against the minimal reproducer in that issue.
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Added a regression test, and tested locally against the minimal reproducer in that issue.
That sounds like a good idea, but it looks it was tried a few months ago and had to be reverted (8b0eaed) :( I'm afraid this is way out of scope of this issue. |
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes bazelbuild#2515. Added a regression test, and tested locally against the minimal reproducer in that issue.
It was reverted because the landscape of |
Previously, the import path within the runfiles was only correct for the case --legacy_external_runfiles=True (which copied the runfiles into `$RUNFILES/<main repo>/external/<external repo>/<path>` in addition to `$RUNFILES/<external repo>/<path>`. This flag was flipped to False in Bazel 8.0.0. Fixes #2515. Tested locally against the minimal reproducer in that issue.
Summary
imports
runfiles handling of external projects appears to have broken with the switch to--legacy_external_runfiles=False
in Bazel 8.0.0.Minimal reproducer
https://github.com/armandomontanez/bazel_reproducers/tree/main/external_runfiles_broken_rules_python
Reproduces on both macOS and linux.
Additional notes
I haven't unwound yet whether or not all
import
handling of externalpy_*
rules are completely broken, I noticed this specifically withpy_proto_library
rules that usestrip_import_prefix
and live in an external repository.I noticed this when working with nanopb where
sys.path
reported the import path as:when the files actually existed at:
The text was updated successfully, but these errors were encountered: