@@ -2,77 +2,54 @@ ARG DEBIAN_VERSION=bookworm
22ARG BASE_IMAGE=debian:$DEBIAN_VERSION
33
44FROM $BASE_IMAGE
5-
6- # Make sure we are on root
75USER root
86
9- ARG RUST_VERSION=1.90
10- ARG LLVM_VER=14
11-
12- # Use the bullseye llvm version because there is no newer one yet
13- ARG LLVM_DEBIAN_VERSION=bookworm
14-
157# Avoid warnings by switching to noninteractive
168ENV DEBIAN_FRONTEND=noninteractive
179
18- RUN apt-get update \
19- && apt-get upgrade -y \
20- && apt-get install -y \
21- apt-utils \
22- git \
23- wget gnupg curl \
24- build-essential \
25- libz-dev \
26- gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
27- python3-venv
28-
29- # dpkg --add-architecture arm64 \
10+ ARG LLVM_VERSION=21
11+ ARG RUST_VERSION=1.90
3012
31- # # Setup llvm sources
32- # RUN echo "deb http://apt.llvm.org/$LLVM_DEBIAN_VERSION/ llvm-toolchain-$LLVM_DEBIAN_VERSION-$LLVM_VER main" >> /etc/apt/sources.list.d/llvm.list
33- # RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
13+ # Install LLVM and its dependencies
14+ RUN apt update \
15+ && apt upgrade -y \
16+ && apt install -y --no-install-recommends wget curl gnupg build-essential lsb-release software-properties-common \
17+ && wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh $LLVM_VERSION \
18+ && apt install -y --no-install-recommends clang lld liblld-$LLVM_VERSION-dev libpolly-$LLVM_VERSION-dev
3419
35- # Install Clang dependencies
36- # On bookworm clang is version 14, which is what we have as default.
37- # Installing without versions here is convinient for scripts calling clang or lld instead of clang-14/lld-14
38- RUN apt-get install -y zip clang lldb lld clangd \
39- clang-$LLVM_VER lldb-$LLVM_VER lld-$LLVM_VER \
40- clangd-$LLVM_VER liblld-$LLVM_VER-dev \
41- llvm-$LLVM_VER-dev libpolly-$LLVM_VER-dev
20+ # TODO: Remove this once we completely switched over to LLVM 21
21+ RUN apt install -y zip clang lldb lld clangd clang-14 lldb-14 lld-14 clangd-14 liblld-14-dev llvm-14-dev libpolly-14-dev
4222
43- # Install llvm-lit, which we use for correctness tests
44- ENV XDG_BIN_HOME=/usr/local/bin
45- # Download the latest installer
46- ADD https://astral.sh/uv/install.sh /uv-installer.sh
47- # Run the installer then remove it
48- RUN sh /uv-installer.sh && rm /uv-installer.sh && mkdir -p /usr/local/uv
49- ENV UV_TOOL_DIR="/usr/local/uv"
23+ # Install llvm-lit, used by our correctness tests
24+ COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /bin/
5025ENV UV_TOOL_BIN_DIR="/usr/local/bin/"
5126RUN uv tool install lit
5227
28+ # Install Rust
5329ENV CARGO_HOME=/usr/local/cargo
5430ENV RUSTUP_HOME=/usr/local/rustup
55- # Get Rust
31+
5632RUN curl https://sh.rustup.rs -sSf | bash -s -- --profile minimal --default-toolchain none -y
5733ENV PATH="${CARGO_HOME}/bin:${PATH}"
5834
5935RUN rustup toolchain install $RUST_VERSION \
60- && rustup default $RUST_VERSION \
61- && rustup component add clippy rustfmt llvm-tools-preview \
62- && rustup target add aarch64-unknown-linux-gnu \
63- && rustup target add x86_64-unknown-linux-musl
64-
36+ && rustup default $RUST_VERSION \
37+ && rustup component add clippy rustfmt llvm-tools-preview \
38+ && rustup target add aarch64-unknown-linux-gnu \
39+ && rustup target add x86_64-unknown-linux-musl
6540
6641RUN chmod -R a+rw $CARGO_HOME \
67- && chmod -R a+rw $RUSTUP_HOME \
68- && chmod -R a+rw /usr/local/uv \
69- && chmod -R a+rw /usr/local/bin
42+ && chmod -R a+rw $RUSTUP_HOME \
43+ && chmod -R a+rw /usr/local/bin
44+
45+ # Install cargo-binstall to make subsequent binaries easier to download
46+ RUN wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$(uname -m)-unknown-linux-musl.tgz \
47+ && tar -xf cargo-binstall-$(uname -m)-unknown-linux-musl.tgz -C $CARGO_HOME/bin \
48+ && rm cargo-binstall-*.tgz
7049
71- # Install bininstall to make subsequent binaries easier to download
72- RUN wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-`uname -m`-unknown-linux-musl.tgz && tar -xf cargo-binstall-`uname -m`-unknown-linux-musl.tgz -C $CARGO_HOME/bin
73- # Install documentation and coverage tools
7450RUN cargo binstall --no-confirm mdbook grcov cargo-nextest
7551
52+ # Configure container defaults for interactive use
7653WORKDIR /build
7754ENTRYPOINT ["bash" ]
7855
0 commit comments