ci: get rust copied to final image.

This commit is contained in:
Piet 2022-02-21 21:59:04 +01:00 committed by Brennan Ashton
parent 419bc2fd04
commit c5bdbc810d
2 changed files with 14 additions and 10 deletions

View File

@ -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

View File

@ -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"