Closed monperrus closed 1 year ago
ping @yhql
Hi, this error pops up because we haven't specified a default target. You should install this tool https://github.com/LedgerHQ/cargo-ledger which will enable you to do cargo ledger setup
from the command line, and that will make the nanos
, nanox
and nanosplus
targets available from anywhere. Then you'll be able to do cargo build --target nanosplus
in the password-manager repo, or use cargo ledger build nanosplus --load
to build+load directly on device.
If you hit build errors even after using the custom targets, there's probably a few more steps you need to check on your toolchain installation, which are listed here https://github.com/LedgerHQ/ledger-nanos-sdk#usage
thanks, making progress with cargo ledger setup
the next error is
error: failed to run custom build command for `nanopass v1.2.1 (rust-app-password-manager)`
Caused by:
process didn't exit successfully: `/home/martin/martin-no-backup/rust-app-password-manager/target/debug/build/nanopass-7627437efbf19800/build-script-build` (exit status: 101)
--- stderr
thread 'main' panicked at 'failed: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:25:10
build.rs:25
is
let output = Command::new("arm-none-eabi-gcc")
.arg("-print-sysroot")
.output()
.expect("failed");
Installing gcc-arm-none-eabi from https://developer.arm.com/downloads/-/gnu-rm in a local directory
Verifying that the command works:
± ./gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc -print-sysroot
/home/martin/rust-app-password-manager/gcc-arm-none-eabi-10.3-2021.10/bin/../arm-none-eabi
Changing let output = Command::new("arm-none-eabi-gcc")
to let output = Command::new("gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc")
Now I can compile!
± cargo build --target nanosplus
Compiling nanopass v1.2.1 (/home/martin/martin-no-backup/rust-app-password-manager)
Finished dev [unoptimized + debuginfo] target(s) in 2.94s
Thanks a lot!
Now, I'm now trying to create the hex file
It fails as follows.
± cargo ledger build nanosplus
Compiling heapless v0.7.16
Compiling nanopass v1.2.1 (/home/martin/rust-app-password-manager)
Finished release [optimized] target(s) in 1.01s
thread 'main' panicked at 'Objcopy failed: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/utils.rs:34:10
Any suggestion? Thanks!
arm-none-eabi-objcopy
was missing.
Fix is export PATH=gcc-arm-none-eabi-10.3-2021.10/bin/:$PATH
$ cargo ledger build nanosplus
Finished release [optimized] target(s) in 0.06s
text data bss dec hex filename
25600 16896 1904 44400 ad70 /home/martin/martin-no-backup/rust-app-password-manager/target/nanosplus/release/nanopass
$ ls app_nanosplus.json
Could build and run NanoPass.
https://github.com/LedgerHQ/rust-app-password-manager/pull/15 improves the documentation accordingly.
thanks @yhql .
I'm finally trying out rust-app-password-manager you demoed in Paris :)
but I hit this error.
thanks!