首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >生锈构建错误:未知数--json`‘选项`未来--公司

生锈构建错误:未知数--json`‘选项`未来--公司
EN

Stack Overflow用户
提问于 2022-05-04 09:07:27
回答 1查看 549关注 0票数 4

我正在尝试使用Rust为Adafruit线索构建一个基本的应用程序。

当使用外围设备访问箱(PAC)时,一切正常工作,但我想使用北欧半导体的HAL机箱。

我建立了一个非常基本的项目,使用他们的板条箱。在运行cargo build时,我得到以下错误(--verbose):

代码语言:javascript
运行
复制
    Updating crates.io index
   Compiling semver-parser v0.7.0
   Compiling cortex-m v0.7.4
   Compiling proc-macro2 v1.0.37
   Compiling nb v1.0.0
   Compiling unicode-xid v0.2.3
   Compiling syn v1.0.92
   Compiling vcell v0.1.3
   Compiling void v1.0.2
   Compiling bitfield v0.13.2
   Compiling cortex-m-rt v0.7.1
   Compiling critical-section v0.2.7
   Compiling typenum v1.15.0
info: syncing channel updates for 'nightly-2021-08-18-x86_64-unknown-linux-gnu'
   Compiling az v1.2.0
   Compiling nrf52840-pac v0.11.0
info: latest update on 2021-08-18, rust version 1.56.0-nightly (30a0a9b69 2021-08-17)
   Compiling fixed v1.15.0
   Compiling cfg-if v1.0.0
info: component 'rust-src' is up to date
info: component 'rust-std' for target 'riscv32imac-unknown-none-elf' is up to date
info: component 'rust-std' for target 'riscv32imc-unknown-none-elf' is up to date
info: component 'rust-std' for target 'thumbv6m-none-eabi' is up to date
info: component 'rust-std' for target 'thumbv7em-none-eabi' is up to date
info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date
warning: Force-skipping unavailable component 'rust-std-avr-specs/avr-atmpeg328p.json'
   Compiling bare-metal v1.0.0
error: unknown `--json` option `future-incompat`

   Compiling half v1.8.2
error: could not compile `critical-section`
warning: build failed, waiting for other jobs to finish...
error: build failed

我对Ubuntu20.04上的稳定工具链使用了rustup (使用nighly 2022-05-03不会将任何内容更改为错误消息)。Rustup版本的输出是:

代码语言:javascript
运行
复制
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.60.0 (7737e0b5c 2022-04-04)`

整个项目是可用的这里

我的.cargo/config.toml文件是:

代码语言:javascript
运行
复制
[build]
target = "thumbv7em-none-eabihf"
rustflags = [
  "-C", "link-arg=-Tlink.x",
]

Cargo.toml是:

代码语言:javascript
运行
复制
[package]
name = "hal-test"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cortex-m-rt = "0.7.1"
nrf52840-hal = "0.15.0"
panic-halt = "0.2.0"

src/main.rs文件是:

代码语言:javascript
运行
复制
#![no_std]
#![no_main]

use panic_halt as _;

#[cortex_m_rt::entry]
fn main() -> ! {
    loop {}
}

我试图遍历依赖树,但没有找到添加future-incompat选项的位置,因为它被多次传递给rustc,并且成功了。

我希望你能给我更多的建议,告诉你该往哪里看。

更新2022-05-06:在Ubuntu21.04上构建完全相同的工具链版本的项目,我将不得不进一步研究。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-09 07:09:27

这个问题是通过从rustup切换并使用推荐的运行外壳脚本(https://www.rust-lang.org/tools/install)的安装方法来解决的。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72110443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档