From c5bdbc810dcb1b00a88a26a48bacc46bf9b0ef22 Mon Sep 17 00:00:00 2001 From: Piet Date: Mon, 21 Feb 2022 21:59:04 +0100 Subject: [PATCH] ci: get rust copied to final image. --- tools/ci/cibuild.sh | 4 ++-- tools/ci/docker/linux/Dockerfile | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/tools/ci/cibuild.sh b/tools/ci/cibuild.sh index 802c073bcb..b60001e350 100755 --- a/tools/ci/cibuild.sh +++ b/tools/ci/cibuild.sh @@ -37,7 +37,7 @@ EXTRA_PATH= case ${os} in Darwin) - install="python-tools u-boot-tools elf-toolchain gen-romfs kconfig-frontends arm-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain avr-gcc-toolchain c-cache binutils rust" + install="python-tools u-boot-tools elf-toolchain gen-romfs kconfig-frontends rust arm-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain avr-gcc-toolchain c-cache binutils" mkdir -p "${prebuilt}"/homebrew export HOMEBREW_CACHE=${prebuilt}/homebrew # https://github.com/actions/virtual-environments/issues/2322#issuecomment-749211076 @@ -46,7 +46,7 @@ case ${os} in brew update --quiet ;; Linux) - install="python-tools gen-romfs gperf kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain sparc-gcc-toolchain c-cache rust" + install="python-tools gen-romfs gperf kconfig-frontends rust arm-gcc-toolchain mips-gcc-toolchain riscv-gcc-toolchain xtensa-esp32-gcc-toolchain rx-gcc-toolchain sparc-gcc-toolchain c-cache" ;; esac diff --git a/tools/ci/docker/linux/Dockerfile b/tools/ci/docker/linux/Dockerfile index 9ef32214d7..67a29b9077 100644 --- a/tools/ci/docker/linux/Dockerfile +++ b/tools/ci/docker/linux/Dockerfile @@ -59,6 +59,13 @@ RUN mkdir bloaty -p \ && cmake -DCMAKE_SYSTEM_PREFIX_PATH=/tools/bloaty \ && make install +# Install Rust and targets supported from NuttX +ENV CARGO_HOME=/tools/rust +RUN mkdir -p $CARGO_HOME \ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ + && $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi \ + && $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi + CMD [ "/bin/bash" ] ############################################################################### @@ -191,14 +198,6 @@ RUN cd renesas-tools/source/newlib && \ RUN cd /tools/renesas-tools/build/gcc && \ make && make install -# Install Rust and targets supported from NuttX -ENV CARGO_HOME=/tools/rust -RUN mkdir -p $CARGO_HOME && \ - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ - $CARGO_HOME/bin/rustup target add thumbv6m-none-eabi && \ - $CARGO_HOME/bin/rustup target add thumbv7m-none-eabi -ENV PATH="$CARGO_HOME/bin:$PATH" - ############################################################################### # Final Docker image used for running CI system. This includes all toolchains # supported by the CI system. @@ -262,6 +261,11 @@ ENV PATH="/tools/kconfig-frontends/bin:$PATH" COPY --from=nuttx-tools /tools/bloaty/ bloaty/ ENV PATH="/tools/bloaty/bin:$PATH" +# Pull in the Rust toolchain including supported targets +COPY --from=nuttx-tools /tools/rust/ /tools/rust/ +ENV CARGO_HOME=/tools/rust +ENV PATH="/tools/rust/bin:$PATH" + # ARM toolchain COPY --from=nuttx-toolchain-arm /tools/gcc-arm-none-eabi/ gcc-arm-none-eabi/ ENV PATH="/tools/gcc-arm-none-eabi/bin:$PATH"