Skip to content

fix(ci): restore green CI — MSRV test run and clippy on current stable - #70

Merged
chipsenkbeil merged 3 commits into
mainfrom
fix/ci-msrv-and-clippy
Aug 29, 2026
Merged

chipsenkbeil merged 3 commits into
mainfrom
fix/ci-msrv-and-clippy

Conversation

@chipsenkbeil

@chipsenkbeil chipsenkbeil commented Aug 28, 2026 •

Copy link
Copy Markdown
Owner

Fixes the red CI on main (run 33142530648) without touching rust-version = "1.65.0".

1. MSRV job runs the full test suite again

The 1.65.0 rows were failing before compiling anything:

error: package `zmij v1.0.23` cannot be built because it requires rustc 1.71 or newer

zmij is transitive under serde_json, our only dev-dependency, and fixing it just exposes the next one — verified on a real 1.65.0 toolchain that itoa v1.0.18 (needs 1.68) and ryu v1.0.23 (needs 1.71) are queued behind it.

Cargo.toml pinning cannot fix this, which I checked rather than assumed. With serde_json = "=1.0.145" pinned exactly, cargo 1.65 still resolves:

crate resolved requires
serde_json 1.0.145 pinned, fine
itoa 1.0.18 1.68
ryu 1.0.23 1.71

A manifest constraint reaches direct dependencies only, and every crate that forces the newer compiler is transitive.

The fix uses cargo's MSRV-aware resolver, which lives in stable, not in 1.65:

- name: Lock dependencies to releases supporting Rust ${{ matrix.rust }}
  run: cargo +stable generate-lockfile
  env:
    CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS: fallback
- run: cargo +${{ matrix.rust }} test --locked ${{ matrix.flags }}

Stable honors the rust-version of every crate in the graph and picks serde_json 1.0.145, itoa 1.0.15, ryu 1.0.20. It also writes a v3 lockfile, which 1.65 can read, because it takes our declared rust-version into account. Nothing is pinned by hand, so this keeps working as serde_json's dependency set churns — it already swapped ryu for zmij once.

CI result: both MSRV rows now run the full suite and pass (3m3s / 2m49s), rather than only compiling the library.

2. Clippy on current stable

Two genuine leftovers, fixed rather than blanket-silenced:

  • extra_unused_lifetimes (11 sites, src/common/non_utf8/iter.rs) — Iter and Ancestors were bounded T: for<'enc> Encoding. Encoding takes no lifetime parameter, so the binder is vacuous; the Utf8Iter / Utf8Ancestors twins in src/common/utf8/iter.rs already use the plain form. Dropping it makes the two files mirror each other again, and the bound is semantically identical, so nothing breaks for callers.
  • byte_char_slices (src/unix/constants.rs:20) — given the same #[allow(clippy::byte_char_slices)] that windows::DISALLOWED_FILENAME_BYTES has carried since the Clippy 1.90 pass. The suggested *b"/\0" would break the visual parallel with DISALLOWED_FILENAME_CHARS on the next line.

3. Documentation

The --locked dance is not discoverable from the workflow alone, and a contributor running cargo +1.65.0 test by hand hits a resolution error with no hint why. Added a Development section to the README covering the test / fmt / clippy invocations CI gates on plus a Minimum supported Rust version subsection with the reproduction, and repeated the command in AGENTS.md.

Also corrected the rustc badge text, which read 1.58.1+ while the badge image and Cargo.toml both said 1.65.0.

Verification

Locally, on stable 1.98.0 and a real 1.65.0 toolchain:

  • cargo +1.65.0 test --locked --all-features — 369 doctests plus unit tests, all passing
  • cargo +1.65.0 test --locked --no-default-features — exit 0
  • cargo clippy --all-targets × {--all-features, --no-default-features} with RUSTFLAGS=-Dwarnings — exit 0
  • the same two clippy runs against --target x86_64-pc-windows-msvc, covering the #[cfg(windows)] code only the windows runner lints — exit 0
  • cargo test --all-features, cargo fmt --check — clean

All 17 CI checks green.

Answering "can cargo test imply --locked?"

No. I probed for it rather than guessing:

  • build.locked, net.locked, term.locked in .cargo/config.toml are all rejected as unused config key
  • an alias is ignored when it shadows a builtin: warning: user-defined alias 'test' is ignored, because it is shadowed by a built-in command

A non-shadowing alias (cargo tl = "test --locked") does work, but it cannot select the +1.65.0 toolchain, so it would not carry the MSRV run anyway. --locked stays explicit in the workflow and in the documented command.

Worth noting --locked is a guard rather than load-bearing here: 1.65 will happily reuse the generated lockfile without it. It is there so that a lockfile which stops satisfying the manifest fails loudly instead of quietly resolving back to releases that need a newer compiler.

https://claude.ai/code/session_01A5uCQTmXn119ATyfP27hfe

The 1.65.0 rows ran `cargo test`, which compiles dev-dependencies. serde_json
now pulls in zmij (needs 1.71) and itoa 1.0.18 (needs 1.68), so those rows
failed on a chain the crate does not expose to consumers. Move MSRV
verification into its own job that builds the library only -- what
`rust-version` actually promises.

Clippy 1.98.0 also flagged two real leftovers:

* `Iter` and `Ancestors` carried a `for<'enc> Encoding` bound whose binder
  is vacuous, since `Encoding` takes no lifetime parameter. Their `Utf8`
  counterparts already use the plain bound, so drop it here to match.
* `unix::DISALLOWED_FILENAME_BYTES` wants the same
  `#[allow(clippy::byte_char_slices)]` its windows sibling already carries,
  keeping the byte list parallel with `DISALLOWED_FILENAME_CHARS`.

Claude-Session: https://claude.ai/code/session_01A5uCQTmXn119ATyfP27hfe
Resolve the dependency graph under stable with
`CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback`, then hand the resulting
lockfile to 1.65.0 with `--locked`. Stable honors the `rust-version` of every
crate in the graph, so serde_json lands on 1.0.145 and itoa on 1.0.15 rather
than releases needing 1.71.

Pinning in Cargo.toml cannot do this: an exact `serde_json` pin still leaves
cargo 1.65 free to take itoa 1.0.18 and ryu 1.0.23, both of which are
transitive and out of reach of our manifest.

Claude-Session: https://claude.ai/code/session_01A5uCQTmXn119ATyfP27hfe
@chipsenkbeil chipsenkbeil changed the title fix(ci): keep MSRV and clippy jobs green without bumping rust-version fix(ci): restore green CI — MSRV test run and clippy on current stable Aug 28, 2026
@chipsenkbeil
chipsenkbeil force-pushed the fix/ci-msrv-and-clippy branch from fd96245 to eaba01e Compare August 29, 2026 02:09
The `--locked` dance the MSRV job performs is not discoverable from the
workflow alone, and a contributor running `cargo +1.65.0 test` by hand hits a
resolution failure with no hint as to why. Write it down in the README under a
new Development section, alongside the test, fmt and clippy invocations CI
gates on, and repeat the command in AGENTS.md.

Also correct the rustc badge text, which still read 1.58.1 while the badge
image and Cargo.toml both say 1.65.0.

Claude-Session: https://claude.ai/code/session_01A5uCQTmXn119ATyfP27hfe
@chipsenkbeil
chipsenkbeil force-pushed the fix/ci-msrv-and-clippy branch from eaba01e to 7d97e7c Compare August 29, 2026 02:28
@chipsenkbeil
chipsenkbeil merged commit 0fd79eb into main Aug 29, 2026
17 checks passed
@chipsenkbeil
chipsenkbeil deleted the fix/ci-msrv-and-clippy branch August 29, 2026 02:56
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.

1 participant