From cb459fb72d9281e3983b560d94f7c3654a70db31 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 5 Dec 2022 16:57:27 +0200 Subject: [PATCH] stdenv.mkDerivation: workaround hacks in perl cross-compilation --- pkgs/stdenv/generic/make-derivation.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 7255f2ec9e157..bb40abfc911b2 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -200,7 +200,18 @@ let if (lib.isDerivation dep && dep ? stdenv) then if (stdenv.buildPlatform.canExecute dep.stdenv.hostPlatform) then dep - else lib.warn "${dep.name} in ${attrs.name or attrs.pname}'s ${listName} not executable on build" dep + else + # TODO(@Artturin) remove workaround + # if something has __spliced then it has been spliced but may not have a buildHost + # example: perl's cross-compilation is bad and has some hacks + # perl's mini output is only created when buildPlatfom != hostPlatform + # > pkgsCross.aarch64-multiplatform.buildPackages.perl.mini + # + # > pkgsCross.aarch64-multiplatform.buildPackages.__splicedPackages.perl.mini.__spliced + # { targetTarget = «derivation ...perl-aarch64-unknown-linux-gnu...»; } + if (!dep ? __spliced) then + lib.warn "${dep.name} in ${attrs.name or attrs.pname}'s ${listName} not executable on build" dep + else dep else dep; nameToSplicedName = {