Commit d2c6646
committed
Fix Bazel 7 related protobuf build failures
Related to bazel-contrib#1482, bazel-contrib#1618, and bazel-contrib#1619. Results from the investigation
documented at:
- bazel-contrib#1619 (comment)
Updates `_import_paths()` in `scala_proto_aspect.bzl` to handle
differences `ProtoInfo.proto_source_root` and `ProtoInfo.direct_sources`
values between Bazel 6 and Bazel 7.
Without this change, `_import_paths()` emits incorrect values under
Bazel 7, causing targets containing generated `.proto` inputs to fail,
e.g. `//test/proto3:test_generated_proto`.
See also:
- Fix paths for sibling repository setup and generated .proto files
bazelbuild/bazel@6c6c196
- The docstring for `ProtoInfo.proto_source_root` in the Bazel sources:
https://github.com/bazelbuild/bazel/blob/7.3.2/src/main/starlark/builtins_bzl/common/proto/proto_info.bzl#L155-L172
- Remove incompatible_generated_protos_in_virtual_imports
bazelbuild/bazel@3efaa32
- Comment from: Generated Protos are no longer considered as
virtual_imports in Bazel 7
bazelbuild/bazel#21075 (comment)
---
I cherrypicked this commit into bazel-contrib#1618. While it fixed the
`//test/proto3` build failure, it does _not_ fix the hanging
scalapb_workers from the ProtoScalaPBRule aspect.
I'll have to investiate further whether than hang is related to Bazel,
rules_proto, com_google_protobuf, or some mixture thereof. Still,
progress!1 parent 14d3fa6 commit d2c6646
1 file changed
+14
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
| |||
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | | - | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
| |||
0 commit comments