From 9df656308a8ceb2ea1ef3f3fae44ee6193092c45 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Wed, 6 Aug 2025 12:42:35 +0100 Subject: [PATCH] ci: add build job on Ubuntu Jammy with Python 3.7 In order to avoid regressions with glibc < 2.39 and Python 3.7 (cherry picked from commit 4f49a6f572043dbc3a302302464fad5ffbd40e01) --- .github/workflows/build-test.sh | 18 ++++++++++++++---- .github/workflows/build-test.yml | 17 +++++++++++++++-- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.sh b/.github/workflows/build-test.sh index fd1dd3d5709..fe27e617840 100755 --- a/.github/workflows/build-test.sh +++ b/.github/workflows/build-test.sh @@ -125,10 +125,15 @@ fi # This is added by default, and it is often broken, but we don't need anything from it sudo rm -f /etc/apt/sources.list.d/microsoft-prod.{list,sources} -# add-apt-repository --enable-source does not work on deb822 style sources. -for f in /etc/apt/sources.list.d/*.sources; do - sudo sed -i "s/Types: deb/Types: deb deb-src/g" "$f" -done +if grep -q 'VERSION_CODENAME=jammy' /usr/lib/os-release; then + sudo add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci + sudo add-apt-repository -y --no-update --enable-source +else + # add-apt-repository --enable-source does not work on deb822 style sources. + for f in /etc/apt/sources.list.d/*.sources; do + sudo sed -i "s/Types: deb/Types: deb deb-src/g" "$f" + done +fi sudo apt-get -y update sudo apt-get -y build-dep systemd sudo apt-get -y install "${PACKAGES[@]}" @@ -139,6 +144,11 @@ sudo apt-get -y install "${PACKAGES[@]}" pip3 install --user -r .github/workflows/requirements.txt --require-hashes --break-system-packages export PATH="$HOME/.local/bin:$PATH" +if [[ -n "$CUSTOM_PYTHON" ]]; then + # If CUSTOM_PYTHON is set we need to pull jinja2 from pip, as a local interpreter is used + pip3 install --user --break-system-packages jinja2 +fi + $CC --version meson --version ninja --version diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0c2b81dc70b..50e82992323 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -17,22 +17,35 @@ permissions: jobs: build: - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.runner }} concurrency: - group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}-${{ matrix.runner }}-${{ matrix.python-version }} cancel-in-progress: true strategy: fail-fast: false matrix: + runner: [ ubuntu-24.04 ] + python-version: [ '' ] env: - { COMPILER: "gcc", COMPILER_VERSION: "11", LINKER: "bfd", CRYPTOLIB: "gcrypt" } - { COMPILER: "gcc", COMPILER_VERSION: "13", LINKER: "mold", CRYPTOLIB: "openssl" } - { COMPILER: "clang", COMPILER_VERSION: "14", LINKER: "mold", CRYPTOLIB: "gcrypt" } - { COMPILER: "clang", COMPILER_VERSION: "16", LINKER: "bfd", CRYPTOLIB: "openssl" } - { COMPILER: "clang", COMPILER_VERSION: "18", LINKER: "lld", CRYPTOLIB: "auto" } + include: + # Do one run with the oldest supported python version to ensure there are no regressions + # It is only available on Jammy, which is useful as it will also provide a build check for + # older glibc + - env: { COMPILER: "gcc", COMPILER_VERSION: "12", LINKER: "bfd", CRYPTOLIB: "openssl", CUSTOM_PYTHON: "1" } + runner: [ ubuntu-22.04 ] + python-version: '3.7' env: ${{ matrix.env }} steps: - name: Repository checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Setup python + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 + with: + python-version: ${{ matrix.python-version }} - name: Build check run: .github/workflows/build-test.sh -- 2.47.3