-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
deps: update protobuf to 3.14 #14253
Conversation
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Please provide guidance how to fix deps check CI. Not sure what I understand what it means. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this opportunity to bump the Go version at https://github.com/envoyproxy/envoy/blob/master/bazel/dependency_imports.bzl#L19 to 1.15.5
?
Changes to dependencies get flagged for approval by https://github.com/orgs/envoyproxy/teams/dependency-shepherds. Policy at https://github.com/envoyproxy/envoy/blob/master/DEPENDENCY_POLICY.md#dependency-shepherds
api/bazel/repository_locations.bzl
Outdated
version = "ec9cd95372b9630aafba2cb4a0e448c43768e0df", | ||
sha256 = "60b4b8036497368512795afca0292d1777d1ce651db76c36706af1733179213a", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we bump to the latest PGV commit?
1bcea29601b5624234a19b3d7f0ebd9e9984f583
2062bbe50eddf3c98490339721fb02b5b5cd78f610f163b98bbf95ba7105553f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
api/bazel/repository_locations.bzl
Outdated
strip_prefix = "protoc-gen-validate-{version}", | ||
urls = ["https://github.com/envoyproxy/protoc-gen-validate/archive/{version}.tar.gz"], | ||
release_date = "2020-06-08", | ||
release_date = "2020-10-28", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release_date
for latest PGV commit as per comment above is 2020-11-30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Kuat Yessenov <kuat@google.com>
There is something wrong with scripts:
|
What does the following mean:
Is it because go dependency somehow became part of data plane? How do I tag "go_repository"? |
@htuch Do you know how to fix protoxform build error:
I can't tell what changed to make it fail... |
I tried to debug this and found that import google
print(google.__path__) shows |
I've looked at this and found that the difference seems to be in: More specifically, the protobuf 3.13.0 version has:
which is missing in protobuf v3.14.0. This seems to be coming from: protocolbuffers/protobuf#7902 |
https://github.com/protocolbuffers/protobuf/blob/v3.14.0/python/google/__init__.py shows it's there? |
I think it's removed from the inner one (in https://github.com/protocolbuffers/protobuf/blob/v3.14.0/python/google/protobuf/__init__.py) |
OK, let me try to add a patch... |
Signed-off-by: Kuat Yessenov <kuat@google.com>
Looks like another CI failure:
There's a weird character in the file name. |
This looks very similar to this bug: bazel-contrib/rules_go#1880 And it seems that the function that fixed the bug was modified recently: I wonder if a patch in
|
@adisuissa I'm more inclined to think this is a bug in Azure task. The tests seem to pass for me locally as well. |
Yeah seems to be a bug of Azure task. Though Windows failure seems real. |
@@ -31,3 +31,9 @@ | ||
# Copyright 2007 Google Inc. All Rights Reserved. | ||
|
||
__version__ = '3.14.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to maintain a patch or can we get a change landed upstream to avoid this? CC @envoyproxy/dependency-shepherds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't quite understand what's the deal with google dependencies, python, and bazel. If someone who understands it better could pick it up, I'd appreciate it. I only see it at the level that this was there before, and it's gone, and it works with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is from protocolbuffers/protobuf@66e3562. @dlj-NaN do you know why that PR would have caused google.api
imports to start breaking?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing to keep in mind is that I can't update googleapis because some python rules are being removed (I need to find out why). So there's that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I don't think any of our build experts has a much better grasp of the Python/Bazel/GoogleAPIs internals, I'd probably start from first principles debugging :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protocolbuffers/protobuf@66e3562 gets pretty deep into the semantics of Python imports and different packaging. The interaction addressed by that commit is very tricky, and may be hidden by varying the order of imports.
(I'm guessing the reason this appeared with a protobuf commit was exactly due to order of imports... google.auth
comes after google.api
alphabetically, but due to transitive imports, google.protobuf
is effectively a very early import in many scenarios.)
The upshot is that there shouldn't be any files named google/__init__.py
in other installed packages. Just as a first guess, this might be caused by installing googleapis/google-auth-library-python as an egg (maybe via setup.py install
?), but other google
packages using native namespaces. (This also gets into what Bazel does in its pip rules....)
Anyhow, some fixes might be:
- Remove
google/__init__.py
from googleapis/google-auth-library-python. (@busunkim96 to comment on that.) - Pre-install the package with an up-to-date version of
pip
, which should install using the native namespace. - Update Bazel's pip rules to make sure it does (2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove google/init.py from googleapis/google-auth-library-python.
Removing google/__init__.py
from the google-auth
will probably be done next quarter as we officially drop 2.7. google-auth is last on the list since it is transitively required by nearly all the cloud client libraries.
Over the past year we've gradually moved google-cloud-API
packages to using native namespace packages (example: google-cloud-texttospeech) while other libraries like google-api-core
, google-cloud-core
, and google-auth
have kept google/__init__.py
with pkg_resources style namespace packages. I see now that setuptools does not recommend this, but we have not seen customers open issues about it. Our docs always point folks pip install
packages.
One thing to keep in mind is that I can't update googleapis because some python rules are being removed (I need to find out why). So there's that.
Are you referring to Bazel rules in https://github.com/googleapis/googleapis or something else?
I don't have much context here so I'm not sure it matters, but the google-cloud-* libraries get their copy of many commonly used protos (google.api
, google.type
, ...) from https://github.com/googleapis/python-api-common-protos, published on PyPI as google-apis-common-protos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is related but I'm trying to land an update to how we process pip dependencies using the latest rules_python
at #14329
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened an issue for further discussion #14412.
We're using googleapis/googleapis here because some protos are missing from https://github.com/googleapis/python-api-common-protos (e.g. google.api.expr
for CEL). Does this mean we can't use PIP approach since there's no pre-generated package I am aware for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip handling changes with the latest rules_python
- https://github.com/bazelbuild/rules_python/releases/tag/0.1.0. PR #14329 that moves us to that handling is blocked due to Windows (/cc @envoyproxy/windows-dev). In theory pip supports installing from Git - https://pip.pypa.io/en/stable/reference/pip_install/#git but no idea if this works for the current deprecated pip method or the new method we are trying to get to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking on the upgrade work, we're seriously out-of-date 😱
Thanks @jayconrod, I found out it's opencensus repo that has a conflict. |
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
/retest |
Retrying Azure Pipelines: |
/retest |
Retrying Azure Pipelines: |
@htuch @moderation This is ready for review again. Let me know if you want to resolve python patch here, or in a followup. |
/lgtm deps |
@@ -16,7 +16,7 @@ load("@rules_antlr//antlr:deps.bzl", "antlr_dependencies") | |||
load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") | |||
|
|||
# go version for rules_go | |||
GO_VERSION = "1.14.7" | |||
GO_VERSION = "1.15.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.15.6 is out but I can bump this in a follow up
@kyessenov I'm good with merging this if you can followup on the Python protobuf patch as a followup. |
@htuch sure, let's open an issue for tracking then. We'll need to include relevant people, since I don't write python with bazel myself and unaware of best practices. |
Can we merge this? I have cel-cpp update staged which needs this protobuf version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks so much for persisting through the obstacle course run!
* master: (49 commits) sds: allow multiple init managers share sds target (envoyproxy#14357) [http] Remove legacy codecs (envoyproxy#14381) http2: Add integration tests for METADATA and RST_STREAM frame flood mitigation for upstream servers (envoyproxy#14365) test: start dissolving :printers_include rule. (envoyproxy#14429) integration tests: re-enable set_node_on_first_message_only (envoyproxy#14270) formatter: add a formatter that returns a google::protobuf::Struct rather than a string (envoyproxy#14258) ratelimit: support returning custom response bodies for non-OK responses from the external ratelimit service (envoyproxy#14189) deps: update protobuf to 3.14 (envoyproxy#14253) stream_info: add setResponseCode and update local_reply to take a normal StreamInfo (envoyproxy#14402) http: alpn upstream (envoyproxy#13922) Moved starttls integration test to test/extensions/transport_sockets/starttls. (envoyproxy#14425) generic conn pool: directly use thread local cluster (envoyproxy#14423) wasm: add mathetake to CODEOWNERS (envoyproxy#14427) wasm: clear route cache when modifying HTTP request headers. (envoyproxy#14318) tls: disable TLS inspector injection (envoyproxy#14404) aggregate cluster: cleanups (envoyproxy#14411) Mark starttls_integration_test flaky on Windows (envoyproxy#14419) tcp: improved unit testing (envoyproxy#14415) config: making protocol config explicit (envoyproxy#14362) wasm: dead code (envoyproxy#14407) ... Signed-off-by: Michael Puncel <mpuncel@squareup.com>
@kyessenov fyi the rules_go update breaks rules_docker (for us internally, maybe for others too): which calls go_register_toolchains() without passing a version... (this was fine before, it'd would fallback to a default). |
@rgs1 Sorry about that. It's hard to get around breaking changes since only the latest version of rules_go supports 3.14 protoc but the latest version also turns duplicate linker warnings into errors. |
All good, I'll send a PR for rules_docker -- just commenting in case anyone else was hitting this. |
bazelbuild/rules_docker#1700 is maybe enough. |
Signed-off-by: Kuat Yessenov kuat@google.com
Commit Message: update protobuf to 3.14
Additional Description:
There is an unfortunate change in 3.14 that changed
go_package
for WKT, which necessitates updating several go dependencies as well:Risk Level: low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features: