Skip to content

Conversation

@zaharidichev
Copy link
Member

Our workload.proto package has a package definition in it. We rely on that package definition for naming our generated protobuf file. We however do not want the package details being part of the service/method names of the generated client code.

For that purpose we have used the disable_package_emission method successfully in the past in order to generate code that does not have the package details in the service/method names.

When we moved to tonic_prost_build however in this PR, we have lost this functionality as the emit_package method does not seem to be honored.

In order to fix that and revert back to generating code with the correct service definitions while still preserving the name of the generated rust file, this PR:

  • removes the package definition from the protobuf file
  • adds a post processing step that renames the generated _.rs file to what it is supposed to be

@zaharidichev zaharidichev requested a review from alpeb November 25, 2025 18:26
@alpeb
Copy link
Member

alpeb commented Nov 25, 2025

I've pushed a change that configures the default name, and thus we don't have to rename the file.

Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tested fine end-to-end 👍

@cratelyn cratelyn self-requested a review November 25, 2025 19:37
@cratelyn cratelyn marked this pull request as ready for review November 25, 2025 21:51
@cratelyn cratelyn requested a review from a team as a code owner November 25, 2025 21:51
@cratelyn cratelyn merged commit 9e09c13 into main Nov 25, 2025
15 checks passed
@cratelyn cratelyn deleted the zd/spire-proto-no-packages branch November 25, 2025 21:52
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.

4 participants