Skip to content

fix(rust): immediate-abort via Cargo.toml profile (host-safe)#247

Merged
chcmedeiros merged 2 commits into
mainfrom
fix/immediate-abort-cargo-profile
Jun 22, 2026
Merged

fix(rust): immediate-abort via Cargo.toml profile (host-safe)#247
chcmedeiros merged 2 commits into
mainfrom
fix/immediate-abort-cargo-profile

Conversation

@chcmedeiros

@chcmedeiros chcmedeiros commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

What

Selects the immediate-abort panic strategy the canonical way for nightly-2025-12-05, and keeps the host CI jobs cheap by not rebuilding host core.

Changes (4 files)

  • app/rust/Cargo.toml: add cargo-features = ["panic-immediate-abort"] as the first line and panic = "immediate-abort" under [profile.release]. [profile.dev]'s panic = "abort" is unchanged.
  • app/rust/.cargo/config.toml: drop [unstable] build-std=["core"] and remove the -Z unstable-options / -C panic=immediate-abort flags from the device-target rustflags. All other rustflags (--emit asm, relocation-model=ropi, link args) are kept.
  • app/Makefile.rust: the device build now passes -Z build-std=core on the command line (cargo build -Z build-std=core --target ... --release).
  • app/rust/rust-toolchain.toml: channel 1.83.0nightly-2025-12-05; components gain clippy and rustfmt.

Why

cargo-features = ["panic-immediate-abort"] + [profile.release] panic = "immediate-abort" is the canonical way to select the immediate-abort panic strategy on nightly-2025-12-05 (the old -C panic=immediate-abort rustflag / panic_immediate_abort build-std feature path no longer applies). Moving build-std from config.toml into the device build command means the host clippy/test jobs (now on nightly) don't rebuild host core. The toolchain moves to nightly because the cargo-features gate requires a nightly cargo.

Select the immediate-abort panic strategy the canonical way on
nightly-2025-12-05: cargo-features = ["panic-immediate-abort"] plus
[profile.release] panic = "immediate-abort", instead of the device-target
rustflags (-C panic=immediate-abort / -Z unstable-options).

Move build-std out of .cargo/config.toml into the device build command
(cargo build -Z build-std=core ...) so the host clippy/test jobs (now on
nightly) don't rebuild host core.

Bump rust-toolchain to nightly-2025-12-05 (the cargo-features gate needs a
nightly cargo) and add clippy/rustfmt components.

Mirrors Zondax/ledger-icp #332.
@chcmedeiros
chcmedeiros force-pushed the fix/immediate-abort-cargo-profile branch from d080b50 to 2f34725 Compare June 22, 2026 15:52
@chcmedeiros
chcmedeiros merged commit 2b2b288 into main Jun 22, 2026
118 checks passed
@chcmedeiros
chcmedeiros deleted the fix/immediate-abort-cargo-profile branch June 22, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants