Merge pull request #178869 from Artturin/curlies

This commit is contained in:
Artturi 2022-07-06 17:30:45 +03:00 committed by GitHub
commit fb6816eae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 15 deletions

View file

@ -156,6 +156,7 @@ in rec {
(onSystems ["i686-linux"] "nixos.tests.zfs.installer")
(onFullSupported "nixpkgs.emacs")
(onFullSupported "nixpkgs.jdk")
(onFullSupported "nixpkgs.tests.packageTestsForChannelBlockers.curl.withCheck")
["nixpkgs.tarball"]
];
};

View file

@ -120,6 +120,7 @@ in rec {
"nixos.tests.proxy.x86_64-linux"
"nixos.tests.simple.x86_64-linux"
"nixpkgs.jdk.x86_64-linux"
"nixpkgs.tests.packageTestsForChannelBlockers.curl.withCheck.x86_64-linux"
"nixpkgs.tarball"
];
};

View file

@ -24,6 +24,14 @@ with pkgs;
config = callPackage ./config.nix { };
# we can't add 'nixpkgs.curl.tests' to hydra jobs due to 'tests' (and 'passthru') being stripped
# TODO: add a function in lib-release.nix to get derivations and add `.x86_64-linux` to them
# then we can just point release files to nixpkgs.tests.packageTestsForChannelBlockers instead of
# nixpkgs.tests.packageTestsForChannelBlockers.curl.withCheck
packageTestsForChannelBlockers = recurseIntoAttrs {
curl = recurseIntoAttrs pkgs.curl.tests;
};
haskell = callPackage ./haskell { };
cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };

View file

@ -33,6 +33,8 @@
, ocamlPackages
, phpExtensions
, python3
, tests
, fetchpatch
}:
# Note: this package is used for bootstrapping fetchurl, and thus
@ -61,14 +63,14 @@ assert wolfsslSupport -> wolfssl != null;
assert zlibSupport -> zlib != null;
assert zstdSupport -> zstd != null;
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "curl";
version = "7.84.0";
src = fetchurl {
urls = [
"https://curl.haxx.se/download/${pname}-${version}.tar.bz2"
"https://github.com/curl/curl/releases/download/${lib.replaceStrings ["."] ["_"] pname}-${version}/${pname}-${version}.tar.bz2"
"https://curl.haxx.se/download/curl-${finalAttrs.version}.tar.bz2"
"https://github.com/curl/curl/releases/download/curl-${finalAttrs.version}/curl-${finalAttrs.version}.tar.bz2"
];
sha256 = "sha256-cC+ybnMZCjvXcHGqFG9Qe5gXzE384hjSq4fwDNO8BZ0=";
};
@ -149,7 +151,10 @@ stdenv.mkDerivation rec {
CXX = "${stdenv.cc.targetPrefix}c++";
CXXCPP = "${stdenv.cc.targetPrefix}c++ -E";
doCheck = true;
# takes 14 minutes on a 24 core and because many other packages depend on curl
# they cannot be run concurrently and are a bottleneck
# tests are available in passthru.tests.withCheck
doCheck = false;
preCheck = ''
patchShebangs tests/
'' + lib.optionalString stdenv.isDarwin ''
@ -174,16 +179,23 @@ stdenv.mkDerivation rec {
ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4.4.0
'';
passthru = {
passthru = let
useThisCurl = attr: attr.override { curl = finalAttrs.finalPackage; };
in {
inherit opensslSupport openssl;
tests = {
inherit curlpp coeurl;
haskell-curl = haskellPackages.curl;
ocaml-curly = ocamlPackages.curly;
php-curl = phpExtensions.curl;
pycurl = python3.pkgs.pycurl;
withCheck = finalAttrs.finalPackage.overrideAttrs (_: { doCheck = true; });
fetchpatch = tests.fetchpatch.simple.override { fetchpatch = fetchpatch.override { fetchurl = useThisCurl fetchurl; }; };
curlpp = useThisCurl curlpp;
coeurl = useThisCurl coeurl;
haskell-curl = useThisCurl haskellPackages.curl;
ocaml-curly = useThisCurl ocamlPackages.curly;
pycurl = useThisCurl python3.pkgs.pycurl;
php-curl = useThisCurl phpExtensions.curl;
# error: attribute 'override' missing
# Additional checking with support http3 protocol.
inherit (nixosTests) nginx-http3;
# nginx-http3 = useThisCurl nixosTests.nginx-http3;
nginx-http3 = nixosTests.nginx-http3;
};
};
@ -196,4 +208,4 @@ stdenv.mkDerivation rec {
# Fails to link against static brotli or gss
broken = stdenv.hostPlatform.isStatic && (brotliSupport || gssSupport);
};
}
})

View file

@ -66,8 +66,8 @@ lib.makeScope pkgs.newScope (self: with self; {
#
# Build inputs is used for extra deps that may be needed. And zendExtension
# will mark the extension as a zend extension or not.
mkExtension =
{ name
mkExtension = lib.makeOverridable
({ name
, configureFlags ? [ "--enable-${name}" ]
, internalDeps ? [ ]
, postPhpize ? ""
@ -151,7 +151,7 @@ lib.makeScope pkgs.newScope (self: with self; {
description = "PHP upstream extension: ${name}";
inherit (php.meta) maintainers homepage license;
};
});
}));
php = phpPackage;

View file

@ -97,6 +97,7 @@ let
jobs.lib-tests
jobs.pkgs-lib-tests
jobs.stdenv.x86_64-linux
jobs.tests.packageTestsForChannelBlockers.curl.withCheck.x86_64-linux
jobs.cargo.x86_64-linux
jobs.go.x86_64-linux
jobs.linux.x86_64-linux
@ -133,6 +134,7 @@ let
++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools
++ lib.optionals supportDarwin.x86_64 [
jobs.stdenv.x86_64-darwin
jobs.tests.packageTestsForChannelBlockers.curl.withCheck.x86_64-darwin
jobs.cargo.x86_64-darwin
jobs.cachix.x86_64-darwin
jobs.go.x86_64-darwin