SemVer versioning #62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the version tags are
2.92.0
2.92.0-1
2.92.0-2
etc.
This is a valid scheme on its own, however it also is valid SemVer syntax, and using SemVer semantics we get 2.92.0-1 < 2.92.0-2 < 2.92.0. This is because
-
is a prerelease marker. Npins tries to interpret tags using SemVer, so it breaks on this (workaround:--pre-releases --version-upper-bound 2.92.0
). I see several potential solutions:2.92.0
. This makes all releases pre-releases, and thus gives the correct SemVer ordering. Downsides:--pre-releases
to npins, and until they do npins will find the last release prior to this practice, which will soon be outdated. (Retracting tags might be an option, but different can of worms)2.92.0.1
. This would not be SemVer compatible anymore, but it could be made to parse just fine in practice (npins currently parses it, but I just checked and the library does the wrong semantics atm).3+2.92.0
. The issue here is that it works well as long as all Lix releases are monotonically increasing. As soon as a patch bump to an older version gets released, this kinda requires special handling.option 3 and 1 combined sounds like the best one. perhaps one major version per lix "major" (ie 1=2.90, 2=2.91, 3=2.92), copy the lix "minor" into the module minor, patches for nixpkgs-related changes, build metadata to very explicitly specify which lix it's for without having to know the version scheme. maybe even add the date to the build metadata?
I am not sure if we should change our approach from traditional distro versioning to semver just because someone decided to misinterpret our version number as semver. Especially because the proposed versions here are super confusing.
One unintended consequence of this is that I'm guessing that the way that npins is using this in practice means that it's implicitly grabbing the latest version of lix and the module and hoping that by misinterpreting them as semver, they're matching. Unlike flakes where the module's expected lix version is encoded in the module itself via its lock file, I'm guessing that npins manages both the module and lix separately.
That separate management really isn't the intent of using the module on stable versions, and is kinda fragile. The intended method is that the module should provide the lix version, and we should fix our entry points for non flakes so it does that.
Also I think this question will be made somewhat obsolete by adding stable branches without having to mangle the version numbers in the tags.
Obviously for HEAD the lix and lix-module are just main for both and you update both every time.
Just to clarify, npins doesn't manage much. The common pattern is indeed to have one pin for lix and the module. It is up to the user to take care of syncing them, and npins provides some basic tools for that.
fully agreed.
Note that implementing distro-style versioning in npins could be done, but given I won't change the current default behavior it may still lead to user confusion
Do we have consensus on the desired implementation? @pennae could you generate some examples of what you envision? My understanding is something like
3.0.0+2.92.0
,3.1.0+2.92.1
,3.1.1+2.92.1
, etc. ?@raito you got exactly right