From acb063701a6a209a514bbdefacc9bce22332ef60 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Tue, 26 Apr 2022 22:17:48 +0200 Subject: lib.systems.elaborate: expose canExecute predicate over isCompatible canExecute is like isCompatible, but also checks that the Kernels are _equal_, i.e. that both platforms use the same syscall interface. This is crucial in order to actually be able to execute binaries for the other platform. isCompatible is dropped, since it has changed semantically and there's no use case left in nixpkgs. --- lib/systems/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/systems/default.nix') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index e02890b113861..74f84914faab1 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" -- cgit 1.4.1