Skip to content

chore(ci): run the nightly-only checks again and raise the serde floor - #853

Open
thatssoheil wants to merge 1 commit into
tokio-rs:masterfrom
thatssoheil:ci/minimal-versions-gate
Open

thatssoheil wants to merge 1 commit into
tokio-rs:masterfrom
thatssoheil:ci/minimal-versions-gate

Conversation

@thatssoheil

Copy link
Copy Markdown

Fixes #851.

ci/test-stable.sh gated its benchmark check and its minimal-versions check on
RUST_VERSION, and no workflow sets that variable - ci.yml sets RUSTFLAGS,
RUST_BACKTRACE and nightly, none of them RUST_VERSION. So the block at
ci/test-stable.sh:14 has never been entered since #452, in the nightly job
included.

This gates the block on the toolchain actually in use instead. The nightly job
runs rustup update $nightly && rustup default $nightly before invoking the
script (ci.yml), so rustc --version reports a nightly version there and a
stable version in the stable matrix. Nothing else changes for the stable
jobs.

Enabling the gate exposes the second half of the issue: the check fails on the
serde floor the manifest declares. -Z minimal-versions resolves serde
1.0.60, whose alloc feature does not compile under it:

error[E0432]: unresolved imports `alloc::BTreeMap`, `alloc::BTreeSet`,
`alloc::BinaryHeap`, `alloc::LinkedList`, `alloc::VecDeque`
   --> serde-1.0.60/src/lib.rs:192:21

So the floor moves to 1.0.70. That number is measured, not guessed - see below.

Both changes have to land together: enabling the gate alone turns the nightly
job red, and publish_docs needs nightly, so documentation would stop
publishing too.

Evidence

The gate is dead. Simulating the CI jobs with rustc/cargo shims that log
every invocation, ci/test-stable.sh as it stands on master makes exactly two
cargo calls under a nightly toolchain and never reaches the block; with this
change it makes six, including cargo check --benches,
cargo hack --remove-dev-deps --workspace, cargo update -Z minimal-versions
and cargo check --all-features. Under a stable toolchain it still makes two.

1.0.70 is the first working floor. In a scratch clone, with
cargo hack --remove-dev-deps --workspace emulated (the crate does not have
cargo-hack installed here) followed by cargo +nightly update -Z minimal-versions:

serde floor resolved cargo +nightly check --all-features
1.0.60 1.0.60 rc=101, E0432
1.0.69 1.0.69 rc=101, E0432
1.0.70 1.0.70 rc=0

cargo +nightly check --benches is rc=0 with the floor at 1.0.70.

Stable is unaffected. cargo test (248 passed), cargo test --all-features
and cargo test --no-default-features --features serde all pass on the change.
The manifest's rust-version is untouched, so the minrust job is unaffected.

One trade-off worth naming

If rustc were somehow unresolvable the condition would read as false and the
block would skip silently. That is the same shape of failure that produced this
issue, so it is worth a maintainer's eye; I kept it because by that point in the
script cargo has already run successfully under set -e, and because this is
the form the issue's own comment proposes. Happy to switch to
rustup show active-toolchain or an explicit command -v rustc guard if you
would rather not rely on the version banner.

Disclosure

AI-assisted (Hermes Agent, Nous Research). Every claim above was re-verified
against the real toolchains before opening this; I can walk through any line.

ci/test-stable.sh gated its benchmark and minimal-versions checks on a
RUST_VERSION environment variable that no workflow sets, so those two checks
have not run in CI since tokio-rs#452. Gate on the toolchain actually in use instead:
the nightly job switches the default toolchain before it runs the script, so
`rustc --version` is the authority and cannot go stale.

Running the check for the first time fails on the serde floor this crate
declares: -Z minimal-versions resolves serde 1.0.60, whose alloc feature does
not compile under it (E0432, unresolved imports alloc::BTreeMap, BTreeSet,
BinaryHeap, LinkedList and VecDeque). 1.0.69 fails identically and 1.0.70
compiles, so the floor becomes 1.0.70.

Verified locally with the nightly toolchain:

  cargo +nightly update -Z minimal-versions && cargo +nightly check --all-features
  cargo +nightly check --benches

both succeed at floor 1.0.70 and fail at 1.0.69. The stable matrix is
unaffected: cargo test, cargo test --all-features and cargo test
--no-default-features --features serde all pass.

Disclosure: AI-assisted (Hermes Agent, Nous Research); both claims above were
re-checked against the real toolchains before this commit.
Copilot AI lite review requested due to automatic review settings September 13, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

Updates nightly CI detection and raises the Serde minimum version so minimal-version checks pass.

Changes:

  • Detect nightly via rustc --version.
  • Raise the Serde floor from 1.0.60 to 1.0.70.
File summaries
File Description
ci/test-stable.sh Re-enables nightly benchmark and minimal-version checks.
Cargo.toml Updates the Serde dependency floor.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minimal-versions check skipped in CI since #452, and it fails on serde 1.0.60

2 participants