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

Make include_source_info protoc flag configurable #1213

Closed
kgrech opened this issue Dec 27, 2024 · 0 comments · Fixed by #1212
Closed

Make include_source_info protoc flag configurable #1213

kgrech opened this issue Dec 27, 2024 · 0 comments · Fixed by #1212

Comments

@kgrech
Copy link
Contributor

kgrech commented Dec 27, 2024

From the protoc --help:

  --include_source_info       When using --descriptor_set_out, do not strip
                              SourceCodeInfo from the FileDescriptorProto.
                              This results in vastly larger descriptors that
                              include information about the original
                              location of each decl in the source file as
                              well as surrounding comments.

We already support passing disable_comments to disable comment processing during the code generation.

However, when we compile FileDescriptorSet, we always pass --include_source_info. These might cause a problem, especially when the file is later included into the final binary using include_bytes! e.g. because of the following:

  • The comments might contain sensitive private information (comments + file location) which we don't want to be visible in the binary (e.g. when someone disassemble it).
  • It increases the size of the binary
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 a pull request may close this issue.

1 participant