Skip to content

Commit 86296d1

Browse files
DaanDeMeyerbluca
authored andcommitted
ci: Switch to Ubuntu 24.04
(cherry picked from commit d5474f7)
1 parent 8c99a73 commit 86296d1

18 files changed

+52
-26
lines changed

.github/workflows/build_test.sh

+19-6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ if [[ "$COMPILER" == clang ]]; then
7676
CXX="clang++-$COMPILER_VERSION"
7777
AR="llvm-ar-$COMPILER_VERSION"
7878

79+
if systemd-analyze compare-versions "$COMPILER_VERSION" ge 17; then
80+
CFLAGS="-fno-sanitize=function"
81+
CXXFLAGS="-fno-sanitize=function"
82+
else
83+
CFLAGS=""
84+
CXXFLAGS=""
85+
fi
86+
7987
# Prefer the distro version if available
8088
if ! apt-get -y install --dry-run "llvm-$COMPILER_VERSION" >/dev/null; then
8189
# Latest LLVM stack deb packages provided by https://apt.llvm.org/
@@ -91,6 +99,8 @@ elif [[ "$COMPILER" == gcc ]]; then
9199
CC="gcc-$COMPILER_VERSION"
92100
CXX="g++-$COMPILER_VERSION"
93101
AR="gcc-ar-$COMPILER_VERSION"
102+
CFLAGS=""
103+
CXXFLAGS=""
94104

95105
if ! apt-get -y install --dry-run "gcc-$COMPILER_VERSION" >/dev/null; then
96106
# Latest gcc stack deb packages provided by
@@ -103,17 +113,20 @@ else
103113
fatal "Unknown compiler: $COMPILER"
104114
fi
105115

106-
# PPA with some newer build dependencies (like zstd)
107-
sudo add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci
108-
sudo add-apt-repository -y --no-update --enable-source
116+
# This is added by default, and it is often broken, but we don't need anything from it
117+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.{list,sources}
118+
# add-apt-repository --enable-source does not work on deb822 style sources.
119+
for f in /etc/apt/sources.list.d/*.sources; do
120+
sudo sed -i "s/Types: deb/Types: deb deb-src/g" "$f"
121+
done
109122
sudo apt-get -y update
110123
sudo apt-get -y build-dep systemd
111124
sudo apt-get -y install "${PACKAGES[@]}"
112125
# Install more or less recent meson and ninja with pip, since the distro versions don't
113126
# always support all the features we need (like --optimization=). Since the build-dep
114127
# command above installs the distro versions, let's install the pip ones just
115128
# locally and add the local bin directory to the $PATH.
116-
pip3 install --user -r .github/workflows/requirements.txt --require-hashes
129+
pip3 install --user -r .github/workflows/requirements.txt --require-hashes --break-system-packages
117130
export PATH="$HOME/.local/bin:$PATH"
118131

119132
$CC --version
@@ -126,8 +139,8 @@ for args in "${ARGS[@]}"; do
126139
info "Checking build with $args"
127140
# shellcheck disable=SC2086
128141
if ! AR="$AR" \
129-
CC="$CC" CC_LD="$LINKER" CFLAGS="-Werror" \
130-
CXX="$CXX" CXX_LD="$LINKER" CXXFLAGS="-Werror" \
142+
CC="$CC" CC_LD="$LINKER" CFLAGS="$CFLAGS" \
143+
CXX="$CXX" CXX_LD="$LINKER" CXXFLAGS="$CXXFLAGS" \
131144
meson setup \
132145
-Dtests=unsafe -Dslow-tests=true -Dfuzz-tests=true --werror \
133146
-Dnobody-group=nogroup -Dcryptolib="${CRYPTOLIB:?}" -Ddebug=false \

.github/workflows/build_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
build:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121
concurrency:
2222
group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}
2323
cancel-in-progress: true

.github/workflows/cflite_pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions: read-all
1313

1414
jobs:
1515
PR:
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
if: github.repository != 'systemd/systemd' || github.event.pull_request.user.login == 'dependabot[bot]'
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ github.ref }}

.github/workflows/cifuzz.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ on:
2222
- main
2323
jobs:
2424
Fuzzing:
25-
runs-on: ubuntu-latest
25+
# FIXME: Figure out why 32-bit applications fail to run in docker on Ubuntu 24.04.
26+
runs-on: ubuntu-22.04
2627
if: github.repository == 'systemd/systemd'
2728
concurrency:
2829
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ matrix.architecture }}-${{ github.ref }}

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
analyze:
2828
name: Analyze
2929
if: github.repository != 'systemd/systemd-security'
30-
runs-on: ubuntu-22.04
30+
runs-on: ubuntu-24.04
3131
concurrency:
3232
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
3333
cancel-in-progress: true

.github/workflows/coverity.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
build:
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1818
if: github.repository == 'systemd/systemd'
1919
env:
2020
# Set in repo settings -> secrets -> actions

.github/workflows/development_freeze.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
github.event.workflow_run.event == 'pull_request' &&
2222
github.event.workflow_run.conclusion == 'success' &&
2323
github.repository == 'systemd/systemd'
24-
runs-on: ubuntu-22.04
24+
runs-on: ubuntu-24.04
2525

2626
permissions:
2727
pull-requests: write

.github/workflows/differential-shellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
lint:
1818
if: github.event.repository.name != 'systemd-security'
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020

2121
permissions:
2222
security-events: write

.github/workflows/gather-pr-metadata.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
gather-metadata:
1818
if: github.repository == 'systemd/systemd'
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020

2121
steps:
2222
- name: Repository checkout

.github/workflows/issue_labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions:
1010

1111
jobs:
1212
label-component:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414

1515
permissions:
1616
issues: write

.github/workflows/labeler.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
triage:
1818
if: github.repository == 'systemd/systemd'
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020
permissions:
2121
pull-requests: write
2222

.github/workflows/linter.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616
jobs:
1717
build:
1818
name: Lint Code Base
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020
concurrency:
2121
group: ${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: true
@@ -29,7 +29,7 @@ jobs:
2929
fetch-depth: 0
3030

3131
- name: Lint Code Base
32-
uses: github/super-linter/slim@45fc0d88288beee4701c62761281edfee85655d7
32+
uses: super-linter/super-linter/slim@88ea3923a7e1f89dd485d079f6eb5f5e8f937589
3333
env:
3434
DEFAULT_BRANCH: main
3535
VALIDATE_ALL_CODEBASE: false

.github/workflows/make_release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
release:
1313
if: github.repository == 'systemd/systemd' || github.repository == 'systemd/systemd-stable'
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04
1515

1616
permissions:
1717
contents: write

.github/workflows/mkosi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ permissions:
4646

4747
jobs:
4848
ci:
49-
runs-on: ubuntu-22.04
49+
runs-on: ubuntu-24.04
5050
concurrency:
5151
group: ${{ github.workflow }}-${{ matrix.distro }}-${{ matrix.release }}-${{ github.ref }}
5252
cancel-in-progress: true

.github/workflows/scorecards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
analysis:
2424
name: Scorecards analysis
2525
if: github.repository == 'systemd/systemd'
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-24.04
2727
permissions:
2828
id-token: write # Used to receive a badge.
2929

.github/workflows/unit_tests.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,23 @@ for phase in "${PHASES[@]}"; do
4646
case $phase in
4747
SETUP)
4848
info "Setup phase"
49-
# PPA with some newer build dependencies
50-
add-apt-repository -y --no-update ppa:upstream-systemd-ci/systemd-ci
51-
add-apt-repository -y --no-update --enable-source
49+
# This is added by default, and it is often broken, but we don't need anything from it
50+
rm -f /etc/apt/sources.list.d/microsoft-prod.{list,sources}
51+
# add-apt-repository --enable-source does not work on deb822 style sources.
52+
for f in /etc/apt/sources.list.d/*.sources; do
53+
sed -i "s/Types: deb/Types: deb deb-src/g" "$f"
54+
done
5255
apt-get -y update
5356
apt-get -y build-dep systemd
5457
apt-get -y install "${ADDITIONAL_DEPS[@]}"
55-
pip3 install -r .github/workflows/requirements.txt --require-hashes
58+
pip3 install -r .github/workflows/requirements.txt --require-hashes --break-system-packages
5659
;;
5760
RUN|RUN_GCC|RUN_CLANG|RUN_CLANG_RELEASE)
5861
if [[ "$phase" =~ ^RUN_CLANG ]]; then
5962
export CC=clang
6063
export CXX=clang++
64+
export CFLAGS="-fno-sanitize=function"
65+
export CXXFLAGS="-fno-sanitize=function"
6166
if [[ "$phase" == RUN_CLANG ]]; then
6267
# The docs build is slow and is not affected by compiler/flags, so do it just once
6368
MESON_ARGS+=(-Dman=enabled)
@@ -82,6 +87,8 @@ for phase in "${PHASES[@]}"; do
8287
if [[ "$phase" =~ ^RUN_CLANG_ASAN_UBSAN ]]; then
8388
export CC=clang
8489
export CXX=clang++
90+
export CFLAGS="-fno-sanitize=function"
91+
export CXXFLAGS="-fno-sanitize=function"
8592
# Build fuzzer regression tests only with clang (for now),
8693
# see: https://github.com/systemd/systemd/pull/15886#issuecomment-632689604
8794
# -Db_lundef=false: See https://github.com/mesonbuild/meson/issues/764

.github/workflows/unit_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
build:
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1818
concurrency:
1919
group: ${{ github.workflow }}-${{ matrix.run_phase }}-${{ matrix.cryptolib }}-${{ github.ref }}
2020
cancel-in-progress: true

mkosi.images/system/mkosi.conf.d/10-centos/mkosi.conf

+5
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44
Distribution=centos
55

66
[Content]
7+
Environment=
8+
# The kernel versions in CentOS Stream 9 doesn't support orphan_file, but later versions of
9+
# mkfs.ext4 enabled it by default, so we disable it explicitly.
10+
Environment=SYSTEMD_REPART_MKFS_OPTIONS_EXT4="-O ^orphan_file"
11+
712
Packages=
813
kernel-modules # For squashfs support

0 commit comments

Comments
 (0)