test: pin Trezor T Rust nightly to 2025-04-15
What changed, and why it matters
This change only adjusts a test setup script to pin a specific Rust compiler version when building the Trezor T hardware wallet emulator for automated tests. It is a build/test infrastructure fix, not a security patch, and does not change any wallet handling, cryptography, or user-facing code.
No security action needed. Treat as a normal test infrastructure maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/setup_environment.sh to stop using the rolling Rust nightly toolchain and instead install nightly-2025-04-15 when compiling trezor-firmware for the Trezor T emulator. The reason is that newer Rust nightlies reject the firmware’s use of the unstable reexport_test_harness_main attribute (E0658). This is purely a CI/test environment compatibility fix.
Changed components
test/setup_environment.shInspect captured patch +9 / −6
diff --git a/test/setup_environment.sh b/test/setup_environment.sh
index 7d602a5..36788bf 100755
--- a/test/setup_environment.sh
+++ b/test/setup_environment.sh
@@ -115,12 +115,15 @@ if [[ -n ${build_trezor_1} || -n ${build_trezor_t} ]]; then
fi
if [[ -n ${build_trezor_t} ]]; then
- rustup update
- rustup toolchain uninstall nightly
- rustup toolchain install nightly
- rustup default nightly
- rustup component add rustfmt
- rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
+ # Pin the Rust nightly to the one trezor-firmware ${TREZOR_VERSION} expects
+ # (see its shell.nix: rust-bin.nightly."2025-04-15"). The rolling "nightly"
+ # channel has drifted and newer nightlies reject the firmware's
+ # reexport_test_harness_main attribute with error E0658.
+ TREZOR_RUST_NIGHTLY="nightly-2025-04-15"
+ rustup toolchain install ${TREZOR_RUST_NIGHTLY}
+ rustup default ${TREZOR_RUST_NIGHTLY}
+ rustup component add rustfmt --toolchain ${TREZOR_RUST_NIGHTLY}
+ rustup component add rust-src --toolchain ${TREZOR_RUST_NIGHTLY}-x86_64-unknown-linux-gnu
# Build trezor t emulator. This is pretty fast, so rebuilding every time is ok
# But there should be some caching that makes this faster
git am ../../data/trezor-t-build.patch
Why this scored 16/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.