build(core/rust): use `dev` profile for debug builds of emulator
What changed, and why it matters
This commit changes how the Trezor emulator's Rust code is compiled. It makes debug builds use the Rust 'dev' profile (which keeps extra internal safety checks) not only when an explicit debug flag is set, but also whenever the firmware is built with Python optimizations disabled (PYOPT='0'). This is a build-hardening change for the emulator/debug environment and does not alter runtime behavior of production devices or introduce a security vulnerability.
No security action required. Treat as a normal build-system hardening improvement for emulator/debug builds.
Security signals we found
Build configuration change for emulator/debug profile
Enables debug_assert! and internal checks in Rust dev builds
No runtime code or cryptographic logic changed
No production device firmware behavior changed
Evidence from the diff
In core/SConscript.unix, the condition for selecting the Rust ‘dev’ profile is expanded from ARGUMENTS.get('TREZOR_EMULATOR_DEBUGGABLE', '0') == '1' to also include PYOPT == '0'. The ‘dev’ profile enables debug_assert! and other internal checks that are stripped in ‘release’. This affects only emulator/debug builds and is a defensive build configuration change.
Changed components
core/SConscript.unixTrezor emulator Rust build profile selectionInspect captured patch +1 / −1
diff --git a/core/SConscript.unix b/core/SConscript.unix
index cb77f1bf6..37fa573e6 100644
--- a/core/SConscript.unix
+++ b/core/SConscript.unix
@@ -902,7 +902,7 @@ env.Depends(protobuf_blobs, qstr_generated)
# Rust library
#
env.get("ENV")["RUST_TARGET"] = os.popen("rustc -vV | sed -n 's/host: //p'").read().strip()
-if ARGUMENTS.get('TREZOR_EMULATOR_DEBUGGABLE', '0') == '1':
+if PYOPT == '0' or ARGUMENTS.get('TREZOR_EMULATOR_DEBUGGABLE', '0') == '1':
profile = 'dev'
else:
profile = 'release'
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.