feat: introduce version constraints for proto toolchain#25163
feat: introduce version constraints for proto toolchain#25163thesayyn wants to merge 1 commit intoprotocolbuffers:mainfrom
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.
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.
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.
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.
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.
For now its exact match, users can use transitions to choose the version.
There was a problem hiding this comment.
I'll add some tests that shows this ability, but for now its defaulting to release version.
There was a problem hiding this comment.
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
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