[GH-ISSUE #631] [Question] Semver rules for pre-release #4685

Open
opened 2026-06-13 13:01:05 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Moser-ss on GitHub (Oct 26, 2020).
Original GitHub issue: https://github.com/semver/semver/issues/631

Hey, I have a great question.

This rule >=1.2.3 should match the version 4.5.6-rc.1?

Or this rule is only to indicate to I want stable releases?

Because 4.5.6-rc.1 is greater than 1.2.3

Originally created by @Moser-ss on GitHub (Oct 26, 2020). Original GitHub issue: https://github.com/semver/semver/issues/631 Hey, I have a great question. This rule `>=1.2.3` should match the version `4.5.6-rc.1`? Or this rule is only to indicate to I want stable releases? Because 4.5.6-rc.1 is greater than 1.2.3
GiteaMirror added the question label 2026-06-13 13:01:05 -05:00
Author
Owner

@klehelley commented on GitHub (Oct 26, 2020):

Provided the rule you wrote means "higher or equal to 1.2.3 according to the SemVer precedence rules", then version 4.5.3-rc.1 matches.

The way you have worded your question it feels like you are not asking about SemVer "by itself", but in relation to the way it is used by some tools. Am I right to think that? Because if that is the case, you want to ask the tool maintainers what this notation means.

<!-- gh-comment-id:716617025 --> @klehelley commented on GitHub (Oct 26, 2020): Provided the rule you wrote means "higher or equal to `1.2.3` according to the SemVer precedence rules", then version `4.5.3-rc.1` matches. The way you have worded your question it feels like you are not asking about SemVer "by itself", but in relation to the way it is used by some tools. Am I right to think that? Because if that is the case, you want to ask the tool maintainers what this notation means.
Author
Owner

@steveklabnik commented on GitHub (Oct 28, 2020):

Currently, the semver spec does not speak about this at all, so strictly, the answer is unknown.

https://github.com/semver/semver/pull/584 is a proposal to define this behavior. In general, this would not match, because pre-releases only match when a pre-release is requested, though I still have not had time to truly review the proposal and so don't know if it says this or not.

<!-- gh-comment-id:718010331 --> @steveklabnik commented on GitHub (Oct 28, 2020): Currently, the semver spec does not speak about this at all, so strictly, the answer is unknown. https://github.com/semver/semver/pull/584 is a proposal to define this behavior. In general, this would *not* match, because pre-releases only match when a pre-release is requested, though I still have not had time to truly review the proposal and so don't know if it says this or not.
Author
Owner

@Stargateur commented on GitHub (May 11, 2022):

@steveklabnik semver clearly give two examples:

Example: 1.0.0-alpha < 1.0.0.
Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0. https://semver.org/#spec-item-11

I think semver crate of Rust is totally wrong about this. Also I don't see why pre-release should be exclude of this, precedence rules are not about compatibility rules. ^ ~ should clearly exclude pre-release but >= > <= < = should not cause these operator are for ordering so they should use precedence rules.

<!-- gh-comment-id:1123068190 --> @Stargateur commented on GitHub (May 11, 2022): @steveklabnik semver clearly give two examples: > Example: 1.0.0-alpha < 1.0.0. > Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0. https://semver.org/#spec-item-11 I think semver crate of Rust is totally wrong about this. Also I don't see why pre-release should be exclude of this, precedence rules are not about compatibility rules. `^` `~` should clearly exclude pre-release but `>=` `>` `<=` `<` `=` should not cause these operator are for ordering so they should use precedence rules.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/semver#4685