Skip to content

Commit f9decb4

Browse files
cdeckerclaude
andcommitted
fix: Simplify coverage build to use ubuntu-24.04 with default clang
Replaced the complex LLVM 18 specific setup with simpler approach: - Update all runners to ubuntu-24.04 - Use default clang package (no version-specific installation) - Use default llvm-profdata and llvm-cov from system packages - Removed custom LLVM repository setup - Removed version-specific tool paths and symlinks - Removed libclang-rt-18-dev dependency (included with build-essential) This approach leverages the system's default LLVM/Clang toolchain on ubuntu-24.04, which avoids version mismatch issues entirely. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <[email protected]>
1 parent 7723dc1 commit f9decb4

File tree

2 files changed

+17
-39
lines changed

2 files changed

+17
-39
lines changed

.github/scripts/setup.sh

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,12 @@ export RUST_VERSION=stable
66
sudo useradd -ms /bin/bash tester
77
sudo apt-get update -qq
88

9-
# Add LLVM apt repository for consistent LLVM 18 installation across all steps
10-
sudo apt-get install -qq --no-install-recommends -yy wget gnupg
11-
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
12-
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
13-
sudo apt-get update -qq
14-
159
sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
1610
autoconf \
1711
automake \
1812
binfmt-support \
1913
build-essential \
20-
clang-18 \
21-
libclang-rt-18-dev \
14+
clang \
2215
cppcheck \
2316
docbook-xml \
2417
eatmydata \
@@ -29,7 +22,6 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
2922
git \
3023
gnupg \
3124
jq \
32-
llvm-18-tools \
3325
libc6-dev-arm64-cross \
3426
libc6-dev-armhf-cross \
3527
libev-dev \
@@ -67,17 +59,6 @@ sudo apt-get -qq install --no-install-recommends --allow-unauthenticated -yy \
6759
systemtap-sdt-dev \
6860
zlib1g-dev
6961

70-
# Add LLVM 18 tools to PATH (they're installed in /usr/lib/llvm-18/bin/)
71-
export PATH="/usr/lib/llvm-18/bin:$PATH"
72-
echo 'export PATH="/usr/lib/llvm-18/bin:$PATH"' | sudo tee /etc/profile.d/llvm-18-path.sh
73-
74-
# Create symlinks in /usr/bin for common LLVM tools so they're always accessible
75-
echo "Creating symlinks for LLVM 18 tools in /usr/bin..."
76-
sudo ln -sf /usr/lib/llvm-18/bin/llvm-profdata /usr/bin/llvm-profdata-18 || true
77-
sudo ln -sf /usr/lib/llvm-18/bin/llvm-cov /usr/bin/llvm-cov-18 || true
78-
sudo ln -sf /usr/bin/llvm-profdata-18 /usr/bin/llvm-profdata || true
79-
sudo ln -sf /usr/bin/llvm-cov-18 /usr/bin/llvm-cov || true
80-
8162
echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester
8263
sudo chmod 0440 /etc/sudoers.d/tester
8364

.github/workflows/coverage-nightly.yaml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
jobs:
1919
compile:
2020
name: Build with Coverage
21-
runs-on: ubuntu-22.04
21+
runs-on: ubuntu-24.04
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4
@@ -36,15 +36,15 @@ jobs:
3636

3737
- name: Build with coverage instrumentation
3838
run: |
39-
./configure --enable-debugbuild --enable-coverage CC=clang-18
39+
./configure --enable-debugbuild --enable-coverage CC=clang
4040
uv run make -j $(nproc) testpack.tar.bz2
4141
4242
- name: Record LLVM version
4343
run: |
4444
echo "Recording LLVM version used for compilation..."
45-
clang-18 --version > LLVM_VERSION.txt
45+
clang --version > LLVM_VERSION.txt
4646
echo "" >> LLVM_VERSION.txt
47-
/usr/lib/llvm-18/bin/llvm-profdata --version >> LLVM_VERSION.txt
47+
llvm-profdata --version >> LLVM_VERSION.txt
4848
cat LLVM_VERSION.txt
4949
tar -rf testpack.tar.bz2 LLVM_VERSION.txt
5050
@@ -56,7 +56,7 @@ jobs:
5656

5757
test:
5858
name: Test (${{ matrix.name }})
59-
runs-on: ubuntu-22.04
59+
runs-on: ubuntu-24.04
6060
needs: compile
6161
strategy:
6262
fail-fast: false
@@ -147,8 +147,8 @@ jobs:
147147
cat LLVM_VERSION.txt
148148
echo ""
149149
echo "Current system LLVM version:"
150-
clang-18 --version
151-
/usr/lib/llvm-18/bin/llvm-profdata --version
150+
clang --version
151+
llvm-profdata --version
152152
else
153153
echo "⚠ WARNING: LLVM_VERSION.txt not found in build artifact"
154154
fi
@@ -189,10 +189,9 @@ jobs:
189189
- name: Verify LLVM tools are available
190190
if: always()
191191
run: |
192-
echo "Verifying LLVM 18 tools are available..."
193-
/usr/lib/llvm-18/bin/llvm-profdata --version
194-
# Create symlinks for scripts that expect llvm-profdata without version suffix
195-
sudo ln -sf /usr/lib/llvm-18/bin/llvm-profdata /usr/bin/llvm-profdata || true
192+
echo "Verifying LLVM tools are available..."
193+
which llvm-profdata
194+
llvm-profdata --version
196195
197196
- name: Merge coverage data locally
198197
if: always()
@@ -222,7 +221,7 @@ jobs:
222221

223222
report:
224223
name: Generate Coverage Report
225-
runs-on: ubuntu-22.04
224+
runs-on: ubuntu-24.04
226225
needs: test
227226
if: always()
228227

@@ -232,12 +231,10 @@ jobs:
232231

233232
- name: Verify LLVM tools are available
234233
run: |
235-
echo "Verifying LLVM 18 tools are available..."
236-
/usr/lib/llvm-18/bin/llvm-profdata --version
237-
/usr/lib/llvm-18/bin/llvm-cov --version
238-
# Create symlinks for scripts that expect tools without version suffix
239-
sudo ln -sf /usr/lib/llvm-18/bin/llvm-profdata /usr/bin/llvm-profdata || true
240-
sudo ln -sf /usr/lib/llvm-18/bin/llvm-cov /usr/bin/llvm-cov || true
234+
echo "Verifying LLVM tools are available..."
235+
which llvm-profdata llvm-cov
236+
llvm-profdata --version
237+
llvm-cov --version
241238
242239
- name: Download build artifact
243240
uses: actions/download-artifact@v4
@@ -255,7 +252,7 @@ jobs:
255252
cat LLVM_VERSION.txt
256253
echo ""
257254
echo "Current system LLVM version:"
258-
/usr/lib/llvm-18/bin/llvm-profdata --version
255+
llvm-profdata --version
259256
echo ""
260257
echo "✓ LLVM version verification complete"
261258
else

0 commit comments

Comments
 (0)