Merge pull request #260963 from reckenrode/curl-fix

curl: fix infinite recursion in staging-next
This commit is contained in:
toonn 2023-10-21 19:12:14 +02:00 committed by GitHub
commit b525407492
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 20 deletions

View file

@ -1047,9 +1047,9 @@ in
overrides = self: super: {
inherit (prevStage) ccWrapperStdenv
autoconf automake bash bison cmake cmakeMinimal cpio cyrus_sasl db expat flex groff
libedit libtool m4 ninja openldap openssh patchutils pbzx perl pkg-config python3
python3Minimal scons serf sqlite subversion sysctl texinfo unzip which
autoconf automake bash bison cmake cmakeMinimal cyrus_sasl db expat flex groff
libedit libtool m4 ninja openldap openssh patchutils perl pkg-config python3 scons
serf sqlite subversion sysctl texinfo unzip which
# CF dependencies - dont rebuild them.
icu
@ -1057,11 +1057,40 @@ in
# LLVM dependencies - dont rebuild them.
libffi libiconv libxml2 ncurses zlib;
# These overrides are required to break an infinite recursion. curl depends on Darwin
# frameworks, but those frameworks require these dependencies to build, which
# depend on curl indirectly.
cpio = super.cpio.override {
inherit (prevStage) fetchurl;
};
libyaml = super.libyaml.override {
inherit (prevStage) fetchFromGitHub;
};
pbzx = super.pbzx.override {
inherit (prevStage) fetchFromGitHub;
};
python3Minimal = super.python3Minimal.override {
inherit (prevStage) fetchurl;
};
xar = super.xar.override {
inherit (prevStage) fetchurl;
};
darwin = super.darwin.overrideScope (selfDarwin: superDarwin: {
inherit (prevStage.darwin) dyld CF Libsystem darwin-stubs
# CF dependencies - dont rebuild them.
libobjc objc4;
# rewrite-tbd is also needed to build Darwin frameworks, so its built using the
# previous stages fetchFromGitHub to avoid an infinite recursion (same as above).
rewrite-tbd = superDarwin.rewrite-tbd.override {
inherit (prevStage) fetchFromGitHub;
};
signingUtils = superDarwin.signingUtils.override {
inherit (selfDarwin) sigtool;
};
@ -1158,9 +1187,10 @@ in
(prevStage:
# previous stage4 stdenv:
assert lib.all isBuiltByNixpkgsCompiler (with prevStage; [
bash binutils-unwrapped brotli bzip2 curl diffutils ed file findutils gawk gettext gmp
gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libkrb5 libssh2
libunistring libxml2 ncurses nghttp2 openbsm openpam openssl patch pcre xz zlib zstd
bash binutils-unwrapped brotli bzip2 cpio curl diffutils ed file findutils gawk
gettext gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libkrb5
libssh2 libunistring libxml2 libyaml ncurses nghttp2 openbsm openpam openssl patch
pbzx pcre python3Minimal xar xz zlib zstd
]);
assert lib.all isBuiltByNixpkgsCompiler (with prevStage.darwin; [
@ -1176,9 +1206,9 @@ in
]);
assert lib.all isBuiltByBootstrapFilesCompiler (with prevStage; [
autoconf automake bison cmake cmakeMinimal cpio cyrus_sasl db expat flex groff libedit
libtool m4 ninja openldap openssh patchutils pbzx perl pkg-config.pkg-config python3
python3Minimal scons serf sqlite subversion sysctl.provider texinfo unzip which
autoconf automake bison cmake cmakeMinimal cyrus_sasl db expat flex groff libedit
libtool m4 ninja openldap openssh patchutils perl pkg-config.pkg-config python3 scons
serf sqlite subversion sysctl.provider texinfo unzip which
]);
assert prevStage.darwin.cctools == prevStage.darwin.cctools-llvm;
@ -1307,14 +1337,14 @@ in
overrides = self: super: {
inherit (prevStage)
bash binutils brotli bzip2 coreutils curl diffutils ed file findutils gawk gettext
gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libssh2
libunistring libxml2 ncurses nghttp2 openbsm openpam openssl patch pcre xz zlib
zstd;
bash binutils brotli bzip2 coreutils cpio curl diffutils ed file findutils gawk
gettext gmp gnugrep gnumake gnused gnutar gzip icu libffi libiconv libidn2 libssh2
libunistring libxml2 libyaml ncurses nghttp2 openbsm openpam openssl patch pbzx
pcre python3Minimal xar xz zlib zstd;
darwin = super.darwin.overrideScope (_: _: {
inherit (prevStage.darwin)
CF ICU Libsystem darwin-stubs dyld locale libobjc libtapi xnu;
CF ICU Libsystem darwin-stubs dyld locale libobjc libtapi rewrite-tbd xnu;
} // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) {
inherit (prevStage.darwin) binutils binutils-unwrapped cctools-llvm cctools-port;
});

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, pkg-config, perl, nixosTests
{ lib, stdenv, fetchurl, darwin, pkg-config, perl, nixosTests
, brotliSupport ? false, brotli
, c-aresSupport ? false, c-aresMinimal
, gnutlsSupport ? false, gnutls
@ -57,10 +57,6 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-FsYqnErw9wPSi9pte783ukcFWtNBTXDexj4uYzbyqC0=";
};
patches = [
./7.79.1-darwin-no-systemconfiguration.patch
];
outputs = [ "bin" "dev" "out" "man" "devdoc" ];
separateDebugInfo = stdenv.isLinux;
@ -68,6 +64,11 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true;
buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
CoreFoundation
CoreServices
SystemConfiguration
]);
nativeBuildInputs = [ pkg-config perl ];
# Zlib and OpenSSL must be propagated because `libcurl.la' contains

View file

@ -13,6 +13,11 @@ let
# default.
targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
(stdenv.targetPlatform.config + "-");
# Bootstrap `fetchurl` needed to build SDK packages without causing an infinite recursion.
fetchurlBoot = import ../build-support/fetchurl/boot.nix {
inherit (stdenv) system;
};
in
makeScopeWithSplicing' {
@ -32,10 +37,13 @@ makeScopeWithSplicing' {
apple_sdk_10_12 = pkgs.callPackage ../os-specific/darwin/apple-sdk {
inherit (buildPackages.darwin) print-reexports;
inherit (self) darwin-stubs;
fetchurl = fetchurlBoot;
};
# macOS 11.0 SDK
apple_sdk_11_0 = pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 { };
apple_sdk_11_0 = pkgs.callPackage ../os-specific/darwin/apple-sdk-11.0 {
fetchurl = fetchurlBoot;
};
# Pick an SDK
apple_sdk = if stdenv.hostPlatform.isAarch64 then apple_sdk_11_0 else apple_sdk_10_12;