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

bazel: set --include_source_info when generating protobuf code #68806

Merged
merged 1 commit into from Aug 12, 2021

Commits on Aug 12, 2021

  1. bazel: set --include_source_info when generating protobuf code

    This flag [instructs Bazel](bazelbuild/rules_proto#56 (comment))
    to set a [command-line flag](protocolbuffers/protobuf#7623 (comment))
    when invoking `protoc` that causes the generated proto descriptor sets
    to contain extra info:
    
    ```
      --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.
    ```
    
    Setting this solves two problems:
    
    1. We need the descriptor sets to have comments for cockroachdb#65814.
    2. Without this change, generated `.pb.go` files from the sandbox won't
       contain comments. This makes the files more difficult to read and
       dirties the files in your checkout if you copy those `.pb.go` files
       to your workspace.
    
    Also delete an unnecessary `--symlink_prefix=_bazel/` from the `test`
    configuration (it's inherited from the `build` configuration so it's
    redundant).
    
    Release note: None
    rickystewart committed Aug 12, 2021
    Configuration menu
    Copy the full SHA
    90f9e3b View commit details
    Browse the repository at this point in the history