Skip to content

Fix protobuf bridging for nested messages.#856

Merged
copybara-service[bot] merged 1 commit intomainfrom
test_901453677
Apr 21, 2026
Merged

Fix protobuf bridging for nested messages.#856
copybara-service[bot] merged 1 commit intomainfrom
test_901453677

Conversation

@copybara-service
Copy link
Copy Markdown

Fix protobuf bridging for nested messages.

Crubit previously incorrectly assumed that the C++ generated class name for a protobuf (e.g. MyMessage_Request) perfectly matched the expected Rust type path (my_message::Request). This caused the rs_bindings_from_cc generator to fail to find the correct type from the Rust protobuf crate.

This fix traverses the DeclContext in C++ to correctly reconstruct the nested snake_case Rust module paths, and uses this reconstructed rust_name in the generator instead of ignoring it.

@copybara-service copybara-service Bot force-pushed the test_901453677 branch 2 times, most recently from efca112 to ec4a5bb Compare April 21, 2026 15:39
Crubit previously incorrectly assumed that the C++ generated class name for a protobuf (e.g. `MyMessage_Request`) perfectly matched the expected Rust type path (`my_message::Request`). This caused the `rs_bindings_from_cc` generator to fail to find the correct type from the Rust protobuf crate.

This fix traverses the `DeclContext` in C++ to correctly reconstruct the nested `snake_case` Rust module paths, and uses this reconstructed `rust_name` in the generator instead of ignoring it.

PiperOrigin-RevId: 903251309
@copybara-service copybara-service Bot merged commit ee9d342 into main Apr 21, 2026
@copybara-service copybara-service Bot deleted the test_901453677 branch April 21, 2026 15:43
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 this pull request may close these issues.

1 participant