Skip to content

[xDS Proto] Update Bazel build dependencies for Envoy API#29219

Merged
lidizheng merged 3 commits intogrpc:masterfrom
lidizheng:xp-bazel
Mar 29, 2022
Merged

[xDS Proto] Update Bazel build dependencies for Envoy API#29219
lidizheng merged 3 commits intogrpc:masterfrom
lidizheng:xp-bazel

Conversation

@lidizheng
Copy link
Copy Markdown
Contributor

@lidizheng lidizheng commented Mar 25, 2022

First step of #25272.


third_party/protoc-gen-validate.patch: The HEAD and latest releases of protoc-gen-validate have an incorrect hash value for Golang's ProtoBuf library. It's unclear if this is specific to my local environment (hard to believe another well-known library would have obvious build error), but applying this explicit patch did fix the dependency issue.

Envoy protos depends on the protoc-gen-validate to generate C++ proto libraries. It's written in Go, so this PR updates several Go dependencies to make it buildable.

Changes:

  1. Upgraded io_bazel_rules_go;
  2. Upgraded bazel_gazelle;
  3. Upgraded com_envoyproxy_protoc_gen_validate (with patch);
  4. Removed submodule protoc_gen_validate (this was required when we were trying another CMake solution, no longer required).

CC @veblush

@markdroth
Copy link
Copy Markdown
Member

Instead of patching here, can you submit a PR to the proto-gen-validate repo to fix the problem upstream?

@lidizheng
Copy link
Copy Markdown
Contributor Author

@markdroth Posted bufbuild/protoc-gen-validate#582 to the upstream repo.

@lidizheng
Copy link
Copy Markdown
Contributor Author

@jtattermusch PTAL.

For the Go dependency issue, if Envoy folks are acceptive to the change, I will create a follow-up PR to remove the patch.

@lidizheng lidizheng merged commit af97f15 into grpc:master Mar 29, 2022
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Mar 29, 2022
@cpsauer cpsauer mentioned this pull request Mar 30, 2022
@depthwise
Copy link
Copy Markdown

This PR makes it impossible to cleanly include GRPC as an external dependency into workspaces that already include rules_go. Or at least it's unclear how to do so.

@gnossen
Copy link
Copy Markdown
Contributor

gnossen commented Aug 25, 2022

@depthwise Can you please add some more detail? Is the issue the call to go_register_toolchains?

@gowtham-sundara
Copy link
Copy Markdown

@gnossen Yes, you cannot have 2 go_register_toolchains and let's say I want go1.19 in my repo, it's impossible. The older version allowed for dual registration, the new one from io_rules_go does not and makes using this impossible.

@depthwise
Copy link
Copy Markdown

depthwise commented Aug 25, 2022

@gnossen yep. Once I patch it out, things work OK. There's got to be a way to check if it's declared already and not re-declare it if it is. Or alternatively make it a separate function call that the user of the external dependency can simply skip.

@dbernadett
Copy link
Copy Markdown

@gnossen I am also seeing this issue. I'll try some patches, but it would be nice if this didn't have to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/none imported Specifies if the PR has been imported to the internal repository per-call-memory/neutral perf-change/none release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants