From 6e18b15ce019718868b2276cc7d691d4dd2157ef Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 9 Dec 2024 20:04:11 +0200 Subject: [PATCH] lib/tests/release.nix: Fix build if `impure.nix` returns a cross pkgs In https://www.github.com/NixOS/nixpkgs/pull/341067 `ofborg-eval-lib-tests` fails because it uses `pkgsHostTarget` of the cross pkgs ```diff diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix index 4d847e280f4b9..463de791a1a65 100644 --- a/pkgs/top-level/impure.nix +++ b/pkgs/top-level/impure.nix @@ -86,4 +86,5 @@ assert args ? system -> !(args ? localSystem); import ./. (builtins.removeAttrs args [ "system" ] // { inherit config overlays localSystem; + crossSystem = { config = "aarch64-unknown-linux-gnu"; }; }) ``` --- lib/tests/release.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/tests/release.nix b/lib/tests/release.nix index 5334498d08449..cc789c777cc80 100644 --- a/lib/tests/release.nix +++ b/lib/tests/release.nix @@ -1,18 +1,22 @@ { # The pkgs used for dependencies for the testing itself # Don't test properties of pkgs.lib, but rather the lib in the parent directory pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; }, + pkgsBB ? pkgs.pkgsBuildBuild, nix ? pkgs-nixVersions.stable, nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.latest ], - pkgs-nixVersions ? import ./nix-for-tests.nix { inherit pkgs; }, + pkgs-nixVersions ? import ./nix-for-tests.nix { pkgs = pkgsBB; }, }: let lib = import ../.; testWithNix = nix: - import ./test-with-nix.nix { inherit lib nix pkgs; }; + import ./test-with-nix.nix { + inherit lib nix; + pkgs = pkgsBB; + }; in - pkgs.symlinkJoin { + pkgsBB.symlinkJoin { name = "nixpkgs-lib-tests"; paths = map testWithNix nixVersions; }