Skip to content

CI: use key-restore for cache GH action #2223

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

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

marxin
Copy link
Contributor

@marxin marxin commented Jan 25, 2025

It seems one can't overwrite a cache entry:

Failed to save: Unable to reserve cache with key linkcheck--0.8.1, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/master, Key: linkcheck--0.8.1, Version: 33f8fd511bed9c91c40778bc5c27cb58425caa894ab50f9c5705d83cb78660e0
Warning: Cache save failed.

A proper solution is to use restore-keys:
https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache

I tested that in the following Draft PR (#2222), with the following Action result:
https://github.com/rust-lang/rustc-dev-guide/actions/runs/12966946869/job/36168260759

@camelid

It seems one can't overwrite a cache entry:
```
Failed to save: Unable to reserve cache with key linkcheck--0.8.1, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/master, Key: linkcheck--0.8.1, Version: 33f8fd511bed9c91c40778bc5c27cb58425caa894ab50f9c5705d83cb78660e0
Warning: Cache save failed.
```

A proper solution is to use `restore-keys`:
https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
Copy link
Member

@camelid camelid left a comment

Choose a reason for hiding this comment

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

Thanks! Hopefully this fixes the rate-limit issues.

@camelid camelid merged commit e895255 into rust-lang:master Jan 26, 2025
1 check passed
@marxin marxin deleted the CI-cache-restore-key branch January 27, 2025 06:13
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