Skip to content

Commit c493de6

Browse files
committed
Pre-install all CI compilers in base Docker image
Pre-install GCC 13, GCC 14, clang 15, and clang 18 in the base image so that the setup-linux action only needs to activate the right compiler instead of downloading/installing at runtime. This reduces CI job latency and removes fragile S3/dnf dependencies from the critical path. Also register clang runtime library directories with ldconfig so that libclang_rt.asan.so is discoverable by the linker without LD_LIBRARY_PATH workarounds in CI scripts. Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 53ed5a4 commit c493de6

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docker/Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,39 @@ RUN dnf install -y \
2929
&& dnf clean all \
3030
&& rm -rf /var/cache/dnf
3131

32+
# Install additional GCC toolset versions needed by CI (GCC 11 is the system default)
33+
RUN dnf install -y \
34+
gcc-toolset-13-gcc \
35+
gcc-toolset-13-gcc-c++ \
36+
gcc-toolset-13-gcc-gfortran \
37+
gcc-toolset-14-gcc \
38+
gcc-toolset-14-gcc-c++ \
39+
gcc-toolset-14-gcc-gfortran \
40+
&& dnf clean all \
41+
&& rm -rf /var/cache/dnf
42+
43+
# Install pre-built clang 15 and 18 (clang 20 is already the system default)
44+
RUN ARCH=$(uname -m) && PLATFORM="linux-${ARCH}" && \
45+
for CLANG_VERSION in 15 18; do \
46+
S3_URL="https://gha-artifacts.s3.amazonaws.com/clang/${PLATFORM}/clang-${CLANG_VERSION}/clang-${CLANG_VERSION}-${PLATFORM}.tar.gz" && \
47+
INSTALL_DIR="/opt/clang-${CLANG_VERSION}" && \
48+
echo "Installing clang ${CLANG_VERSION} from ${S3_URL}" && \
49+
curl -fsSL "${S3_URL}" -o /tmp/clang.tar.gz && \
50+
mkdir -p "${INSTALL_DIR}" && \
51+
tar xzf /tmp/clang.tar.gz -C "${INSTALL_DIR}" --strip-components=1 && \
52+
rm -f /tmp/clang.tar.gz; \
53+
done
54+
55+
# Register clang runtime library directories so the linker can find libclang_rt.asan.so
56+
# etc. without needing LD_LIBRARY_PATH hacks at CI time.
57+
RUN for CLANG_VERSION in 15 18; do \
58+
INSTALL_DIR="/opt/clang-${CLANG_VERSION}" && \
59+
CLANG_RT_DIR=$("${INSTALL_DIR}/bin/clang" --print-runtime-dir 2>/dev/null || true) && \
60+
if [ -n "${CLANG_RT_DIR}" ] && [ -d "${CLANG_RT_DIR}" ]; then \
61+
echo "${CLANG_RT_DIR}" > "/etc/ld.so.conf.d/clang-${CLANG_VERSION}.conf"; \
62+
fi; \
63+
done && ldconfig
64+
3265
# Install uv (Python package manager) — needed before CUDA install for uv run
3366
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
3467
ENV PATH="/root/.local/bin:${PATH}"

0 commit comments

Comments
 (0)