Merge pull request #288812 from hercules-ci/lib-flake-version

`lib/` flake: fix `lib.version`
This commit is contained in:
Robert Hensing 2024-03-03 18:19:00 +01:00 committed by GitHub
commit 39327e4cf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 2 deletions

View file

@ -17,6 +17,10 @@ end_of_line = unset
insert_final_newline = unset insert_final_newline = unset
trim_trailing_whitespace = unset trim_trailing_whitespace = unset
# We want readFile .version to return the version without a newline.
[.version]
insert_final_newline = false
# see https://nixos.org/nixpkgs/manual/#chap-conventions # see https://nixos.org/nixpkgs/manual/#chap-conventions
# Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces # Match json/lockfiles/markdown/nix/perl/python/ruby/shell/docbook files, set indent to spaces

View file

@ -1 +0,0 @@
24.05

1
.version Symbolic link
View file

@ -0,0 +1 @@
lib/.version

1
lib/.version Normal file
View file

@ -0,0 +1 @@
24.05

View file

@ -53,6 +53,12 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" {
echo "Running lib/tests/modules.sh" echo "Running lib/tests/modules.sh"
bash lib/tests/modules.sh bash lib/tests/modules.sh
echo "Checking lib.version"
nix-instantiate lib -A version --eval || {
echo "lib.version does not evaluate when lib is isolated from the rest of the nixpkgs tree"
exit 1
}
echo "Running lib/tests/filesystem.sh" echo "Running lib/tests/filesystem.sh"
TEST_LIB=$PWD/lib bash lib/tests/filesystem.sh TEST_LIB=$PWD/lib bash lib/tests/filesystem.sh

View file

@ -159,7 +159,7 @@ in {
version = release + versionSuffix; version = release + versionSuffix;
/* Returns the current nixpkgs release number as string. */ /* Returns the current nixpkgs release number as string. */
release = lib.strings.fileContents ../.version; release = lib.strings.fileContents ./.version;
/* The latest release that is supported, at the time of release branch-off, /* The latest release that is supported, at the time of release branch-off,
if applicable. if applicable.