LedgerHQ / cargo-ledger

(Moved in the ledger device rust SDK --> https://github.com/LedgerHQ/ledger-device-rust-sdk). Load code on a Ledger device with a `cargo` subcommand
Apache License 2.0
15 stars 12 forks source link

Download and install custom target JSONs automatically #18

Closed yhql closed 1 year ago

yhql commented 1 year ago

This PR changes the behaviour of cargo-ledger to always check whether the nanos, nanox, nanosplus custom target files from the Rust SDK are present in the rustup toolchain (the rustc --print sysroot folder). If they are not present, cargo-ledger will use curl to get them from the SDK's master branch.

After that, the targets are available to cargo from anywhere, with no need to point to a specific folder or use an environment variable, as was previously advised.

This works thanks to https://github.com/rust-lang/rust/pull/83800