From 4e907dbca19d4b1ab6b110c7e68f88a539df7c97 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 8 Jan 2018 01:33:35 -0500 Subject: stdenv: Force `doCheck` and `doInstallCheck` to be false when we are cross compiling I hope this will be a temporary measure. If there is consensus around issue #33599, then we can follow an explicit `dontCheck`, but default to not checking during cross builds when none is given. --- pkgs/stdenv/generic/make-derivation.nix | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'pkgs/stdenv') 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 -- cgit 1.4.1