背景
我按照本指南在相应的回购中构建项目。我成功地编译、运行并验证了03项目。
问题
然而,按照建造项目05的指示;错误[E0463]:找不到core
的板条箱":
$ cargo build --features v2 --target thumbv7em-none-eabihf
info: syncing channel updates for 'nightly-2021-08-18-aarch64-apple-darwin'
info: latest update on 2021-08-18, rust version 1.56.0-nightly (30a0a9b69 2021-08-17)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
info: downloading component 'rust-std' for 'riscv32imac-unknown-none-elf'
info: downloading component 'rust-std' for 'riscv32imc-unknown-none-elf'
info: downloading component 'rust-std' for 'thumbv6m-none-eabi'
info: downloading component 'rust-std' for 'thumbv7em-none-eabi'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-src'
info: installing component 'rust-std'
info: installing component 'rust-std' for 'riscv32imac-unknown-none-elf'
info: installing component 'rust-std' for 'riscv32imc-unknown-none-elf'
info: installing component 'rust-std' for 'thumbv6m-none-eabi'
info: installing component 'rust-std' for 'thumbv7em-none-eabi'
info: installing component 'rustc'
info: installing component 'rustfmt'
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2022-01-20, rust version 1.58.1 (db9d1b20b 2022-01-20)
info: downloading component 'rust-src'
info: installing component 'rust-src'
Compiling critical-section v0.2.5
error[E0463]: can't find crate for `core`
|
= note: the `thumbv7em-none-eabihf` target may not be installed
= help: consider downloading the target with `rustup target add thumbv7em-none-eabihf`
= help: consider building the standard library from source with `cargo build -Zbuild-std`
For more information about this error, try `rustc --explain E0463`.
error: could not compile `critical-section` due to previous error
这似乎是一个意外的错误,因为这表明我缺少thumbv7em-none-eabihf
目标工具链,但如果没有安装该工具链,项目03将无法正确编译。
问题
我可以修复我的系统以正确构建项目05吗?或者项目中有漏洞?
相关系统数据:
如果有人想了解更多信息,请在评论中lmk,我可以用我的机器的更多输出更新本节。
$ rustup component list --installed
cargo-aarch64-apple-darwin
clippy-aarch64-apple-darwin
rust-src
rust-std-aarch64-apple-darwin
rust-std-thumbv7em-none-eabihf
rustc-aarch64-apple-darwin
rustfmt-aarch64-apple-darwin
$ rustup show
Default host: aarch64-apple-darwin
rustup home: /Users/___/.rustup
installed toolchains
--------------------
stable-aarch64-apple-darwin (default)
nightly-2021-08-18-aarch64-apple-darwin
installed targets for active toolchain
--------------------------------------
aarch64-apple-darwin
thumbv7em-none-eabihf
active toolchain
----------------
stable-aarch64-apple-darwin (default)
rustc 1.58.1 (db9d1b20b 2022-01-20)
原来我的生锈工具链坏了;我最初用nix安装了所有东西,但用rustup安装(即货物(替换了一些nix安装解决了问题。