This document collects practical commands and environment variables for narrowing failures when working on the Galdralag firmware workspace (Rust crates, host tools, and the embedded target). It does not replace the threat model or crypto policy; it is an operator checklist.
For recorded test matrices and fuzz metadata, see TEST_RESULTS.md. For toolchain and xtask recipes, see GALDRALAG_DEV_REFERENCE.md and dev-ref.md.
When a test or host binary panics or returns Err, enable a full backtrace:
RUST_BACKTRACE=1 cargo test -p vault --lib
RUST_BACKTRACE=full cargo test -p cipher-profileUse full when line numbers are elided or the default trace stops too early.
To see why a crate fails to compile or link (missing symbols, wrong features, cfg gates):
cargo build -vv -p galdra-core-host
cargo check -vv -p vaultFor the firmware triple (see below), xtask forwards to cargo; you can add verbosity by running the underlying cargo command from GALDRALAG_DEV_REFERENCE.md with -vv if you need linker script or RUSTFLAGS detail.
Run one package:
cargo test -p ephemeral-session
cargo test -p usb-personalityRun one test by name filter (substring match):
cargo test -p vault ecdh_commutativityRun a single test exactly (avoids matching similarly named tests):
cargo test -p vault ecdh_commutativity -- --exactShow println! and test output interleaved (default hides success output):
cargo test -p vault -- --nocaptureTests marked #[ignore] (slow, hardware-specific, or optional):
cargo test -p vault -- --ignoredWorkspace default often excludes xtask:
cargo test --workspace --exclude xtask
cargo test -p xtaskFrom the repository root:
| Command | Use when |
|---|---|
cargo run -p xtask -- check-fw |
Embedded riscv32imac-unknown-none-elf compile errors without a full build |
cargo run -p xtask -- check-xous-core |
Fail if nested/sibling xous-core is not the CCID branch (prints ln -sfn fix) |
cargo run -p xtask -- build-fw |
Full firmware image build for the same triple |
cargo run -p xtask -- test-host |
Broad host-side workspace tests (excluding xtask) |
cargo run -p xtask -- test-crypto |
vault + security-tests with single test thread |
cargo run -p xtask -- test-profiles |
cipher-profile only |
cargo run -p xtask -- test-session |
ephemeral-session only |
cargo run -p xtask -- test-biometric |
Biometric crates with test-hal where needed |
cargo run -p xtask -- wycheproof |
Vault Wycheproof-style JSON corpora |
cargo run -p xtask -- timing-test |
Dudect harness (see GALDRALAG_DEV_REFERENCE) |
cargo run -p xtask -- test-all |
Full pipeline (optional --no-fuzz to skip cargo-fuzz) |
cargo run -p xtask -- test-openpgp |
Quick host check: reports whether gpg is on PATH (does not substitute for a CCID reader) |
cargo run -p xtask -- bench-rsa |
Slow ignored RSA baseline in vault (--ignored --nocapture) |
If an xtask command fails, re-run the equivalent cargo test … shown in xtask/src/main.rs so you can append -- --nocapture or a test name filter. For fuzz target names and aliases, run cargo run -p xtask -- with no further arguments: the process prints a usage: line listing accepted verbs.
Install the target once:
rustup target add riscv32imac-unknown-none-elfThen use check-fw / build-fw as above. If the failure is in a specific crate, locate it under crates/ and run:
cargo check -p <crate-name> --target riscv32imac-unknown-none-elf(Only crates that declare that target in their build will succeed; host-only crates are checked on the host triple instead.)
For USB CCID on Xous, see crates/baochip-openpgp, xous-core/services/usb-bao1x (feature ccid-openpgp), optional galdralag-service (services/galdralag/README.md, cargo run -p xtask -- check-xous-core, Dabao: scripts/build_dabao_ccid_image.sh), docs/RRAM_LAYOUT.md, and the README — Known limitations / open work. GnuPG against real hardware can still fail at the OS or provisioning layer even when unit tests pass.
Fast feedback without running tests:
cargo clippy --workspace --exclude xtask -- -D warnings
cargo check --workspace --exclude xtaskScope to one crate when iterating:
cargo clippy -p galdr-core --all-targetsThe fuzz/ tree is a separate Cargo workspace. See fuzz/README.md for targets and cargo fuzz run … examples. If cargo fuzz requires nightly on your machine:
cd fuzz && cargo +nightly fuzz run <target_name>Use minimized crash artifacts (cargo fuzz tmin) only after you can reproduce a crash reliably; store reproducers outside the tree if they contain secrets.
Operational behaviour, environment, and provisioning flows are in GALDRA-TOOL.md. For device-dependent failures, prefer a VM or disposable user session; some tests are #[ignore] until a token is present.
Reader enumeration, pcscd, udev, and GnuPG scdaemon behaviour are covered in OPENPGP_CARD.md. Typical checks:
pcscdrunning and the device listed bypcsc_scanor equivalent.- Correct udev rules so your user can open the reader.
gpg --card-statusafter unplug/replug to confirm session state.
- PAD / metrics methodology: BIOMETRIC_TESTING.md
- Board-level or lab checks: HARDWARE_TEST.md, HARDWARE_VERIFICATION.md
Browse API docs for a crate:
cargo doc -p vault --open --no-depsUse --document-private-items only when debugging internal modules; do not treat that output as a stable public API.
Collect before reporting:
- Exact command and full terminal output (or last 200 lines of
cargo … -vv). rustc -V,cargo -V, andrust-toolchain.tomlcontents if not default stable.- Host OS and whether the failure is host triple vs
riscv32imac-unknown-none-elf. - For crypto surprises: whether vectors or fuzz seeds reproduce (never paste production keys).
This keeps triage focused on reproducible steps rather than guesswork.