diff --git a/lib/systems/default.nix b/lib/systems/default.nix index e02890b11386..74f84914faab 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -34,8 +34,10 @@ rec { # Either of these can be losslessly-extracted from `parsed` iff parsing succeeds. system = parse.doubleFromSystem final.parsed; config = parse.tripleFromSystem final.parsed; - # Determine whether we are compatible with the provided CPU - isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu; + # Determine whether we can execute binaries built for the provided platform. + canExecute = platform: + parse.isCompatible final.parsed.cpu platform.parsed.cpu + && final.parsed.kernel == platform.parsed.kernel; # Derived meta-data libc = /**/ if final.isDarwin then "libSystem" diff --git a/pkgs/development/libraries/capnproto/default.nix b/pkgs/development/libraries/capnproto/default.nix index 75b5f14d67ce..aeb9728af826 100644 --- a/pkgs/development/libraries/capnproto/default.nix +++ b/pkgs/development/libraries/capnproto/default.nix @@ -17,9 +17,9 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ] - ++ lib.optional (!(stdenv.hostPlatform.isCompatible stdenv.buildPlatform)) capnproto; + ++ lib.optional (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) capnproto; - cmakeFlags = lib.optional (!(stdenv.hostPlatform.isCompatible stdenv.buildPlatform)) "-DEXTERNAL_CAPNP"; + cmakeFlags = lib.optional (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) "-DEXTERNAL_CAPNP"; # Upstream 77ac9154440bcc216fda1092fd5bb51da62ae09c, modified to apply to v0.9.1. Drop on update. patches = lib.optional stdenv.hostPlatform.isMusl ./musl-no-fibers.patch; diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 5c5ca64b1e95..ace0d704b721 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -31,7 +31,7 @@ # compatible with or current architecture. getCompatibleTools = lib.foldl (v: system: if v != null then v - else if localSystem.isCompatible (lib.systems.elaborate { inherit system; }) then archLookupTable.${system} + else if localSystem.canExecute (lib.systems.elaborate { inherit system; }) then archLookupTable.${system} else null) null (lib.attrNames archLookupTable); archLookupTable = table.${localSystem.libc}