-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Duplicated label "@com_google_protobuf//:protobuf_python" in the deps of a py_proto_library #9688
Comments
@epertoso Thank you for the detailed bug report. The test case was easy to reproduce. @Wyverald @meteorcloudy Do you have any ideas on how to fix this? It seems to me like we just need to deduplicate a
|
protocolbuffers/protobuf#9688 caused build errors when trying to integrate the latest `pyprotoc-plugin` changes into https://github.com/3rdparty/eventuals. Fixes build errors of the form: ``` ERROR: /home/vscode/.cache/dazel/tests/external/com_envoyproxy_protoc_gen_validate/validate/BUILD:28:17: Label '@com_google_protobuf//:protobuf_python' is duplicated in the 'deps' attribute of rule 'validate_py' ERROR: /home/vscode/.cache/dazel/tests/external/envoy_api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD:7:18: Target '@com_envoyproxy_protoc_gen_validate//validate:validate_proto' contains an error and its package is in error and referenced by '@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg' INFO: Repository com_github_curl_curl instantiated at: /workspaces/respect/submodules/eventuals/WORKSPACE.bazel:26:5: in <toplevel> /workspaces/respect/submodules/eventuals/bazel/deps.bzl:24:14: in deps /home/vscode/.cache/dazel/tests/external/com_github_3rdparty_bazel_rules_curl/bazel/deps.bzl:30:10: in deps /home/vscode/.cache/dazel/tests/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /home/vscode/.cache/dazel/tests/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in <toplevel> ERROR: Analysis of target '//test:death-client' failed; build aborted: ```
protocolbuffers/protobuf#9688 caused build errors when trying to integrate the latest `pyprotoc-plugin` changes into https://github.com/3rdparty/eventuals. Fixes build errors of the form: ``` ERROR: /home/vscode/.cache/dazel/tests/external/com_envoyproxy_protoc_gen_validate/validate/BUILD:28:17: Label '@com_google_protobuf//:protobuf_python' is duplicated in the 'deps' attribute of rule 'validate_py' ERROR: /home/vscode/.cache/dazel/tests/external/envoy_api/envoy/extensions/filters/network/http_connection_manager/v3/BUILD:7:18: Target '@com_envoyproxy_protoc_gen_validate//validate:validate_proto' contains an error and its package is in error and referenced by '@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg' INFO: Repository com_github_curl_curl instantiated at: /workspaces/respect/submodules/eventuals/WORKSPACE.bazel:26:5: in <toplevel> /workspaces/respect/submodules/eventuals/bazel/deps.bzl:24:14: in deps /home/vscode/.cache/dazel/tests/external/com_github_3rdparty_bazel_rules_curl/bazel/deps.bzl:30:10: in deps /home/vscode/.cache/dazel/tests/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe Repository rule http_archive defined at: /home/vscode/.cache/dazel/tests/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in <toplevel> ERROR: Analysis of target '//test:death-client' failed; build aborted: ```
This is a very tricky problem and indeed one I did not foresee. We can't do 1 since the strings passed in are not "absolute" labels, and unfortunately |
This change fixes a few minor issues to unblock builds in internal: * Patch labels must be qualified by the repository name or they get resolved relative to the calling workspace * `com_google_protobuf` must be overridden and updated to 3.20.1 to get around protocolbuffers/protobuf#9688 Tested: Built internal using `--override_repository` pointing to enkit; `//systest/...` builds. It's possible that other builds still fail; TBD after this is merged. Jira: INFRA-1038
This change fixes a few minor issues to unblock builds in internal: * Patch labels must be qualified by the repository name or they get resolved relative to the calling workspace * `com_google_protobuf` must be overridden and updated to 3.20.1 to get around protocolbuffers/protobuf#9688 Tested: Built internal using `--override_repository` pointing to enkit; `//systest/...` builds. It's possible that other builds still fail; TBD after this is merged. Jira: INFRA-1038
bazelbuild/bazel@b859571 claims to be exactly that. |
What version of protobuf and what language are you using?
Version: v3.20.0
Language: Python
What operating system (Linux, Windows, ...) and version?
GNU/Linux (Debian Buster, dockerized)
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.10.3
What did you do?
Steps to reproduce the behavior:
test_py
target in the minimal example given below ($ bazel build :test_py
)What did you expect to see
A successful build.
What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
We depend on gRPC, which in turns depend on protoc-gen-validate. We saw the error after updating protobuf to v3.20, the failing target is validate_py.
The error was introduced by this PR: #9187, as the test
protobuf/protobuf.bzl
Line 549 in bc799d7
py_libs
anddeps
contain strings, and notLabel
s.Minimal example
WORKSPACE
BUILD
test.proto
The text was updated successfully, but these errors were encountered: