build(core): propagate emulator feature from projects
What changed, and why it matters
This commit is a build-system cleanup for the Trezor firmware's Rust code. It changes how the 'emulator' feature flag is passed between different software components. The firmware project no longer supports the emulator feature (which makes sense because real firmware runs on hardware, not an emulator), while the bootloader, prodtest, and core Rust library now propagate the feature more consistently. There is no indication of a security vulnerability in this change.
No security action required. Treat as routine build maintenance. Reviewers may want to confirm the TODO in core/embed/rust/Cargo.toml is tracked and resolved in a follow-up to avoid inconsistent emulator feature behavior across projects.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies Cargo.toml feature propagation for the emulator feature across core/embed Rust projects. Bootloader and prodtest now forward emulator to trezor_lib/emulator. Firmware removes the emulator feature entirely. The core rust/Cargo.toml now exposes emulator = [“io/emulator”, “upymod?/emulator”] with an explicit TODO noting this is not a project-wide policy. This is a build configuration refactor with no runtime code changes.
Changed components
core/embed/projects/bootloader/Cargo.tomlcore/embed/projects/firmware/Cargo.tomlcore/embed/projects/prodtest/Cargo.tomlcore/embed/rust/Cargo.tomlInspect captured patch +5 / −4
### core/embed/projects/bootloader/Cargo.toml
@@ -31,7 +31,7 @@ dbg_console_vcp = ["dbg_console", "sys/dbg_console_vcp", "io/usb_iface_vcp"]
debug = ["trezor_lib/debug"]
debuglink = ["trezor_lib/debuglink", "io/usb_iface_debug"]
disable_animation = []
-emulator = ["io/emulator"]
+emulator = ["io/emulator", "trezor_lib/emulator"]
production = ["io/production"]
ui_debug = ["trezor_lib/ui_debug"]
ui_debug_overlay = ["trezor_lib/ui_debug_overlay"]
### core/embed/projects/firmware/Cargo.toml
@@ -33,7 +33,6 @@ debug = ["trezor_lib/debug"]
debuglink = ["trezor_lib/debuglink", "io/usb_iface_debug"]
dev_keys = ["trezor_lib/dev_keys"]
disable_animation = ["upymod/disable_animation"]
-emulator = ["io/emulator", "upymod/emulator"]
force_bootloader_upgrade = []
frozen = ["upymod/frozen"]
log_stack_usage = ["upymod/log_stack_usage"]
### core/embed/projects/prodtest/Cargo.toml
@@ -28,7 +28,7 @@ dbg_console_swo = ["dbg_console", "sys/dbg_console_swo"]
dbg_console_system_view = ["dbg_console", "sys/dbg_console_system_view"]
debug = ["trezor_lib/debug"]
debuglink = ["trezor_lib/debuglink", "io/usb_iface_debug"]
-emulator = ["io/emulator"]
+emulator = ["io/emulator", "trezor_lib/emulator"]
production = ["io/production"]
ui_debug = ["trezor_lib/ui_debug"]
ui_debug_overlay = ["trezor_lib/ui_debug_overlay"]
### core/embed/rust/Cargo.toml
@@ -168,7 +168,9 @@ test = [
default = []
-emulator = []
+# TODO: should we propagate the emulator feature here? some say yes, some say no.
+# For now we propagate, but this is NOT a project wide policy.
+emulator = ["io/emulator", "upymod?/emulator"]
mcu_stm32f429 = ["mcu_stm32f4"]
mcu_stm32f4 = []
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.