lol

Merge pull request #260963 from reckenrode/curl-fix

curl: fix infinite recursion in staging-next

authored by

toonn and committed by
GitHub
b5254074 31ebe7b4

+59 -20
+44 -14
pkgs/stdenv/darwin/default.nix
··· 1047 1047 1048 1048 overrides = self: super: { 1049 1049 inherit (prevStage) ccWrapperStdenv 1050 - autoconf automake bash bison cmake cmakeMinimal cpio cyrus_sasl db expat flex groff 1051 - libedit libtool m4 ninja openldap openssh patchutils pbzx perl pkg-config python3 1052 - python3Minimal scons serf sqlite subversion sysctl texinfo unzip which 1050 + autoconf automake bash bison cmake cmakeMinimal cyrus_sasl db expat flex groff 1051 + libedit libtool m4 ninja openldap openssh patchutils perl pkg-config python3 scons 1052 + serf sqlite subversion sysctl texinfo unzip which 1053 1053 1054 1054 # CF dependencies - don’t rebuild them. 1055 1055 icu 1056 1056 1057 1057 # LLVM dependencies - don’t rebuild them. 1058 1058 libffi libiconv libxml2 ncurses zlib; 1059 + 1060 + # These overrides are required to break an infinite recursion. curl depends on Darwin 1061 + # frameworks, but those frameworks require these dependencies to build, which 1062 + # depend on curl indirectly. 1063 + cpio = super.cpio.override { 1064 + inherit (prevStage) fetchurl; 1065 + }; 1066 + 1067 + libyaml = super.libyaml.override { 1068 + inherit (prevStage) fetchFromGitHub; 1069 + }; 1070 + 1071 + pbzx = super.pbzx.override { 1072 + inherit (prevStage) fetchFromGitHub; 1073 + }; 1074 + 1075 + python3Minimal = super.python3Minimal.override { 1076 + inherit (prevStage) fetchurl; 1077 + }; 1078 + 1079 + xar = super.xar.override { 1080 + inherit (prevStage) fetchurl; 1081 + }; 1059 1082 1060 1083 darwin = super.darwin.overrideScope (selfDarwin: superDarwin: { 1061 1084 inherit (prevStage.darwin) dyld CF Libsystem darwin-stubs 1062 1085 # CF dependencies - don’t rebuild them. 1063 1086 libobjc objc4; 1064 1087 1088 + # rewrite-tbd is also needed to build Darwin frameworks, so it’s built using the 1089 + # previous stage’s fetchFromGitHub to avoid an infinite recursion (same as above). 1090 + rewrite-tbd = superDarwin.rewrite-tbd.override { 1091 + inherit (prevStage) fetchFromGitHub; 1092 + }; 1093 + 1065 1094 signingUtils = superDarwin.signingUtils.override { 1066 1095 inherit (selfDarwin) sigtool; 1067 1096 }; ··· 1158 1187 (prevStage: 1159 1188 # previous stage4 stdenv: 1160 1189 assert lib.all isBuiltByNixpkgsCompiler (with prevStage; [ 1161 - bash binutils-unwrapped brotli bzip2 curl diffutils ed file findutils gawk gettext gmp 1162 - gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libkrb5 libssh2 1163 - libunistring libxml2 ncurses nghttp2 openbsm openpam openssl patch pcre xz zlib zstd 1190 + bash binutils-unwrapped brotli bzip2 cpio curl diffutils ed file findutils gawk 1191 + gettext gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libkrb5 1192 + libssh2 libunistring libxml2 libyaml ncurses nghttp2 openbsm openpam openssl patch 1193 + pbzx pcre python3Minimal xar xz zlib zstd 1164 1194 ]); 1165 1195 1166 1196 assert lib.all isBuiltByNixpkgsCompiler (with prevStage.darwin; [ ··· 1176 1206 ]); 1177 1207 1178 1208 assert lib.all isBuiltByBootstrapFilesCompiler (with prevStage; [ 1179 - autoconf automake bison cmake cmakeMinimal cpio cyrus_sasl db expat flex groff libedit 1180 - libtool m4 ninja openldap openssh patchutils pbzx perl pkg-config.pkg-config python3 1181 - python3Minimal scons serf sqlite subversion sysctl.provider texinfo unzip which 1209 + autoconf automake bison cmake cmakeMinimal cyrus_sasl db expat flex groff libedit 1210 + libtool m4 ninja openldap openssh patchutils perl pkg-config.pkg-config python3 scons 1211 + serf sqlite subversion sysctl.provider texinfo unzip which 1182 1212 ]); 1183 1213 1184 1214 assert prevStage.darwin.cctools == prevStage.darwin.cctools-llvm; ··· 1307 1337 1308 1338 overrides = self: super: { 1309 1339 inherit (prevStage) 1310 - bash binutils brotli bzip2 coreutils curl diffutils ed file findutils gawk gettext 1311 - gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libssh2 1312 - libunistring libxml2 ncurses nghttp2 openbsm openpam openssl patch pcre xz zlib 1313 - zstd; 1340 + bash binutils brotli bzip2 coreutils cpio curl diffutils ed file findutils gawk 1341 + gettext gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libssh2 1342 + libunistring libxml2 libyaml ncurses nghttp2 openbsm openpam openssl patch pbzx 1343 + pcre python3Minimal xar xz zlib zstd; 1314 1344 1315 1345 darwin = super.darwin.overrideScope (_: _: { 1316 1346 inherit (prevStage.darwin) 1317 - CF ICU Libsystem darwin-stubs dyld locale libobjc libtapi xnu; 1347 + CF ICU Libsystem darwin-stubs dyld locale libobjc libtapi rewrite-tbd xnu; 1318 1348 } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { 1319 1349 inherit (prevStage.darwin) binutils binutils-unwrapped cctools-llvm cctools-port; 1320 1350 });
+6 -5
pkgs/tools/networking/curl/default.nix
··· 1 - { lib, stdenv, fetchurl, pkg-config, perl, nixosTests 1 + { lib, stdenv, fetchurl, darwin, pkg-config, perl, nixosTests 2 2 , brotliSupport ? false, brotli 3 3 , c-aresSupport ? false, c-aresMinimal 4 4 , gnutlsSupport ? false, gnutls ··· 57 57 hash = "sha256-FsYqnErw9wPSi9pte783ukcFWtNBTXDexj4uYzbyqC0="; 58 58 }; 59 59 60 - patches = [ 61 - ./7.79.1-darwin-no-systemconfiguration.patch 62 - ]; 63 - 64 60 outputs = [ "bin" "dev" "out" "man" "devdoc" ]; 65 61 separateDebugInfo = stdenv.isLinux; 66 62 ··· 68 64 69 65 strictDeps = true; 70 66 67 + buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ 68 + CoreFoundation 69 + CoreServices 70 + SystemConfiguration 71 + ]); 71 72 nativeBuildInputs = [ pkg-config perl ]; 72 73 73 74 # Zlib and OpenSSL must be propagated because `libcurl.la' contains
+9 -1
pkgs/top-level/darwin-packages.nix
··· 13 13 # default. 14 14 targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) 15 15 (stdenv.targetPlatform.config + "-"); 16 + 17 + # Bootstrap `fetchurl` needed to build SDK packages without causing an infinite recursion. 18 + fetchurlBoot = import ../build-support/fetchurl/boot.nix { 19 + inherit (stdenv) system; 20 + }; 16 21 in 17 22 18 23 makeScopeWithSplicing' { ··· 32 37 apple_sdk_10_12 = pkgs.callPackage ../os-specific/darwin/apple-sdk { 33 38 inherit (buildPackages.darwin) print-reexports; 34 39 inherit (self) darwin-stubs; 40 + fetchurl = fetchurlBoot; 35 41 }; 36 42 37 43 # macOS 11.0 SDK 38 - apple_sdk_11_0 = pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 { }; 44 + apple_sdk_11_0 = pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 { 45 + fetchurl = fetchurlBoot; 46 + }; 39 47 40 48 # Pick an SDK 41 49 apple_sdk = if stdenv.hostPlatform.isAarch64 then apple_sdk_11_0 else apple_sdk_10_12;