lol

Merge pull request #296750 from reckenrode/darwin-nocurl

darwin.stdenv: drop curl from the bootstrap

authored by

Randy Eckenrode and committed by
GitHub
b7d77e74 dce2b692

+33 -33
+33 -33
pkgs/stdenv/darwin/default.nix
··· 158 158 __stdenvImpureHostDeps = commonImpureHostDeps; 159 159 __extraImpureHostDeps = commonImpureHostDeps; 160 160 161 + # Using the bootstrap tools curl for fetchers allows the stdenv bootstrap to avoid 162 + # having a dependency on curl, allowing curl to be updated without triggering a 163 + # new stdenv bootstrap on Darwin. 161 164 overrides = self: super: (overrides self super) // { 162 165 fetchurl = thisStdenv.fetchurlBoot; 166 + fetchpatch = super.fetchpatch.override { inherit (self) fetchurl; }; 167 + fetchgit = super.fetchgit.override { 168 + git = super.git.override { curl = bootstrapTools; }; 169 + }; 170 + fetchzip = super.fetchzip.override { inherit (self) fetchurl; }; 163 171 }; 164 172 }; 165 173 ··· 415 423 buildInputs = old.buildInputs ++ [ self.darwin.CF ]; 416 424 }); 417 425 418 - curl = super.curlMinimal; 419 - 420 426 # Disable tests because they use dejagnu, which fails to run. 421 427 libffi = super.libffi.override { doCheck = false; }; 422 428 ··· 489 495 ''; 490 496 }) 491 497 492 - # Build sysctl and Python for use by LLVM’s check phase. These must be built in their 493 - # own stage, or an infinite recursion results on x86_64-darwin when using the source-based SDK. 498 + # Build cctools, Python, and sysctl for use by LLVM’s check phase. They must be built in 499 + # their stage to prevent infinite recursions and to make sure the stdenv used to build 500 + # LLVM has the newly built cctools instead of the one from the bootstrap tools. 494 501 (prevStage: 495 502 # previous stage1 stdenv: 496 503 assert lib.all isFromBootstrapFiles (with prevStage; [ coreutils gnugrep ]); ··· 1027 1034 # LLVM dependencies - don’t rebuild them. 1028 1035 libffi libiconv libxml2 ncurses zlib; 1029 1036 1030 - # These overrides are required to break an infinite recursion. curl depends on Darwin 1031 - # frameworks, but those frameworks require these dependencies to build, which 1032 - # depend on curl indirectly. 1033 - cpio = super.cpio.override { 1034 - inherit (prevStage) fetchurl; 1035 - }; 1036 - 1037 - libyaml = super.libyaml.override { 1038 - inherit (prevStage) fetchFromGitHub; 1039 - }; 1040 - 1041 - pbzx = super.pbzx.override { 1042 - inherit (prevStage) fetchFromGitHub; 1043 - }; 1044 - 1045 - python3Minimal = super.python3Minimal.override { 1046 - inherit (prevStage) fetchurl; 1047 - }; 1048 - 1049 - xar = super.xar.override { 1050 - inherit (prevStage) fetchurl; 1051 - }; 1052 - 1053 1037 darwin = super.darwin.overrideScope (selfDarwin: superDarwin: { 1054 1038 inherit (prevStage.darwin) dyld CF Libsystem darwin-stubs 1055 1039 # CF dependencies - don’t rebuild them. 1056 1040 libobjc objc4; 1057 1041 1058 - # rewrite-tbd is also needed to build Darwin frameworks, so it’s built using the 1059 - # previous stage’s fetchFromGitHub to avoid an infinite recursion (same as above). 1060 - rewrite-tbd = superDarwin.rewrite-tbd.override { 1061 - inherit (prevStage) fetchFromGitHub; 1062 - }; 1063 - 1064 1042 signingUtils = superDarwin.signingUtils.override { 1065 1043 inherit (selfDarwin) sigtool; 1066 1044 }; ··· 1075 1053 bintools = selfDarwin.binutils-unwrapped; 1076 1054 libc = selfDarwin.Libsystem; 1077 1055 }; 1056 + 1057 + # cctools needs to build the LLVM man pages, which requires sphinx. Sphinx 1058 + # has hatch-vcs as a transitive dependency, which pulls in git (and curl). 1059 + # Disabling the tests for hatch-vcs allows the stdenv bootstrap to avoid having 1060 + # any dependency on curl other than the one provided in the bootstrap tools. 1061 + cctools-llvm = superDarwin.cctools-llvm.override (old: { 1062 + llvmPackages = 1063 + let 1064 + tools = old.llvmPackages.tools.extend (_: superTools: { 1065 + llvm-manpages = superTools.llvm-manpages.override { 1066 + python3Packages = prevStage.python3Packages.overrideScope (_: superPython: { 1067 + hatch-vcs = (superPython.hatch-vcs.override { 1068 + git = null; 1069 + pytestCheckHook = null; 1070 + }); 1071 + }); 1072 + }; 1073 + }); 1074 + inherit (old.llvmPackages) libraries release_version; 1075 + in 1076 + { inherit tools libraries release_version; } // tools // libraries; 1077 + }); 1078 1078 }); 1079 1079 1080 1080 llvmPackages = super.llvmPackages // (