ci: pin Rust toolchain via rust-toolchain.toml and simplify CI#1868
Draft
AdilZouitine wants to merge 2 commits into
Draft
ci: pin Rust toolchain via rust-toolchain.toml and simplify CI#1868AdilZouitine wants to merge 2 commits into
AdilZouitine wants to merge 2 commits into
Conversation
The crate uses no nightly features, so the cibuildwheel overrides that install nightly via rustup were wasted CI time and a churn source. Pin stable + rustfmt + clippy via a rust-toolchain.toml at the repo root; rustup picks it up automatically on the first cargo invocation and installs the listed cross-compile targets too. The macOS and Windows runners ship with rustup preinstalled, so their before-build blocks collapse to `rustup show` (which still triggers toolchain-file resolution and logs the resolved channel/targets for the build record). Linux runners use the manylinux container which has no rust at all, so they install rustup with --default-toolchain=none and let the toolchain file pick the channel. Drops CARGO_NET_GIT_FETCH_WITH_CLI from the Linux env block; it was a setuptools-rust-era workaround that the maturin build no longer needs.
This was referenced May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & Why
Two related cleanups land together. First, the crate uses no nightly features (
grep -rn '#!\\[feature(' rust_src/returns nothing), so the cibuildwheel overrides that installed nightly Rust were wasted CI time and a source of nightly-churn flakes. Second, the right way to communicate the required toolchain to both developers and CI is arust-toolchain.tomlfile at the repo root: rustup reads it automatically on the firstcargoinvocation and installs the pinned channel and targets. Once that file exists, the cibuildwheelbefore-buildhooks collapse to "install rustup, then do nothing else".How
rust-toolchain.tomlat repo root:channel = "stable",components = ["rustfmt", "clippy"],profile = "minimal", and the three cross-compile targets we need (aarch64-apple-darwin,x86_64-apple-darwin,i686-pc-windows-msvc).pyproject.toml:--default-toolchain=none --profile=minimal. The toolchain file picks the channel and targets on firstcargoinvocation.rustup show(those runners come with rustup preinstalled;rustup showis enough to trigger the toolchain-file resolution and log the resolved state).CARGO_NET_GIT_FETCH_WITH_CLI = "true"from[tool.cibuildwheel.linux.environment]: setuptools-rust-era workaround the maturin build doesn't need.CLAUDE.md: one-line note next to theuv syncblock explaining the toolchain pin.No changes to
.github/workflows/; cibuildwheel readspyproject.tomldirectly.Testing
rustup showreports "stable-aarch64-apple-darwin (overridden by '…/rust-toolchain.toml')".cargo build --releaseandcargo bench --no-runbuild cleanly under the pinned channel.pypiworkflow on this branch viaworkflow_dispatchand confirm every matrix cell succeeds with the simplifiedbefore-buildblocks. (Linux × {manylinux, musllinux} × py311-py314 × {x86_64, aarch64}; macOS-15 × py311-py314; Windows-2025 × py311-py314.)Notes for reviewers
before-buildstill installs rustup because the manylinux container has no rust at all. macOS-15 and windows-2025 runners ship with rustup; for those, the override is justrustup showso the build log captures what's about to be used.workflow_dispatchrun on the PR branch is required to merge: the regular per-PRdev.ymldoesn't exercise the wheel build matrix.Stack
river._river_rustwith PyO3 submodulesParent: #1867 (PR 3). Child: #1869 (PR 5).