crank icon indicating copy to clipboard operation
crank copied to clipboard

error: no such command `+nightly`

Open paulyoung opened this issue 2 years ago • 4 comments

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?

paulyoung avatar Oct 16 '23 00:10 paulyoung

Nightly toolchain is needed to build core and alloc libs.

boozook avatar Apr 15 '24 16:04 boozook

@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.

paulyoung avatar Apr 16 '24 01:04 paulyoung

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.

boozook avatar Apr 16 '24 07:04 boozook