You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that a pre-release should always be lower priority than a release, and the presence of a hyphen makes it a prerelease. According to the semver spec (item 9) a prerelease may itself contain a hyphen, so this should be legal.
(a workaround which works for me, by the way, is to instead use + inside the prerelease string: 0.0.1-3+1)
Logs
No response
The text was updated successfully, but these errors were encountered:
I am having a look, and it seems the semver specification allows that. I am wondering why, this reads to me like a self-inflicting unnecessary pain. I would definitely recommend using prereleases in the form X.Y.Z-pre.1.2.3 or something like that, and restrict the hyphen to the definition of the pre-release.
I am checking if this can be changed in Conan, but seems complicated, because the way that versions are parsed, the extra hyphens will produce pre-releases into the pre-releases, not necessarily parsed as identifiers, and changing itseems that would require a big effort, so not sure if it is worth it.
Recall that Conan aims to be close to semver, but due to massive demand, it is not and it will not be fully conforming. For example Conan versions allow:
More than 3 numbers as digit versions. X.Y.Z.V.W is allowed and managed correctly, with version-ranges too
Less than 3 digits as versions
Allow letters too in the main "digit" versions, and mixed digits and letters in the versions, also for versions inside pre-releases and builds.
Order versions also according to the +build.X.Y.Z versions
So depending on the efforts, we might not support extra hyphens in the identifiers. I will update with the findings of the effort to try to change this.
I am proposing #14561, that will change the parsing to split in the first hyphen from the left, allowing the extra hyphens to be part of the pre-release.
However, inside the pre-release the extra hyphens will have the meaning of extra pre-releases, not a single identifier, and that can affect how the relative order of multiple pre-releases can be evaluated.
The proposal means:
It is generally discouraged to use more than 1 hyphen in versions
If used, be aware that they are defining extra nested pre-release levels inside the pre-release, and that will affect relative ordering and range resolution
As we don't aim to be fully conformant with semver, if this change creates any issues, problems, it will be reverted.
We finally made it more compliant, the pre-releases will not have nested pre-releases, and will consider hyphens as pure identifiers. Will be in 2.0.10
Environment details
Steps to reproduce
Use a version which has more than one hyphen:
Quote:
1.1-alpha.1
is older than1.1
, not newer.From:
https://docs.conan.io/2/tutorial/versioning/version_ranges.html#semantic-versioning
My understanding is that a pre-release should always be lower priority than a release, and the presence of a hyphen makes it a prerelease. According to the semver spec (item 9) a prerelease may itself contain a hyphen, so this should be legal.
(a workaround which works for me, by the way, is to instead use + inside the prerelease string: 0.0.1-3+1)
Logs
No response
The text was updated successfully, but these errors were encountered: