Failed to build hello-rust example
valentinegb opened this issue · 3 comments
valentinegb commented
When trying to build the hello-rust
example (cargo build --release
), it fails and prints the following error:
error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the 'nightly-2022-11-03-aarch64-apple-darwin' toolchain
Steps to reproduce
- Download ZIP from GitHub
- Move
hello-rust
folder out (I moved it to myprojects
folder) - Modify
Cargo.toml
so that dependencies don't specify paths - In the
hello-rust
directory, run the following commands:rustup default nightly
rustup target add thumbv7em-none-eabihf
cargo build --release
- Build fails
Desktop
- OS: macOS Ventura 13.2 (a) Beta (22D7750270d)
rustup
: 1.25.1 (bb60b1e89 2022-07-12)rustc
: 1.67.0-nightly (edf018221 2022-11-02)cargo
: 1.67.0-nightly (7e484fc1a 2022-10-27)
Potential solution
In the rust-toolchain.toml
file, changing channel
to "nightly"
seems to resolve this issue.
katekyy commented
Try uninstalling your toolchain with rustup uninstall nightly-2022-11-03-aarch64-apple-darwin
, and installing it again.
valentinegb commented
Alright, seems like that worked!
valentinebriese@Valentines-Air hello-rust % rustup uninstall nightly-2022-11-03-aarch64-apple-darwin
info: uninstalling toolchain 'nightly-2022-11-03-aarch64-apple-darwin'
info: toolchain 'nightly-2022-11-03-aarch64-apple-darwin' uninstalled
valentinebriese@Valentines-Air hello-rust % cargo build --release
info: syncing channel updates for 'nightly-2022-11-03-aarch64-apple-darwin'
info: latest update on 2022-11-03, rust version 1.67.0-nightly (edf018221 2022-11-02)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rust-std' for 'thumbv7em-none-eabihf'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rust-std' for 'thumbv7em-none-eabihf'
info: installing component 'rustc'
info: installing component 'rustfmt'
Updating crates.io index
Compiling flipperzero-sys v0.5.0
Compiling flipperzero-rt v0.5.0
Compiling flipperzero v0.5.0
Compiling hello-rust v0.1.0 (/Users/valentinebriese/projects/hello-rust)
Finished release [optimized] target(s) in 7.41s
valentinebriese@Valentines-Air hello-rust % cargo build --release
Finished release [optimized] target(s) in 0.01s
valentinebriese@Valentines-Air hello-rust % cargo --version
cargo 1.67.0-nightly (7e484fc1a 2022-10-27)
Dunno why that happened, but I guess I'll close the issue then.
dcoles commented
Thanks @katekyy!
@valentinegb I'm also at a bit of a loss why that might have happened, but glad to hear you got it resolved.