-
Notifications
You must be signed in to change notification settings - Fork 16k
feat: introduce version constraints for proto toolchain #25163
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
base: main
Are you sure you want to change the base?
Conversation
This feature adds semver range matching for prebuilt protoc toolchains. The internal protoc_major, protoc_minor, and protoc_patch settings default to RELEASE_VERSION (e.g., 33.0.0). Downstream projects can apply their own transitions to request a specific version range. Toolchains match if the requested version aligns at any granularity—so a v33.0.0 toolchain matches requests for 33, 33.0, or 33.0.0, enabling the protobuf cross-version runtime guarantee.
| RELEASE_VERSION = _TEST_VERSION | ||
| RELEASED_BINARY_INTEGRITY = _TEST_SHAS | ||
|
|
||
| def _parse_version(version): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably exists somewhere else, maybe in skylib
|
|
||
| # Internal settings (set by transition, not by users directly) | ||
| string_setting( | ||
| name = "protoc_major", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
protoc actually doesn't have a major version (or you could say every version is a major version bump and it has no patch releases). https://protobuf.dev/support/version-support/ explains this a little more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can simplify this a little more to match the versioning guarantees.
| ) | ||
|
|
||
| # User-facing version flag for semver toolchain matching. | ||
| # Users can set this to request a specific protoc version (e.g., "33", "33.0", or "33.0.0"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can users actually do anything with this? It seems like it would error for anything but an ~exact match
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now its exact match, users can use transitions to choose the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add some tests that shows this ability, but for now its defaulting to release version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but that means that right now, it's pretty much useless because the only thing you can do is specify a single version (that should be the default anyway) right? We should probably at least clarify that in the comments, that this isn't really useful yet but will be user-facing in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% agree.
This feature adds semver range matching for prebuilt protoc toolchains. The internal protoc_major, protoc_minor, and protoc_patch settings default to RELEASE_VERSION (e.g., 33.0.0). Downstream projects can apply their own transitions to request a specific version range. Toolchains match if the requested version aligns at any granularity—so a v33.0.0 toolchain matches requests for 33, 33.0, or 33.0.0, enabling the protobuf cross-version runtime guarantee.
Continuation of #24115