Skip to content

fix(ci): include flake.lock in rust-cache key - #160

Merged
hakula139 merged 1 commit into
mainfrom
fix/rust-cache-flake-lock-key
Dec 6, 2026
Merged

hakula139 merged 1 commit into
mainfrom
fix/rust-cache-flake-lock-key

Conversation

@hakula139

Copy link
Copy Markdown
Member

Summary

  • Include key: ${{ hashFiles('flake.lock') }} in both Swatinem/rust-cache@v2 steps (rust and msrv jobs) in .github/workflows/rust.yml.
  • When a consumer upgrades nixpkgs while keeping rust-toolchain.toml pinned, Swatinem/rust-cache@v2 previously restored the old NixOS release's target/ directory because Cargo.lock and rustc -Vv were unchanged, causing cached build-script binaries to fail on Linux with ENOENT due to stale /nix/store glibc PT_INTERP paths.
  • Adding flake.lock to the key input isolates both primary and restore keys across Nix input updates.

Test plan

  • nix develop -c run-hooks (all 21 hooks passed, including actionlint and check-yaml)
  • nix flake check --all-systems (all checks passed)

Related

When a consumer upgrades nixpkgs while keeping rust-toolchain.toml pinned, Swatinem/rust-cache@v2 restores the previous NixOS release target/ directory because Cargo.lock and rustc -Vv are unchanged. Cached build-script binaries then fail on Linux with ENOENT due to stale /nix/store glibc PT_INTERP paths.

Include hashFiles('flake.lock') in the rust-cache key for both the main and MSRV jobs so Nix toolchain or glibc changes invalidate the Cargo cache.
@hakula139 hakula139 added bug Unexpected behavior ci CI, build, and release automation labels Dec 6, 2026
@hakula139 hakula139 self-assigned this Dec 6, 2026
@hakula139
hakula139 merged commit 7df131b into main Dec 6, 2026
3 checks passed
@hakula139
hakula139 deleted the fix/rust-cache-flake-lock-key branch December 6, 2026 06:26
@hakula139 hakula139 mentioned this pull request Dec 6, 2026
4 tasks done
hakula139 added a commit that referenced this pull request Dec 6, 2026
## Summary

Prepare `v3.10.2` release notes in `CHANGELOG.md` and restore the
documented minimum `nixpkgs` version in `docs/flake.md` to `26.05`,
since this patch release introduces no breaking changes for `26.05`
callers while devkit's own `flake.nix` stays on `nixos-26.11`.

- **ci**: `setup-nix` uses `cachix/cachix-action` v18, which installs a
pinned Cachix CLI version (#157)
- **flake**: `devkit`'s default `nixpkgs` input tracks `nixos-26.11`,
while downstream repositories using `inputs.nixpkgs.follows` are
unaffected and the minimum supported `nixpkgs` release remains `26.05`
(#158)
- **ci**: `rust.yml` includes `flake.lock` in the `Swatinem/rust-cache`
key for both `rust` and `msrv` jobs (#160)

## Test plan

- [x] `nix run .#changelog -- v3.10.2` generated the draft from
`v3.10.1`
- [x] `nix develop -c run-hooks` passed (all 21 hooks)
- [x] `nix flake check --all-systems` passed
- [x] Commit and pre-push hooks passed

## Related

- Refs hakulab/nixos-config#659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior ci CI, build, and release automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant