-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(grpc): Add protobuf codegen
#2320
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LucioFranco
reviewed
Jul 2, 2025
LucioFranco
reviewed
Jul 2, 2025
d39e0f5 to
de384b4
Compare
9e45ab4 to
dfc5213
Compare
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
LucioFranco
reviewed
Jul 24, 2025
Member
LucioFranco
left a comment
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, I tested this locally, the absolute paths is what solved it for me. We can merge this but I want to merge #2321 first and then rebase this ontop of that before we merge this.
copybara-service bot
pushed a commit
to protocolbuffers/protobuf
that referenced
this pull request
Jul 24, 2025
This check was meant to enforce that the version of the protobuf crate exactly matches the version of the codegen crate, but this is not strictly necessary. Tonic would also like to re-export our crate from the `tonic-protobuf` crate, and the `DEP_UPB_VERSION` check is causing problems with that since the environment variable is set only for crates that directly depend on the `protobuf` crate (see [discussion](hyperium/tonic#2320 (comment))). While I was at it I also removed the code in the protobuf build script that sets the `DEP_UPB_INCLUDE` variable, which is unnecessary now that we no longer generate any C code which would need to know where to find upb's headers. PiperOrigin-RevId: 786745312
copybara-service bot
pushed a commit
to protocolbuffers/protobuf
that referenced
this pull request
Jul 24, 2025
This check was meant to enforce that the version of the protobuf crate exactly matches the version of the codegen crate, but this is not strictly necessary. Tonic would also like to re-export our crate from the `tonic-protobuf` crate, and the `DEP_UPB_VERSION` check is causing problems with that since the environment variable is set only for crates that directly depend on the `protobuf` crate (see [discussion](hyperium/tonic#2320 (comment))). While I was at it I also removed the code in the protobuf build script that sets the `DEP_UPB_INCLUDE` variable, which is unnecessary now that we no longer generate any C code which would need to know where to find upb's headers. PiperOrigin-RevId: 786745312
copybara-service bot
pushed a commit
to protocolbuffers/protobuf
that referenced
this pull request
Jul 24, 2025
This check was meant to enforce that the version of the protobuf crate exactly matches the version of the codegen crate, but this is not strictly necessary. Tonic would also like to re-export our crate from the `tonic-protobuf` crate, and the `DEP_UPB_VERSION` check is causing problems with that since the environment variable is set only for crates that directly depend on the `protobuf` crate (see [discussion](hyperium/tonic#2320 (comment))). While I was at it I also removed the code in the protobuf build script that sets the `DEP_UPB_INCLUDE` variable, which is unnecessary now that we no longer generate any C code which would need to know where to find upb's headers. PiperOrigin-RevId: 786760264
acozzette
pushed a commit
to acozzette/protobuf
that referenced
this pull request
Jul 24, 2025
This check was meant to enforce that the version of the protobuf crate exactly matches the version of the codegen crate, but this is not strictly necessary. Tonic would also like to re-export our crate from the `tonic-protobuf` crate, and the `DEP_UPB_VERSION` check is causing problems with that since the environment variable is set only for crates that directly depend on the `protobuf` crate (see [discussion](hyperium/tonic#2320 (comment))). While I was at it I also removed the code in the protobuf build script that sets the `DEP_UPB_INCLUDE` variable, which is unnecessary now that we no longer generate any C code which would need to know where to find upb's headers. PiperOrigin-RevId: 786760264
acozzette
pushed a commit
to protocolbuffers/protobuf
that referenced
this pull request
Jul 24, 2025
This check was meant to enforce that the version of the protobuf crate exactly matches the version of the codegen crate, but this is not strictly necessary. Tonic would also like to re-export our crate from the `tonic-protobuf` crate, and the `DEP_UPB_VERSION` check is causing problems with that since the environment variable is set only for crates that directly depend on the `protobuf` crate (see [discussion](hyperium/tonic#2320 (comment))). While I was at it I also removed the code in the protobuf build script that sets the `DEP_UPB_INCLUDE` variable, which is unnecessary now that we no longer generate any C code which would need to know where to find upb's headers. PiperOrigin-RevId: 786760264
Collaborator
Author
|
Hi @dfawley, @LucioFranco can you please have another look? |
LucioFranco
approved these changes
Jul 30, 2025
dfawley
approved these changes
Jul 30, 2025
cjqzhao
pushed a commit
to cjqzhao/tonic
that referenced
this pull request
Aug 7, 2025
cjqzhao
pushed a commit
to cjqzhao/tonic
that referenced
this pull request
Aug 7, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes the following:
grpc-buildcrate that helps generate code during cargo builds.To keep the CI fast, the protoc plugin binary for each OS is cached. The plugin binaries are re-built only if the plugin's code or build files are updated.
Notes