From 1fd1796e65ddb690e7697d84b2e93904e59dcc53 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sat, 7 Sep 2024 22:01:39 -0400 Subject: [PATCH] zlib: build with the bootstrap stdenv on Darwin Using the bootstrap stdenv avoids an infinite recursion from xcbuild depending on zlib depending on xcrun from xcbuild, which is propagated by the non-bootstrap stdenv. --- pkgs/top-level/all-packages.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 34839400f48c..17fa21ed1130 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23701,7 +23701,15 @@ with pkgs; zeitgeist = callPackage ../development/libraries/zeitgeist { }; - zlib = callPackage ../development/libraries/zlib { }; + zlib = callPackage ../development/libraries/zlib { + stdenv = + # zlib is a dependency of xcbuild. Avoid an infinite recursion by using a bootstrap stdenv + # that does not propagate xcrun. + if stdenv.hostPlatform.isDarwin then + darwin.bootstrapStdenv + else + stdenv; + }; zlib-ng = callPackage ../development/libraries/zlib-ng { };