fix(core): build emulator without pyopt enabled
What changed, and why it matters
This commit changes how the Trezor emulator (a software version of the hardware wallet used for testing) is built. It disables a MicroPython bytecode optimization called 'pyopt' for emulator builds and tweaks how the build tool handles the --pyopt flag. The change only affects the emulator/test build, not the real hardware firmware, and there is no direct evidence in the commit that this fixes a security vulnerability.
No security action required. Treat as a normal build/test maintenance commit. If reviewing for release, verify that emulator test suites still pass and that firmware builds remain unaffected.
Security signals we found
No security-relevant code change in the diff
Change is confined to emulator build configuration
No mention of vulnerability, CVE, researcher, or security issue in commit message
pyopt=false preserves more debug information, which is the opposite of a hardening change
Evidence from the diff
The patch modifies core/Makefile so that build_unix (emulator) passes –pyopt=false, and updates core/embed/xtask/src/args.rs to add overrides_with=’pyopt’ to the pyopt argument. The stated purpose is to build the emulator without pyopt enabled. This is likely a build/test reliability fix: pyopt can strip docstrings/source-line info, which may break emulator debugging, tests, or stack traces. The change does not alter device firmware builds and contains no security-relevant code change.
Changed components
core/Makefile build_unix targetcore/embed/xtask/src/args.rs BuildArgs pyopt CLI optionInspect captured patch +2 / −2
diff --git a/core/Makefile b/core/Makefile
index c629e7af..a4c7d6b5 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -242,7 +242,7 @@ build_firmware: ## build firmware with frozen modules
xtask build firmware $(XTASK_BUILD_OPTS)
build_unix: ## build unix port
- xtask build firmware --emulator $(XTASK_BUILD_OPTS)
+ xtask build firmware --emulator $(XTASK_BUILD_OPTS) --pyopt=false
build_unix_frozen: ## build unix port with frozen modules
xtask build firmware --emulator --frozen $(XTASK_BUILD_OPTS)
diff --git a/core/embed/xtask/src/args.rs b/core/embed/xtask/src/args.rs
index 62c5042d..47a589f7 100644
--- a/core/embed/xtask/src/args.rs
+++ b/core/embed/xtask/src/args.rs
@@ -272,7 +272,7 @@ pub struct BuildArgs {
pub source_lines: Option<bool>,
/// Optimize MicroPython bytecode
- #[arg(long, num_args = 0..=1, default_missing_value = "true")]
+ #[arg(long, num_args = 0..=1, default_missing_value = "true", overrides_with = "pyopt")]
pub pyopt: Option<bool>,
/// Enable Micropython memory performance measurements
Why this scored 12/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.