From 90fe327540abc9923e7df7b419d0041041b58384 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 6 Aug 2022 12:45:38 +0200 Subject: [PATCH] stdenv: fix usage of native check inputs when using strictDeps, fixes #161570 In the past `checkInputs` were added to `nativeBuildInputs`. This was primarily done for convenience, since the introduction of `checkInputs` broke testing of Python packages (which already had the concept of `checkInputs`), and fixing all expressions directly was a hassle. Now we do the right thing, making sure `checkInputs` is added to `buildInputs` and also introducing `nativeCheckInputs` which is meant for things like hooks. Note this will require fixing all Python expressions using `checkInputs`. See #161570 for more details on this topic. --- pkgs/stdenv/generic/make-derivation.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 73030e7d941e8..79110c4564619 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -102,7 +102,9 @@ let , depsTargetTargetPropagated ? [] # 1 -> 1 , checkInputs ? [] +, checkNativeInputs ? [] , installCheckInputs ? [] +, nativeInstallCheckInputs ? [] # Configure Phase , configureFlags ? [] @@ -212,13 +214,15 @@ else let (map (drv: drv.nativeDrv or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs ++ lib.optional separateDebugInfo' ../../build-support/setup-hooks/separate-debug-info.sh ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh - ++ lib.optionals doCheck checkInputs - ++ lib.optionals doInstallCheck' installCheckInputs)) + ++ lib.optionals doCheck checkNativeInputs + ++ lib.optionals doInstallCheck' nativeInstallCheckInputs)) (map (drv: drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget)) ] [ (map (drv: drv.__spliced.hostHost or drv) (checkDependencyList "depsHostHost" depsHostHost)) - (map (drv: drv.crossDrv or drv) (checkDependencyList "buildInputs" buildInputs)) + (map (drv: drv.crossDrv or drv) (checkDependencyList "buildInputs" buildInputs + ++ lib.optionals doCheck checkInputs + ++ lib.optionals doInstallCheck' installCheckInputs)) ] [ (map (drv: drv.__spliced.targetTarget or drv) (checkDependencyList "depsTargetTarget" depsTargetTarget))