xref: /curl/.github/workflows/linux-old.yml (revision 2f22fc10)
1# Copyright (C) Daniel Fandrich, <dan@coneharvesters.com>, et al.
2#
3# SPDX-License-Identifier: curl
4#
5# Compile on an old version of Linux that has barely the minimal build
6# requirements for CMake. This tests that curl is still usable on really
7# outdated systems.
8#
9# Debian stretch is chosen as it closely matches some of the oldest major
10# versions we support (especially cmake); see docs/INTERNALS.md and it
11# is still supported (as of this writing).
12# stretch has ELTS support from Freexian until 2027-06-30
13# For ELTS info see https://www.freexian.com/lts/extended/docs/how-to-use-extended-lts/
14# The Debian key will expire 2025-05-20, after which package signature
15# verification may need to be disabled.
16# httrack is one of the smallest downloaders, needed to bootstrap ELTS,
17# and won't conflict with the curl we're building.
18
19name: Old Linux
20
21'on':
22  push:
23    branches:
24      - master
25      - '*/ci'
26    paths-ignore:
27      - '**/*.md'
28      - '.circleci/**'
29      - 'appveyor.*'
30      - 'packages/**'
31      - 'plan9/**'
32      - 'projects/**'
33      - 'winbuild/**'
34  pull_request:
35    branches:
36      - master
37    paths-ignore:
38      - '**/*.md'
39      - '.circleci/**'
40      - 'appveyor.*'
41      - 'packages/**'
42      - 'plan9/**'
43      - 'projects/**'
44      - 'winbuild/**'
45
46permissions: {}
47
48env:
49  MAKEFLAGS: -j 5
50  DEBIAN_FRONTEND: noninteractive
51
52jobs:
53  cmake:
54    name: linux (cmake & autoconf)
55    runs-on: 'ubuntu-latest'
56    container: 'debian:stretch'
57
58    steps:
59      - name: 'install prereqs'
60        # Remember, this shell is dash, not bash
61        run: |
62          sed -E -i -e s@[a-z]+\.debian\.org/@archive.debian.org/debian-archive/@ -e '/ stretch-updates /d' /etc/apt/sources.list
63          apt-get update
64          # See comment above if this fails after 2025-05-20
65          apt-get install -y --no-install-suggests --no-install-recommends httrack
66          httrack --get https://deb.freexian.com/extended-lts/pool/main/f/freexian-archive-keyring/freexian-archive-keyring_2022.06.08_all.deb
67          dpkg -i freexian-archive-keyring_2022.06.08_all.deb
68          echo 'deb http://deb.freexian.com/extended-lts stretch-lts main contrib non-free' | tee /etc/apt/sources.list.d/extended-lts.list
69          apt-get update
70          apt-get install -y --no-install-suggests --no-install-recommends cmake make automake autoconf libtool gcc pkg-config libpsl-dev libzstd-dev zlib1g-dev libssl1.0-dev libssh-dev libssh2-1-dev libc-ares-dev heimdal-dev libldap2-dev librtmp-dev stunnel4 groff
71          # GitHub's actions/checkout needs a newer glibc. This one is the
72          # latest available for buster, the next stable release after stretch.
73          httrack --get https://security.debian.org/debian-security/pool/updates/main/g/glibc/libc6_2.28-10+deb10u4_amd64.deb
74          dpkg -i libc6_*_amd64.deb
75
76      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
77
78      - name: 'cmake build-only (out-of-tree, libssh2)'
79        run: |
80          mkdir bld-1
81          cd bld-1
82          cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
83            -DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON
84          make install
85          src/curl --disable --version
86
87      - name: 'cmake build-only curl_config.h'
88        run: |
89          echo '::group::raw'; cat bld-1/lib/curl_config.h || true; echo '::endgroup::'
90          grep -F '#define' bld-1/lib/curl_config.h | sort || true
91
92      - name: 'cmake generate (out-of-tree, c-ares, libssh, zstd, gssapi)'
93        run: |
94          mkdir bld-cares
95          cd bld-cares
96          cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
97            -DENABLE_ARES=ON -DCURL_ZSTD=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_LIBRTMP=ON \
98            -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
99
100      - name: 'cmake curl_config.h'
101        run: |
102          echo '::group::raw'; cat bld-cares/lib/curl_config.h || true; echo '::endgroup::'
103          grep -F '#define' bld-cares/lib/curl_config.h | sort || true
104
105      - name: 'cmake build'
106        run: |
107          make -C bld-cares
108          bld-cares/src/curl --disable --version
109
110      - name: 'cmake install'
111        run: make -C bld-cares install
112
113      - name: 'cmake build tests'
114        run: make -C bld-cares testdeps
115
116      - name: 'cmake run tests'
117        run: make -C bld-cares test-ci
118
119      - name: 'autoreconf'
120        run: autoreconf -if
121
122      - name: 'configure (out-of-tree, c-ares, libssh, zstd, gssapi)'
123        run: |
124          mkdir bld-am
125          cd bld-am
126          ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
127            --with-openssl --enable-ares --with-libssh --with-zstd --with-gssapi --with-librtmp \
128            --prefix="$PWD"/../install-am
129
130      - name: 'autoconf curl_config.h'
131        run: |
132          echo '::group::raw'; cat bld-am/lib/curl_config.h || true; echo '::endgroup::'
133          grep -F '#define' bld-am/lib/curl_config.h | sort || true
134
135      - name: 'autoconf build'
136        run: |
137          make -C bld-am
138          bld-am/src/curl --disable --version
139
140      - name: 'autoconf install'
141        run: make -C bld-am install
142
143      - name: 'autoconf build tests'
144        run: make -C bld-am/tests all
145