Skip to content

Commit

Permalink
Merge remote-tracking branch 'curl/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dongbeiouba committed Jan 5, 2025
2 parents b032cbe + 699ac94 commit e54886d
Show file tree
Hide file tree
Showing 493 changed files with 2,586 additions and 1,084 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ commands:
- run:
command: |
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
WOLFSSL_VER=5.7.4
WOLFSSL_VER=5.7.6
echo "Installing wolfSSL $WOLFSSL_VER"
curl -LOsSf --retry 6 --retry-connrefused --max-time 999 https://github.com/wolfSSL/wolfssl/archive/v$WOLFSSL_VER-stable.tar.gz
tar -xzf v$WOLFSSL_VER-stable.tar.gz
Expand Down
14 changes: 13 additions & 1 deletion .github/scripts/badwords.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@
# If separator is '=', the string will be compared case sensitively.
# If separator is ':', the check is done case insensitively.
#
# To add white listed uses of bad words that are removed before checking for
# the bad ones:
#
# ---(accepted word)
#
my $w;
while(<STDIN>) {
chomp;
if($_ =~ /^#/) {
next;
}
if($_ =~ /^([^:=]*)([:=])(.*)/) {
if($_ =~ /^---(.*)/) {
push @whitelist, $1;
}
elsif($_ =~ /^([^:=]*)([:=])(.*)/) {
my ($bad, $sep, $better)=($1, $2, $3);
push @w, $bad;
$alt{$bad} = $better;
Expand All @@ -41,6 +49,10 @@ sub file {
$in =~ s/(\[.*\])\(.*\)/$1/g;
# remove backticked texts
$in =~ s/\`.*\`//g;
# remove whitelisted patterns
for my $p (@whitelist) {
$in =~ s/$p//g;
}
foreach my $w (@w) {
my $case = $exactcase{$w};
if(($in =~ /^(.*)$w/i && !$case) ||
Expand Down
5 changes: 5 additions & 0 deletions .github/scripts/badwords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ couldn't:could not
64-bits:64 bits or 64-bit
32-bits:32 bits or 32-bit
\bvery\b:rephrase using an alternative word
\bCurl\b=curl
\bLibcurl\b=libcurl
---WWW::Curl
---NET::Curl
---Curl Corporation
3 changes: 3 additions & 0 deletions .github/scripts/cleancmd.pl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
}
next if($ignore);

# strip out backticked words
$_ =~ s/`[^`]+`//g;

# strip out all long command line options
$_ =~ s/--[a-z0-9-]+//g;

Expand Down
3 changes: 0 additions & 3 deletions .github/scripts/cmp-config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
'#define GETHOSTNAME_TYPE_ARG2 size_t' => 1,
'#define HAVE_BROTLI 1' => 1,
'#define HAVE_BROTLI_DECODE_H 1' => 1,
'#define HAVE_DECL_GETPWUID_R 0' => 1,
'#define HAVE_DECL_GETPWUID_R 1' => 1,
'#define HAVE_DECL_GETPWUID_R_MISSING 1' => 1,
'#define HAVE_DLFCN_H 1' => 1,
'#define HAVE_GSSAPI_GSSAPI_KRB5_H 1' => 1,
'#define HAVE_INTTYPES_H 1' => 1,
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/checkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ jobs:
- name: trim cmdline docs markdown _*.md files
run: find docs/cmdline-opts -name "_*.md" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl --no-header

- name: trim docs/ markdown _*.md files
run: git ls-files docs/*.md docs/internals/*.md | xargs -n1 .github/scripts/cleancmd.pl --no-header

- name: setup the custom wordlist
run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt

Expand All @@ -137,7 +140,7 @@ jobs:
name: checkout

- name: badwords
run: .github/scripts/badwords.pl < .github/scripts/badwords.txt docs/*.md docs/libcurl/*.md docs/libcurl/opts/*.md docs/cmdline-opts/*.md docs/TODO docs/KNOWN_BUGS tests/*.md
run: .github/scripts/badwords.pl < .github/scripts/badwords.txt `git ls-files '**.md'` docs/TODO docs/KNOWN_BUGS packages/OS400/README.OS400

- name: verify-synopsis
run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
Expand Down
56 changes: 12 additions & 44 deletions .github/workflows/http3-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ env:
quictls-version: 3.3.0
# renovate: datasource=github-tags depName=gnutls/gnutls versioning=semver registryUrl=https://github.com
gnutls-version: 3.8.8
wolfssl-version: master
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
wolfssl-version: 5.7.6
# renovate: datasource=github-tags depName=ngtcp2/nghttp3 versioning=semver registryUrl=https://github.com
nghttp3-version: 1.7.0
# renovate: datasource=github-tags depName=ngtcp2/ngtcp2 versioning=semver registryUrl=https://github.com
Expand All @@ -55,33 +56,7 @@ env:
quiche-version: 0.22.0

jobs:
setup:
runs-on: ubuntu-latest
outputs:
wolfssl-version: ${{ steps.wolfssl-version.outputs.result }}

steps:
- id: wolfssl-version
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
result-encoding: string
script: |
let version = '${{ env.wolfssl-version }}'
if (version != 'master') {
return version
}
let { data: commits } = await github.rest.repos.listCommits({
owner: 'wolfSSL',
repo: 'wolfssl',
})
return commits[0].sha
build-cache:
needs:
- setup
runs-on: ubuntu-latest

steps:
Expand All @@ -108,7 +83,6 @@ jobs:
id: cache-wolfssl
env:
cache-name: cache-wolfssl
wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
with:
path: /home/runner/wolfssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
Expand All @@ -129,7 +103,7 @@ jobs:
cache-name: cache-ngtcp2
with:
path: /home/runner/ngtcp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}-${{ env.quictls-version }}-${{ env.gnutls-version }}-${{ env.wolfssl-version }}

- name: cache nghttp2
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
Expand All @@ -138,7 +112,7 @@ jobs:
cache-name: cache-nghttp2
with:
path: /home/runner/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}-${{ env.quictls-version }}-${{ env.ngtcp2-version }}-${{ env.nghttp3-version }}

- id: settings
if: |
Expand Down Expand Up @@ -191,16 +165,10 @@ jobs:
name: 'build gnutls'

- if: steps.cache-wolfssl.outputs.cache-hit != 'true'
env:
wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
run: |
cd $HOME
mkdir wolfssl
git clone --quiet --depth=1 -b v${{ env.wolfssl-version }}-stable https://github.com/wolfSSL/wolfssl.git
cd wolfssl
git init
git remote add origin https://github.com/wolfSSL/wolfssl.git
git fetch origin --depth=1 ${{ env.wolfssl-version }}
git checkout ${{ env.wolfssl-version }}
./autogen.sh
./configure --disable-dependency-tracking --enable-all --enable-quic \
--disable-benchmark --disable-crypttests --disable-examples --prefix=$PWD/build
Expand All @@ -215,7 +183,9 @@ jobs:
cd nghttp3
git submodule update --init --depth=1
autoreconf -fi
./configure --disable-dependency-tracking --prefix=$PWD/build PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig" --enable-lib-only
./configure --disable-dependency-tracking --prefix=$PWD/build \
PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig" \
--enable-lib-only
make
make install
name: 'build nghttp3'
Expand All @@ -227,7 +197,7 @@ jobs:
cd ngtcp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix=$PWD/build \
PKG_CONFIG_PATH="$PWD/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/gnutls/build/lib/pkgconfig:$HOME/wolfssl/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig" \
PKG_CONFIG_PATH="$HOME/quictls/build/lib/pkgconfig:$HOME/gnutls/build/lib/pkgconfig:$HOME/wolfssl/build/lib/pkgconfig" \
--enable-lib-only --with-openssl --with-gnutls --with-wolfssl
make install
name: 'build ngtcp2'
Expand All @@ -239,7 +209,7 @@ jobs:
cd nghttp2
autoreconf -fi
./configure --disable-dependency-tracking --prefix=$PWD/build \
PKG_CONFIG_PATH="$HOME/build/lib/pkgconfig:$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig" \
PKG_CONFIG_PATH="$HOME/quictls/build/lib/pkgconfig:$HOME/nghttp3/build/lib/pkgconfig:$HOME/ngtcp2/build/lib/pkgconfig" \
LDFLAGS="-Wl,-rpath,$HOME/quictls/build/lib" \
--enable-http3
make install
Expand All @@ -248,7 +218,6 @@ jobs:
linux:
name: ${{ matrix.build.generate && 'CM' || 'AM' }} ${{ matrix.build.name }}
needs:
- setup
- build-cache
runs-on: 'ubuntu-24.04'
timeout-minutes: 45
Expand Down Expand Up @@ -359,7 +328,6 @@ jobs:
id: cache-wolfssl
env:
cache-name: cache-wolfssl
wolfssl-version: ${{ needs.setup.outputs.wolfssl-version }}
with:
path: /home/runner/wolfssl/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.wolfssl-version }}
Expand All @@ -382,7 +350,7 @@ jobs:
cache-name: cache-ngtcp2
with:
path: /home/runner/ngtcp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.ngtcp2-version }}-${{ env.quictls-version }}-${{ env.gnutls-version }}-${{ env.wolfssl-version }}
fail-on-cache-miss: true

- name: cache nghttp2
Expand All @@ -392,7 +360,7 @@ jobs:
cache-name: cache-nghttp2
with:
path: /home/runner/nghttp2/build
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}
key: ${{ runner.os }}-http3-build-${{ env.cache-name }}-${{ env.nghttp2-version }}-${{ env.quictls-version }}-${{ env.ngtcp2-version }}-${{ env.nghttp3-version }}
fail-on-cache-miss: true

- name: cache openssl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ env:
# renovate: datasource=github-tags depName=libressl-portable/portable versioning=semver registryUrl=https://github.com
libressl-version: 4.0.0
# renovate: datasource=github-tags depName=wolfSSL/wolfssl versioning=semver extractVersion=^v?(?<version>.+)-stable$ registryUrl=https://github.com
wolfssl-version: 5.7.4
wolfssl-version: 5.7.6
# renovate: datasource=github-tags depName=Mbed-TLS/mbedtls versioning=semver registryUrl=https://github.com
mbedtls-version: 3.6.2
# renovate: datasource=github-tags depName=nibanks/msh3 versioning=semver registryUrl=https://github.com
Expand Down
5 changes: 3 additions & 2 deletions CMake/FindLDAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ else()
# On Apple the SDK LDAP gets picked up from
# 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains
# ldap.h and lber.h both being stubs to include <ldap.h> and <lber.h>.
# This causes an infinite inclusion loop in compile.
# This causes an infinite inclusion loop in compile. Also do this for libraries
# to avoid picking up the 'ldap.framework' with a full path.
set(_save_cmake_system_framework_path ${CMAKE_SYSTEM_FRAMEWORK_PATH})
set(CMAKE_SYSTEM_FRAMEWORK_PATH "")
find_path(LDAP_INCLUDE_DIR NAMES "ldap.h")
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path})
find_library(LDAP_LIBRARY NAMES "ldap")
find_library(LDAP_LBER_LIBRARY NAMES "lber")
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path})

unset(LDAP_VERSION CACHE)
if(LDAP_INCLUDE_DIR AND EXISTS "${LDAP_INCLUDE_DIR}/ldap_features.h")
Expand Down
28 changes: 14 additions & 14 deletions CMake/FindRustls.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,35 @@ else()
endif()

if(APPLE)
find_library(SECURITY_FRAMEWORK "Security")
find_library(SECURITY_FRAMEWORK NAMES "Security")
mark_as_advanced(SECURITY_FRAMEWORK)
if(NOT SECURITY_FRAMEWORK)
message(FATAL_ERROR "Security framework not found")
endif()
list(APPEND RUSTLS_LIBRARIES "-framework Security")

find_library(FOUNDATION_FRAMEWORK "Foundation")
find_library(FOUNDATION_FRAMEWORK NAMES "Foundation")
mark_as_advanced(FOUNDATION_FRAMEWORK)
if(NOT FOUNDATION_FRAMEWORK)
message(FATAL_ERROR "Foundation framework not found")
endif()
list(APPEND RUSTLS_LIBRARIES "-framework Foundation")
elseif(NOT WIN32)
find_library(_pthread_library "pthread")
if(_pthread_library)
list(APPEND RUSTLS_LIBRARIES "pthread")
find_library(PTHREAD_LIBRARY NAMES "pthread")
if(PTHREAD_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${PTHREAD_LIBRARY})
endif()
mark_as_advanced(_pthread_library)
mark_as_advanced(PTHREAD_LIBRARY)

find_library(_dl_library "dl")
if(_dl_library)
list(APPEND RUSTLS_LIBRARIES "dl")
find_library(DL_LIBRARY NAMES "dl")
if(DL_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${DL_LIBRARY})
endif()
mark_as_advanced(_dl_library)
mark_as_advanced(DL_LIBRARY)

find_library(_math_library "m")
if(_math_library)
list(APPEND RUSTLS_LIBRARIES "m")
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND RUSTLS_LIBRARIES ${MATH_LIBRARY})
endif()
mark_as_advanced(_math_library)
mark_as_advanced(MATH_LIBRARY)
endif()
8 changes: 4 additions & 4 deletions CMake/FindWolfSSL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ else()
endif()

if(NOT WIN32)
find_library(_math_library "m")
if(_math_library)
list(APPEND WOLFSSL_LIBRARIES "m") # for log and pow
find_library(MATH_LIBRARY NAMES "m")
if(MATH_LIBRARY)
list(APPEND WOLFSSL_LIBRARIES ${MATH_LIBRARY}) # for log and pow
endif()
mark_as_advanced(_math_library)
mark_as_advanced(MATH_LIBRARY)
endif()
28 changes: 27 additions & 1 deletion CMake/curl-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,39 @@ if("@HAVE_LIBZ@")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")

# Alias for either shared or static library
if(NOT TARGET @PROJECT_NAME@::libcurl)
add_library(@PROJECT_NAME@::libcurl ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
endif()

# For compatibility with CMake's FindCURL.cmake
set(CURL_VERSION_STRING "@CURLVERSION@")
set(CURL_LIBRARIES @PROJECT_NAME@::libcurl)
set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")

set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@")
set(CURL_SUPPORTED_FEATURES "@CURL_SUPPORTED_FEATURES_LIST@")

foreach(_item IN LISTS CURL_SUPPORTED_PROTOCOLS CURL_SUPPORTED_FEATURES)
set(CURL_SUPPORTS_${_item} TRUE)
endforeach()

set(_missing_req "")
foreach(_item IN LISTS CURL_FIND_COMPONENTS)
if(CURL_SUPPORTS_${_item})
set(CURL_${_item}_FOUND TRUE)
elseif(CURL_FIND_REQUIRED_${_item})
list(APPEND _missing_req ${_item})
endif()
endforeach()

if(_missing_req)
string(REPLACE ";" " " _missing_req "${_missing_req}")
if(CURL_FIND_REQUIRED)
message(FATAL_ERROR "CURL: missing required components: ${_missing_req}")
endif()
unset(_missing_req)
endif()

check_required_components("@PROJECT_NAME@")
Loading

0 comments on commit e54886d

Please sign in to comment.