curl-sys 0.4.90+curl-8.21.0

Native bindings to the libcurl library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
#
# SPDX-License-Identifier: curl

name: 'dist'

'on':
  push:
    branches:
      - master
      - '*/ci'
  pull_request:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

permissions: {}

env:
  CURL_TEST_MIN: 1500
  DO_NOT_TRACK: '1'
  MAKEFLAGS: -j 5

jobs:
  maketgz-and-verify-in-tree:
    name: 'AM in-tree & maketgz'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - name: 'remove preinstalled curl libcurl4{-doc}'
        run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc

      - name: 'autoreconf'
        run: autoreconf -fi

      - name: 'configure'
        run: ./configure --without-ssl --without-libpsl

      - name: 'make'
        run: make V=1

      - name: 'maketgz'
        run: SOURCE_DATE_EPOCH=1711526400 ./scripts/maketgz 99.98.97

      - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
        with:
          name: 'release-tgz'
          path: 'curl-99.98.97.tar.gz'
          retention-days: 1

      - name: 'configure build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          ./configure --prefix="$HOME"/temp --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
          make
          make test-ci
          make install
          popd
          # basic check of the installed files
          bash scripts/installcheck.sh "$HOME"/temp
          rm -rf curl-99.98.97

  verify-out-of-tree-docs:
    name: 'AM out-of-tree docs'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'configure build & docs'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          touch curl-99.98.97/docs/{cmdline-opts,libcurl}/Makefile.inc
          mkdir build
          pushd build
          ../curl-99.98.97/configure --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl
          make
          make test-ci
          popd
          rm -rf build
          rm -rf curl-99.98.97

  verify-out-of-tree-autotools-debug:
    name: 'AM out-of-tree (debug)'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          mkdir build
          pushd build
          ../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --enable-debug --without-libpsl
          make
          make test-ci
          make install
          curl-install/bin/curl --disable --version
          curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
          popd
          scripts/checksrc-all.pl

  verify-out-of-tree-autotools:
    name: 'AM out-of-tree !perl'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          mkdir build
          pushd build
          ../configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
          make
          make install
          curl-install/bin/curl --disable --version
          curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'
          popd

  verify-in-tree-autotools:
    name: 'AM in-tree !perl'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          ./configure --prefix="$PWD"/curl-install --enable-option-checking=fatal --enable-werror --without-ssl --without-libpsl ac_cv_path_PERL=
          make
          make install
          curl-install/bin/curl --disable --version
          curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'

  verify-out-of-tree-cmake:
    name: 'CM out-of-tree !perl'
    runs-on: ubuntu-latest
    timeout-minutes: 5
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          cmake -B build -DCMAKE_INSTALL_PREFIX="$PWD"/curl-install -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DPERL_EXECUTABLE=
          cmake --build build
          cmake --install build
          export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
          curl-install/bin/curl --disable --version
          curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'

  verify-in-tree-cmake:
    name: 'CM in-tree !perl'
    runs-on: ubuntu-latest
    timeout-minutes: 5
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'build & install'
        run: |
          echo "::stop-commands::$(uuidgen)"
          tar xvf curl-99.98.97.tar.gz
          pushd curl-99.98.97
          cmake . -G Ninja -DCMAKE_INSTALL_PREFIX="$PWD"/curl-install -DCURL_WERROR=ON -DCURL_USE_LIBPSL=OFF -DPERL_EXECUTABLE=
          cmake --build .
          cmake --install .
          export LD_LIBRARY_PATH="$PWD/curl-install/lib:$LD_LIBRARY_PATH"
          curl-install/bin/curl --disable --version
          curl-install/bin/curl --manual | wc -l | grep -v '^ *0$'

  missing-files:
    name: 'missing files'
    runs-on: ubuntu-slim
    timeout-minutes: 5
    needs: maketgz-and-verify-in-tree
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
        with:
          name: 'release-tgz'

      - name: 'detect files missing from release tarball'
        run: .github/scripts/distfiles.sh curl-99.98.97.tar.gz

  reproducible-releases:
    name: 'reproducible releases'
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - name: 'remove preinstalled curl libcurl4{-doc}'
        run: sudo apt-get -o Dpkg::Use-Pty=0 purge curl libcurl4 libcurl4-doc

      - name: 'generate release tarballs'
        run: ./scripts/dmaketgz 9.10.11

      - name: 'verify release tarballs'
        run: |
          mkdir _verify
          mv curl-9.10.11.tar.gz _verify
          cd _verify
          ../scripts/verify-release curl-9.10.11.tar.gz

  cmake-integration:
    name: 'CM integration ${{ matrix.image }}'
    runs-on: ${{ matrix.image }}
    timeout-minutes: 15
    defaults:
      run:
        shell: ${{ contains(matrix.image, 'windows') && 'msys2 {0}' || 'bash' }}
    env:
      CC: ${{ !contains(matrix.image, 'windows') && 'clang' || '' }}
      MAKEFLAGS: ${{ contains(matrix.image, 'macos') && '-j 4' || '-j 5' }}
      MATRIX_IMAGE: '${{ matrix.image }}'
      TESTOPTS: ${{ contains(matrix.image, 'macos') && '-D_CURL_PREFILL=ON' || '' }} ${{ contains(matrix.image, 'windows') && '-DCMAKE_UNITY_BUILD_BATCH_SIZE=30' || '' }}
      OLD_CMAKE_VERSION: 3.19.8
      OLD_CMAKE_SHA256_LINUX_ARM: 807f5afb2a560e00af9640e496d5673afefc2888bf0ed076412884a5ebb547a1
      OLD_CMAKE_SHA256_MACOS_UNI: 0976d23d982af05dcbfb3aa34fcb62ead43bea27f0e3bb95222f2a78161423f2
      OLD_CMAKE_SHA256_WIN_INTEL: 2a30877a3d6b50da305b289f4d1c03befdfaeb2edba02a563c681e883d810380
    strategy:
      fail-fast: false
      matrix:
        image: [ubuntu-24.04-arm, macos-latest, windows-2022]
    steps:
      - uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c # v2.31.1
        if: ${{ contains(matrix.image, 'windows') }}
        with:
          msystem: mingw64
          release: false
          update: false
          cache: false
          path-type: inherit
          install: >-
            mingw-w64-x86_64-zlib mingw-w64-x86_64-zstd mingw-w64-x86_64-libpsl mingw-w64-x86_64-libssh2 mingw-w64-x86_64-nghttp2 mingw-w64-x86_64-openssl

      - name: 'install prereqs'
        timeout-minutes: 3
        run: |
          if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
            cd ~
            curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
              --location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-win64-x64.zip" --output pkg.bin
            sha256sum pkg.bin && sha256sum pkg.bin | grep -qwF -- "${OLD_CMAKE_SHA256_WIN_INTEL}" && unzip -q pkg.bin && rm -f pkg.bin
            printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-win64-x64/bin/cmake.exe > ~/old-cmake-path.txt
          elif [[ "${MATRIX_IMAGE}" = *'ubuntu'* ]]; then
            sudo find /etc/apt/sources.list.d -type f -not -name 'ubuntu.sources' -delete -print
            sudo sed -i 's/priority:1/priority:9/' /etc/apt/apt-mirrors.txt; cat /etc/apt/apt-mirrors.txt
            sudo apt-get -o Dpkg::Use-Pty=0 update
            sudo apt-get -o Dpkg::Use-Pty=0 install libpsl-dev libssl-dev
            cd ~
            curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
              --location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-Linux-aarch64.tar.gz" --output pkg.bin
            sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_LINUX_ARM}" && tar -xzf pkg.bin && rm -f pkg.bin
            printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-Linux-aarch64/bin/cmake > ~/old-cmake-path.txt
          else
            brew install libpsl openssl
            cd ~
            curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
              --location --proto-redir =https "https://github.com/Kitware/CMake/releases/download/v${OLD_CMAKE_VERSION}/cmake-${OLD_CMAKE_VERSION}-macos-universal.tar.gz" --output pkg.bin
            sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${OLD_CMAKE_SHA256_MACOS_UNI}" && tar -xzf pkg.bin && rm -f pkg.bin
            printf '%s' ~/cmake-"${OLD_CMAKE_VERSION}"-macos-universal/CMake.app/Contents/bin/cmake > ~/old-cmake-path.txt
          fi

      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
        with:
          persist-credentials: false

      - name: 'via ExternalProject'
        if: ${{ !contains(matrix.image, 'ubuntu') }}
        run: ./tests/cmake/test.sh ExternalProject ${TESTOPTS}
      - name: 'via FetchContent'
        run: ./tests/cmake/test.sh FetchContent ${TESTOPTS} -DCURL_USE_OPENSSL=ON
      - name: 'via add_subdirectory'
        run: ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON
      - name: 'via find_package'
        run: ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
      - name: 'via find_package (C++)'
        if: ${{ contains(matrix.image, 'ubuntu') }}
        run: TEST_CMAKE_FLAGS=-DTEST_CPP=ON ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON
      - name: 'via find_package (PREFER_CONFIG=ON)'
        if: ${{ contains(matrix.image, 'windows') }}
        run: |
          export TEST_CMAKE_FLAGS_PROVIDER='-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON -DCURL_ZSTD=OFF'
          TEST_CMAKE_FLAGS_PROVIDER+=' -DNGHTTP2_INCLUDE_DIR=C:/msys64/mingw64/include -DNGHTTP2_LIBRARY=C:/msys64/mingw64/lib/libnghttp2.dll.a'
          export TEST_CMAKE_FLAGS_CONSUMER="${TEST_CMAKE_FLAGS_PROVIDER}"
          ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON

      - name: 'via ExternalProject (old cmake)'
        if: ${{ contains(matrix.image, 'ubuntu') }}
        run: |
          export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
          if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
            export CFLAGS='-arch arm64'
          fi
          if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
            export TEST_CMAKE_GENERATOR='MSYS Makefiles'
            export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc'
          fi
          ./tests/cmake/test.sh ExternalProject ${TESTOPTS}

      - name: 'via add_subdirectory OpenSSL (old cmake)'
        run: |
          export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
          if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
            export CFLAGS='-arch arm64'
            export TEST_CMAKE_FLAGS='-DCURL_USE_LIBPSL=OFF'  # auto-detection does not work with old-cmake
          fi
          if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
            export TEST_CMAKE_GENERATOR='MSYS Makefiles'
            export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64'
          fi
          ./tests/cmake/test.sh add_subdirectory ${TESTOPTS} -DCURL_USE_OPENSSL=ON

      - name: 'via find_package OpenSSL (old cmake)'
        run: |
          export TEST_CMAKE_CONSUMER; TEST_CMAKE_CONSUMER="$(cat ~/old-cmake-path.txt)"
          if [[ "${MATRIX_IMAGE}" = *'macos'* ]]; then
            export CFLAGS='-arch arm64'
            export TEST_CMAKE_FLAGS='-DCURL_USE_LIBPSL=OFF'  # auto-detection does not work with old-cmake
          fi
          if [[ "${MATRIX_IMAGE}" = *'windows'* ]]; then
            export TEST_CMAKE_GENERATOR='MSYS Makefiles'
            export TEST_CMAKE_FLAGS='-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DOPENSSL_ROOT_DIR=C:/msys64/mingw64'
          fi
          ./tests/cmake/test.sh find_package ${TESTOPTS} -DCURL_USE_OPENSSL=ON

  verify-tarball-downloads:
    name: 'Verify tarball downloads'
    runs-on: ubuntu-slim
    timeout-minutes: 2
    steps:
      - name: 'download and import GPG key'
        env:
          CURL_GPG_ID: 27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2
        run: |
          for keyserver in \
            https://keyserver.ubuntu.com/ \
            https://pgpkeys.eu/ \
          ; do
            echo "--- Downloading from ${keyserver}..."
            if curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
               "${keyserver}pks/lookup?op=get&options=mr&exact=on&search=0x${CURL_GPG_ID}" \
               | gpg --batch --keyserver-options timeout=15 --display-charset utf-8 --keyid-format 0xlong --import --status-fd 1 2>&1; then
              break
            fi
          done

      - name: 'download and verify tarballs'
        run: |
          echo "--- Detecting latest curl tarball version..."
          curl_version="$(curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused https://curl.se/info.json \
            | jq --raw-output .Version)"

          for suffix in .tar.bz2 .tar.gz .tar.xz .zip; do
            echo "--- Downloading ${curl_version} ${suffix}..."
            curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
              --output pkg.bin "https://curl.se/download/curl-${curl_version}${suffix}" \
              --output pkg.sig "https://curl.se/download/curl-${curl_version}${suffix}.asc"
            echo "--- Verifying ${curl_version} ${suffix}..."
            gpg --batch --keyserver-options timeout=15 --display-charset utf-8 --keyid-format 0xlong --verify-options show-primary-uid-only \
              --verify pkg.sig pkg.bin 2>&1
            echo '---'
          done