release-lib: Cache cross nixpkgs evals too

This will help with release-cross.nix eval time. It also allowed me to
share code between the cross and native helpers.
This commit is contained in:
John Ericson
2018-11-01 15:35:08 -04:00
parent aa964c82d3
commit 79c713bc14
2 changed files with 62 additions and 38 deletions
+3 -3
View File
@@ -81,11 +81,11 @@ in
# good idea lest there be some irrelevant pass-through debug attrs that
# cause false negatives.
testEqualOne = path: system: let
f = path: attrs: builtins.toString (lib.getAttrFromPath path (allPackages attrs));
f = path: crossSystem: system: builtins.toString (lib.getAttrFromPath path (pkgsForCross crossSystem system));
in assertTrue (
f path { inherit system; }
f path null system
==
f (["buildPackages"] ++ path) { inherit system crossSystem; }
f (["buildPackages"] ++ path) crossSystem system
);
testEqual = path: systems: forMatchingSystems systems (testEqualOne path);