Repository navigation
fix(nix): advance the rust-overlay pin to the toolchain's nightly, and gate the flake in CI - #1210
Closed
almightychang wants to merge 2 commits into
Closed
almightychang wants to merge 2 commits into
almightychang wants to merge 2 commits into
Conversation
`flake.nix` derives the toolchain from the checked-in pin with `fromRustupToolchainFile ./rust-toolchain.toml`, so the lock's `rust-overlay` revision has to know every nightly that file names. `fe616639d` moved the pin to `nightly-2026-08-28` without touching the lock, leaving `rust-overlay` at a 2026-05-09 revision that predates it. Every flake output then failed to evaluate with `Nightly 2026-08-28 is not available` -- the dev shell `CONTRIBUTING.md` recommends and the `cargo-oxide` package alike. Only the `rust-overlay` node moves. `nixpkgs` and every other input stay at their current revisions, so the shell's CUDA, LLVM, and support packages are unchanged and the fix is confined to the input that went stale. Verified on the updated lock: both `devShells.x86_64-linux.default` and `packages.x86_64-linux.cargo-oxide` evaluate, and `nix develop` reports rustc 1.100.0-nightly (e457a7b0d 2026-08-27) with LLVM 23.1.0 alongside CUDA 13.2.51 -- the toolchain `fe616639d` intended to pin. Signed-off-by: Sam <[email protected]>
The preceding commit fixed a lock that had fallen four months behind the nightly `rust-toolchain.toml` names. Nothing would have caught it: no workflow mentions Nix, so no job evaluates the flake. `scripts/check-toolchain-parity.sh` is the closest existing guard, and it is the wrong place for this. It compares copies of the pin's *text* -- the nested pin, the scaffold, the devcontainer, the book's quoted blocks -- while `flake.lock` instead has to be able to *resolve* the pin. The only comparison a text guard could make is the overlay's `lastModified` against the nightly's date, a proxy that passes whenever the dates happen to line up regardless of whether the flake works. Evaluating the flake checks the property that actually broke. It is also cheap: forcing the two output derivations builds no toolchain and takes about a second once the inputs are fetched, so the job's cost is installing Nix and fetching inputs. Both public outputs are covered, because the failure hit the dev shell `CONTRIBUTING.md` recommends and the `cargo-oxide` package alike. `check-flake` mirrors the gate locally but stays out of `check` and `check-guards`, which must keep running for contributors without Nix. The `check-guards` comment records that so the omission reads as a decision rather than the drift that comment exists to prevent. Signed-off-by: Sam <[email protected]>
Collaborator
|
Right diagnosis in #1209, and half of this is already in: main landed the same rust-overlay advance as 5944e11 shortly before this PR went up, which is why the branch now conflicts. #1209 is closed against that commit. Closing the PR because the remaining half, the CI gate, is a trade we don't want:
Appreciate the tight scoping of the lock bump itself (one input, no whole-lock churn); that matched what we landed independently. |
Contributor
Author
|
@nihalpasham |
3 of 4 tasks
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.
Summary
Fixes #1209. Every flake output fails to evaluate on
main:flake.nixderives its toolchain fromrust-toolchain.toml, butfe616639d(#1201) moved the pin tonightly-2026-08-28without updating the 2026-05-09rust-overlaylock revision. That revision predates the nightly, so both the dev shellCONTRIBUTING.md:123recommends and thecargo-oxidepackage fail witherror: Nightly 2026-08-28 is not available.This advances only
rust-overlayand adds the gate that would have caught the drift.Changes
flake.lock: advancerust-overlayfrom1d634a90(2026-05-09) to89e26eea(2026-08-30). No other node moves;nixpkgs, CUDA, LLVM, and support packages remain pinned. Advancing that one input is sufficient; a whole-lock bump is not needed..github/workflows/flake.yml: evaluate both public outputs without building the toolchain. No existing workflow evaluated the flake.Justfile: mirror the gate ascheck-flake, outsidecheckandcheck-guardsso contributors without Nix can still run them.Why a flake evaluation and not an extension of
check-toolchain-parity.shcheck-toolchain-parity.shcompares copies of the pin text: the nestedrustc-codegen-cudapin, thecargo oxide newscaffold, the devcontainer, and the book's quoted[toolchain]blocks.flake.lockis not another copy; its overlay must resolve the pin. ComparinglastModifiedwith the nightly date could pass when the dates align even if the flake does not work. Evaluating both output derivations tests the property that broke and builds no toolchain; the cost is installing Nix and fetching inputs, with evaluation taking about a second once cached.Testing
Before, on
8b41ac1b5:After, on this branch (
just check-flake; the store hashes depend on the source tree, the point is that both resolve):The shell also supplies the pinned rustc 1.100 / LLVM 23 toolchain and CUDA, and completes a workspace check:
just checkruns in the restored shell and gets throughfmt-check,clippy,test,test-cuda, and all ofcheck-guards. It stops incheck-intrinsics:That is not this change and not a missing
llc.intrinsics/catalog.jsonpins the probe backend by binary hash, and the recorded2e5bc688...is byte-for-byte thellcthat rustup ships fornightly-2026-08-28. The shell'sllcis the same nightly and reports the sameLLVM version 23.1.0-rust-1.100.0-nightly, but nixpkgs rewrites its ELF interpreter and RPATH into the store, so its hash cannot match. Anynix developshell hits this, before and after this PR. It does mean the environmentCONTRIBUTING.mdrecommends cannot run the repo's own probe validation; that is a separate problem and I have not touched it here.One standard example end to end in the same shell, on an RTX 5080:
The new workflow has never run on GitHub Actions; this PR's runs are
action_requiredpending maintainer approval. Locally, its two commands pass throughjust check-flake.cachix/install-nix-actionenablesnix-command flakesby default, so noextra_nix_configis needed. The action uses the exactv31.11.1release because no floatingv31tag exists, matching theJimver/[email protected]precedent.just checkpasses (the local mirror of CI: fmt, clippy, tests, guards, docs) (fmt, clippy, tests, CUDA tests and guards pass;check-intrinsicscannot pass inside anynix developshell, for the pre-existing reason above)cargo oxide run <example>passes, orscripts/smoketest.sh -o '^<example>$'(vecadd, in the restored shell, on hardware)Checklist
git commit -s)Out of scope, noted for the record
flake.nix:85still selectspkgs.llvmPackages_22while the pin uses rustc 1.100 with LLVM 23. It does not block evaluation and remains separate from this lock fix; #1209 records it.