Skip to content

Commit 1deecaa

Browse files
ci: Install development snapshots of gcc and clang
TODO: Make sure the Docker image is actually rebuild
1 parent 9e6d1b0 commit 1deecaa

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

ci/linux-debian.Dockerfile

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM debian:stable
22

3+
SHELL ["/bin/bash", "-c"]
4+
35
RUN dpkg --add-architecture i386 && \
46
dpkg --add-architecture s390x && \
57
dpkg --add-architecture armhf && \
@@ -9,7 +11,7 @@ RUN dpkg --add-architecture i386 && \
911
# dkpg-dev: to make pkg-config work in cross-builds
1012
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
1113
RUN apt-get update && apt-get install --no-install-recommends -y \
12-
git ca-certificates \
14+
git ca-certificates wget \
1315
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
1416
gcc clang llvm libclang-rt-dev libc6-dbg \
1517
g++ \
@@ -23,6 +25,38 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2325
sagemath
2426

2527
WORKDIR /root
28+
29+
# Build and install gcc snapshot
30+
ARG GCC_SNAPSHOT_MAJOR=14
31+
RUN wget --progress=dot:giga --https-only --recursive --accept '*.tar.xz' --level 1 --no-directories "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}" && \
32+
wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \
33+
sha512sum --check --ignore-missing sha512.sum && \
34+
# We should have downloaded exactly one tar.xz file
35+
ls && \
36+
[[ $(ls *.tar.xz | wc -l) -eq "1" ]] && \
37+
tar xf *.tar.xz && \
38+
mkdir gcc-build && cd gcc-build && \
39+
apt-get update && apt-get install --no-install-recommends -y libgmp-dev libmpfr-dev libmpc-dev flex && \
40+
../*/configure --prefix=/opt/gcc-snapshot --enable-languages=c --disable-bootstrap --disable-multilib --without-isl && \
41+
make -j $(nproc) && \
42+
make install && \
43+
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
44+
45+
# Install clang snapshot
46+
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
47+
# Add repository for this Debian release
48+
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
49+
# Install clang snapshot
50+
apt-get update && apt-get install --no-install-recommends -y clang && \
51+
# Remove just the "clang" symlink again
52+
apt-get remove -y clang && \
53+
# We should have exactly two clang versions now
54+
ls /usr/bin/clang* && \
55+
[[ $(ls /usr/bin/clang-?? | sort | wc -l) -eq "2" ]] && \
56+
# Create symlinks for them
57+
ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
58+
ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
59+
2660
# The "wine" package provides a convience wrapper that we need
2761
RUN apt-get update && apt-get install --no-install-recommends -y \
2862
git ca-certificates wine64 wine python3-simplejson python3-six msitools winbind procps && \

0 commit comments

Comments
 (0)