Skip to content

Commit

Permalink
ci: explicitly install latest clang for nightly test
Browse files Browse the repository at this point in the history
It appears LLVM's deb repo is slightly borked and has set the
clang package to alias unreleased LLVM instead of latest stable.
Explicitly install the latest version by checking the API.

Fixes #2497.

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
lidavidm and kou committed Feb 4, 2025
1 parent b49201c commit 722dc30
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/nightly-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ on:
- main
paths:
- ".github/workflows/nightly-verify.yml"
- "ci/docker/cpp-clang-latest.dockerfile"
- "ci/docker/cpp-gcc-latest.dockerfile"
- "dev/release/verify-release-candidate.sh"
- "dev/release/verify-release-candidate.ps1"
schedule:
Expand Down
18 changes: 14 additions & 4 deletions ci/docker/cpp-clang-latest.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,24 @@ ARG GO

RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y curl gnupg && \
echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm main" \
apt-get install -y curl gnupg jq && \
# llvmorg-19.1.7 ->
# 19.1.7 ->
# 19
latest_llvm_major_version=$( \
curl https://api.github.com/repos/llvm/llvm-project/releases/latest | \
jq -r .tag_name | \
cut -d- -f2 | \
cut -d. -f1) && \
echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${latest_llvm_major_version} main" \
> /etc/apt/sources.list.d/llvm.list && \
echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm main" \
echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${latest_llvm_major_version} main" \
>> /etc/apt/sources.list.d/llvm.list && \
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - && \
apt-get update -y && \
apt-get install -y clang libc++abi-dev libc++-dev libomp-dev && \
apt-get install -y clang-${latest_llvm_major_version} libc++abi-${latest_llvm_major_version}-dev libc++-${latest_llvm_major_version}-dev libomp-${latest_llvm_major_version}-dev && \
ln -s /usr/bin/clang-${latest_llvm_major_version} /usr/bin/clang && \
ln -s /usr/bin/clang++-${latest_llvm_major_version} /usr/bin/clang++ && \
apt-get clean

RUN export DEBIAN_FRONTEND=noninteractive && \
Expand Down

0 comments on commit 722dc30

Please sign in to comment.