-
Notifications
You must be signed in to change notification settings - Fork 243
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
buf breaking
with .txtpb
files
#2355
Comments
Hmm - no, not expected heh. Can you provide us a reproducible example? |
The zip includes the .proto files, compiled Python files, and |
I'm not sure what to do with the files - can you provide a specific, reproducible example with reproduction steps? For example, indicate which commands to run to see the error. |
I remade the zip so that it matches more closely with my repo structure. You'll want to run the commands from the parent of this zip once it's unarchived. Using the Python grpc tools plugin (which in turn uses protoc) works as expected: $ python -m grpc_tools.protoc --proto_path=. --include_imports --include_source_info -o buf_example/proto/image.txtpb --python_out=. --grpc_python_out=. --buf-breaking_out=. '--buf-breaking_opt={"against_input":"buf_example/proto/image.txtpb","limit_to_input_files":true}' buf_example/proto/messages.proto buf_example/proto/interface.proto
--buf-breaking_out: buf_example/proto/messages.proto:10:3:Field "1" on message "GetExampleEndpointResponse" changed type from "string" to "double" Using the buf cli, I get this error: $ buf breaking --against buf_example/proto/image.txtpb --path buf_example/proto/messages.proto --path buf_example/proto/interface.proto
Failure: could not unmarshal image: proto: syntax error (line 2:1): invalid field name: � |
You're creating a binary format However, if you were using
This is being fixed in #2361. As a temporary workaround, this will correctly create a text image:
|
Thanks for looking into it! A few questions:
Why do I need to supply the
Is it possible for it to output a text format instead, or do you have another recommendation here? Since my org uses |
Actually I was mistaken -
With
You don't need to use |
Ah so my current implementation is this. For reference, this is the command I'm using:
|
I've attempted to create exact end-to-end reproduction steps, but am unable to reproduce the success of this command. If I run: rm -f image.txtpb
protoc \
--proto_path=. \
--include_imports \
--include_source_info \
-o image.txtpb \
buf_example/proto/messages.proto \
buf_example/proto/interface.proto
protoc \
--proto_path=. \
--buf-breaking_out=. \
'--buf-breaking_opt={"against_input":"image.txtpb","limit_to_input_files":true}' \
buf_example/proto/messages.proto \
buf_example/proto/interface.proto The result is:
Which is as expected. |
Hmm weird, I ran those same commands on my machine and it worked perfectly fine. I'm using |
I'm not sure, but perhaps you have some other installation issue. If you're able to provide reproduction steps for us, we're happy to take a look, but since we're not able to reproduce this issue, I'm not sure there's more we can do. Closing for now, but let us know if you run into other difficulties. |
I just had a potential reason this might be the case - can you confirm what version of |
I'm unable to get the version of |
|
Oh, how can I check the version of |
There's no builtin way - you'll need to check from where you're installing. |
So, I just upgraded my buf install to 1.26.1 -- and that resulted in the same behavior that you were experiencing. If that's the expected result, I'll go ahead and update my usage. Thanks again for the assistance. |
I have
protoc
outputting a file descriptor set, with a.txtpb
extension. When I use theprotoc-gen-buf-breaking
plugin, the breaking change detector is able to compare against the file descriptor set as expected. However, when I try to do the same via the CLI:I get:
Is this expected?
The text was updated successfully, but these errors were encountered: