Opened 3 years ago

Closed 3 years ago

Last modified 3 months ago

#65056 closed enhancement (fixed)

curl: Enable http2 by default

Reported by: dgilman (David Gilman) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: barracuda156
Port: curl

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Please enable the http2 variant by default. http2 is common enough that in the past year I've had to recompile with +http2 twice to test stuff out. There is even a HTTP 3 now.

I also note that Debian is shipping curl built with nghttp2, brotli, zstd, libssh2, librtmp, openldap, and even gssapi. I think it's worth reviewing that list to see what else should be built by default. In my opinion anything Debian is shipping is going to be considered an effective default for any distribution.

Change History (9)

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: set to ryandesign
Status: newaccepted
Summary: Enable http2 by defaultcurl: Enable http2 by default

Just to set your expectations, I don't generally look at what Debian or another package manager enables in their packages, and I don't know if any other MacPorts maintainers do that.

I don't know how Debian's packages work. I don't know if they have a concept like MacPorts variants which let the user choose which features to enable. If they don't, that would be a good justification for them enabling many features automatically, whereas in MacPorts it's a good reason not to, since not all users need all features and some of them come with a lot of dependencies.

I'm happy to enable http/2 support unconditionally since http/2 is mainstream now, even though I would not expect the lack of http/2 support to have caused many problems since I would expect servers that support http/2 to still support http/1.1 as well, although maybe I'm out of date with that expectation.

http/3 appears not to be final yet. curl's support for http/3 appears to be experimental. Looks like it could use any of several different libraries for http/3 support, none of which are in MacPorts yet, I think. If you want http/3 support in MacPorts curl, we'd have to add at least one of those ports first. Let's table that until later. Feel free to file another ticket for that, or to submit tickets or pull requests for any of those needed dependencies.

I'm happy to add brotli compression support to curl since that's also gained mainstream acceptance. The curl port already has zstd compression support enabled unconditionally.

libssh2, openldap, and gssapi support seem more esoteric to me, justifiably hidden in non-default variants. The gss variant has a comment explaining that it requires macOS gss, not MacPorts gss, and therefore it declares a conflict with the MacPorts gss and kerberos5 ports. If we enabled that variant by default (or enabled that feature unconditionally without a variant) it would cause an inconvenience for users who also had the gss or kerberos5 ports installed every time they wanted to upgrade the curl port -- at least those users who did not receive binaries from us.

librtmp support also seems esoteric, to the extent that there hasn't even been a variant for it in the curl port and I'm not aware of anyone having mentioned it before you. I can certainly add a variant for it.

comment:2 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In e82cd37894a10f8b7609d02b8c8f9c669526e822/macports-ports (master):

curl: Add rtmp variant

See: #65056

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In e1ed418961c5919aacfeb582bb0baa2d74243a8f/macports-ports (master):

curl: Enable brotli and http/2 support

Closes: #65056

comment:4 in reply to:  3 Changed 3 years ago by barracuda156

Replying to ryandesign:

In e1ed418961c5919aacfeb582bb0baa2d74243a8f/macports-ports (master):

curl: Enable brotli and http/2 support

Closes: #65056

Adding default dependency on nghttp2 breaks universal variant on Leopard:

36-61:~ svacchanda$ sudo port -v -n upgrade curl +universal
--->  Computing dependencies for curl.
Error: Cannot install curl for the archs 'ppc ppc64' because
Error: its dependency nghttp2 cannot build for the required archs.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.

Which otherwise worked:

36-61:~ svacchanda$ bbedit `port file curl`
36-61:~ svacchanda$ port -v installed curl
The following ports are currently installed:
  curl @7.80.0_0+ssl requested_variants='-universal' platform='darwin 9' archs='ppc' date='2021-12-22T09:17:24+0800'
  curl @7.80.0_0+ssl+universal requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2021-12-24T19:23:27+0800'
  curl @7.82.0_0+ssl+universal (active) requested_variants='+universal' platform='darwin 9' archs='ppc ppc64' date='2022-03-29T19:49:27+0800'

comment:5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

I don't see anything in the nghttp2 port that would indicate a problem building it universal. If it's not working for you, file a ticket about it.

comment:6 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: barracuda156 added

nghttp2 requires C++14 which involves bring in newer compilers on older systems. Is that reason enough to put it back to being a variant again? The variant could conceivably be enabled by default on newer systems that already have C++14 compilers and disabled by default on older systems that don't, though maybe that's more confusing than leaving it off by default for everyone.

comment:7 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

In b944040204a0f97164809ada1205c1071e7d8436/macports-ports (master):

curl: Move HTTP/2 support back to +http2 variant

Revert the preceding effort to enable HTTP/2 unconditionally. While
HTTP/2 is nice, it uses nghttp2 which requires C++14 which requires
newer compilers on older systems which can cause a bootstrapping
headache. So now enable the variant by default only on systems that
don't need additional compilers to build it.

See: #65056
Closes: #65063

comment:8 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

In 65784cb779b059baae47a00f107e012be432a632/macports-ports (master):

Revert "curl: Move HTTP/2 support back to +http2 variant"

This reverts commit b944040204a0f97164809ada1205c1071e7d8436.

Now that the nghttp2 port no longer imposes a C++ version requirement,
http2 support can be enabled unconditionally.

See: #65056
See: #65063
See: #70048

comment:9 Changed 3 months ago by ryandesign (Ryan Carsten Schmidt)

In ab601bb9f7d20d00d9f00a309b3c55c5e21763c7/macports-ports (master):

curl: Move brotli/http2/idn/psl/zstd to variants

While some users want commonly-used features enabled in curl by default,
others wish to have the option to disable them to build a minimal curl
for MacPorts to link with on older systems. Therefore move brotli,
http2, idn, psl, and zstd features to variants which are on by default.

See: #55197
See: #61654
See: #65056
See: #70481

Note: See TracTickets for help on using tickets.