summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-01-09 15:09:54 -0500
committerGitHub <noreply@github.com>2018-01-09 15:09:54 -0500
commit06a8d665286b3afa854a357a7fda63b2d875feb0 (patch)
treea9f29030f4dfb4c1e50f3518eb4b90d1c91e86d3 /pkgs/stdenv/generic
parent17bdefd1425dc91f77b4645e858992d944917bb2 (diff)
parent133b4658dfa1da5ae5e56f36ab39e5b12cfdb751 (diff)
downloadnixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar.gz
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar.bz2
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar.lz
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar.xz
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.tar.zst
nixlib-06a8d665286b3afa854a357a7fda63b2d875feb0.zip
Merge pull request #33603 from obsidiansystems/cross-check
stdenv: Force `doCheck` to be false when we are cross compiling
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix19
1 files changed, 17 insertions, 2 deletions
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 2d702ab389e6..3ffa7cfe35fc 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -36,6 +36,7 @@ rec {
     , depsTargetTarget            ? [] #  1 ->  1
     , depsTargetTargetPropagated  ? [] #  1 ->  1
 
+    # Configure Phase
     , configureFlags ? []
     , # Target is not included by default because most programs don't care.
       # Including it then would cause needless mass rebuilds.
@@ -44,6 +45,13 @@ rec {
       configurePlatforms ? lib.optionals
         (stdenv.hostPlatform != stdenv.buildPlatform)
         [ "build" "host" ]
+
+    # Check phase
+    , doCheck ? false
+
+    # InstallCheck phase
+    , doInstallCheck ? false
+
     , crossConfig ? null
     , meta ? {}
     , passthru ? {}
@@ -60,6 +68,7 @@ rec {
 
     , hardeningEnable ? []
     , hardeningDisable ? []
+
     , ... } @ attrs:
 
     # TODO(@Ericson2314): Make this more modular, and not O(n^2).
@@ -178,9 +187,15 @@ rec {
             "/bin/sh"
           ];
           __propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
-        } // (if outputs' != [ "out" ] then {
+        } // lib.optionalAttrs (outputs' != [ "out" ]) {
           outputs = outputs';
-        } else { }));
+        } // lib.optionalAttrs (attrs ? doCheck) {
+          # TODO(@Ericson2314): Make unconditional / resolve #33599
+          doCheck = doCheck && (stdenv.hostPlatform == stdenv.targetPlatform);
+        } // lib.optionalAttrs (attrs ? doInstallCheck) {
+          # TODO(@Ericson2314): Make unconditional / resolve #33599
+          doInstallCheck = doInstallCheck && (stdenv.hostPlatform == stdenv.targetPlatform);
+        });
 
       # The meta attribute is passed in the resulting attribute set,
       # but it's not part of the actual derivation, i.e., it's not