diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-02 21:44:15 -0800 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-12-15 05:13:50 -0800 |
commit | 2d036511f65a267604a27d4758de1eb952315b15 (patch) | |
tree | 2d62dd5e1819639f2378445f476031cb5b76671e | |
parent | 77d3093caa6777dd5861d6f497fee2a61480bdf9 (diff) |
pkgs/test/release/default.nix: init
This derivation verifies that all jobset attributes can be evaluated
under tryEval without producing any non-catchable errors or causing
infinite recursion.
-rw-r--r-- | pkgs/test/release/default.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/test/release/default.nix b/pkgs/test/release/default.nix new file mode 100644 index 000000000000..f112ee6b9212 --- /dev/null +++ b/pkgs/test/release/default.nix @@ -0,0 +1,46 @@ +# Adapted from lib/tests/release.nix +{ pkgs-path ? ../../.. +, pkgs ? import pkgs-path {} +, lib ? pkgs.lib +, nix ? pkgs.nix +}: + +# +# This verifies that release-attrpaths-superset.nix does not encounter +# infinite recursion or non-tryEval-able failures. +# +pkgs.runCommand "all-attrs-eval-under-tryEval" { + nativeBuildInputs = [ + nix + pkgs.gitMinimal + ] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools; + strictDeps = true; +} +'' + datadir="${nix}/share" + export TEST_ROOT=$(pwd)/test-tmp + export HOME=$(mktemp -d) + export NIX_BUILD_HOOK= + export NIX_CONF_DIR=$TEST_ROOT/etc + export NIX_LOCALSTATE_DIR=$TEST_ROOT/var + export NIX_LOG_DIR=$TEST_ROOT/var/log/nix + export NIX_STATE_DIR=$TEST_ROOT/var/nix + export NIX_STORE_DIR=$TEST_ROOT/store + export PAGER=cat + cacheDir=$TEST_ROOT/binary-cache + + nix-store --init + + cp -r ${pkgs-path + "/lib"} lib + cp -r ${pkgs-path + "/pkgs"} pkgs + cp -r ${pkgs-path + "/default.nix"} default.nix + cp -r ${pkgs-path + "/nixos"} nixos + cp -r ${pkgs-path + "/maintainers"} maintainers + cp -r ${pkgs-path + "/.version"} .version + cp -r ${pkgs-path + "/doc"} doc + echo "Running pkgs/top-level/release-attrpaths-superset.nix" + nix-instantiate --eval --strict --json pkgs/top-level/release-attrpaths-superset.nix -A names > /dev/null + + mkdir $out + echo success > $out/${nix.version} +'' |