Stop setting java_multiple_files for edition 2024 sources - #4664
Merged
Conversation
Setting `java_multiple_files = true` on an edition 2024 or later proto file causes generation to fail. Update managed mode to skip setting this.
Contributor
|
The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).
|
pkwarren
commented
Sep 1, 2026
| options ...ModifyOption, | ||
| ) error { | ||
| // The option was removed in edition 2024, where its behavior became the | ||
| // default. The latest protoc plugins reject any file that still sets it. |
Member
Author
There was a problem hiding this comment.
Error from buf generate:
> buf generate
Failure: invalid_argument: plugin "buf.build/protocolbuffers/java:v36.1" exited with non-zero status 1
stderr:
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1788296414.665177 1 descriptor.cc:1493] foo/v1/foo.proto foo/v1/foo.proto: google.protobuf.FileOptions.java_multiple_files has been removed in edition 2024: This behavior is enabled by default in editions 2024 and above. To disable it, you can set `features.(pb.java).nest_in_file_class = YES` on individual messages, enums, or services.
emcfarlane
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setting
java_multiple_files = trueon an edition 2024 or later proto file causes generation to fail. Update managed mode to skip setting this.