From 57b4d81bbcc80e121fe1fbef775657555298a54f Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 7 Aug 2024 13:20:27 -0600 Subject: [PATCH] ci: Add rust target support Invoke `rust target add ...` for each of the targets supported by Zephyr. There is a bit of a catch-22 here. We should be getting this list from the build, but the change that adds Rust support can't merge until Rust support has been tested. Once the first PR is merged, and the zephyr/lib/rust/targets.txt file exists, the hardcoded list here can be replaced by a loop that adds each of these targest. All of the targets adds about 300Mb to the image, as these targets only include a fairly minimal 'core' and 'alloc' library. Signed-off-by: David Brown --- Dockerfile.ci | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Dockerfile.ci b/Dockerfile.ci index 220a214..f6d43bb 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -89,6 +89,17 @@ RUN wget -q -O- "https://sh.rustup.rs" | sh -s -- -y # Install uefi-run utility RUN ~/.cargo/bin/cargo install uefi-run --root /usr +# Install target support for Rust. This is the list as of the current +# time. +RUN \ + ~/.cargo/bin/rustup target install riscv32i-unknown-none-elf && \ + ~/.cargo/bin/rustup target install riscv64imac-unknown-none-elf && \ + ~/.cargo/bin/rustup target install thumbv6m-none-eabi && \ + ~/.cargo/bin/rustup target install thumbv7em-none-eabi && \ + ~/.cargo/bin/rustup target install thumbv7m-none-eabi && \ + ~/.cargo/bin/rustup target install thumbv8m.main-none-eabi && \ + ~/.cargo/bin/rustup target install x86_64-unknown-none + # Install LLVM and Clang RUN wget ${WGET_ARGS} https://apt.llvm.org/llvm.sh && \ chmod +x llvm.sh && \