What changed, and why it matters
This commit only changes how automated code checks and tests are run for Rust code. It adds a new CI job, creates a Makefile to run style checks, tests, and a linter across Rust crates, and adjusts gitignore files. There is no change to the actual Trezor firmware or wallet behavior, and no security bug is fixed or introduced.
No security action needed; this is a routine CI/development hygiene change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit is purely CI/build tooling: it adds a rust_test GitHub Actions job, refactors Makefile ruststyle targets to delegate to a new rust/Makefile, and adds/updates .gitignore entries for Rust target directories. It does not modify any source code, cryptographic logic, protocol handling, or device behavior.
Changed components
.github/workflows/common.ymlMakefilerust/Makefilerust/.gitignorerust/trezor-client/.gitignoreInspect captured patch +47 / −3
diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml
index d5ac39229..5ae351322 100644
--- a/.github/workflows/common.yml
+++ b/.github/workflows/common.yml
@@ -79,6 +79,16 @@ jobs:
# LD_LIBRARY_PATH workaround: https://discourse.nixos.org/t/nixpkgs-nixos-unstable-many-package-fail-with-glibc-2-38-not-found/35078 https://github.com/NixOS/nixpkgs/issues/287764
- run: nix-shell --arg fullDeps true --run "unset LD_LIBRARY_PATH && cd python && uv run tox"
+ rust_test:
+ name: Rust crates test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - uses: ./.github/actions/environment
+ - run: nix-shell --run "make -C rust check"
+
storage_test:
name: Storage test
# TODO: only for changes in storage/
diff --git a/Makefile b/Makefile
index 282cbd73b..56d63e323 100644
--- a/Makefile
+++ b/Makefile
@@ -94,13 +94,14 @@ defs_check: ## check validity of coin definitions and protobuf files
ruststyle:
@echo [RUSTFMT]
@cd core/embed/rust ; cargo fmt
- @cd rust/trezor-client ; cargo fmt
+ make -C rust style
ruststyle_check:
rustfmt --version
@echo [RUSTFMT]
@cd core/embed/rust ; cargo fmt -- --check
- @cd rust/trezor-client ; cargo fmt -- --check
+ make -C rust style_check
+
typecheck: pyright
diff --git a/rust/.gitignore b/rust/.gitignore
new file mode 100644
index 000000000..901b6e6f9
--- /dev/null
+++ b/rust/.gitignore
@@ -0,0 +1 @@
+*/target/
diff --git a/rust/Makefile b/rust/Makefile
new file mode 100644
index 000000000..4e488f5f0
--- /dev/null
+++ b/rust/Makefile
@@ -0,0 +1,33 @@
+# trezor-client needs running emulator for test, handled in core.yml
+CRATES_TEST = trezor-thp trezor-tjpgdec
+CRATES = ${CRATES_TEST} trezor-client
+
+check: clippy test
+
+style:
+ @for D in $(CRATES); do ( \
+ echo "[STYLE $$D]"; \
+ cd $$D; \
+ cargo fmt \
+ ); done
+
+style_check:
+ @for D in $(CRATES); do ( \
+ echo "[STYLE $$D]"; \
+ cd $$D; \
+ cargo fmt -- --check \
+ ); done
+
+clippy:
+ @for D in $(CRATES); do ( \
+ echo "[CLIPPY $$D]"; \
+ cd $$D; \
+ cargo clippy \
+ ); done
+
+test:
+ @for D in $(CRATES_TEST); do ( \
+ echo "[TEST $$D]"; \
+ cd $$D; \
+ cargo test \
+ ); done
diff --git a/rust/trezor-client/.gitignore b/rust/trezor-client/.gitignore
deleted file mode 100644
index 2f7896d1d..000000000
--- a/rust/trezor-client/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-target/
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.