chore(core): adjust hardcoded paths to use xtask build
What changed, and why it matters
This commit simply updates internal file paths in developer and testing scripts so they point to a new build output directory. It does not change any code that runs on the Trezor device or handle user data, secrets, or network traffic. There is no security issue here.
No security action needed; review as a normal build-system maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes hardcoded filesystem paths from the old core/build/unix/... and core/build/firmware/... locations to the new core/build-xtask/artifacts/latest/... layout used by the project’s xtask build system. Affected files are helper scripts for running the emulator, executing tests, collecting coverage, locating emulator binaries, and printing Rust stack sizes. No firmware logic, cryptography, protocol parsing, or memory handling is modified.
Changed components
core/emu.pycore/tests/run_tests.shcore/tools/coverage-collect.pytests/emulators.pytools/print-rust-stack-sizes.pyInspect captured patch +11 / −7
diff --git a/core/emu.py b/core/emu.py
index a754bdc6..5e512600 100755
--- a/core/emu.py
+++ b/core/emu.py
@@ -24,7 +24,7 @@ except Exception:
HERE = Path(__file__).resolve().parent
-MICROPYTHON = HERE / "build" / "unix" / "trezor-emu-core"
+MICROPYTHON = HERE / "build-xtask" / "artifacts" / "latest" / "firmware-emu"
SRC_DIR = HERE / "src"
PROFILE_BASE = Path.home() / ".trezoremu"
diff --git a/core/tests/run_tests.sh b/core/tests/run_tests.sh
index de858fce..21df685c 100755
--- a/core/tests/run_tests.sh
+++ b/core/tests/run_tests.sh
@@ -3,7 +3,7 @@
declare -a results
declare -i passed=0 failed=0 exit_code=0
declare COLOR_GREEN='\e[32m' COLOR_RED='\e[91m' COLOR_RESET='\e[39m'
-MICROPYTHON="${MICROPYTHON:-../build/unix/trezor-emu-core -X heapsize=2M}"
+declare MICROPYTHON="${MICROPYTHON:-../build-xtask/artifacts/latest/firmware-emu -X heapsize=2M}"
export SDL_VIDEODRIVER=dummy
print_summary() {
diff --git a/core/tools/coverage-collect.py b/core/tools/coverage-collect.py
index 56370578..850edf89 100755
--- a/core/tools/coverage-collect.py
+++ b/core/tools/coverage-collect.py
@@ -12,8 +12,8 @@ data = coverage.CoverageData(result_filename)
def to_preprocessed_path(py_path: Path) -> Path:
- # Remap <prefix>/src/<rel>.py → <prefix>/build/unix/src/<rel>.i so coverage
- # reports against the preprocessed source actually compiled into the frozen
+ # Remap <prefix>/src/<rel>.py → <prefix>/build-xtask/artifacts/latest/mpy-files/<rel>.i
+ # so coverage reports against the preprocessed source actually compiled into the frozen
# build (dead feature-flag branches already rewritten to `if False:`).
# Fall back to the original .py path when no .i exists (e.g. unfrozen
# debug-only modules loaded directly from src/).
@@ -23,7 +23,11 @@ def to_preprocessed_path(py_path: Path) -> Path:
src_index = path_parts.index("src")
prefix = path_parts[:src_index]
rest = path_parts[src_index + 1 :]
- i_path = Path(*prefix) / "build/unix/src" / Path(*rest).with_suffix(".i")
+ i_path = (
+ Path(*prefix)
+ / "build-xtask/artifacts/latest/mpy-files"
+ / Path(*rest).with_suffix(".i")
+ )
return i_path if os.path.exists(i_path) else py_path
diff --git a/tests/emulators.py b/tests/emulators.py
index c309bebe..b604d8eb 100644
--- a/tests/emulators.py
+++ b/tests/emulators.py
@@ -35,7 +35,7 @@ BINDIR = ROOT / "tests" / "emulators"
_SHARED_TROPIC_MODELS: Dict[str, TropicModel] = {}
LOCAL_BUILD_PATHS = {
- "core": ROOT / "core" / "build" / "unix" / "trezor-emu-core",
+ "core": ROOT / "core" / "build-xtask" / "artifacts" / "latest" / "firmware-emu",
"legacy": ROOT / "legacy" / "firmware" / "trezor.elf",
}
diff --git a/tools/print-rust-stack-sizes.py b/tools/print-rust-stack-sizes.py
index 35f6eef0..cdd99008 100755
--- a/tools/print-rust-stack-sizes.py
+++ b/tools/print-rust-stack-sizes.py
@@ -13,7 +13,7 @@ SYMBOL_TYPES = ("t", "w") # text, weak
ROOT = Path(__file__).parent.parent.resolve()
-FIRMWARE_ELF = ROOT / "core" / "build" / "firmware" / "firmware.elf"
+FIRMWARE_ELF = ROOT / "core" / "build-xtask" / "artifacts" / "latest" / "firmware.elf"
elf = ELFFile(FIRMWARE_ELF.open("rb"))
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.