Files
jak-project/third-party/curl/.github/workflows/non-native.yml
T
Alexander J. Semenuk 5d5e35fb9b fix: Windows toolchain compatibility (curl 8.21 re-vendor, endless reconfigure loop) (#4355)
## Problem

Windows builds break with a current local toolchain (Scoop LLVM 22.1.8,
CMake 4.4.0, VS 2026), in two independent ways:

1. The build stops at curl's deliberate guard: `#error "no non-blocking
method was found/used/set"` in `third-party/curl/lib/nonblock.c`.
2. From the second configure onward, `cmake --build` re-runs CMake in an
endless loop (observed 42 consecutive reconfigure cycles in a single
build). Likely the same mechanism behind the "endlessly building" VS
2026 note in `docs/setup/dev/vs.md`.

## Root cause

1. `third-party/curl/CMake/CurlTests.c` passes `int *` to
`ioctlsocket()`, whose third parameter is `u_long *`. Clang 22 promotes
`-Wincompatible-pointer-types` to a hard error in C, so the
`HAVE_IOCTLSOCKET_FIONBIO` try_compile silently fails and
`curl_config.h` never defines it. Upstream CI does not see this because
the windows-2022 runner image ships an older LLVM. GCC 14 promotes the
same warning to a hard error, which is very likely the `CurlTests.c.obj`
failure reported from MSYS2 in open-goal/jak-project#3551. Upstream curl
hit the identical problem with GCC 14 and fixed the probe in curl 8.8.0
(curl/curl#13578).
2. The root CMakeLists copies the build tree's `compile_commands.json`
into `<src>/build/` for clangd using `configure_file()`, which registers
its input as a configure dependency. CMake rewrites
`compile_commands.json` late in every generation, after
`CTestTestfile.cmake` and `cmake_install.cmake` (outputs of the same
Ninja regen rule), so once the dependency is registered the rule is
deterministically dirty and every `ninja` invocation re-runs CMake. A
pristine first configure is safe (the file does not exist yet, so the
`if(EXISTS ...)` guard skips the copy), which is why the loop looks
machine- or IDE-specific.

## Fix

1. Per review, re-vendor `third-party/curl` at the `curl-8_21_0` tag
(previously `curl-8_3_0`), which carries the upstream probe fix plus two
years of upstream development; `vendor.yaml` updated to match.
Adjustments the version jump forced:
- curl 8.15 removed the native macOS Secure Transport backend
(`CURL_USE_SECTRANSP`), so macOS now builds curl against OpenSSL like
Linux. The two macOS workflows install Homebrew `openssl@3` and export
`OPENSSL_ROOT_DIR` (keg-only), and the macOS setup docs gained the same
two lines.
- `CURL_BROTLI` / `CURL_ZSTD` switched to AUTO-detection in curl 8.10;
pinned OFF to keep the previous no-compression behavior and avoid
silently linking whatever the CI images happen to have.
- curl's new top-level `BUILD_EXAMPLES` cache option (default ON) leaked
into discord-rpc's identically named option and broke configure at a
nonexistent `examples/send-presence` directory; pinned OFF ahead of the
third-party subdirectories.

The diff is dominated by the mechanical tag-tree swap under
`third-party/curl` (linguist-vendored, collapsed in review). The
hand-written changes are `CMakeLists.txt`, the two macOS workflows,
`docs/setup/system/macos.md`, and `vendor.yaml`.
2. Swap `configure_file()` for `file(COPY ...)`: the same clangd copy
with no configure dependency registered. (`file(COPY_FILE ...
ONLY_IF_DIFFERENT)` would be cleaner still but requires CMake 3.21,
above the declared `cmake_minimum_required(VERSION 3.10)`.)

## Test plan

- [x] Fresh `cmake --preset Release-windows-clang` (LLVM 22, no cache
seeding) completes and logs `Enabled SSL backends: Schannel`; the
FIONBIO probe passes without the previous `#error`
- [x] Full Windows Release build from scratch in the branch worktree
(all 1422 targets)
- [x] goalc-test suite: 1509 passed, 0 failed
- [x] Second consecutive configure with `compile_commands.json` present:
the regen rule in `build.ninja` has no `compile_commands.json` input;
`<src>/build/compile_commands.json` is still refreshed for clangd
- [x] Repeated `ninja` invocations after a full build no longer re-run
CMake
- [x] macOS Intel and ARM CI green (first exercise of the OpenSSL
backend switch)

---

I work off a self-hosted forge, so this GitHub account is quiet; the
configure logs and ninja dirty-node traces from the investigation are
available if anyone wants the raw data.

(AI-assisted)
2026-07-27 19:19:18 -04:00

566 lines
23 KiB
YAML
Vendored
Generated

# Copyright (C) Viktor Szakats
#
# SPDX-License-Identifier: curl
name: 'non-native'
'on':
push:
branches:
- master
- '*/ci'
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '.circleci/**'
- 'appveyor.*'
- 'Dockerfile'
- 'projects/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: {}
env:
CURL_CI: github
CURL_TEST_MIN: 1820
DO_NOT_TRACK: '1'
jobs:
cross:
name: "${{ matrix.os }} ${{ matrix.version }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.cc }} ${{ matrix.desc }} ${{ matrix.arch }}"
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
shell: cpa.sh {0} # zizmor: ignore[misfeature]
env:
CC: '${{ matrix.cc }}'
MAKEFLAGS: -j 3
MATRIX_ARCH: '${{ matrix.arch }}'
MATRIX_BUILD: '${{ matrix.build }}'
MATRIX_INSTALL: '${{ matrix.install }}'
MATRIX_OPTIONS: '${{ matrix.options }}'
MATRIX_OS: '${{ matrix.os }}'
MATRIX_VERSION: '${{ matrix.version }}'
strategy:
matrix:
include:
# https://github.com/DragonFlyBSD/DPorts
# { os: 'dragonflybsd', version: '6.4.2', build: 'autotools', arch: 'x86_64', cc: 'gcc' , desc: 'openssl skiprun',
# install: 'autoconf automake libtool openldap26-client libidn2',
# options: '--with-openssl --enable-ldap --enable-ldaps --with-libidn2' }
# { os: 'dragonflybsd', version: '6.4.2', build: 'cmake' , arch: 'x86_64', cc: 'gcc' , desc: 'openssl skipall',
# install: 'cmake ninja' }
# https://ports.freebsd.org/
- { os: 'freebsd' , version: '15.1', build: 'autotools', arch: 'x86_64', cc: 'clang', desc: 'openssl',
install: 'autoconf automake libtool krb5-devel openldap26-client libidn2 stunnel',
options: '--with-openssl --with-gssapi --enable-ldap --enable-ldaps --with-libidn2' }
- { os: 'freebsd' , version: '15.1', build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'openssl !unity skiprun !examples',
install: 'cmake-core ninja perl5 krb5-devel openldap26-client libidn2',
options: '-DCURL_USE_GSSAPI=ON -DCMAKE_UNITY_BUILD=OFF' }
- { os: 'freebsd' , version: '14.3', build: 'autotools', arch: 'arm64' , cc: 'clang', desc: 'openssl !examples',
install: 'autoconf automake libtool krb5-devel openldap26-client libidn2 stunnel',
options: '--with-openssl --with-gssapi --enable-ldap --enable-ldaps --with-libidn2' }
- { os: 'freebsd' , version: '14.3', build: 'cmake' , arch: 'arm64' , cc: 'clang', desc: 'openssl',
install: 'cmake-core ninja perl5 krb5-devel openldap26-client libidn2 stunnel',
options: '-DCURL_USE_GSSAPI=ON' }
# https://app.midnightbsd.org/
# https://man.midnightbsd.org/cgi-bin/man.cgi/mport
# { os: 'midnightbsd' , version: '4.0.4', build: 'autotools' , arch: 'x86_64', cc: 'clang', desc: 'gnutls skipall !examples',
# install: 'autoconf autoconf-archive automake libtool gnutls',
# options: '--with-gnutls' }
- { os: 'midnightbsd' , version: '4.0.4', build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'gnutls skiprun',
install: 'cmake-core ninja perl5 gnutls openldap26-client libidn2',
options: '-DCURL_USE_GNUTLS=ON' }
# https://pkgsrc.se/
- { os: 'netbsd' , version: '10.1' , build: 'autotools', arch: 'x86_64', cc: 'gcc' , desc: 'openssl skipall !examples',
install: 'autoconf automake libtool mit-krb5',
options: '--with-openssl --with-gssapi' }
- { os: 'netbsd' , version: '10.1' , build: 'cmake' , arch: 'x86_64', cc: 'gcc' , desc: 'openssl',
install: 'cmake ninja-build mit-krb5 openldap-client libidn2',
options: '-DCURL_USE_GSSAPI=ON' }
# https://openbsd.app/
# https://www.openbsd.org/faq/faq15.html
# https://github.com/OpenMPT/openmpt/blob/master/.github/workflows/OpenBSD-Autotools.yml
- { os: 'openbsd' , version: '7.9' , build: 'autotools', arch: 'x86_64', cc: 'clang', desc: 'libressl skipall !examples',
install: 'autoconf-2.72p0 automake-1.18.1 libtool', # NOTE: also sync these versions with the autoreconf step!
options: '--with-openssl' }
- { os: 'openbsd' , version: '7.9' , build: 'cmake' , arch: 'x86_64', cc: 'clang', desc: 'libressl',
install: 'cmake ninja openldap-client-- libidn2' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'setup VM'
uses: cross-platform-actions/action@5ea7e8e4677bd726033a10b094ba1c5762b15dee # v1.3.0
with:
environment_variables: 'CC CURL_CI CURL_TEST_MIN DO_NOT_TRACK MAKEFLAGS MATRIX_ARCH MATRIX_BUILD MATRIX_INSTALL MATRIX_OPTIONS MATRIX_OS MATRIX_VERSION'
operating_system: '${{ matrix.os }}'
version: '${{ matrix.version }}'
architecture: '${{ matrix.arch }}'
- name: 'install prereqs'
run: |
if [ "${MATRIX_OS}" = 'dragonflybsd' ]; then
sudo pkg install -y pkgconf brotli libnghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'freebsd' ]; then
sudo pkg install -y pkgconf brotli libnghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'midnightbsd' ]; then
if [ "${MATRIX_BUILD}" = 'autotools' ]; then
sudo mport index | grep -v -E 'Downloading.+%'
sudo mport upgrade | grep -v -E '(Downloading.+%|^/usr/local)'
fi
sudo mport install pkgconf brotli libnghttp2 ${MATRIX_INSTALL} | grep -v -E '(Downloading.+%|^/usr/local)' || true
elif [ "${MATRIX_OS}" = 'netbsd' ]; then
sudo pkgin -y install pkg-config perl brotli libssh2 libpsl nghttp2 ${MATRIX_INSTALL}
elif [ "${MATRIX_OS}" = 'openbsd' ]; then
sudo pkg_add -I brotli libssh2 libpsl nghttp2 ${MATRIX_INSTALL}
if [ "${MATRIX_BUILD}" = 'autotools' ]; then
sudo pkg_delete -I curl # to avoid autotools build linking against system libcurl
fi
fi
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: |
if [ "${MATRIX_OS}" = 'openbsd' ]; then
if [ "${MATRIX_VERSION}" = '7.9' ]; then
export AUTOCONF_VERSION=2.72
export AUTOMAKE_VERSION=1.18
fi
fi
autoreconf -fi
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja -DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_ENABLE_NTLM=ON ${MATRIX_OPTIONS}
else
if [ "${MATRIX_ARCH}" != 'x86_64' ]; then
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
../configure --prefix="$HOME"/curl-install --enable-unity --enable-debug --enable-warnings --enable-werror --disable-static \
--disable-dependency-tracking --enable-option-checking=fatal \
--with-brotli --with-libssh2 --with-nghttp2 \
${options} ${MATRIX_OPTIONS}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld V=1
fi
- name: 'curl -V'
run: bld/src/curl --disable --version
- name: 'curl install'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --install bld
else
make -C bld install
fi
- name: 'build tests'
if: ${{ matrix.arch == 'x86_64' && !contains(matrix.desc, 'skipall') }} # Slow on emulated CPU
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'run tests'
if: ${{ matrix.arch == 'x86_64' && !contains(matrix.desc, 'skipall') && !contains(matrix.desc, 'skiprun') }} # Slow on emulated CPU
run: |
export TFLAGS='-j8'
if [ "${MATRIX_OS}" = 'openbsd' ]; then
TFLAGS="$TFLAGS !2707" # Skip 2707 'ws: Peculiar frame sizes' on suspicion of hangs
fi
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose --target test-ci
else
make -C bld V=1 test-ci
fi
- name: 'build examples'
if: ${{ !contains(matrix.desc, '!examples') }}
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
amiga:
name: "AmigaOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} gcc AmiSSL m68k"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
AMISSL_VERSION: '5.27'
AMISSL_SHA256: 5003bef8c5930354d16b0ce7196d71b2811891c42fad38a9238c5ce4098ad42a
TOOLCHAIN_VERSION: 6.5.0
TOOLCHAIN_SHA256: 381e227c9ef552f073771d6f851cfdf873b574f3cf5db7c1c0107ea5d7146edc
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'cache compiler'
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache-compiler
with:
path: ~/opt/amiga
key: ${{ runner.os }}-amigaos-${{ env.TOOLCHAIN_VERSION }}-${{ env.AMISSL_VERSION }}-amd64
- name: 'install compiler'
if: ${{ !steps.cache-compiler.outputs.cache-hit }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
https://franke.ms/download/amiga-gcc.tgz --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xf pkg.bin && rm -f pkg.bin
cd opt/amiga
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/jens-maus/amissl/releases/download/${AMISSL_VERSION}/AmiSSL-${AMISSL_VERSION}-SDK.lha" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${AMISSL_SHA256}" && 7z x -bd -y pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
ln -s ~/opt/amiga /opt
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DAMIGA=1 \
-DCMAKE_SYSTEM_NAME=Generic \
-DCMAKE_SYSTEM_PROCESSOR=m68k \
-DCMAKE_C_COMPILER_TARGET=m68k-unknown-amigaos \
-DCMAKE_C_COMPILER=/opt/amiga/bin/m68k-amigaos-gcc \
-DCMAKE_C_FLAGS='-O0 -msoft-float -mcrt=clib2' \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_USE_LIBPSL=OFF \
-DAMISSL_INCLUDE_DIR=/opt/amiga/AmiSSL/Developer/include \
-DAMISSL_STUBS_LIBRARY=/opt/amiga/AmiSSL/Developer/lib/AmigaOS3/libamisslstubs.a \
-DAMISSL_AUTO_LIBRARY=/opt/amiga/AmiSSL/Developer/lib/AmigaOS3/libamisslauto.a
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking --enable-option-checking=fatal \
CC=/opt/amiga/bin/m68k-amigaos-gcc \
AR=/opt/amiga/bin/m68k-amigaos-ar \
RANLIB=/opt/amiga/bin/m68k-amigaos-ranlib \
--host=m68k-amigaos \
--disable-shared \
--without-libpsl \
--with-amissl \
LDFLAGS=-L/opt/amiga/AmiSSL/Developer/lib/AmigaOS3 \
CPPFLAGS=-I/opt/amiga/AmiSSL/Developer/include \
CFLAGS='-O0 -msoft-float -mcrt=clib2' \
LIBS='-lnet -lm -latomic'
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
android:
name: "Android ${{ matrix.platform }}, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} ${{ matrix.name }} arm64"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
strategy:
matrix:
include:
- { build: 'autotools', platform: '21', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '21', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
- { build: 'autotools', platform: '35', name: "!ssl !zstd",
options: '--without-ssl --without-libpsl --without-zstd' }
- { build: 'cmake' , platform: '35', name: "!ssl !zstd",
options: '-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF -DCURL_ZSTD=OFF' }
fail-fast: false
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'autoreconf'
if: ${{ matrix.build == 'autotools' }}
run: autoreconf -fi
- name: 'configure'
env:
MATRIX_OPTIONS: '${{ matrix.options }}'
MATRIX_PLATFORM: '${{ matrix.platform }}'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then # https://developer.android.com/ndk/guides/cmake
cmake -B bld -G Ninja \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM="android-${MATRIX_PLATFORM}" \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DCMAKE_WARN_DEPRECATED=OFF \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
--host="aarch64-linux-android${MATRIX_PLATFORM}" \
${MATRIX_OPTIONS}
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'dump config files'
run: |
for f in libcurl.pc curl-config; do
echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::'
done
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --verbose
else
make -C bld V=1
fi
- name: 'curl info'
run: |
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 file --
find . -type f \( -name curl -o -name '*.so' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi
msdos:
name: "MS-DOS, ${{ matrix.build == 'cmake' && 'CM' || 'AM' }} djgpp !ssl i586"
runs-on: ubuntu-latest
timeout-minutes: 5
env:
LDFLAGS: -s
MAKEFLAGS: -j 5
MATRIX_BUILD: '${{ matrix.build }}'
# renovate: datasource=github-releases depName=andrewwutw/build-djgpp versioning=semver-coerced registryUrl=https://github.com
TOOLCHAIN_VERSION: '3.4'
TOOLCHAIN_SHA256: 8464f17017d6ab1b2bb2df4ed82357b5bf692e6e2b7fee37e315638f3d505f00
strategy:
matrix:
build: [autotools, cmake]
fail-fast: false
steps:
- name: 'install packages'
timeout-minutes: 2
run: |
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 libfl2
- name: 'cache compiler (djgpp)'
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
id: cache-compiler
with:
path: ~/djgpp
key: ${{ runner.os }}-djgpp-${{ env.TOOLCHAIN_VERSION }}-amd64
- name: 'install compiler (djgpp)'
if: ${{ !steps.cache-compiler.outputs.cache-hit }}
run: |
cd ~
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 120 --retry 3 --retry-connrefused \
--location --proto-redir =https "https://github.com/andrewwutw/build-djgpp/releases/download/v${TOOLCHAIN_VERSION}/djgpp-linux64-gcc1220.tar.bz2" --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF -- "${TOOLCHAIN_SHA256}" && tar -xjf pkg.bin && rm -f pkg.bin
cd djgpp
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/wat3211b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF faa2222ab5deb2c2aac229c760bf4d45aca5379f5af97865c308a0467046b67a && unzip -q pkg.bin && rm -f pkg.bin
curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 60 --retry 3 --retry-connrefused \
https://www.delorie.com/pub/djgpp/current/v2tk/zlb13b.zip --output pkg.bin
sha256sum pkg.bin | tee /dev/stderr | grep -qwF f3d2fa8129e7591c7e79074306d8ab91a70ec172cc01baedeae74992285dd3a3 && unzip -q pkg.bin && rm -f pkg.bin
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: 'configure'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=DOS \
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_ENABLE_SSL=OFF -DCURL_USE_LIBPSL=OFF \
-DZLIB_INCLUDE_DIR="$HOME"/djgpp/include \
-DZLIB_LIBRARY="$HOME"/djgpp/lib/libz.a \
-DWATT_ROOT="$HOME"/djgpp/net/watt
else
autoreconf -fi
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror --disable-shared \
--disable-dependency-tracking --enable-option-checking=fatal \
CC="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-gcc \
AR="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ar \
RANLIB="$HOME"/djgpp/bin/i586-pc-msdosdjgpp-ranlib \
WATT_ROOT="$HOME"/djgpp/net/watt \
--host=i586-pc-msdosdjgpp \
--without-ssl --without-libpsl \
--with-zlib="$HOME"/djgpp
fi
- name: 'configure log'
if: ${{ !cancelled() }}
run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true
- name: 'curl_config.h'
run: |
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
grep -F '#define' bld/lib/curl_config.h | sort || true
- name: 'build'
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld
else
make -C bld
fi
- name: 'curl info'
run: |
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 file --
find . \( -name '*.exe' -o -name '*.a' \) -print0 | xargs -0 stat -c '%10s bytes: %n' --
- name: 'build tests'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target testdeps
else
make -C bld -C tests
fi
- name: 'build examples'
if: ${{ matrix.build == 'cmake' }} # skip for autotools to save time
run: |
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake --build bld --target curl-examples-build
else
make -C bld examples
fi