bazel-contrib / bazel-contrib/rules_go
secretmanager_proto doesn'\''t directly depend on a proto_library that '\''srcs'\'' it.'
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
### What version of rules_go are you using?
v0.37.0
### What version of gazelle are you using?
v0.28.0
### What version of Bazel are you using?
5.4.0
### Does this issue reproduce with the latest releases of all the above?
Yes
### What operating system and processor architecture are you using?
Darwin MacOS version 12.5.1 intel Chipset
### What did you do?
Building a go module with above described versions
### What did you expect to see?
A succesful execution
### What did you see instead?
`google/cloud/secretmanager/v1/resources.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
ERROR: /private/var/tmp/_bazel_udhamsingh/dc16e0ae3780655f2259c44c62c986e7/external/go_googleapis/google/cloud/secretmanager/v1/BUILD.bazel:21:17 GoCompilePkg external/go_googleapis/google/cloud/secretmanager/v1/secretmanager_go_proto.a failed: (Exit 1): sandbox-exec failed: error executing command
(cd /private/var/tmp/_bazel_udhamsingh/dc16e0ae3780655f2259c44c62c986e7/sandbox/darwin-sandbox/600/execroot/harness_monorepo && \
exec env - \
PATH=/bin:/usr/bin:/usr/local/bin \
TMPDIR=/var/folders/vs/rxltpcn91hz8cnxf_9bw5vkw0000gr/T/ \
VERIFICATION_SERVICE_SECRET=67d9b94d9856665afc21acd3aa745401 \
/usr/bin/sandbox-exec -f /private/var/tmp/_bazel_udhamsingh/dc16e0ae3780655f2259c44c62c986e7/sandbox/darwin-sandbox/600/sandbox.sb /var/tmp/_bazel_udhamsingh/install/47f1c25bb3cb1d9b4a99f26940323be5/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--proto_path=external/go_googleapis' '--proto_path=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/descriptor_proto' '--proto_path=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/duration_proto' '--proto_path=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/field_mask_proto' '--proto_path=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/empty_proto' '--proto_path=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/timestamp_proto' '--descriptor_set_out=bazel-out/darwin-fastbuild/bin/external/go_googleapis/google/cloud/secretmanager/v1/secretmanager_proto-descriptor-set.proto.bin' '-Igoogle/cloud/secretmanager/v1/resources.proto=external/go_googleapis/google/cloud/secretmanager/v1/resources.proto' '-Igoogle/cloud/secretmanager/v1/service.proto=external/go_googleapis/google/cloud/secretmanager/v1/service.proto' '-Igoogle/api/annotations.proto=external/go_googleapis/google/api/annotations.proto' '-Igoogle/api/client.proto=external/go_googleapis/google/api/client.proto' '-Igoogle/api/field_behavior.proto=external/go_googleapis/google/api/field_behavior.proto' '-Igoogle/api/http.proto=external/go_googleapis/google/api/http.proto' '-Igoogle/api/resource.proto=external/go_googleapis/google/api/resource.proto' '-Igoogle/api/routing.proto=external/go_googleapis/google/api/routing.proto' '-Igoogle/api/launch_stage.proto=external/go_googleapis/google/api/launch_stage.proto' '-Igoogle/protobuf/descriptor.proto=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/descriptor_proto/google/protobuf/descriptor.proto' '-Igoogle/protobuf/duration.proto=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/duration_proto/google/protobuf/duration.proto' '-Igoogle/iam/v1/iam_policy.proto=external/go_googleapis/google/iam/v1/iam_policy.proto' '-Igoogle/iam/v1/options.proto=external/go_googleapis/google/iam/v1/options.proto' '-Igoogle/iam/v1/policy.proto=external/go_googleapis/google/iam/v1/policy.proto' '-Igoogle/type/expr.proto=external/go_googleapis/google/type/expr.proto' '-Igoogle/protobuf/field_mask.proto=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/field_mask_proto/google/protobuf/field_mask.proto' '-Igoogle/protobuf/empty.proto=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/empty_proto/google/protobuf/empty.proto' '-Igoogle/protobuf/timestamp.proto=bazel-out/darwin-fastbuild/bin/external/com_google_protobuf/_virtual_imports/timestamp_proto/google/protobuf/timestamp.proto' --direct_dependencies google/api/annotations.proto:google/api/client.proto:google/api/field_behavior.proto:google/api/http.proto:google/api/resource.proto:google/api/routing.proto:google/iam/v1/iam_policy.proto:google/iam/v1/options.proto:google/iam/v1/policy.proto:google/protobuf/duration.proto:google/protobuf/empty.proto:google/protobuf/field_mask.proto:google/protobuf/timestamp.proto:google/cloud/secretmanager/v1/resources.proto:google/cloud/secretmanager/v1/service.proto '--direct_dependencies_violation_msg=%s is imported, but @go_googleapis//google/cloud/secretmanager/v1:secretmanager_proto doesn'\''t directly depend on a proto_library that '\''srcs'\'' it.' external/go_googleapis/google/cloud/secretmanager/v1/resources.proto external/go_googleapis/google/cloud/secretmanager/v1/service.proto)
`
Contributor guide
Research direction
Start with external/go_googleapis/google/cloud/secretmanager/v1/BUILD.bazel and the failing GoCompilePkg command in the report; compare the secretmanager_proto dependencies with the imported resources.proto and service.proto files. Reproduce with rules_go v0.37.0, Gazelle v0.28.0, and Bazel 5.4.0, then verify that the build completes without the direct-dependency or proto3-optional errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100