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

[Question] Does buf.dependency support schemas with multiple packages? #76

Closed
veganafro opened this issue May 31, 2024 · 1 comment
Closed

Comments

@veganafro
Copy link

I'm running into errors when trying to depend on well-known-types from the Buf Schema Registry.

The trimmed error message looks like:

gazelle: /private/var/tmp.../external/rules_buf~~buf~buf_deps/google/protobuf: directory contains multiple proto packages. Gazelle can only generate a proto_library for one package.
ERROR: /private/var/tmp/.../external/protobuf~/BUILD.bazel:351:14: in proto_library rule @@protobuf~//:descriptor_proto:
Traceback (most recent call last):
	File "/virtual_builtins_bzl/common/proto/proto_library.bzl", line 88, column 26, in _proto_library_impl
	File "/virtual_builtins_bzl/common/proto/proto_library.bzl", line 212, column 17, in _write_descriptor_set

Does the buf.dependency extension support specifying that I only want to depend on the google.protobuf package?

  • MODULE.bazel:
bazel_dep(name = "rules_proto", version = "6.0.0")
bazel_dep(name = "rules_buf", version = "0.3.0")

buf = use_extension("@rules_buf//buf:extensions.bzl", "buf")
buf.toolchains(version = "v1.32.2", sha256 = "90fc6d90d4b777f6f21fc73258d4c2bcbcbd750bb77f14eeaae125c68a2931cc")
buf.dependency(module = "buf.build/envoyproxy/protoc-gen-validate:89818263b32b46d39c9ecb5984bd2850")
buf.dependency(module = "buf.build/protocolbuffers/wellknowntypes:409ee3f23673455597f9fe23d75eb7a1")
use_repo(buf, "buf_deps")
@veganafro
Copy link
Author

Closing this issue until I have a better understanding of how rules_buf and how its rules interact with protobuf toolchains.

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

1 participant