[英]rust-embedded Discovery `05-led-roulette` fails to build
I am following this guide to build the projects in the corresponding repo .我正在按照本指南在相应的 repo中构建项目。 I successfully compiled, ran and verified project 03 .我成功编译、运行并验证了项目 03 。
However, following the instructions to build project 05 produces "error[E0463]: can't find crate for core
":但是,按照构建项目 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
This seems like an unexpected error, since it suggests that I'm missing the thumbv7em-none-eabihf
target toolchain, and yet project 03 would not have compiled correctly without this toolchain installed.这似乎是一个意外错误,因为它表明我缺少thumbv7em-none-eabihf
目标工具链,但如果没有安装此工具链,项目 03 将无法正确编译。
Can I fix something about my system to correctly build project 05?我可以修复我的系统以正确构建项目 05 吗? Or is there a bug in the project?还是项目有bug?
If anyone would like more information, please lmk in the comments and I can update this section with more outputs from my machine.如果有人想了解更多信息,请在评论中 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)
Turns out my rust toolchain was broken;原来我的 rust 工具链坏了; I originally installed everything with nix, but replacing some of the nix installs with rustup installs (ie, cargo) fixed the issues.我最初用 nix 安装了所有东西,但是用 rustup 安装(即 cargo)替换了一些 nix 安装解决了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.