commit: b4a094f4165eba939dc23b9af9c660ab3b45f449 Author: Matt Jolly <kangie <AT> gentoo <DOT> org> AuthorDate: Thu May 30 00:30:56 2024 +0000 Commit: Matt Jolly <kangie <AT> gentoo <DOT> org> CommitDate: Thu May 30 02:02:10 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4a094f4
net-misc/curl: add 8.8.0-r1 This release fixes an issue where under certain circumstances (in particular when invoked within the Gentoo sandbox), `multi_wait()` would incorrectly calculate the timeout, resulting in test failures. Allow setting `--enable-debug` via USE=debug with an appropriate warning to the ebuild and live ebuild. Closes: https://bugs.gentoo.org/932660 See-also: https://github.com/curl/curl/issues/13782 Signed-off-by: Matt Jolly <kangie <AT> gentoo.org> .../{curl-9999.ebuild => curl-8.8.0-r1.ebuild} | 19 +++++- net-misc/curl/curl-9999.ebuild | 16 ++++- .../curl/files/curl-8.8.0-multi_wait-timeout.patch | 75 ++++++++++++++++++++++ 3 files changed, 108 insertions(+), 2 deletions(-) diff --git a/net-misc/curl/curl-9999.ebuild b/net-misc/curl/curl-8.8.0-r1.ebuild similarity index 95% copy from net-misc/curl/curl-9999.ebuild copy to net-misc/curl/curl-8.8.0-r1.ebuild index 17ec871e7e2a..b77ba32f5d7e 100644 --- a/net-misc/curl/curl-9999.ebuild +++ b/net-misc/curl/curl-8.8.0-r1.ebuild @@ -26,7 +26,7 @@ fi LICENSE="BSD curl ISC test? ( BSD-4 )" SLOT="0" -IUSE="+adns +alt-svc brotli +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3" +IUSE="+adns +alt-svc brotli debug +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3" IUSE+=" +psl +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd" # These select the default SSL implementation IUSE+=" curl_ssl_gnutls curl_ssl_mbedtls +curl_ssl_openssl curl_ssl_rustls" @@ -136,6 +136,9 @@ QA_CONFIG_IMPL_DECL_SKIP=( PATCHES=( "${FILESDIR}"/${PN}-prefix-2.patch "${FILESDIR}"/${PN}-respect-cflags-3.patch + "${FILESDIR}"/${P}-install-manpage.patch + "${FILESDIR}"/${P}-mbedtls.patch + "${FILESDIR}"/${P}-multi_wait-timeout.patch ) src_prepare() { @@ -279,6 +282,12 @@ multilib_src_configure() { --with-zsh-functions-dir="${EPREFIX}"/usr/share/zsh/site-functions ) + if use debug; then + myconf+=( + --enable-debug + ) + fi + if use test && multilib_is_native_abi && ( use http2 || use nghttp3 ); then myconf+=( --with-test-nghttpx="${BROOT}/usr/bin/nghttpx" @@ -368,3 +377,11 @@ multilib_src_install_all() { find "${ED}" -type f -name '*.la' -delete || die rm -rf "${ED}"/etc/ || die } + +pkg_postinst() { + if use debug; then + ewarn "USE=debug has been selected, enabling debug codepaths and making cURL extra verbose." + ewarn "Use this _only_ for testing. Debug builds should _not_ be used in anger." + ewarn "hic sunt dracones; you have been warned." + fi +} diff --git a/net-misc/curl/curl-9999.ebuild b/net-misc/curl/curl-9999.ebuild index 17ec871e7e2a..7f560fb74a9b 100644 --- a/net-misc/curl/curl-9999.ebuild +++ b/net-misc/curl/curl-9999.ebuild @@ -26,7 +26,7 @@ fi LICENSE="BSD curl ISC test? ( BSD-4 )" SLOT="0" -IUSE="+adns +alt-svc brotli +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3" +IUSE="+adns +alt-svc brotli debug +ftp gnutls gopher +hsts +http2 idn +imap kerberos ldap mbedtls nghttp3 +openssl +pop3" IUSE+=" +psl +progress-meter rtmp rustls samba +smtp ssh ssl sslv3 static-libs test telnet +tftp websockets zstd" # These select the default SSL implementation IUSE+=" curl_ssl_gnutls curl_ssl_mbedtls +curl_ssl_openssl curl_ssl_rustls" @@ -279,6 +279,12 @@ multilib_src_configure() { --with-zsh-functions-dir="${EPREFIX}"/usr/share/zsh/site-functions ) + if use debug; then + myconf+=( + --enable-debug + ) + fi + if use test && multilib_is_native_abi && ( use http2 || use nghttp3 ); then myconf+=( --with-test-nghttpx="${BROOT}/usr/bin/nghttpx" @@ -368,3 +374,11 @@ multilib_src_install_all() { find "${ED}" -type f -name '*.la' -delete || die rm -rf "${ED}"/etc/ || die } + +pkg_postinst() { + if use debug; then + ewarn "USE=debug has been selected, enabling debug codepaths and making cURL extra verbose." + ewarn "Use this _only_ for testing. Debug builds should _not_ be used in anger." + ewarn "hic sunt dracones; you have been warned." + fi +} diff --git a/net-misc/curl/files/curl-8.8.0-multi_wait-timeout.patch b/net-misc/curl/files/curl-8.8.0-multi_wait-timeout.patch new file mode 100644 index 000000000000..38d8c1bd3f20 --- /dev/null +++ b/net-misc/curl/files/curl-8.8.0-multi_wait-timeout.patch @@ -0,0 +1,75 @@ +https://github.com/curl/curl/pull/13825 +From: Stefan Eissing <[email protected]> +Date: Wed, 29 May 2024 17:13:34 +0200 +Subject: [PATCH] fix multi_wait() timeout handling + +- determine the actual poll timeout *after* all sockets + have been collected. Protocols and connection filters may + install new timeouts during collection. +- add debug logging to test1533 where the mistake was noticed +- refs #13782 +--- a/lib/multi.c ++++ b/lib/multi.c +@@ -1366,13 +1366,6 @@ static CURLMcode multi_wait(struct Curl_multi *multi, + if(timeout_ms < 0) + return CURLM_BAD_FUNCTION_ARGUMENT; + +- /* If the internally desired timeout is actually shorter than requested from +- the outside, then use the shorter time! But only if the internal timer +- is actually larger than -1! */ +- (void)multi_timeout(multi, &timeout_internal); +- if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) +- timeout_ms = (int)timeout_internal; +- + memset(ufds, 0, ufds_len * sizeof(struct pollfd)); + memset(&ps, 0, sizeof(ps)); + +@@ -1476,6 +1469,14 @@ static CURLMcode multi_wait(struct Curl_multi *multi, + #endif + #endif + ++ /* We check the internal timeout *AFTER* we collected all sockets to ++ * poll. Collecting the sockets may install new timers by protocols ++ * and connection filters. ++ * Use the shorter one of the internal and the caller requested timeout. */ ++ (void)multi_timeout(multi, &timeout_internal); ++ if((timeout_internal >= 0) && (timeout_internal < (long)timeout_ms)) ++ timeout_ms = (int)timeout_internal; ++ + #if defined(ENABLE_WAKEUP) && defined(USE_WINSOCK) + if(nfds || use_wakeup) { + #else +--- a/tests/libtest/Makefile.inc ++++ b/tests/libtest/Makefile.inc +@@ -487,7 +487,7 @@ lib1551_SOURCES = lib1551.c $(SUPPORTFILES) + lib1552_SOURCES = lib1552.c $(SUPPORTFILES) $(TESTUTIL) + lib1552_LDADD = $(TESTUTIL_LIBS) + +-lib1553_SOURCES = lib1553.c $(SUPPORTFILES) $(TESTUTIL) ++lib1553_SOURCES = lib1553.c $(SUPPORTFILES) $(TSTTRACE) $(TESTUTIL) + lib1553_LDADD = $(TESTUTIL_LIBS) + + lib1554_SOURCES = lib1554.c $(SUPPORTFILES) +--- a/tests/libtest/lib1553.c ++++ b/tests/libtest/lib1553.c +@@ -24,6 +24,7 @@ + #include "test.h" + + #include "testutil.h" ++#include "testtrace.h" + #include "warnless.h" + #include "memdebug.h" + +@@ -74,6 +75,12 @@ CURLcode test(char *URL) + easy_setopt(curls, CURLOPT_XFERINFOFUNCTION, xferinfo); + easy_setopt(curls, CURLOPT_NOPROGRESS, 1L); + ++ libtest_debug_config.nohex = 1; ++ libtest_debug_config.tracetime = 1; ++ test_setopt(curls, CURLOPT_DEBUGDATA, &libtest_debug_config); ++ easy_setopt(curls, CURLOPT_DEBUGFUNCTION, libtest_debug_cb); ++ easy_setopt(curls, CURLOPT_VERBOSE, 1L); ++ + multi_add_handle(multi, curls); + + multi_perform(multi, &still_running);
