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

protobuf_generate passes options in the wrong order to protoc. #12375

Closed
MSK61 opened this issue Mar 31, 2023 · 3 comments
Closed

protobuf_generate passes options in the wrong order to protoc. #12375

MSK61 opened this issue Mar 31, 2023 · 3 comments
Assignees

Comments

@MSK61
Copy link

MSK61 commented Mar 31, 2023

ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${_plugin_options}:${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file}

The plugin options ${_plugin_options} are misplaced between --${protobuf_generate_LANGUAGE}_out and ${protobuf_generate_PROTOC_OUT_DIR}. Even stranger, the options are nonsensically concatenated with a colon : to ${protobuf_generate_PROTOC_OUT_DIR}. I think the correct format for the arguments should be something like:

ARGS ${protobuf_generate_PROTOC_OPTIONS} --${protobuf_generate_LANGUAGE}_out ${protobuf_generate_PROTOC_OUT_DIR} ${_plugin_options} ${_plugin} ${_protobuf_include_path} ${_abs_file}
@acozzette acozzette self-assigned this Apr 18, 2023
copybara-service bot pushed a commit that referenced this issue Apr 19, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525572684
copybara-service bot pushed a commit that referenced this issue Apr 19, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525572684
copybara-service bot pushed a commit that referenced this issue Apr 20, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525591320
@acozzette
Copy link
Member

The format may look strange but I think it's actually correct. A typical flag would look something like --cpp_out=option1,option2:path.

@MSK61
Copy link
Author

MSK61 commented Apr 20, 2023

The format may look strange but I think it's actually correct. A typical flag would look something like --cpp_out=option1,option2:path.

Does this agree with the --cpp_out option description here? It's stated that --cpp_out should only take the directory where the generated files are placed.

@acozzette
Copy link
Member

You are right, it looks like this is not covered in the docs yet.

mkruskal-google pushed a commit that referenced this issue May 4, 2023
This should fix #12374, #12375, and #12450. The `protobuf_PROTOC_EXEC` variable
is not defined, and I think `protobuf::protoc` is what we should be using
instead.

PiperOrigin-RevId: 525591320
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

No branches or pull requests

2 participants