rust - 为什么我的 rustup rust-toolchain 文件没有覆盖默认值?

标签 rust toolchain nightly-build rustup

我想使用 Rust“每晚”构建来与 Arrow 和 Datafusion 一起工作。根据this post和使用rust book我应该能够将一个 rust-toolchain 文件放在项目的主目录中,其中只包含单词“nightly”,这应该使它成为该项目的默认构建。但是,这不起作用。

有什么我遗漏的建议吗?

当我检查默认值时,我看到它使用的是“稳定”构建。

(base) Apples-MBP:data_fusion_tutorial Daniel$ rustup default
stable-x86_64-apple-darwin (default) 

这是我的项目目录:

(base) Apples-MBP:data_fusion_tutorial Daniel$ ls -a
.       ..      .git        .gitignore  Cargo.lock  Cargo.toml  rust-toolchain  src     target

如果我跑

rustup override set nightly

然后项目构建正常,但默认仍然是“稳定的”。

最佳答案

我遇到了类似的问题。

$ cat rust-toolchain.toml
[toolchain]
channel = "nightly"
$ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/n8henrie/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.50.0 (cb75ad5db 2021-02-10)

有趣的是,如果我删除 .toml 扩展名,它会起作用:

$ mv rust-toolchain{.toml,}
$ rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/n8henrie/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

active toolchain
----------------

nightly-aarch64-apple-darwin (overridden by '/path/to/cwd/rust-toolchain')
rustc 1.52.0-nightly (3a5d45f68 2021-03-09)

看起来 toml 扩展应该没问题,不知道为什么它不起作用:

In these cases the toolchain can be named in the project's directory in a file called rust-toolchain.toml or rust-toolchain.

https://rust-lang.github.io/rustup/overrides.html?#the-toolchain-file

它对我来说也适用于 nightly 这个词,所以我不确定为什么它对你不起作用,但似乎这里可能有一些怪癖。

也许您可以使用名为 rust-toolchain 的文件尝试 TOML 语法?

编辑:看起来 .toml 扩展名是 recent development ,也许本书的更新在工具更新之前发布。

EDIT2:最近的 rustup 版本是 20201202 的 1.23.1,这是我正在运行的,所以我的问题可能出在这里。您运行的是什么版本的 rustup?

https://github.com/rust-lang/rustup/releases

关于rust - 为什么我的 rustup rust-toolchain 文件没有覆盖默认值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65348882/

相关文章:

rust - 如何通过读取和转换文件来创建Stream?

android - 如何使用 Gradle 进行夜间构建?

python - 什么是行业广泛使用的持续集成工具,基于 Python 的程序的夜间构建系统

Rust:条件特征继承

arrays - 如何使用 ndarray 从向量的向量创建二维数组?

c++ - Visual Studio C++ 2012 和 2017 在随机数生成中显示不同的行为?

linux - ARM9 异常导致系统崩溃并生成核心转储

build-process - 为每晚构建保存哪些工件?

rust - 预期的 bool,在使用运算符 % 时发现 i32

iphone - 工具链问题 : How do you add a header/lib so the compiler knows where to find it?