[Concept,3/5] docker: Install Rust toolchain for ulib examples

Message ID 20260219192130.737116-4-sjg@u-boot.org
State New
Headers
Series docker: Update Docker image and fix trace test |

Commit Message

Simon Glass Feb. 19, 2026, 7:21 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The ulib Rust demo requires cross-compilation targets that are not
present in the CI Docker image. Install rustup with the minimal profile
and add the four targets needed by the Rust demo builds:

- i686-unknown-linux-gnu (qemu-x86)
- x86_64-unknown-none (qemu-x86_64, efi-x86_app64)
- riscv64gc-unknown-none-elf (qemu-riscv64, efi-riscv_app64)
- aarch64-unknown-none (efi-arm_app64)

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 tools/docker/Dockerfile | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Patch

diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile
index b804df03e16..71932e5433c 100644
--- a/tools/docker/Dockerfile
+++ b/tools/docker/Dockerfile
@@ -315,6 +315,16 @@  RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
 RUN useradd -m -U uboot
 USER uboot:uboot
 
+# Install Rust toolchain with cross-compilation targets for ulib examples
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
+	sh -s -- -y --default-toolchain stable --profile minimal && \
+	. $HOME/.cargo/env && \
+	rustup target add \
+		aarch64-unknown-none \
+		i686-unknown-linux-gnu \
+		riscv64gc-unknown-none-elf \
+		x86_64-unknown-none
+ENV PATH="/home/uboot/.cargo/bin:${PATH}"
 
 # Populate the cache for pip to use. Get these via wget as the
 # COPY / ADD directives don't work as we need them to.