xref: /curl/.github/workflows/linux-old.yml (revision 71cf0d1f)
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@692973e3d937129bcbf40652eb9f2f61becf3332 # 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 -DENABLE_WEBSOCKETS=ON
84          make install
85          src/curl --disable --version
86
87      - name: 'cmake generate (out-of-tree, c-ares, libssh, zstd, gssapi)'
88        run: |
89          mkdir bld-cares
90          cd bld-cares
91          cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
92            -DENABLE_ARES=ON -DCURL_ZSTD=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON -DUSE_LIBRTMP=ON -DENABLE_WEBSOCKETS=ON \
93            -DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
94
95      - name: 'cmake build'
96        run: |
97          make -C bld-cares
98          bld-cares/src/curl --disable --version
99
100      - name: 'cmake install'
101        run: make -C bld-cares install
102
103      - name: 'cmake build tests'
104        run: make -C bld-cares testdeps
105
106      - name: 'cmake run tests'
107        run: make -C bld-cares test-ci
108
109      - name: 'autoreconf'
110        run: autoreconf -if
111
112      - name: 'configure (out-of-tree, libssh2)'
113        run: |
114          mkdir bld-am
115          cd bld-am
116          ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
117            --with-openssl --enable-ares --with-libssh --with-zstd --with-gssapi --with-librtmp --enable-websockets \
118            --prefix="$PWD"/../install-am
119
120      - name: 'autoconf build'
121        run: |
122          make -C bld-am
123          bld-am/src/curl --disable --version
124
125      - name: 'autoconf install'
126        run: make -C bld-am install
127
128      - name: 'autoconf build tests'
129        run: make -C bld-am/tests all
130