From 8f9f99255c8300d167597e8dd602e9a48c7d00b4 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 15 May 2025 13:59:26 +0200 Subject: tools/docker: add rust compiler Add the new dependencies necessary for generating RUST=y Linux configs and for building RUST=y kernels. --- tools/docker/env/Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tools/docker/env') diff --git a/tools/docker/env/Dockerfile b/tools/docker/env/Dockerfile index f96d05d75..cf7137306 100644 --- a/tools/docker/env/Dockerfile +++ b/tools/docker/env/Dockerfile @@ -112,6 +112,20 @@ RUN chmod 0777 /syzkaller ENV SOURCEDIR_FUCHSIA /syzkaller/fuchsia ENV SOURCEDIR_NETBSD /syzkaller/netbsd +# Rust toolchain for kernel builds. +ENV RUSTUP_HOME=/usr/local/rustup +ENV CARGO_HOME=/usr/local/cargo +ENV PATH=/usr/local/cargo/bin:$PATH +ENV RUST_VERSION=1.87.0 +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain $RUST_VERSION +RUN rustup component add rust-src +RUN cargo install --locked bindgen-cli + +# Use the latest libdw-dev release, otherwise we get compilation error when CONFIG_RUST=y. +RUN echo "deb http://deb.debian.org/debian bookworm-backports main contrib non-free non-free-firmware" > /etc/apt/sources.list.d/bookworm-backports.list +RUN apt-get update +RUN apt-get install -y --no-install-recommends libdw-dev/bookworm-backports libelf-dev/bookworm-backports + # Install node to pass act jobs (https://github.com/nektos/act) RUN apt-get install -y -q nodejs -- cgit mrf-deployment