Skip to content

Commit 3ae105a

Browse files
committed
docs(nix): document Nixpkgs versioning context
Signed-off-by: Samiser <github@me.samiser.xyz>
1 parent db0fc05 commit 3ae105a

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/univers/nix.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@
77
# Visit https://aboutcode.org and https://github.com/aboutcode-org/univers for support and download.
88

99
"""
10-
Python port of Nix's ``builtins.compareVersions``.
11-
https://nix.dev/manual/nix/latest/language/builtins.html#builtins-compareVersions
10+
Compare version strings of software distributed through Nixpkgs. Refer to
11+
Nixpkgs contributor documentation on how versioning is handled there:
12+
https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#versioning
13+
14+
Note that Nix version handling is not authoritative for versioning syntax or
15+
semantics in Nixpkgs. It's merely a compatibility constraint for supporting
16+
unmaintained legacy Nix use cases around ``nix-env``. But one can assume that
17+
versions of a given package from any Nixpkgs release will be ordered correctly
18+
by Nix, which is why it's included here.
1219
20+
The ordering is that of Nix's ``builtins.compareVersions``:
21+
https://nix.dev/manual/nix/latest/language/builtins.html#builtins-compareVersions
1322
The reference implementation is ``compareVersions`` and ``componentsLT`` in
1423
https://github.com/NixOS/nix/blob/534f199c9a34ace17d4db26fa3d377ee904bdf03/src/libstore/names.cc
1524
and this port reproduces it exactly:

0 commit comments

Comments
 (0)