error: no such command `+nightly`
When providing the --device flag, +nightly is added to cargo build:
https://github.com/pd-rs/crank/blob/f46cda4a2dd028d5580d89268975fcb21f6f0eb5/src/main.rs#L611-L615
and I run into the following error:
INFO crank > build command: RUSTFLAGS="-Ctarget-cpu=cortex-m7 -Clink-args=--emit-relocs -Crelocation-model=pic -Cpanic=abort" "cargo" "+nightly" "build" "--lib" "--target" "thumbv7em-none-eabihf" "-Zbuild-std=core,alloc" "-Zbuild-std-features=panic_immediate_abort"
error: no such command: `+nightly`
Cargo does not handle `+toolchain` directives.
Did you mean to invoke `cargo` through `rustup` instead?
Error: cargo failed with error ExitStatus(unix_wait_status(25856))
I've been using a local copy of crank that removes +nightly and everything seems to work fine.
What's the motivation for adding +nightly when the --device flag is provided?
Nightly toolchain is needed to build core and alloc libs.
@boozook i don’t disagree, but as the error message above demonstrates, adding +nightly only works for a specific workflow.
I ended up using a fork of crank because of this.
adding +nightly only works for a specific workflow.
Not only. If you have rustup, you could just add rust-toolchain toml with channel=nightly to the root of your project. Example.