Skip to content

Commit

Permalink
lib/tests/release.nix: Fix build if impure.nix returns a cross pkgs
Browse files Browse the repository at this point in the history
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"; };
 })
```
  • Loading branch information
Artturin committed Dec 9, 2024
1 parent e77c1ff commit 6e18b15
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/tests/release.nix
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 6e18b15

Please sign in to comment.