From 41d308656773689b4adb47337aa9caf7f771ba4e Mon Sep 17 00:00:00 2001 From: Yannik Sander Date: Fri, 18 Apr 2025 16:41:20 +0200 Subject: [PATCH] perl: filter out reference to `apple-sdk` package The perl package started depending on `apple-sdk` via references in `lib/perl5/5.40.0/darwin-thread-multi-2level/Config_heavy.pl`: ``` fd --type=file . /nix/store/cwlch1mxd40ayx8qy7hl8q2scrwgqhg6-perl-5.40.0/lib/ -X rg "/nix/store/lsjl29pwp5if71jfgxlv8fifsrpax805-apple-sdk-11.3" {} /nix/store/cwlch1mxd40ayx8qy7hl8q2scrwgqhg6-perl-5.40.0/lib/perl5/5.40.0/darwin-thread-multi-2level/Config_heavy.pl 1039:incpth='/nix/store/j3dhkx4m14m38drh3f40bccrwrgzlsg5-libcxx-19.1.7-dev/include /nix/store/hklang3njvw0f5mgra9vsvn3c2zi2v45-compiler-rt-libc-19.1.7-dev/include /nix/store/g4qcalcnvm5n393xq8p9swxd8rc0xxzj-libxcrypt-4.4.38/include /nix/store/f4z2y0zn2bmrwywp67y3h21cmb6ky547-libiconv-109-dev/include /nix/store/17a9rq4bw8drbhlr3dijrmxzfqlz8z85-libresolv-83-dev/include /nix/store/34bb5prqghfl0hpindhk8xlc5s2q2xjg-libsbuf-14.1.0-dev/include /nix/store/vzi6s9yh1i12bkj9abyfp43y6x1fdzpl-cups-headers-2.4.11/include /no-such-path/resource-root/include /nix/store/lsjl29pwp5if71jfgxlv8fifsrpax805-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include /no-such-path/include' 1087:libpth='/nix/store/g4qcalcnvm5n393xq8p9swxd8rc0xxzj-libxcrypt-4.4.38/lib /no-such-path/resource-root/lib /nix/store/lsjl29pwp5if71jfgxlv8fifsrpax805-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib /no-such-path/lib' 1092:libspath=' /nix/store/g4qcalcnvm5n393xq8p9swxd8rc0xxzj-libxcrypt-4.4.38/lib /no-such-path/resource-root/lib /nix/store/lsjl29pwp5if71jfgxlv8fifsrpax805-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib /no-such-path/lib' 1331:timeincl='/nix/store/lsjl29pwp5if71jfgxlv8fifsrpax805-apple-sdk-11.3/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h ' ``` This change increases the closure size of `perl` from ~115MiB to ~1.11GiB on darwin systems. `apple-sdk` seems to be referenced via `stdenv.cc.fallback_sdk`. Following the exisitng pattern in `pkgs/development/interpreters/perl/interpreter.nix`, that removes removes references to `stdenv.cc` and `stdenv.cc.cc`, this commit also removes the reference to `apple-sdk` / `stdenv.cc.fallback_sdk`. --- pkgs/development/interpreters/perl/interpreter.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/interpreters/perl/interpreter.nix b/pkgs/development/interpreters/perl/interpreter.nix index 0c9586fe1273..f75a504b14de 100644 --- a/pkgs/development/interpreters/perl/interpreter.nix +++ b/pkgs/development/interpreters/perl/interpreter.nix @@ -273,6 +273,12 @@ stdenv.mkDerivation ( --replace "${ if stdenv.hasCC && stdenv.cc.cc != null then stdenv.cc.cc else "/no-such-path" }" /no-such-path \ + --replace "${ + if stdenv.hasCC && stdenv.cc.fallback_sdk or null != null then + stdenv.cc.fallback_sdk + else + "/no-such-path" + }" /no-such-path \ --replace "$man" /no-such-path '' + lib.optionalString crossCompiling ''