diff options
Diffstat (limited to 'meta/recipes-support/curl')
-rw-r--r-- | meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch | 64 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl/disable-tests | 15 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl/no-test-timeout.patch | 25 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl/run-ptest | 13 | ||||
-rw-r--r-- | meta/recipes-support/curl/curl_8.7.1.bb (renamed from meta/recipes-support/curl/curl_7.84.0.bb) | 67 | ||||
-rw-r--r-- | meta/recipes-support/curl/files/0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch | 37 | ||||
-rw-r--r-- | meta/recipes-support/curl/files/0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch | 33 |
7 files changed, 162 insertions, 92 deletions
diff --git a/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch b/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch new file mode 100644 index 0000000000..98f7db93e8 --- /dev/null +++ b/meta/recipes-support/curl/curl/721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch @@ -0,0 +1,64 @@ +From 721941aadf4adf4f6aeb3f4c0ab489bb89610c36 Mon Sep 17 00:00:00 2001 +From: Stefan Eissing <stefan@eissing.org> +Date: Mon, 1 Apr 2024 15:41:18 +0200 +Subject: [PATCH] http: with chunked POST forced, disable length check on read + callback + +- when an application forces HTTP/1.1 chunked transfer encoding + by setting the corresponding header and instructs curl to use + the CURLOPT_READFUNCTION, disregard any POST length information. +- this establishes backward compatibility with previous curl versions + +Applications are encouraged to not force "chunked", but rather +set length information for a POST. By setting -1, curl will +auto-select chunked on HTTP/1.1 and work properly on other HTTP +versions. + +Reported-by: Jeff King +Fixes #13229 +Closes #13257 +Upstream-Status: Backport +--- + lib/http.c | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/lib/http.c b/lib/http.c +index 92c04e69cd8373..a764d3c4403c39 100644 +--- a/lib/http.c ++++ b/lib/http.c +@@ -2046,8 +2046,19 @@ static CURLcode set_reader(struct Curl_easy *data, Curl_HttpReq httpreq) + else + result = Curl_creader_set_null(data); + } +- else { /* we read the bytes from the callback */ +- result = Curl_creader_set_fread(data, postsize); ++ else { ++ /* we read the bytes from the callback. In case "chunked" encoding ++ * is forced by the application, we disregard `postsize`. This is ++ * a backward compatibility decision to earlier versions where ++ * chunking disregarded this. See issue #13229. */ ++ bool chunked = FALSE; ++ char *ptr = Curl_checkheaders(data, STRCONST("Transfer-Encoding")); ++ if(ptr) { ++ /* Some kind of TE is requested, check if 'chunked' is chosen */ ++ chunked = Curl_compareheader(ptr, STRCONST("Transfer-Encoding:"), ++ STRCONST("chunked")); ++ } ++ result = Curl_creader_set_fread(data, chunked? -1 : postsize); + } + return result; + +@@ -2115,6 +2126,13 @@ CURLcode Curl_http_req_set_reader(struct Curl_easy *data, + data->req.upload_chunky = + Curl_compareheader(ptr, + STRCONST("Transfer-Encoding:"), STRCONST("chunked")); ++ if(data->req.upload_chunky && ++ Curl_use_http_1_1plus(data, data->conn) && ++ (data->conn->httpversion >= 20)) { ++ infof(data, "suppressing chunked transfer encoding on connection " ++ "using HTTP version 2 or higher"); ++ data->req.upload_chunky = FALSE; ++ } + } + else { + curl_off_t req_clen = Curl_creader_total_length(data); diff --git a/meta/recipes-support/curl/curl/disable-tests b/meta/recipes-support/curl/curl/disable-tests index 92056bd8ca..259576fd01 100644 --- a/meta/recipes-support/curl/curl/disable-tests +++ b/meta/recipes-support/curl/curl/disable-tests @@ -1,14 +1,24 @@ +# Intermittently fails e.g. https://autobuilder.yocto.io/pub/non-release/20231220-28/testresults/qemux86-64-ptest/curl.log +# https://autobuilder.yocto.io/pub/non-release/20231220-27/testresults/qemux86-64-ptest/curl.log +337 # These CRL test (alt-avc) are failing 356 412 413 # These CRL tests are scanning docs 971 +# Intermittently hangs e.g http://autobuilder.yocto.io/pub/non-release/20231228-18/testresults/qemux86-64-ptest/curl.log +1091 +# Intermittently hangs e.g https://autobuilder.yocto.io/pub/non-release/20231220-27/testresults/qemux86-64-ptest/curl.log +1096 +# These CRL tests are scanning docs 1119 1132 1135 -# These CRL tests are scnning headers +1478 +# These CRL tests are scanning headers 1167 +1477 # These CRL tests are scanning man pages 1139 1140 @@ -18,7 +28,10 @@ 1165 # This CRL test is looking for src files 1185 +# This test is scanning the source tree +1222 # These CRL tests need --libcurl option to be enabled +1279 1400 1401 1402 diff --git a/meta/recipes-support/curl/curl/no-test-timeout.patch b/meta/recipes-support/curl/curl/no-test-timeout.patch new file mode 100644 index 0000000000..7122b6f043 --- /dev/null +++ b/meta/recipes-support/curl/curl/no-test-timeout.patch @@ -0,0 +1,25 @@ +From 42cddb52e821cfc2f09f1974742714e5f2f1856e Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@arm.com> +Date: Fri, 15 Mar 2024 14:37:37 +0000 +Subject: [PATCH] Set the max-time timeout to 600 so the timeout is 10 minutes + instead of 13 seconds. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <ross.burton@arm.com> +--- + tests/servers.pm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/servers.pm b/tests/servers.pm +index d4472d5..9999938 100644 +--- a/tests/servers.pm ++++ b/tests/servers.pm +@@ -120,7 +120,7 @@ my $sshdverstr; # for socks server, ssh daemon version string + my $sshderror; # for socks server, ssh daemon version error + my %doesntrun; # servers that don't work, identified by pidfile + my %PORT = (nolisten => 47); # port we use for a local non-listening service +-my $server_response_maxtime=13; ++my $server_response_maxtime=600; + my $httptlssrv = find_httptlssrv(); + my %run; # running server + my %runcert; # cert file currently in use by an ssl running server diff --git a/meta/recipes-support/curl/curl/run-ptest b/meta/recipes-support/curl/curl/run-ptest index 614e822922..3d25f3d90b 100644 --- a/meta/recipes-support/curl/curl/run-ptest +++ b/meta/recipes-support/curl/curl/run-ptest @@ -1,6 +1,11 @@ #!/bin/sh + cd tests -./runtests.pl -a -n -s | sed \ - -e 's|\([^ ]* *\) \([^ ]* *\)...OK|PASS: \1 \2|' \ - -e 's|\([^ ]* *\) \([^ ]* *\)...FAILED|FAIL: \1 \2|' \ - -e 's/Warning: test[0-9]\+ not present in tests\/data\/Makefile.inc//' + +# Run all tests, don't stop on first failure +# Don't use valgrind if it is found +# Use automake-style output +# Run four tests in parallel +# Print log output on failure +# Don't run the flaky or timing dependent tests +./runtests.pl -a -n -am -j4 -p !flaky !timing-dependent diff --git a/meta/recipes-support/curl/curl_7.84.0.bb b/meta/recipes-support/curl/curl_8.7.1.bb index 75417cd1bc..c74416d7e9 100644 --- a/meta/recipes-support/curl/curl_7.84.0.bb +++ b/meta/recipes-support/curl/curl_8.7.1.bb @@ -6,17 +6,17 @@ HTTP post, SSL connections, proxy support, FTP uploads, and more!" HOMEPAGE = "https://curl.se/" BUGTRACKER = "https://github.com/curl/curl/issues" SECTION = "console/network" -LICENSE = "MIT-open-group" -LIC_FILES_CHKSUM = "file://COPYING;md5=190c514872597083303371684954f238" +LICENSE = "curl" +LIC_FILES_CHKSUM = "file://COPYING;md5=eed2e5088e1ac619c9a1c747da291d75" SRC_URI = " \ https://curl.se/download/${BP}.tar.xz \ - file://0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch \ - file://0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch \ + file://721941aadf4adf4f6aeb3f4c0ab489bb89610c36.patch \ file://run-ptest \ file://disable-tests \ + file://no-test-timeout.patch \ " -SRC_URI[sha256sum] = "2d118b43f547bfe5bae806d8d47b4e596ea5b25a6c1f080aef49fbcd817c5db8" +SRC_URI[sha256sum] = "6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710cd" # Curl has used many names over the years... CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl" @@ -26,27 +26,35 @@ inherit autotools pkgconfig binconfig multilib_header ptest # Entropy source for random PACKAGECONFIG option RANDOM ?= "/dev/urandom" -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} libidn openssl proxy random threaded-resolver verbose zlib" +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} aws basic-auth bearer-auth digest-auth negotiate-auth libidn openssl proxy random threaded-resolver verbose zlib" PACKAGECONFIG:class-native = "ipv6 openssl proxy random threaded-resolver verbose zlib" PACKAGECONFIG:class-nativesdk = "ipv6 openssl proxy random threaded-resolver verbose zlib" # 'ares' and 'threaded-resolver' are mutually exclusive PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver" +PACKAGECONFIG[aws] = "--enable-aws,--disable-aws" +PACKAGECONFIG[basic-auth] = "--enable-basic-auth,--disable-basic-auth" +PACKAGECONFIG[bearer-auth] = "--enable-bearer-auth,--disable-bearer-auth" PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual" +# Don't use this in production +PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" PACKAGECONFIG[dict] = "--enable-dict,--disable-dict," +PACKAGECONFIG[digest-auth] = "--enable-digest-auth,--disable-digest-auth" PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher," PACKAGECONFIG[imap] = "--enable-imap,--disable-imap," PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," +PACKAGECONFIG[kerberos-auth] = "--enable-kerberos-auth,--disable-kerberos-auth" PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5" -PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap," -PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps," +PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap" +PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap" PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl" PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2" PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls" PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt," +PACKAGECONFIG[negotiate-auth] = "--enable-negotiate-auth,--disable-negotiate-auth" PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2" PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3," @@ -56,7 +64,6 @@ PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp," PACKAGECONFIG[smb] = "--enable-smb,--disable-smb," PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp," -PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss" PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet," PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp," PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares" @@ -67,16 +74,13 @@ PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" EXTRA_OECONF = " \ --disable-libcurl-option \ --disable-ntlm-wb \ - --enable-crypto-auth \ --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \ --without-libpsl \ - --enable-debug \ --enable-optimize \ - --disable-curldebug \ - ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls nss openssl', d) == '') else ''} \ + ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls openssl', d) == '') else ''} \ " -do_install:append:class-target() { +fix_absolute_paths () { # cleanup buildpaths from curl-config sed -i \ -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ @@ -86,15 +90,27 @@ do_install:append:class-target() { ${D}${bindir}/curl-config } +do_install:append:class-target() { + fix_absolute_paths +} + +do_install:append:class-nativesdk() { + fix_absolute_paths +} + do_compile_ptest() { - oe_runmake test - oe_runmake -C ${B}/tests/server + oe_runmake -C ${B}/tests } do_install_ptest() { cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED rm -f ${B}/tests/configurehelp.pm cp -rf ${B}/tests ${D}${PTEST_PATH} + rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la + rm -f ${D}${PTEST_PATH}/tests/libtest/libhostname.la + mv ${D}${PTEST_PATH}/tests/libtest/.libs/* ${D}${PTEST_PATH}/tests/libtest/ + mv ${D}${PTEST_PATH}/tests/libtest/libhostname.so ${D}${PTEST_PATH}/tests/libtest/.libs/ + mv ${D}${PTEST_PATH}/tests/http/clients/.libs/* ${D}${PTEST_PATH}/tests/http/clients/ cp -rf ${S}/tests ${D}${PTEST_PATH} find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete install -d ${D}${PTEST_PATH}/src @@ -102,7 +118,24 @@ do_install_ptest() { cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH} } -RDEPENDS:${PN}-ptest += "bash perl-modules" +RDEPENDS:${PN}-ptest += " \ + bash \ + perl-module-b \ + perl-module-base \ + perl-module-cwd \ + perl-module-digest \ + perl-module-digest-md5 \ + perl-module-file-basename \ + perl-module-file-spec \ + perl-module-file-temp \ + perl-module-io-socket \ + perl-module-ipc-open2 \ + perl-module-list-util \ + perl-module-memoize \ + perl-module-storable \ + perl-module-time-hires \ +" +RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us" PACKAGES =+ "lib${BPN}" diff --git a/meta/recipes-support/curl/files/0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch b/meta/recipes-support/curl/files/0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch deleted file mode 100644 index 878839a5e3..0000000000 --- a/meta/recipes-support/curl/files/0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 50efb0822aa0e0ab165158dd0a26e65a2290e6d2 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg <daniel@haxx.se> -Date: Tue, 28 Jun 2022 09:00:25 +0200 -Subject: [PATCH] easy_lock: switch to using atomic_int instead of bool - -To work with more compilers without requiring separate libs to -link. Like with gcc-12 for RISC-V on Linux. - -Reported-by: Adam Sampson -Fixes #9055 -Closes #9061 - -Upstream-Status: Backport [50efb0822aa0e0ab165158dd0a26e65a2290e6d2] - -Signed-off-by: He Zhe <zhe.he@windriver.com> ---- - lib/easy_lock.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/easy_lock.h b/lib/easy_lock.h -index 07c85c5ff..9c11bc50c 100644 ---- a/lib/easy_lock.h -+++ b/lib/easy_lock.h -@@ -40,8 +40,8 @@ - #include <sched.h> - #endif - --#define curl_simple_lock atomic_bool --#define CURL_SIMPLE_LOCK_INIT false -+#define curl_simple_lock atomic_int -+#define CURL_SIMPLE_LOCK_INIT 0 - - static inline void curl_simple_lock_lock(curl_simple_lock *lock) - { --- -2.25.1 - diff --git a/meta/recipes-support/curl/files/0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch b/meta/recipes-support/curl/files/0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch deleted file mode 100644 index 771bdb2b96..0000000000 --- a/meta/recipes-support/curl/files/0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e2e7f54b7bea521fa8373095d0f43261a720cda0 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg <daniel@haxx.se> -Date: Mon, 27 Jun 2022 08:46:21 +0200 -Subject: [PATCH] easy_lock.h: include sched.h if available to fix build - -Patched-by: Harry Sintonen - -Closes #9054 - -Upstream-Status: Backport [e2e7f54b7bea521fa8373095d0f43261a720cda0] - -Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org> ---- - lib/easy_lock.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/easy_lock.h b/lib/easy_lock.h -index 819f50ce8..1f54289ce 100644 ---- a/lib/easy_lock.h -+++ b/lib/easy_lock.h -@@ -36,6 +36,9 @@ - - #elif defined (HAVE_ATOMIC) - #include <stdatomic.h> -+#if defined(HAVE_SCHED_YIELD) -+#include <sched.h> -+#endif - - #define curl_simple_lock atomic_bool - #define CURL_SIMPLE_LOCK_INIT false --- -2.35.1 - |