From 41485e7337baca768dc542c553a9d66030df7b33 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 2 Oct 2021 14:02:47 +0200 Subject: [PATCH] stdenv.mkDerivation: be less strict about check execution for cross Instead of requiring the platforms be equal, use `isCompatible` to determine if we can execute tests. The upside of this is that we now can execute tests for natively cross compiled package sets like pkgsStatic, pkgsLLVM and pkgsCross.musl64 etc. --- pkgs/stdenv/generic/make-derivation.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index ed457019c55..395c1586a26 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -167,8 +167,8 @@ makeOverlayable (overrideAttrs: let # TODO(@oxij, @Ericson2314): This is here to keep the old semantics, remove when # no package has `doCheck = true`. - doCheck' = doCheck && stdenv.hostPlatform == stdenv.buildPlatform; - doInstallCheck' = doInstallCheck && stdenv.hostPlatform == stdenv.buildPlatform; + doCheck' = doCheck && stdenv.buildPlatform.canExecute stdenv.hostPlatform; + doInstallCheck' = doInstallCheck && stdenv.buildPlatform.canExecute stdenv.hostPlatform; separateDebugInfo' = separateDebugInfo && stdenv.hostPlatform.isLinux && !(stdenv.hostPlatform.useLLVM or false); outputs' = outputs ++ lib.optional separateDebugInfo' "debug";