rules_buf icon indicating copy to clipboard operation
rules_buf copied to clipboard

Not compatible with the `v1.46.0` buf

Open XSAM opened this issue 1 year ago • 1 comments

I got these errors when running linter with v1.46.0 buf

Executing tests from //:root_proto_lint
-----------------------------------------------------------------------------
Failed with code invalid_argument: validation error:
 - file_descriptors[0].file_descriptor_proto: source_code_info must be present [source_code_info_present]
 - file_descriptors[1].file_descriptor_proto: source_code_info must be present [source_code_info_present]
 - file_descriptors[2].file_descriptor_proto: source_code_info must be present [source_code_info_present]
 - file_descriptors[3].file_descriptor_proto: source_code_info must be present [source_code_info_present]
 - file_descriptors[4].file_descriptor_proto: source_code_info must be present [source_code_info_present]
 - file_descriptors[5].file_descriptor_proto: source_code_info must be present [source_code_info_present]
--buf-plugin_out: protoc-gen-buf-plugin: Plugin failed with status code 1.

Steps to reproduce

  • Change https://github.com/bufbuild/rules_buf/blob/ac66781de2092ac5f146e0db58705123d10d9944/examples/bzlmod/MODULE.bazel#L28 to buf.toolchains(version = "v1.46.0")
  • Run bazel run //:root_proto_lint

XSAM avatar Nov 04 '24 01:11 XSAM

Thank you for reporting, I found the change this started happening at (1.40.0). I'll investigate further and get back here, in the mean time you can use --experimental_proto_descriptor_sets_include_source_info flag to include source code info.

bazel run --experimental_proto_descriptor_sets_include_source_info //:root_proto_lint

You can also add it to .bazelrc:

common --experimental_proto_descriptor_sets_include_source_info

srikrsna-buf avatar Nov 06 '24 03:11 srikrsna-buf

@nicksnyder @srikrsna-buf I think the issue should be re-opened and some blurb should be added to the documentation. I ran into the error as well and it took me quite some time to discover this hidden comment.

guw avatar Jul 18 '25 11:07 guw