Skip to content

ci: key Rust cache on resolved Python version#1554

Merged
brianstrauch merged 2 commits into
mainfrom
ci-rust-cache-python-key
May 22, 2026
Merged

ci: key Rust cache on resolved Python version#1554
brianstrauch merged 2 commits into
mainfrom
ci-rust-cache-python-key

Conversation

@brianstrauch
Copy link
Copy Markdown
Member

@brianstrauch brianstrauch commented May 21, 2026

Summary

  • The Swatinem/rust-cache key didn't include Python's patch version, so when the GitHub runner image bumped Python (e.g. 3.14.4 → 3.14.5) the restored build artifacts kept absolute LIBPATH entries pointing at the prior install dir and the link step failed with LNK1181: cannot open input file 'python3.lib' (observed on Windows in run 26251630920).
  • Reorder setup-python to run before rust-cache in each workflow and append env.pythonLocation (the full install path, which includes the patch version) to the cache key. Applied to all four rust-cache uses in ci.yml plus build-binaries.yml and run-bench.yml.

Test plan

  • CI passes on this PR (which will populate fresh caches under the new keys).
  • Confirm the Windows build-lint-test job no longer references a stale Python path in its linker invocation.

The Swatinem/rust-cache key didn't include Python's patch version, so when
the runner image bumped Python (e.g. 3.14.4 -> 3.14.5) the restored build
artifacts kept absolute LIBPATH entries pointing at the prior install dir
and the link step failed with LNK1181 looking for python3.lib in the old
3.14.4 path. Reorder setup-python before rust-cache so its output is
available, and append the full python-version to the cache key.
@brianstrauch brianstrauch requested a review from a team as a code owner May 21, 2026 23:19
Copy link
Copy Markdown
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

Nice find!

Replace the steps-output approach with the env var setup-python sets
automatically, removing the need to assign each step an id.
@brianstrauch brianstrauch enabled auto-merge (squash) May 21, 2026 23:27
@brianstrauch brianstrauch merged commit 595e4dc into main May 22, 2026
35 of 39 checks passed
@brianstrauch brianstrauch deleted the ci-rust-cache-python-key branch May 22, 2026 03:35
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.

2 participants