Merge pull request #5390 from NixOS/fix-isnewerthan-check

Fix the `isDaemonNewer` guard in the testsuite
This commit is contained in:
Eelco Dolstra 2021-10-15 15:50:20 +02:00 committed by GitHub
commit 130284b850
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -126,7 +126,7 @@ isDaemonNewer () {
[[ -n "${NIX_DAEMON_PACKAGE:-}" ]] || return 0
local requiredVersion="$1"
local daemonVersion=$($NIX_DAEMON_PACKAGE/bin/nix-daemon --version | cut -d' ' -f3)
return [[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''2.4''") -ge 0 ]]
[[ $(nix eval --expr "builtins.compareVersions ''$daemonVersion'' ''$requiredVersion''") -ge 0 ]]
}
requireDaemonNewerThan () {

View file

@ -1,6 +1,8 @@
source common.sh
requireDaemonNewerThan "2.4pre20210727"
# Using `--eval-store` with the daemon will eventually copy everything
# to the build store, invalidating most of the tests here
needLocalStore
eval_store=$TEST_ROOT/eval-store

View file

@ -2,7 +2,7 @@ source common.sh
# 27ce722638 required some incompatible changes to the nix file, so skip this
# tests for the older versions
requireDaemonNewerThan "2.4pre20210622"
requireDaemonNewerThan "2.4pre20210712"
clearStore