Bazel WORKSPACE forces downstream projects to explicitly enumerate protoc-gen-validate's dependencies
Related: https://github.com/envoyproxy/protoc-gen-validate/issues/136 Related: https://github.com/grpc/grpc/issues/19835
It is standard practice to leave direct invocations of repository rules out of one's WORKSPACE file and instead to farm them off to a separate .bzl containing a PROJECT_deps() macro (i.e. protoc_gen_validate_deps()) that downstream projects can use to consume all dependencies without explicitly enumerating all transitive dependencies.
I'm willing to put up a PR to resolve this issue if the maintainers are amenable to the change.
@akonradi
Thanks for the info! I have no complaints here, but defer to @akonradi or someone more experienced with Bazel to comment.
@gnossen Thanks, I don't use Bazel much in OSS land so I wasn't aware of this particular wart. Happy to review a PR to fix this.
@gnossen Does #258 address this sufficiently?
I think the following is related to this issue.
I have the following in WORKSPACE:
http_archive(
name = "com_envoyproxy_protoc_gen_validate",
sha256 = "4c692c62e16c168049bca2b2972b0a25222870cf53e61be30b50d761e58728bd",
strip_prefix = "protoc-gen-validate-0.6.7",
urls = [
"https://github.com/envoyproxy/protoc-gen-validate/archive/refs/tags/v0.6.7.tar.gz",
],
)
# Load the dependencies of PGV. This is required for the next step to work.
load("@com_envoyproxy_protoc_gen_validate//bazel:repositories.bzl", "pgv_dependencies")
pgv_dependencies()
# Perform any necessary actions to initialize dependencies.
load("@com_envoyproxy_protoc_gen_validate//bazel:dependency_imports.bzl", "pgv_dependency_imports")
pgv_dependency_imports()
load("@com_envoyproxy_protoc_gen_validate//:dependencies.bzl", "go_third_party")
go_third_party()
But the following error is hit:
File "/home/nyap/.cache/bazel/_bazel_nyap/0205f642c591b57580b66c4cefe4a908/external/com_envoyproxy_protoc_gen_validate/bazel/dependency_imports.bzl", line 5, column 40, in <toplevel>
load("@rules_python//python:pip.bzl", "pip_install")
Error: file '@rules_python//python:pip.bzl' does not contain symbol 'pip_install'