tooling: Move rust tools out of dockerfile
What changed, and why it matters
This commit is a routine developer tooling change. It moves the installation of Rust compiler components (such as code formatting, linting, and target platform support) out of the Docker build script and into a standard Rust toolchain configuration file. There is no indication this change fixes or introduces a security issue.
No security action required. Treat as normal build/maintenance tooling change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates the Dockerfile to rely on rust-toolchain.toml for specifying Rust components and targets, rather than invoking separate rustup commands in the Dockerfile. The rust-toolchain.toml now explicitly lists components (clippy, rust-analyzer, rust-src, rustfmt), targets (thumbv7em-none-eabi, thumbv8m.main-none-eabihf), and a minimal profile. The .containerversion file is bumped from 53 to 54. This is a build-system simplification with no functional firmware changes.
Changed components
Dockerfilesrc/rust/rust-toolchain.toml.containerversionInspect captured patch +6 / −8
diff --git a/.containerversion b/.containerversion
index 59343b0..fb1e7bc 100644
--- a/.containerversion
+++ b/.containerversion
@@ -1 +1 @@
-53
+54
diff --git a/Dockerfile b/Dockerfile
index 6587a49..47da164 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -126,13 +126,8 @@ ENV PATH=/opt/lcov-1.14/bin:$PATH
# Install rust compiler
ENV PATH=/opt/cargo/bin:$PATH
ENV RUSTUP_HOME=/opt/rustup
-COPY src/rust/rust-toolchain.toml /tmp/rust-toolchain.toml
-RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | CARGO_HOME=/opt/cargo sh -s -- --default-toolchain $(grep -oP '(?<=channel = ")[^"]+' /tmp/rust-toolchain.toml) -y
-RUN rustup target add thumbv7em-none-eabi
-RUN rustup target add thumbv8m.main-none-eabihf
-RUN rustup component add rustfmt
-RUN rustup component add clippy
-RUN rustup component add rust-src
+COPY src/rust/rust-toolchain.toml rust-toolchain.toml
+RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | CARGO_HOME=/opt/cargo sh -s -- --default-toolchain $(grep -oP '(?<=channel = ")[^"]+' rust-toolchain.toml) -y
RUN CARGO_HOME=/opt/cargo cargo install cbindgen --version 0.29.2 --locked
RUN CARGO_HOME=/opt/cargo cargo install bindgen-cli --version 0.72.1 --locked
diff --git a/src/rust/rust-toolchain.toml b/src/rust/rust-toolchain.toml
index 5355133..5c2b64c 100644
--- a/src/rust/rust-toolchain.toml
+++ b/src/rust/rust-toolchain.toml
@@ -1,2 +1,5 @@
[toolchain]
channel = "1.93.1"
+components = ["clippy", "rust-analyzer", "rust-src", "rustfmt"]
+targets = ["thumbv7em-none-eabi", "thumbv8m.main-none-eabihf"]
+profile = "minimal"
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.