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

Update protoconverter patch #36290

Merged
merged 5 commits into from
Sep 27, 2024
Merged

Conversation

asedeno
Copy link
Contributor

@asedeno asedeno commented Sep 23, 2024

This serves to decouple protoconverter from the protobuf version it was forked off of.

These changes should really be upstream, but upstream is experiencing technical issues taking patches right now, so we'll carry them here until those are resolved.

Risk Level: low
Testing: CI

This serves to decouple protoconverter from the protobuf version it
was forked off of.

These changes should really be upstream, but upstream is experiencing
technical issues taking patches right now, so we'll carry them here
until those are resolved.

Signed-off-by: Alejandro R. Sedeño <[email protected]>
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #36290 was opened by asedeno.

see: more, trace.

@repokitteh-read-only repokitteh-read-only bot added the deps Approval required for changes to Envoy's external dependencies label Sep 23, 2024
Copy link

CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @mattklein123

🐱

Caused by: #36290 was opened by asedeno.

see: more, trace.

@asedeno
Copy link
Contributor Author

asedeno commented Sep 23, 2024

This is one of the roadblocks for updating our C++ Protobuf dependency.

@asedeno asedeno marked this pull request as ready for review September 23, 2024 16:47
@mattklein123
Copy link
Member

Do you have any more context on this? This is a huge patch. What was actually changed here?

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

When protoconverter forked off of protobuf, it brought with it things it should not have. The crippling one was port_def.h, which is a protobuf internal header that among other things defines of PROTOBUF_VERSION, errors out if it finds it is already defined, and checks for a minimum version of GOOGLE_PROTOBUF_VERSION.
https://github.com/grpc-ecosystem/proto-converter/blob/main/src/google/protobuf/util/converter/port_def.inc#L224-L227

Since the fork, this file has changed in protobuf, and importantly, the definition of PROTOBUF_VERSION moved to runtime_version.h.

This parch is large, yes, but also very negative. Some of it is already in upstream, but not exported to github due to technical issues.

The patch removes these files:

  • common.h
  • common.cc
  • common_unittests.cc
  • port_def.inc
  • port_undef.inc

Additionally, it:

  • Removes #includes for the .h and .inc files that were removed.
  • Removes the use of the PROTOBUF_EXPORT macro.
  • Replaces PROTOBUF_PREDICT_FALSE with ABSL_PREDICT_FALSE

And in a few places it reformats things slightly. I tried to filter these formatting-only changes out, but some crept in.

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

I've gone ahead and moved the file deletions to separate patch_cmds to make the patch itself a little easier to digest.

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

/retest

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

/retest

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

Okay, I don't know what's up with Envoy/Publish and verify.

Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 51df4730-5be8-4a3b-8e97-52d8f99ea0ce
ERROR: io.grpc.StatusRuntimeException: UNAUTHENTICATED

@phlax
Copy link
Member

phlax commented Sep 24, 2024

I don't know what's up with Envoy/Publish and verify.

that should be fixed now - i broke it earlier and landed a patch soon after

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

@phlax, when I merged in main it had all your recent changes up to fcfae60.

@phlax
Copy link
Member

phlax commented Sep 24, 2024

argh - another 8( - ill fix it now ...

@phlax
Copy link
Member

phlax commented Sep 24, 2024

should be half fixed - will follow up asap when i figure out the issue

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

Carving off more of #36167.

@asedeno
Copy link
Contributor Author

asedeno commented Sep 24, 2024

Nope, still fails.

2024/09/24 21:16:11 Downloading https://releases.bazel.build/6.5.0/release/bazel-6.5.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 3dafc16c-40a1-4dc6-8559-8708e30f4d82
ERROR: io.grpc.StatusRuntimeException: UNAUTHENTICATED

@phlax
Copy link
Member

phlax commented Sep 24, 2024

im debugging it atm - but its taking a while

@asedeno
Copy link
Contributor Author

asedeno commented Sep 25, 2024

Okay, we're good to go on CI again. Anything else on your end, @mattklein123?

@phlax
Copy link
Member

phlax commented Sep 25, 2024

im really concerned about the amount of patching going on here - if we are going to land this there needs to be a strong justification for doing so

my 2 questions are

  • do we need to update this dep right now
  • can we upstream these changes instead

@asedeno
Copy link
Contributor Author

asedeno commented Sep 25, 2024

We can't update protobuf without landing this because protoconverter upstream is currently tightly coupled to protobuf <27 and builds with newer protobuf will fail. It doesn't need to be nor should it be this tightly coupled.

We can't upstream these changes until upstream fixes their export process from Google's internal repo. Or, rather, I can upstream them but it won't do us any good here until the export is fixed. In fact, some of these changes have already landed but have not been exported.

@phlax
Copy link
Member

phlax commented Sep 25, 2024

if its to update protobuf - we arent going to do that until after the release anyway - so probably i would say take this one slowly and try to get the upstream issues resolved in the meantime

@asedeno
Copy link
Contributor Author

asedeno commented Sep 25, 2024

I assume you mean 1.32.0, and not the 1.31.2 that just happened?

Trying to fix upstream's issues is a parallel track I am working on, yes.

@phlax
Copy link
Member

phlax commented Sep 25, 2024

yeah 1.32 is due in the next few weeks

@asedeno
Copy link
Contributor Author

asedeno commented Sep 26, 2024

I've attempted to fix protoconverter upstream, but it has gotten itself tangled up with things marked google-internal and is currently not exportable in a way that builds.

@mattklein123
Copy link
Member

We can merge this to unblock things as long as you are still working towards fixing the upstream issues. Thank you!

@repokitteh-read-only repokitteh-read-only bot removed the deps Approval required for changes to Envoy's external dependencies label Sep 27, 2024
@mattklein123 mattklein123 merged commit cb18060 into envoyproxy:main Sep 27, 2024
21 checks passed
@asedeno
Copy link
Contributor Author

asedeno commented Sep 27, 2024

Thanks @mattklein123; to alleviate concerns, as soon as upstream export issues are fixed it is my intention that we be able to import this with no patches.

@asedeno asedeno mentioned this pull request Oct 2, 2024
@asedeno asedeno deleted the update_protoconverter branch October 7, 2024 16:40
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

Successfully merging this pull request may close these issues.

3 participants