生锈构建错误:未知`-json`选项`future-incompat`

发布于 2025-01-25 22:13:29 字数 3155 浏览 3 评论 0 原文

我正在尝试为

当使用外围访问板条箱(PAC)时,一切都可以正常工作,但是我想使用北欧半导体的HAL板条箱。

我设置了一个非常基本的项目,该项目使用他们的 nrf52840-hal crate 。运行货物构建时,我会收到以下错误(完整构建日志 ):

    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

我正在使用ubuntu上的稳定工具链使用Rustup 20.04(使用2022-05-03使用,不会将任何内容更改为错误消息)。 Rustup版本输出是:

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 文件是:

[build]
target = "thumbv7em-none-eabihf"
rustflags = [
  "-C", "link-arg=-Tlink.x",
]

cargo.toml is:

[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.rs 文件是:

#![no_std]
#![no_main]

use panic_halt as _;

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

我尝试尝试浏览依赖项树,但我未能找到此 future-incompat 选项的位置,因为它已经将其传递了很多次到 rustc 并成功。

我将感谢任何有关在哪里寻找的指示。

更新2022-05-06:在Ubuntu 21.04 Works上使用完全相同的工具链版本构建项目,我必须进一步研究。

I am trying to build a basic application for the Adafruit CLUE using Rust.

When using the peripheral access crate (PAC) everything works fine, but I would like to use the HAL crate from Nordic Semiconductors.

I set up a very basic project which uses their nrf52840-hal crate. When running cargo build, I get the following error (full build log with --verbose):

    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

I am using rustup with the stable toolchain on Ubuntu 20.04 (using nighly 2022-05-03 does not change anything to the error message). Rustup version output is:

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)`

The full project is available here.

My .cargo/config.toml file is:

[build]
target = "thumbv7em-none-eabihf"
rustflags = [
  "-C", "link-arg=-Tlink.x",
]

The Cargo.toml is:

[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"

and the src/main.rs file is:

#![no_std]
#![no_main]

use panic_halt as _;

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

I tried to go through the dependency tree but I failed to find where this future-incompat option is added, given that it is passed plenty of times to rustc and it succeeds.

I would appreciate any pointers as to where to look further.

Update 2022-05-06: building the project with the exact same toolchain version on Ubuntu 21.04 works, I'll have to investigate further.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

幸福丶如此 2025-02-01 22:13:29

通过从Rusup Snap切换并使用推荐的安装方法来解决该问题( https://www.rust-lang.org/tools/install )。

The issue was fixed by switching away from the rustup snap and using the recommended installation method of running the shell script (https://www.rust-lang.org/tools/install).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文