From 7419c858e245990533fe933e64d6a5a740325ae9 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 5 Nov 2025 08:51:48 +0000 Subject: [PATCH] mingw-w64-curl: update to 8.17.0 This required the following changes: - 0003*.patch was a backport that is no longer necessary (and hence would fail the build) - 0001*.patch and 0002*.patch touch code that moved from `lib/url.c` to `lib/vtls/vtls.c` and needed some previously consecutive code to be split into two `#ifdef`'ed blocks. Signed-off-by: Johannes Schindelin --- .../0001-Make-cURL-relocatable.patch | 150 +++++++++++------- ...tion-work-inside-libexec-git-core-an.patch | 24 +-- ...happy-do-not-set-unnecessary-timeout.patch | 104 ------------ mingw-w64-curl/PKGBUILD | 17 +- 4 files changed, 109 insertions(+), 186 deletions(-) delete mode 100644 mingw-w64-curl/0003-ip-happy-do-not-set-unnecessary-timeout.patch diff --git a/mingw-w64-curl/0001-Make-cURL-relocatable.patch b/mingw-w64-curl/0001-Make-cURL-relocatable.patch index 9dbc8e60d159a..7508ad4c1648f 100644 --- a/mingw-w64-curl/0001-Make-cURL-relocatable.patch +++ b/mingw-w64-curl/0001-Make-cURL-relocatable.patch @@ -1,4 +1,4 @@ -From 9bc4150738ef5d92b0050f8539758c8f03335442 Mon Sep 17 00:00:00 2001 +From 80b680d4796d1ce913185dbaf4c36c6a64669e86 Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Wed, 22 Feb 2017 11:03:04 +0100 Subject: [PATCH 1/2] Make cURL relocatable @@ -25,14 +25,14 @@ Signed-off-by: Johannes Schindelin configure.ac | 1 + lib/Makefile.inc | 2 ++ lib/curl_config.h.in | 3 +++ - lib/url.c | 38 ++++++++++++++++++++++++++++++++++++++ - 4 files changed, 44 insertions(+) + lib/vtls/vtls.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 55 insertions(+) diff --git a/configure.ac b/configure.ac -index aba3d82af..2d30abb2c 100644 +index cc16f4120..827d04948 100644 --- a/configure.ac +++ b/configure.ac -@@ -4027,6 +4027,7 @@ dnl default includes +@@ -4069,6 +4069,7 @@ dnl default includes ] ) @@ -41,10 +41,10 @@ index aba3d82af..2d30abb2c 100644 dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/lib/Makefile.inc b/lib/Makefile.inc -index b384e0962..216fec947 100644 +index 8b506febc..841e8a7ea 100644 --- a/lib/Makefile.inc +++ b/lib/Makefile.inc -@@ -225,6 +225,7 @@ LIB_CFILES = \ +@@ -229,6 +229,7 @@ LIB_CFILES = \ noproxy.c \ openldap.c \ parsedate.c \ @@ -52,7 +52,7 @@ index b384e0962..216fec947 100644 pingpong.c \ pop3.c \ progress.c \ -@@ -357,6 +358,7 @@ LIB_HFILES = \ +@@ -361,6 +362,7 @@ LIB_HFILES = \ netrc.h \ noproxy.h \ parsedate.h \ @@ -61,7 +61,7 @@ index b384e0962..216fec947 100644 pop3.h \ progress.h \ diff --git a/lib/curl_config.h.in b/lib/curl_config.h.in -index 87d60a274..990895776 100644 +index 668be5ea1..9c3139764 100644 --- a/lib/curl_config.h.in +++ b/lib/curl_config.h.in @@ -14,6 +14,9 @@ @@ -74,56 +74,42 @@ index 87d60a274..990895776 100644 /* Default SSL backend */ #undef CURL_DEFAULT_SSL_BACKEND -diff --git a/lib/url.c b/lib/url.c -index dac24b35e..6fe831e1e 100644 ---- a/lib/url.c -+++ b/lib/url.c -@@ -121,6 +121,9 @@ - #include "curlx/dynbuf.h" - #include "headers.h" - #include "curlx/strparse.h" +diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c +index df0449cbe..bb45551b0 100644 +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -81,6 +81,10 @@ + #include + #endif + +#if defined(__MINGW32__) -+#include "pathtools.h" ++#include "../pathtools.h" +#endif - /* The last 3 #include files should be in this order */ - #include "curl_printf.h" - #include "curl_memory.h" -@@ -430,22 +433,57 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) - if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL && - Curl_ssl_backend() != CURLSSLBACKEND_SECURETRANSPORT) { - #ifdef CURL_CA_BUNDLE ++ + /* The last #include files should be: */ + #include "../curl_memory.h" + #include "../memdebug.h" +@@ -297,6 +301,15 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) + #if defined(CURL_CA_PATH) || defined(CURL_CA_BUNDLE) + struct UserDefined *set = &data->set; + CURLcode result; +#ifdef __MINGW32__ + const size_t path_max = PATH_MAX; ++#ifdef CURL_CA_PATH ++ char relocated_ca_path[path_max]; ++#endif ++#ifdef CURL_CA_BUNDLE + char relocated_bundle[path_max]; -+ get_dll_path(relocated_bundle, path_max); -+ strip_n_suffix_folders(relocated_bundle, 1); -+ strncat(relocated_bundle, "/", path_max - 1); -+ char *relative = get_relative_path(CURL_BINDIR, CURL_CA_BUNDLE); -+ strncat(relocated_bundle, relative, path_max - 1); -+ free((void*)relative); -+ simplify_path(relocated_bundle); -+ result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], relocated_bundle); -+#else - result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE); -+#endif /* defined(__MINGW32__) */ - if(result) - return result; - #ifndef CURL_DISABLE_PROXY -+#if defined(__MINGW32__) -+ result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], -+ relocated_bundle); -+#else - result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], - CURL_CA_BUNDLE); +#endif - if(result) - return result; ++#endif /* defined(__MINGW32__) */ #endif + + if(Curl_ssl_backend() != CURLSSLBACKEND_SCHANNEL) { +@@ -305,16 +318,42 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) + sslc->native_ca_store = TRUE; #endif #ifdef CURL_CA_PATH +#ifdef __MINGW32__ -+ const size_t path_max = PATH_MAX; -+ char relocated_ca_path[path_max]; + get_dll_path(relocated_ca_path, path_max); + strip_n_suffix_folders(relocated_ca_path, 1); + strncat(relocated_ca_path, "/", path_max - 1); @@ -131,18 +117,62 @@ index dac24b35e..6fe831e1e 100644 + strncat(relocated_ca_path, relative, path_max - 1); + free((void*)relative); + simplify_path(relocated_ca_path); -+ result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], relocated_ca_path); ++#endif /* defined(__MINGW32__) */ + if(!sslc->custom_capath && !set->str[STRING_SSL_CAPATH]) { ++#ifdef __MINGW32__ ++ result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], relocated_ca_path); +#else - result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], CURL_CA_PATH); + result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], CURL_CA_PATH); +#endif /* defined(__MINGW32__) */ - if(result) - return result; - #ifndef CURL_DISABLE_PROXY -+#if defined(__MINGW32__) -+ result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], relocated_ca_path); + if(result) + return result; + } + sslc->primary.CApath = data->set.str[STRING_SSL_CAPATH]; + #endif + #ifdef CURL_CA_BUNDLE ++#ifdef __MINGW32__ ++ get_dll_path(relocated_bundle, path_max); ++ strip_n_suffix_folders(relocated_bundle, 1); ++ strncat(relocated_bundle, "/", path_max - 1); ++ char *relative = get_relative_path(CURL_BINDIR, CURL_CA_BUNDLE); ++ strncat(relocated_bundle, relative, path_max - 1); ++ free((void*)relative); ++ simplify_path(relocated_bundle); ++#endif /* defined(__MINGW32__) */ + if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE]) { ++#ifdef __MINGW32__ ++ result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], relocated_bundle); +#else - result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], CURL_CA_PATH); -+#endif - if(result) - return result; + result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE); ++#endif /* defined(__MINGW32__) */ + if(result) + return result; + } +@@ -353,8 +392,13 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) #endif + #ifdef CURL_CA_PATH + if(!sslc->custom_capath && !set->str[STRING_SSL_CAPATH_PROXY]) { ++#ifdef __MINGW32__ ++ result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], ++ relocated_ca_path); ++#else + result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], + CURL_CA_PATH); ++#endif /* defined(__MINGW32__) */ + if(result) + return result; + } +@@ -362,8 +406,13 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) + #endif + #ifdef CURL_CA_BUNDLE + if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE_PROXY]) { ++#ifdef __MINGW32__ ++ result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], ++ relocated_bundle); ++#else + result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], + CURL_CA_BUNDLE); ++#endif /* defined(__MINGW32__) */ + if(result) + return result; + } diff --git a/mingw-w64-curl/0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch b/mingw-w64-curl/0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch index b086f35852df0..e8a6d379c1d7d 100644 --- a/mingw-w64-curl/0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch +++ b/mingw-w64-curl/0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch @@ -1,4 +1,4 @@ -From 538ef176222d618321769e714c1d4d81372736db Mon Sep 17 00:00:00 2001 +From 5022c4e5a2bd1483c70f2e8177eb51edd36139eb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 31 Oct 2018 10:52:59 +0100 Subject: [PATCH 2/2] Hack: make relocation work inside libexec/git-core/ and @@ -26,14 +26,14 @@ extend the Git for Windows-specific hack with a hard-code `bin/` case. Signed-off-by: Johannes Schindelin --- - lib/url.c | 21 ++++++++++++++++++++- + lib/vtls/vtls.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) -diff --git a/lib/url.c b/lib/url.c -index 6fe831e1e..5a99ede5b 100644 ---- a/lib/url.c -+++ b/lib/url.c -@@ -439,10 +439,29 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data) +diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c +index bb45551b0..a864fb758 100644 +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -343,10 +343,29 @@ CURLcode Curl_ssl_easy_config_complete(struct Curl_easy *data) get_dll_path(relocated_bundle, path_max); strip_n_suffix_folders(relocated_bundle, 1); strncat(relocated_bundle, "/", path_max - 1); @@ -53,14 +53,14 @@ index 6fe831e1e..5a99ede5b 100644 free((void*)relative); simplify_path(relocated_bundle); + if (access(relocated_bundle, R_OK) != 0 && -+ (len = strlen(relocated_bundle)) >= 28 && -+ !strcmp(relocated_bundle + len - 28, "/etc/ssl/certs/ca-bundle.crt")) { ++ (len = strlen(relocated_bundle)) >= 28 && ++ !strcmp(relocated_bundle + len - 28, "/etc/ssl/certs/ca-bundle.crt")) { + /* Try without /etc/ */ + memmove(relocated_bundle + len - 28, relocated_bundle + len - 24, 25); + if (access(relocated_bundle, R_OK) != 0) + /* fall back to using /etc/ */ + strcat(relocated_bundle + len - 28, "/etc/ssl/certs/ca-bundle.crt"); + } - result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], relocated_bundle); - #else - result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], CURL_CA_BUNDLE); + #endif /* defined(__MINGW32__) */ + if(!sslc->custom_cafile && !set->str[STRING_SSL_CAFILE]) { + #ifdef __MINGW32__ diff --git a/mingw-w64-curl/0003-ip-happy-do-not-set-unnecessary-timeout.patch b/mingw-w64-curl/0003-ip-happy-do-not-set-unnecessary-timeout.patch deleted file mode 100644 index cb992f884e728..0000000000000 --- a/mingw-w64-curl/0003-ip-happy-do-not-set-unnecessary-timeout.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 271add6fc90245bd99448357b4f5a76598eb3e85 Mon Sep 17 00:00:00 2001 -From: Stefan Eissing -Date: Mon, 29 Sep 2025 16:38:55 +0200 -Subject: [PATCH] ip-happy: do not set unnecessary timeout - -When attempts on all addresses have been started, do -no longer set any EXPIRE_HAPPY_EYEBALLS timeouts. - -refs #18767 ---- - lib/cf-ip-happy.c | 43 ++++++++++++++++++++++++++++++------------- - 1 file changed, 30 insertions(+), 13 deletions(-) - -diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c -index 0a1364e4b..801370fd9 100644 ---- a/lib/cf-ip-happy.c -+++ b/lib/cf-ip-happy.c -@@ -156,6 +156,18 @@ static const struct Curl_addrinfo *cf_ai_iter_next(struct cf_ai_iter *iter) - return iter->last; - } - -+static bool cf_ai_iter_has_more(struct cf_ai_iter *iter) -+{ -+ const struct Curl_addrinfo *addr = iter->last ? iter->last->ai_next : -+ ((iter->n < 0) ? iter->head : NULL); -+ while(addr) { -+ if(addr->ai_family == iter->ai_family) -+ return TRUE; -+ addr = addr->ai_next; -+ } -+ return FALSE; -+} -+ - #ifdef USE_IPV6 - static bool cf_ai_iter_done(struct cf_ai_iter *iter) - { -@@ -356,7 +368,7 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, - { - CURLcode result = CURLE_OK; - struct cf_ip_attempt *a = NULL, **panchor; -- bool do_more, more_possible; -+ bool do_more; - struct curltime now; - timediff_t next_expire_ms; - int i, inconclusive, ongoing; -@@ -367,7 +379,6 @@ static CURLcode cf_ip_ballers_run(struct cf_ip_ballers *bs, - evaluate: - now = curlx_now(); - ongoing = inconclusive = 0; -- more_possible = TRUE; - - /* check if a running baller connects now */ - i = -1; -@@ -475,11 +486,8 @@ evaluate: - /* attempt timeout for restart has not expired yet */ - goto out; - } -- else if(ongoing) { -+ else if(!ongoing) { - /* no more addresses, no inconclusive attempts */ -- more_possible = FALSE; -- } -- else { - CURL_TRC_CF(data, cf, "no more attempts to try"); - result = CURLE_COULDNT_CONNECT; - i = 0; -@@ -493,21 +501,30 @@ evaluate: - - out: - if(!result) { -+ bool more_possible; -+ - /* when do we need to be called again? */ - next_expire_ms = Curl_timeleft(data, &now, TRUE); -+ if(next_expire_ms <= 0) { -+ failf(data, "Connection timeout after %" FMT_OFF_T " ms", -+ curlx_timediff(now, data->progress.t_startsingle)); -+ return CURLE_OPERATION_TIMEDOUT; -+ } -+ -+ more_possible = cf_ai_iter_has_more(&bs->addr_iter); -+#ifdef USE_IPV6 -+ if(!more_possible) -+ more_possible = cf_ai_iter_has_more(&bs->ipv6_iter); -+#endif - if(more_possible) { - timediff_t expire_ms, elapsed_ms; - elapsed_ms = curlx_timediff(now, bs->last_attempt_started); - expire_ms = CURLMAX(bs->attempt_delay_ms - elapsed_ms, 0); - next_expire_ms = CURLMIN(next_expire_ms, expire_ms); -+ CURL_TRC_CF(data, cf, "next HAPPY_EYBALLS timeout in %" FMT_TIMEDIFF_T -+ "ms", next_expire_ms); -+ Curl_expire(data, next_expire_ms, EXPIRE_HAPPY_EYEBALLS); - } -- -- if(next_expire_ms <= 0) { -- failf(data, "Connection timeout after %" FMT_OFF_T " ms", -- curlx_timediff(now, data->progress.t_startsingle)); -- return CURLE_OPERATION_TIMEDOUT; -- } -- Curl_expire(data, next_expire_ms, EXPIRE_HAPPY_EYEBALLS); - } - return result; - } diff --git a/mingw-w64-curl/PKGBUILD b/mingw-w64-curl/PKGBUILD index 5e98048e23f31..363256f11c863 100644 --- a/mingw-w64-curl/PKGBUILD +++ b/mingw-w64-curl/PKGBUILD @@ -5,8 +5,8 @@ pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-${_realname}-gnutls" "${MINGW_PACKAGE_PREFIX}-${_realname}-winssl") -pkgver=8.16.0 -pkgrel=2 +pkgver=8.17.0 +pkgrel=1 pkgdesc="Command line tool and library for transferring data with URLs (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -35,15 +35,13 @@ source=("https://github.com/curl/curl/releases/download/${_realname}-${pkgver//. "pathtools.c" "pathtools.h" "0001-Make-cURL-relocatable.patch" - "0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch" - "0003-ip-happy-do-not-set-unnecessary-timeout.patch") -sha256sums=('9459180ab4933b30d0778ddd71c91fe2911fab731c46e59b3f4c8385b1596c91' + "0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch") +sha256sums=('230032528ce5f85594d4f3eace63364c4244ccc3c801b7f8db1982722f2761f4' 'SKIP' '08209cbf1633fa92eae7e5d28f95f8df9d6184cc20fa878c99aec4709bb257fd' '965d3921ec4fdeec94a2718bc2c85ce5e1a00ea0e499330a554074a7ae15dfc6' - '8aa4eab2f2c38afb0ae7825be5be032194574f08cedd37b57b9ea5a19eb25ad4' - 'c43eb97757f71a5f2368fa1b132d286e8ceb91060742e643d4dbc06712a57e94' - '90de3265dc33894fe53fb2b0c0ffd25e1fae0330d2a5e00ebafb3cb34c2e7591') + '36132e2fec731f863a28153995be29a49158f457d5e1ad3dc577d5c23a827594' + '089a62a2e389c70dd40c5fdf80ee69d46f083b105101123b9f5a07dc24411bb4') validpgpkeys=('27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') # Daniel Stenberg if test -z "$WITHOUT_ALTERNATES" @@ -93,8 +91,7 @@ prepare() { apply_patch_with_msg \ 0001-Make-cURL-relocatable.patch \ - 0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch \ - 0003-ip-happy-do-not-set-unnecessary-timeout.patch + 0002-Hack-make-relocation-work-inside-libexec-git-core-an.patch autoreconf -vfi }