From 5a8a8e0f2744d3ba3c1b411c02347e2c78c9a360 Mon Sep 17 00:00:00 2001 From: dybucc <149513579+dybucc@users.noreply.github.com> Date: Sun, 31 May 2026 08:36:56 +0200 Subject: [PATCH] build: add `rust-toolchain.toml` file Previously, one would have to manually set an override in `rustup` for the `libc` repo if they weren't already using `nightly` as their default toolchain channel. This meant stuff that relies on unstable features like our `.rustfmt.toml` config would not work in those cases. Adding a `rust-toolchain.toml` should fix this by either automatically switching users to the `nightly` channel, or triggering a `rustup install` if their installation does not yet include it. --- .github/workflows/ci.yaml | 2 +- ci/install-rust.sh | 1 + rust-toolchain.toml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b38b889ac09ea..be783542c8386 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -55,7 +55,7 @@ jobs: # Here we use the latest stable Rust toolchain already installed by GitHub # Ideally we should run it for every target, but we cannot rely on unstable toolchains # due to Clippy not being consistent between them. - - run: cargo clippy --workspace --exclude libc-test --exclude ctest-test --all-targets -- -D warnings + - run: cargo +stable clippy --workspace --exclude libc-test --exclude ctest-test --all-targets -- -D warnings # This runs `cargo build --target ...` for all T1 and T2 targets` verify_build: diff --git a/ci/install-rust.sh b/ci/install-rust.sh index b40f1df4e7a54..f30446b9a397e 100755 --- a/ci/install-rust.sh +++ b/ci/install-rust.sh @@ -26,6 +26,7 @@ fi rustup set profile minimal rustup update --force "$toolchain" --no-self-update rustup default "$toolchain" +rustup override set "$toolchain" if [ -n "${TARGET:-}" ]; then echo "Install target" diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000000..5d56faf9ae08c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly"