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