stdenvNoCC: drop extraBuildInputs on Darwin

Darwin includes its SDK in `extraBuildInputs`, which isn’t needed in
`stdenvNoCC` because it depends on a compiler.  Including it greatly
increases the size of the `stdenvNoCC` closure (by ~1 GiB).

This wasn’t an issue in the past when darwin included CoreFoundation
because CoreFoundation on its own is very small.  Now that it includes
the whole SDK and links some bintools, it pulls in 300~400 MiB for the
SDK plus another ~445 MiB for LLVM.

Fixes #371465
This commit is contained in:
Randy Eckenrode
2025-03-24 08:17:31 -04:00
parent ce179bc524
commit 4928668e21
+9 -1
View File
@@ -51,7 +51,15 @@ in
, # `stdenv` without a C compiler. Passing in this helps avoid infinite
# recursions, and may eventually replace passing in the full stdenv.
stdenvNoCC ? stdenv.override { cc = null; hasCC = false; }
stdenvNoCC ? (
stdenv.override {
cc = null;
hasCC = false;
}
# Darwin doesnt need an SDK in `stdenvNoCC`. Dropping it shrinks the closure
# size down from ~1 GiB to ~83 MiB, which is a considerable reduction.
// lib.optionalAttrs stdenv.hostPlatform.isDarwin { extraBuildInputs = [ ]; }
)
, # This is used because stdenv replacement and the stdenvCross do benefit from
# the overridden configuration provided by the user, as opposed to the normal