Skip to content

Commit 6cc1d10

Browse files
fix CI: install LLVM 19 from apt.llvm.org, Ubuntu's default is too old
llvmlite>=0.49's ArgumentAttributes only recognizes the LLVM 19+ 'captures(none)' spelling of the renamed 'nocapture' attribute. Ubuntu noble's default llvm/clang packages are LLVM 18, whose llc can't parse that attribute in the emitted .ll text.
1 parent 8f709d9 commit 6cc1d10

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,30 @@ jobs:
2424
- name: Install system dependencies
2525
run: |
2626
sudo apt-get update
27+
sudo apt-get install -y lsb-release wget software-properties-common gnupg linux-tools-common linux-tools-generic
28+
29+
# Ubuntu's default `llvm`/`clang` packages (LLVM 18 on noble) are
30+
# too old to assemble the IR llvmlite>=0.49 emits: llvmlite's
31+
# ArgumentAttributes only knows the LLVM 19+ 'captures(none)'
32+
# spelling (LLVM renamed 'nocapture' to it), and an older llc
33+
# can't parse that attribute in the .ll text. Install a
34+
# known-recent LLVM from apt.llvm.org instead of the distro
35+
# default, and make its tools the ones found on PATH.
36+
wget https://apt.llvm.org/llvm.sh
37+
chmod +x llvm.sh
38+
sudo ./llvm.sh 19 all
39+
sudo ln -sf /usr/bin/clang-19 /usr/local/bin/clang
40+
sudo ln -sf /usr/bin/llc-19 /usr/local/bin/llc
41+
clang --version
42+
llc --version
43+
2744
# bpftool isn't an installable package by itself on Ubuntu: it's a
2845
# virtual package provided by linux-tools-common + a kernel-flavor
2946
# linux-tools-<flavor> package. The runner's exact kernel version
3047
# has no matching linux-tools-<version> package, so the
3148
# update-alternatives symlink for `bpftool` doesn't get set up;
3249
# find whatever binary the generic-flavor package installed and
3350
# put it on PATH ourselves.
34-
sudo apt-get install -y clang llvm libclang-dev linux-tools-common linux-tools-generic
3551
bpftool_bin=$(sudo find /usr/lib/linux-tools* -name bpftool -type f 2>/dev/null | head -1)
3652
if [ -z "$bpftool_bin" ]; then
3753
echo "::error::Could not find a bpftool binary after installing linux-tools-generic"

0 commit comments

Comments
 (0)