背景
我跟随本指南在对应回购中构建项目。我成功地编译、运行和验证了项目03。
问题
但是,下面的构建项目05的说明生成"errorE0463:无法找到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)发布于 2022-02-22 02:43:56
原来我的生锈工具链坏了;我最初用nix安装了所有的东西,但是用锈蚀安装(即货物)替换了一些nix安装,解决了这些问题。
https://stackoverflow.com/questions/71214589
复制相似问题