Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay CI cache restore until the toolchain has been installed. #732

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

xStrom
Copy link
Member

@xStrom xStrom commented Nov 4, 2024

The cache action's docs state:

selecting a toolchain either by action or manual rustup calls should happen before the plugin, as the cache uses the current rustc version as its cache key

In practice we weren't affected too much, because it turns out the cache key is also derived using all environment variables that have the prefix RUST, which includes e.g. our RUST_STABLE_VER. So even if the key was derived using the CI runner's pre-installed old Rust toolchain, our env variable prevented most conflicts.

The cache docs also state that it does not cache, by cleaning the following:

Any files in ~/.cargo/bin that were present before the action ran (for example rustc).

As we were installing the toolchain after the cache action, the potential for caching the toolchain seems there. However the cache size hasn't changed after this ordering change. Perhaps it does a simple path check only and the pre-installed toolchain was in the same path.

In any case, better to invoke the cache action after the toolchain has been installed, as the docs suggest.

@xStrom xStrom marked this pull request as ready for review November 4, 2024 12:48
@xStrom xStrom added this pull request to the merge queue Nov 4, 2024
Merged via the queue into linebender:main with commit 4ef3513 Nov 4, 2024
17 checks passed
@xStrom xStrom deleted the cacheorder branch November 4, 2024 13:08
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