Skip to content

curl: enable HTTP 3 protocol by default#179579

Draft
Izorkin wants to merge 1 commit intoNixOS:stagingfrom
Izorkin:curl-default-http3
Draft

curl: enable HTTP 3 protocol by default#179579
Izorkin wants to merge 1 commit intoNixOS:stagingfrom
Izorkin:curl-default-http3

Conversation

@Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 29, 2022

Description of changes

Enable HTTP 3 protocol by default

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation labels Jun 29, 2022
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 8.has: clean-up This PR removes packages or removes other cruft labels Jun 29, 2022
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 29, 2022
@Izorkin Izorkin force-pushed the curl-default-http3 branch from cdf7330 to 43a224b Compare June 29, 2022 16:36
@lovesegfault
Copy link
Member

I am uncertain whether this is a good idea, quoting from https://curl.se/docs/http3.html:

HTTP/3 and QUIC support in curl is considered EXPERIMENTAL until further notice. It needs to be enabled at build-time.

Further development and tweaking of the HTTP/3 support in curl will happen in the master branch using pull-requests, just like ordinary changes.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 29, 2022

@lovesegfault in the latest update, http 3 works quite stable :)

@Izorkin Izorkin force-pushed the curl-default-http3 branch from 43a224b to 0d7a749 Compare June 29, 2022 17:35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to happy about this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variant?

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 45a89043efa..cebcb20a20a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5102,12 +5102,9 @@ with pkgs;
     pslSupport = true;
   };

-  curlHTTP3 = curl.override {
+  curl = curlMinimal.override ({
     openssl = quictls;
     http3Support = true;
-  };
-
-  curl = curlMinimal.override ({
     idnSupport = true;
     zstdSupport = true;
   } // lib.optionalAttrs (!stdenv.hostPlatform.isStatic) {

In this case, curlMinimal will use openssl, curl will use quictls.

This variant not working:

diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index d0e3e7a61a6..f7bf8c29e96 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -18,7 +18,7 @@
 , http3Support ? false, nghttp3, ngtcp2 ? null
 , idnSupport ? false, libidn2 ? null
 , ldapSupport ? false, openldap ? null
-, opensslSupport ? zlibSupport, openssl ? null
+, opensslSupport ? zlibSupport, quictls ? null
 , pslSupport ? false, libpsl ? null
 , rtmpSupport ? false, rtmpdump ? null
 , scpSupport ? zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin, libssh2 ? null
@@ -53,7 +53,7 @@ assert http3Support -> nghttp3 != null;
 assert http3Support -> ngtcp2 != null;
 assert idnSupport -> libidn2 != null;
 assert ldapSupport -> openldap != null;
-assert opensslSupport -> openssl != null;
+assert opensslSupport -> quictls != null;
 assert pslSupport -> libpsl !=null;
 assert rtmpSupport -> rtmpdump !=null;
 assert scpSupport -> libssh2 != null;
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
     optionals http3Support [ nghttp3 ngtcp2 ] ++
     optional idnSupport libidn2 ++
     optional ldapSupport openldap ++
-    optional opensslSupport openssl ++
+    optional opensslSupport quictls ++
     optional pslSupport libpsl ++
     optional rtmpSupport rtmpdump ++
     optional scpSupport libssh2 ++
@@ -131,7 +131,7 @@ stdenv.mkDerivation rec {
       (lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli))
       (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
       (lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2))
-      (lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl))
+      (lib.withFeatureAs opensslSupport "openssl" (lib.getDev quictls))
       (lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2))
       (lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl))
     ]
@@ -178,7 +178,7 @@ stdenv.mkDerivation rec {
   '';

   passthru = {
-    inherit opensslSupport openssl;
+    inherit opensslSupport quictls;
     tests = {
       inherit curlpp coeurl;
       haskell-curl = haskellPackages.curl;

error: infinite recursion encountered

       at /home/rebrain/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:311:7:

          310|       depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
          311|       nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
             |       ^
          312|       depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, curlMinimal will use openssl, curl will use quictls.

thats a bit better but still it is not very great that we need to use an openssl fork for such a core program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats a bit better but still it is not very great that we need to use an openssl fork for such a core program.

Package quictls = openss 3 + quic patches without changes in functionality.
Updated PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I know and that why I'd rather not have http3 support for now.

@ofborg ofborg bot requested a review from SuperSandro2000 June 29, 2022 18:10
@Izorkin Izorkin force-pushed the curl-default-http3 branch from 0d7a749 to 57ceb5d Compare June 30, 2022 11:27
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 7, 2023
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
@Izorkin Izorkin force-pushed the curl-default-http3 branch from 57ceb5d to 56af637 Compare August 25, 2025 21:08
@nixpkgs-ci nixpkgs-ci bot removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Aug 25, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 21, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: clean-up This PR removes packages or removes other cruft 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants