Skip to content

Handle vendored descriptor.proto gracefully#4478

Merged
emcfarlane merged 8 commits intomainfrom
ed/partialDesc
Apr 17, 2026
Merged

Handle vendored descriptor.proto gracefully#4478
emcfarlane merged 8 commits intomainfrom
ed/partialDesc

Conversation

@emcfarlane
Copy link
Copy Markdown
Contributor

Upgrade protocompile to handle vendored descriptor.proto.

Fix resolver construction when compiled files include a vendored descriptor.proto. The buf descriptor extension (field 536000000 on FileDescriptorSet) fails protodesc validation when FileDescriptorSet is resolved from the vendored file rather than left as a placeholder, because it has no declared extension ranges. Skip prepending the buf descriptor proto when descriptor.proto is already in the compiled output.

Depends on bufbuild/protocompile#710

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 17, 2026, 3:34 PM

@emcfarlane emcfarlane requested a review from doriable April 16, 2026 17:46
@emcfarlane
Copy link
Copy Markdown
Contributor Author

As an e2e example. The LSP will show errors when using features that are not suported/outside the provided descriptor.proto version. Here I use the dependency buf.build/protocolbuffers/wellknowntypes:v27.1 with an edition 2024 file with the some example features:

Screenshot 2026-04-17 at 11 49 14 AM

The build will also fail with the following errors:

custom.proto:11:16:cannot find message field `enforce_naming_style` in `google.protobuf.FeatureSet`
custom.proto:12:16:cannot find message field `default_symbol_visibility` in `google.protobuf.FeatureSet`
custom.proto:24:28:cannot find message field `large_enum` in `pb.JavaFeatures`

@emcfarlane emcfarlane marked this pull request as ready for review April 17, 2026 15:34
@emcfarlane emcfarlane merged commit 1254fac into main Apr 17, 2026
10 checks passed
@emcfarlane emcfarlane deleted the ed/partialDesc branch April 17, 2026 15:40
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