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

Make edition feature defaults from protoc available #615

Merged
merged 4 commits into from
Nov 17, 2023

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Nov 16, 2023

The recent release v25 of protoc makes edition feature resolution available via a flag:
--experimental_edition_defaults_out outputs a google.protobuf.FeatureSetDefaults message, which can be used to seed feature resolution.

This PR adds functionality to the internal upstream-protobuf package to make it easy to shell out to protoc, and to generate the defaults.

import { FileDescriptorSet, proto3, ScalarType } from "@bufbuild/protobuf";
import { UpstreamProtobuf } from "upstream-protobuf";
Copy link
Member Author

Choose a reason for hiding this comment

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

Since we're here, I've also added the compileToDescriptorSet method, which gives us the generic option to generate descriptors from inline protobuf source, and makes this test a bit more readable.

@timostamm timostamm requested review from a team and Alfus November 16, 2023 20:18
@jhump
Copy link
Member

jhump commented Nov 16, 2023

I'm a little confused by the commit history. IIUC, it looks like the meat of the changes are in e16130a, but that was apparently merged to main already in #616. (Oops?)

The diff for this PR shows zero files changed, so I guess that's why.

Anyhow, I looked at that commit, and it looked sane to me 😄!

@timostamm
Copy link
Member Author

The diff for this PR shows zero files changed, so I guess that's why.

Welp. I split the noisy formatter fixes into separate PRs for a better commit history 😐

Yes, this was supposed to be just e16130a.

@timostamm timostamm merged commit d1cb9fc into main Nov 17, 2023
5 checks passed
@timostamm timostamm deleted the tstamm/edition-feature-defaults branch November 17, 2023 10:12
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.

3 participants