ci/Dockerfile: Always use versioned clang packages
This commit switches to a new strategy to make sure we're installing the most recent LLVM packages. Before this commit, we used the unversioned LLVM packages (e.g., `clang` instead of `clang-18`), which are supposed to provide the latest snapshot, but this is broken for arm64 [1], which we want to add in a later PR. Anyway, the new approach is cleaner because it does not require us to fiddle with the installed `clang` package by removing a symlink. [1] https://github.com/llvm/llvm-project/issues/64790 Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
This commit is contained in:
parent
65c79fe2d0
commit
6ebe7d2bb3
@ -46,17 +46,21 @@ RUN mkdir gcc && cd gcc && \
|
|||||||
cd ../.. && rm -rf gcc && \
|
cd ../.. && rm -rf gcc && \
|
||||||
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
|
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
|
||||||
|
|
||||||
# Install clang snapshot
|
# Install clang snapshot, see https://apt.llvm.org/
|
||||||
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
|
RUN \
|
||||||
|
# Setup GPG keys of LLVM repository
|
||||||
|
apt-get update && apt-get install --no-install-recommends -y wget && \
|
||||||
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
|
||||||
# Add repository for this Debian release
|
# Add repository for this Debian release
|
||||||
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
|
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
|
||||||
# Install clang snapshot
|
apt-get update && \
|
||||||
apt-get update && apt-get install --no-install-recommends -y clang && \
|
# Determine the version number of the LLVM development branch
|
||||||
# Remove just the "clang" symlink again
|
LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) && \
|
||||||
apt-get remove -y clang && \
|
# Install
|
||||||
# We should have exactly two clang versions now
|
apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" && \
|
||||||
ls /usr/bin/clang* && \
|
# Create symlink
|
||||||
[[ $(ls /usr/bin/clang-?? | sort | wc -l) -eq "2" ]] && \
|
ln -s "/usr/bin/clang-${LLVM_VERSION}" /usr/bin/clang-snapshot && \
|
||||||
# Create symlinks for them
|
# Clean up
|
||||||
ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
|
apt-get autoremove -y wget && \
|
||||||
ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
|
apt-get clean
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user