Open mgrojo opened 8 months ago
The thing is, for versions before 1.0, there's an unwritten assumption that compatibility is maintained within a 0.x version, that is, the minor acts as major and the patch as minor. But this is not imposed by the semver spec, just a convention.
In some semver implementations, ^
means within the same major version, i.e., 1.x, except for 0.x versions, where it means within the same minor version, i.e, 0.1.x
.
Our library doesn't change interpretation in 0.x and 1.x versions, i.e., ^0
is any 0.x and ^1
is any 1.x.
So, if you want to use pre-stable versions, but with a modicum of back-compatibility, you are supposed to stay within the same 0.x version. Which in some libraries is ^0.x
and in others (like ours) is ~0.x
.
Why does it say that the meaning is not changed, when it is indeed changing the selected version, when only ~ is replaced by ^.
It means that ~
always operates the same, be it a 0.x or a 1.x version: same .x
. Same for ^
.
Maybe there is a reason for this warning, but I cannot see it from this case.
The reason is to make clear that ^0.x
won't give you stability within the pre-1 versions, as you can get updates, just as you saw, from e.g. 0.3 to 0.4.
Besides, what "pre/post" means in pre/post-1.0 versions? Should it say pre-1.0 since it refers to a 0.x version?
It refers to the first 1.0 version of a library, which is considered the first stable release. Yes, pre/post-1.0 was meant to be pre-1.0/post-1.0.
I'm open to a better wording. Perhaps rather than trying to explain on the spot, we can point to an alr help <topic>
that goes in detail.
Thanks, it's clear now after the explanations.
The thing is, for versions before 1.0, there's an unwritten assumption that compatibility is maintained within a 0.x version, that is, the minor acts as major and the patch as minor. But this is not imposed by the semver spec, just a convention.
In some semver implementations,
^
means within the same major version, i.e., 1.x, except for 0.x versions, where it means within the same minor version, i.e,0.1.x
.
Without knowing those two facts about the semver spec and what other implementations are doing is impossible to understand the warning.
Why does it say that the meaning is not changed, when it is indeed changing the selected version, when only ~ is replaced by ^.
It means that
~
always operates the same, be it a 0.x or a 1.x version: same.x
. Same for^
.
That's what you expect unless you know about other implementations, so I understood the warning as if it were mostly the opposite, that, in Alire, both caret and tilde for 0.x releases had the same meaning.
The result I wanted, was in fact what I got.
Besides, what "pre/post" means in pre/post-1.0 versions? Should it say pre-1.0 since it refers to a 0.x version?
It refers to the first 1.0 version of a library, which is considered the first stable release. Yes, pre/post-1.0 was meant to be pre-1.0/post-1.0.
I'm open to a better wording. Perhaps rather than trying to explain on the spot, we can point to an
alr help <topic>
that goes in detail.
I don't have a suggestion that could be still brief and understandable without the context, so I guess pointing to a topic or to the documentation in the web page would certainly help. In any case, someone looking for the meaning of this error should be able now to reach this explanation.
Thanks.
Checklist
alr version
.Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
ada_toml = "~0.3.0"
alr build
. ada_toml 0.3.0 is selected.alr build
Expected Behavior Why does it say that the meaning is not changed, when it is indeed changing the selected version, when only
~
is replaced by^
.Maybe there is a reason for this warning, but I cannot see it from this case. Besides, what "pre/post" means in pre/post-1.0 versions? Should it say pre-1.0 since it refers to a 0.x version?
alr
version Paste here the output ofalr version
.