Open ted-xie opened 1 month ago
I looked into this and the root cause is that:
ProtoInfo.proto_source_root
is "external/maybe_rules_go_proto_bug~"
and the path of the proto is "external/maybe_rules_go_proto_bug~/proto/foo.proto"
ProtoInfo.proto_source_root
is ""
and the path of the proto is "../maybe_rules_go_proto_bug~/proto/foo.proto"
This looks like a bug in ProtoInfo
, probably in this line
https://github.com/bazelbuild/bazel/blob/3a1b336ec8250547651f6c148f79ba1ced2448f2/src/main/starlark/builtins_bzl/common/proto/proto_info.bzl#L122
/cc @comius
What version of rules_go are you using?
0.48. The issue also reproduces at commit 354a98f4acf2333b7603ede50dd5fbc20ae315b1.
What version of gazelle are you using?
N/A
What version of Bazel are you using?
7.1.2
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Debian-based Linux variant, x86_64 architecture.
Any other potentially useful information about your toolchain?
N/A
What did you do?
See repro at https://github.com/ted-xie/rules_go_proto_bug. TL;DR building a go_proto_library rule that's part of an external dependency with
--experimental_sibling_repository_layout
fails. Failure message:What did you expect to see?
I expected the build to succeed.
What did you see instead?
The build fails due to the go proto compiler not being able to find the proto definition.
/cc @ahumesky