Skip to content

Commit 727bec5

Browse files
Merge #1414: ci/gha: Add ARM64 QEMU jobs for clang and clang-snapshot
2635068 ci/gha: Let MSan continue checking after errors in all jobs (Tim Ruffing) e78c7b6 ci/Dockerfile: Reduce size of Docker image further (Tim Ruffing) 2f0d3bb ci/Dockerfile: Warn if `ulimit -n` is too high when running Docker (Tim Ruffing) 4b8a647 ci/gha: Add ARM64 QEMU jobs for clang and clang-snapshot (Tim Ruffing) 6ebe7d2 ci/Dockerfile: Always use versioned clang packages (Tim Ruffing) Pull request description: Solves one item in #1392. This PR also has a few tweaks to the Dockerfile, see individual commits. --- I'll follow up soon with a PR for ARM64/gcc. This will rely on Cirrus CI. ACKs for top commit: hebasto: ACK 2635068. Tree-SHA512: d290bdd8e8e2a2a2b6ccb1b25ecdc9662c51dab745068a98044b9abed75232d13cb9d2ddc2c63c908dcff6a12317f0c7a35db3288c57bc3b814793f7fce059fd
2 parents 65c79fe + 2635068 commit 727bec5

File tree

2 files changed

+46
-22
lines changed

2 files changed

+46
-22
lines changed

.github/workflows/ci.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,22 @@ jobs:
283283
ELLSWIFT: 'yes'
284284
CTIMETESTS: 'no'
285285

286+
strategy:
287+
fail-fast: false
288+
matrix:
289+
configuration:
290+
- env_vars: { } # gcc
291+
- env_vars: # clang
292+
CC: 'clang --target=aarch64-linux-gnu'
293+
- env_vars: # clang-snapshot
294+
CC: 'clang-snapshot --target=aarch64-linux-gnu'
295+
286296
steps:
287297
- name: Checkout
288298
uses: actions/checkout@v3
289299

290300
- name: CI script
301+
env: ${{ matrix.configuration.env_vars }}
291302
uses: ./.github/actions/run-in-docker-action
292303
with:
293304
dockerfile: ./ci/linux-debian.Dockerfile
@@ -474,11 +485,11 @@ jobs:
474485
matrix:
475486
configuration:
476487
- env_vars:
477-
CFLAGS: '-fsanitize=memory -g'
488+
CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g'
478489
- env_vars:
479490
ECMULTGENPRECISION: 2
480491
ECMULTWINDOW: 2
481-
CFLAGS: '-fsanitize=memory -g -O3'
492+
CFLAGS: '-fsanitize=memory -fsanitize-recover=memory -g -O3'
482493

483494
env:
484495
ECDH: 'yes'

ci/linux-debian.Dockerfile

+33-20
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ FROM debian:stable-slim
22

33
SHELL ["/bin/bash", "-c"]
44

5+
WORKDIR /root
6+
7+
# A too high maximum number of file descriptors (with the default value
8+
# inherited from the docker host) can cause issues with some of our tools:
9+
# - sanitizers hanging: https://github.com/google/sanitizers/issues/1662
10+
# - valgrind crashing: https://stackoverflow.com/a/75293014
11+
# This is not be a problem on our CI hosts, but developers who run the image
12+
# on their machines may run into this (e.g., on Arch Linux), so warn them.
13+
# (Note that .bashrc is only executed in interactive bash shells.)
14+
RUN echo 'if [[ $(ulimit -n) -gt 200000 ]]; then echo "WARNING: Very high value reported by \"ulimit -n\". Consider passing \"--ulimit nofile=32768\" to \"docker run\"."; fi' >> /root/.bashrc
15+
516
RUN dpkg --add-architecture i386 && \
617
dpkg --add-architecture s390x && \
718
dpkg --add-architecture armhf && \
@@ -11,7 +22,7 @@ RUN dpkg --add-architecture i386 && \
1122
# dkpg-dev: to make pkg-config work in cross-builds
1223
# llvm: for llvm-symbolizer, which is used by clang's UBSan for symbolized stack traces
1324
RUN apt-get update && apt-get install --no-install-recommends -y \
14-
git ca-certificates wget \
25+
git ca-certificates \
1526
make automake libtool pkg-config dpkg-dev valgrind qemu-user \
1627
gcc clang llvm libclang-rt-dev libc6-dbg \
1728
g++ \
@@ -24,11 +35,10 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
2435
gcc-mingw-w64-i686-win32 wine32 \
2536
python3
2637

27-
WORKDIR /root
28-
2938
# Build and install gcc snapshot
3039
ARG GCC_SNAPSHOT_MAJOR=14
31-
RUN mkdir gcc && cd gcc && \
40+
RUN apt-get update && apt-get install --no-install-recommends -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \
41+
mkdir gcc && cd gcc && \
3242
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}" && \
3343
wget "https://gcc.gnu.org/pub/gcc/snapshots/LATEST-${GCC_SNAPSHOT_MAJOR}/sha512.sum" && \
3444
sha512sum --check --ignore-missing sha512.sum && \
@@ -37,26 +47,29 @@ RUN mkdir gcc && cd gcc && \
3747
[[ $(ls *.tar.xz | wc -l) -eq "1" ]] && \
3848
tar xf *.tar.xz && \
3949
mkdir gcc-build && cd gcc-build && \
40-
apt-get update && apt-get install --no-install-recommends -y libgmp-dev libmpfr-dev libmpc-dev flex && \
4150
../*/configure --prefix=/opt/gcc-snapshot --enable-languages=c --disable-bootstrap --disable-multilib --without-isl && \
4251
make -j $(nproc) && \
4352
make install && \
44-
apt-get autoremove -y libgmp-dev libmpfr-dev libmpc-dev flex && \
45-
apt-get clean && \
4653
cd ../.. && rm -rf gcc && \
47-
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot
54+
ln -s /opt/gcc-snapshot/bin/gcc /usr/bin/gcc-snapshot && \
55+
apt-get autoremove -y wget libgmp-dev libmpfr-dev libmpc-dev flex && \
56+
apt-get clean && rm -rf /var/lib/apt/lists/*
4857

49-
# Install clang snapshot
50-
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
58+
# Install clang snapshot, see https://apt.llvm.org/
59+
RUN \
60+
# Setup GPG keys of LLVM repository
61+
apt-get update && apt-get install --no-install-recommends -y wget && \
62+
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
5163
# Add repository for this Debian release
5264
. /etc/os-release && echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME} main" >> /etc/apt/sources.list && \
53-
# Install clang snapshot
54-
apt-get update && apt-get install --no-install-recommends -y clang && \
55-
# Remove just the "clang" symlink again
56-
apt-get remove -y clang && \
57-
# We should have exactly two clang versions now
58-
ls /usr/bin/clang* && \
59-
[[ $(ls /usr/bin/clang-?? | sort | wc -l) -eq "2" ]] && \
60-
# Create symlinks for them
61-
ln -s $(ls /usr/bin/clang-?? | sort | tail -1) /usr/bin/clang-snapshot && \
62-
ln -s $(ls /usr/bin/clang-?? | sort | head -1) /usr/bin/clang
65+
apt-get update && \
66+
# Determine the version number of the LLVM development branch
67+
LLVM_VERSION=$(apt-cache search --names-only '^clang-[0-9]+$' | sort -V | tail -1 | cut -f1 -d" " | cut -f2 -d"-" ) && \
68+
# Install
69+
apt-get install --no-install-recommends -y "clang-${LLVM_VERSION}" && \
70+
# Create symlink
71+
ln -s "/usr/bin/clang-${LLVM_VERSION}" /usr/bin/clang-snapshot && \
72+
# Clean up
73+
apt-get autoremove -y wget && \
74+
apt-get clean && rm -rf /var/lib/apt/lists/*
75+

0 commit comments

Comments
 (0)