Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular dependency with protobuf #4196

Open
mering opened this issue Dec 16, 2024 · 4 comments
Open

Circular dependency with protobuf #4196

mering opened this issue Dec 16, 2024 · 4 comments

Comments

@mering
Copy link
Contributor

mering commented Dec 16, 2024

What version of rules_go are you using?

0.51.0

What version of gazelle are you using?

0.40.0

What version of Bazel are you using?

8.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Linux

Any other potentially useful information about your toolchain?

I found this in https://github.com/bazelbuild/bazel-central-registry/pull/3414/files (logshttps://buildkite.com/bazel/bcr-presubmit/builds/9387#0193c668-67e2-4bf9-ad25-ac0ca0d40321) but also stumbled over this in our internal workspace for other dependencies where we use the latest version of Bazel deps (go.mod might be a little bit older).

What did you do?

Use Gazelle to build go.mod dependencies.

What did you expect to see?

Working just fine.

What did you see instead?

(18:25:05) ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/5bf8f7e7e7bb5e412d42f707ae65b6b9/external/rules_go+/proto/BUILD.bazel:24:18: in _go_proto_compiler rule @@rules_go+//proto:go_proto: cycle in dependency graph:
    @@protoc-gen-validate+//bazel/go:pgv_plugin_go (48c0a821cf0ed18ef2cbc1ea1d4a740d63398d359260dd0e0d15ea5340fb561e)
    @@protoc-gen-validate+//bazel/go:pgv_plugin_go (6042ca88946d439c676f8f6934f1607d03dd673e4afcca85f0ca449072a5f1db)
    @@protoc-gen-validate+//bazel/go:pgv_plugin_go_reset_plugin_ (ca5463bbfab481435841d997e799fc56f9e2d61c061c1694867c0133c2dd0e8a)
    @@protoc-gen-validate+//:protoc-gen-validate (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
    @@protoc-gen-validate+//:protoc-gen-validate_lib (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
    @@protoc-gen-validate+//module:module (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
    @@protoc-gen-validate+//validate:validate_go (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
    @@protoc-gen-validate+//validate:validate_go_proto (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
.-> @@rules_go+//proto:go_proto (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@rules_go+//proto:go_proto_reset_plugin_ (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+com_github_golang_protobuf//protoc-gen-go:protoc-gen-go (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+com_github_golang_protobuf//protoc-gen-go:protoc-gen-go_lib (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+org_golang_google_protobuf//compiler/protogen:protogen (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+org_golang_google_protobuf//reflect/protodesc:protodesc (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+org_golang_google_protobuf//src/google/protobuf:gofeaturespb (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
|   @@gazelle++go_deps+org_golang_google_protobuf//src/google/protobuf:gofeaturespb_go_proto (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
`-- @@rules_go+//proto:go_proto (dc2b93f47f15dcd32b7df9eaa6e969f0abf6a08d6340f3631337d326c9bcde5c)
@fmeum
Copy link
Member

fmeum commented Dec 16, 2024

@linzhp I think that we've seen this before, but I don't remember what caused it. Do you have an idea?

@linzhp
Copy link
Contributor

linzhp commented Dec 16, 2024

Can you try disabling the go_proto_library rules in org_golang_google_protobuf with gazelle:go_generate_proto false?

@mering
Copy link
Contributor Author

mering commented Dec 16, 2024

@linzhp How can I do this in a non-root module like bazelbuild/bazel-central-registry#3414?

@fmeum
Copy link
Member

fmeum commented Dec 17, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants