Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@thesayyn
Copy link
Collaborator

@thesayyn thesayyn commented Jan 5, 2026

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

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):
Copy link
Collaborator Author

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",
Copy link
Member

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

Copy link
Collaborator Author

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").
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

100% agree.

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