Skip to content

Unpin Rust nightly in CI #6022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,23 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
RUSTUP_TOOLCHAIN: nightly-2025-07-18 # TODO: Set to "nightly" once https://github.com/rust-lang/rust/issues/144168 is fixed
NIGHTLY_CHANNEL: nightly
Comment on lines 351 to +352
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Prefer the built-in RUSTUP_TOOLCHAIN variable over a bespoke NIGHTLY_CHANNEL.

RUSTUP_TOOLCHAIN is understood by both cargo and rustup; setting it once eliminates the need to thread a custom variable through every command. Unless you have a strong reason to diverge, consider reverting to the canonical env-var.


🏁 Script executed:

#!/bin/bash
# Check for remaining references to the old variable that would now be dead code.
rg -n 'RUSTUP_TOOLCHAIN' .github/workflows

Length of output: 42


🏁 Script executed:

#!/bin/bash
# Verify all usages of the custom NIGHTLY_CHANNEL variable in CI workflows
rg -n 'NIGHTLY_CHANNEL' .github/workflows -A2

Length of output: 680


Replace custom NIGHTLY_CHANNEL with the built-in RUSTUP_TOOLCHAIN

To standardize on the canonical toolchain variable and avoid threading a bespoke env var through every command, update your CI workflow as follows:

• In .github/workflows/ci.yaml around line 352, rename the environment variable:

-    env:
-      NIGHTLY_CHANNEL: nightly
+    env:
+      RUSTUP_TOOLCHAIN: nightly

• In the Rust setup step (around line 358), point toolchain at the new var:

-        with:
-          toolchain: ${{ env.NIGHTLY_CHANNEL }}
+        with:
+          toolchain: ${{ env.RUSTUP_TOOLCHAIN }}

• In the Miri test step (around line 364), you can drop the +${…} prefix now that the default toolchain is set:

-        run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test -p rustpython-vm -- miri_test
+        run: cargo miri test -p rustpython-vm -- miri_test

This ensures both rustup and cargo honor your chosen nightly channel without a custom variable.

🤖 Prompt for AI Agents
In .github/workflows/ci.yaml around lines 351 to 364, replace the custom
environment variable NIGHTLY_CHANNEL with the built-in RUSTUP_TOOLCHAIN to
standardize the toolchain usage. Rename the env variable NIGHTLY_CHANNEL to
RUSTUP_TOOLCHAIN at line 352, update the Rust setup step near line 358 to use
the new RUSTUP_TOOLCHAIN variable for the toolchain setting, and modify the Miri
test step around line 364 to remove the '+${…}' prefix since the default
toolchain is now set via RUSTUP_TOOLCHAIN. This change ensures rustup and cargo
consistently use the specified nightly channel without a bespoke env var.

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUSTUP_TOOLCHAIN }}
toolchain: ${{ env.NIGHTLY_CHANNEL }}
components: miri

- uses: Swatinem/rust-cache@v2

- name: Run tests under miri
run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test -p rustpython-vm -- miri_test
env:
# miri-ignore-leaks because the type-object circular reference means that there will always be
# a memory leak, at least until we have proper cyclic gc
run: MIRIFLAGS='-Zmiri-ignore-leaks' cargo +${{ env.RUSTUP_TOOLCHAIN }} miri test -p rustpython-vm -- miri_test
MIRIFLAGS: '-Zmiri-ignore-leaks'

wasm:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
Expand Down
Loading