Skip to content

Commit fd22161

Browse files
py_proto_library: external runfiles fix
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. This is identical to the change made to rules_python in bazel-contrib/rules_python#2516. Work towards bazel-contrib/rules_python#2581. PiperOrigin-RevId: 721941173
1 parent 9a03332 commit fd22161

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bazel/py_proto_library.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ def _py_proto_aspect_impl(target, ctx):
7676
proto_root = proto_root[len(ctx.bin_dir.path) + 1:]
7777

7878
plugin_output = ctx.bin_dir.path + "/" + proto_root
79-
proto_root = ctx.workspace_name + "/" + proto_root
79+
80+
# Import path within the runfiles tree
81+
if proto_root.startswith("external/"):
82+
proto_root = proto_root[len("external") + 1:]
83+
else:
84+
proto_root = ctx.workspace_name + "/" + proto_root
8085

8186
proto_common.compile(
8287
actions = ctx.actions,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy