Skip to content

Stop setting java_multiple_files for edition 2024 sources - #4664

Merged
pkwarren merged 1 commit into
mainfrom
pkw/java-edition-2024
Sep 1, 2026
Merged

Stop setting java_multiple_files for edition 2024 sources#4664
pkwarren merged 1 commit into
mainfrom
pkw/java-edition-2024

Conversation

@pkwarren

@pkwarren pkwarren commented Sep 1, 2026

Copy link
Copy Markdown
Member

Setting java_multiple_files = true on an edition 2024 or later proto file causes generation to fail. Update managed mode to skip setting this.

Setting `java_multiple_files = true` on an edition 2024 or later proto
file causes generation to fail. Update managed mode to skip setting
this.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 1, 2026, 8:59 PM

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pkwarren
pkwarren merged commit 92aa508 into main Sep 1, 2026
12 checks passed
@pkwarren
pkwarren deleted the pkw/java-edition-2024 branch September 1, 2026 21:10
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.

2 participants