summary refs log tree commit diff
path: root/pkgs/top-level/release-cross.nix
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@Yahoo.com>2016-12-25 10:50:53 -0800
committerJohn Ericson <Ericson2314@Yahoo.com>2016-12-29 08:53:18 -0800
commit1d0e91831be906e63bdcd9d32ff721b67462699b (patch)
tree3ca2e80ec110cc40de1e996151989e0376a9619a /pkgs/top-level/release-cross.nix
parent916012121cb950d66ab04ff62eff16b2d94edb7f (diff)
downloadnixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar.gz
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar.bz2
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar.lz
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar.xz
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.tar.zst
nixpkgs-1d0e91831be906e63bdcd9d32ff721b67462699b.zip
release-cross: Test for unchanged native derivations
These derivations do not care about the target platform, and thus should
not be affected by cross-compiling. Currently, these tests *fail*, but they
will be fixed soon by a latter PR. The release-cross job doesn't block a
channel, so this should be no problem.
Diffstat (limited to 'pkgs/top-level/release-cross.nix')
-rw-r--r--pkgs/top-level/release-cross.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index cbafc65195d..de64c2b3cc7 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -1,5 +1,7 @@
 with import ./release-lib.nix { supportedSystems = [ builtins.currentSystem ]; };
 let
+  lib = import ../../lib;
+
   nativePlatforms = linux;
 
   /* Basic list of packages to cross-build */
@@ -22,6 +24,40 @@ let
 in
 
 {
+  # These `nativeDrv`s should be identical to their vanilla ones --- cross
+  # compiling should not affect the native derivation.
+  ensureUnaffected = let
+    # Absurd values are fine here, as we are not building anything. In fact,
+    # there probably a good idea to try to be "more parametric" --- i.e. avoid
+    # any special casing.
+    crossSystem = {
+      config = "foosys";
+      libc = "foolibc";
+    };
+
+    # Converting to a string (drv path) before checking equality is probably a
+    # good idea lest there be some irrelevant pass-through debug attrs that
+    # cause false negatives.
+    testEqualOne = path: system: let
+      f = attrs: builtins.toString (lib.getAttrFromPath path (allPackages attrs));
+    in assert f { inherit system; } == f { inherit system crossSystem; }; true;
+
+    testEqual = path: systems: forAllSupportedSystems systems (testEqualOne path);
+
+    mapTestEqual = lib.mapAttrsRecursive testEqual;
+
+  in mapTestEqual {
+    boehmgc = nativePlatforms;
+    libffi = nativePlatforms;
+    libiconv = nativePlatforms;
+    libtool = nativePlatforms;
+    zlib = nativePlatforms;
+    readline = nativePlatforms;
+    libxml2 = nativePlatforms;
+    guile = nativePlatforms;
+  };
+
+
   /* Test some cross builds to the Sheevaplug */
   crossSheevaplugLinux = let
     crossSystem = {