rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

[Bazel CI] Error compiling external protobuf source: undeclared inclusion(s) in rule

Open sgowroji opened this issue 4 months ago • 1 comments

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3807#018f03f8-b794-41df-a7d3-38707c4d2f6d

Platform: Windows

Logs:

ERROR: [0mC:/b/uhnenhph/external/protobuf~/src/google/protobuf/BUILD.bazel:70:14: Compiling external/protobuf~/src/google/protobuf/_virtual_imports/type_proto/google/protobuf/type.pb.cc failed: undeclared inclusion(s) in rule '@@protobuf~//src/google/protobuf:type_proto'

Culprit:

Steps:

git clone https://github.com/bazelbuild/rules_proto
git reset d4c3498677e7fbda6f717585276ea4d8b75acec0  --hard
export USE_BAZEL_VERSION=d37762b494a4e122d46a5a71e3a8cc77fa15aa25
bazel build //... 

CC Greenteam @wyverald

sgowroji avatar Apr 23 '24 03:04 sgowroji

This is common pain from the Bazel community as well. IMO rules_proto should stop exercising the "build protoc from source" codepath, as that's only intended for C++ projects per https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation

If you want to use the github main version at HEAD, or you need to modify protobuf code, or you are using C++, it's recommended to build your own protoc binary from source.

I can make that change if the maintainers indicate a willingness to accept it.

alexeagle avatar Apr 29 '24 18:04 alexeagle

Hi @alexeagle, Friendly ping to know the status of the above issue. Thanks!

sgowroji avatar May 14 '24 04:05 sgowroji

Thanks @alexeagle for your suggestions :)

The issue has been fixed in protobuf repo.

comius avatar May 15 '24 13:05 comius