Repository navigation
fix(version): ignore SemVer build metadata and compare long numbers - #158
Merged
Merged
Conversation
fix(version): accept build metadata like `+build.5` in constraints again, as 1.18.0 did, and after a pre-release fix(version): read `+…` on a tag as build metadata, so `1.2.3+beta` is a stable `1.2.3` Build metadata follows the SemVer grammar: a plus, then dot-separated identifiers of letters, digits and hyphens. It can come after the number, a pre-release or a tail. It never changes order, stability, equality or matching, and it stays only in the version string. `1.2.3+5-beta` is `1.2.3` with metadata `5-beta`, and `1.2.3-linux+build.5` keeps the tail `linux`. Version numbers now compare part by part as digit strings, so parts too long for an integer no longer compare equal. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
`dload show` and the download log print the version with its pre-release and build metadata, `1.2.3-rc.1+build.5` instead of `1.2.3`. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
roxblnfk
added a commit
that referenced
this pull request
Oct 12, 2026
…158) fix(version): accept build metadata like `+build.5` in constraints again, as 1.18.0 did, and after a pre-release fix(version): read `+…` on a tag as build metadata, so `1.2.3+beta` is a stable `1.2.3` fix(binary): show the whole version a binary prints, with its pre-release and build metadata Build metadata follows the SemVer grammar on tags, binary output and constraints, and never changes order, stability or matching. Version numbers compare part by part as digit strings, so parts too long for an integer no longer compare equal. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
roxblnfk
added a commit
that referenced
this pull request
Oct 12, 2026
…158) fix(version): accept build metadata like `+build.5` in constraints again, as 1.18.0 did, and after a pre-release fix(version): read `+…` on a tag as build metadata, so `1.2.3+beta` is a stable `1.2.3` fix(binary): show the whole version a binary prints, with its pre-release and build metadata Build metadata follows the SemVer grammar on tags, binary output and constraints, and never changes order, stability or matching. Version numbers compare part by part as digit strings, so parts too long for an integer no longer compare equal. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was changed
+build.5,+5,+exp.sha.5114f85) follows the SemVer grammar on tags, binary output and constraints, after the number, a pre-release or a tail, and is ignored for ordering, stability and matching:>=1.2.3+build.5parses again as it did in 1.18.0, and1.2.3-beta.1+build.5is1.2.3-beta.1.+…on a tag is always metadata:1.2.3+betais a stable1.2.3(it read as beta before), and1.2.3+5-betais1.2.3with metadata5-beta.Version::$numberno longer carries the metadata;dload showand the download log print the whole version a binary prints, pre-release and metadata included (1.2.3-rc.1+build.5).>1.99999999999999999998accepts1.99999999999999999999;version_compareis gone fromVersion.Why?
Copilot's review of #155 found these after it was merged: metadata with letters was rejected in constraints and misread on tags, and long number parts compared as equal.
Review notes
-devfrom a lower bound that carries metadata, so~1.0+build-7rejects1.0.0-RC1there while~1.0accepts it; DLoad strips the metadata first, so both forms agree.Checklist