-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
cargo
and rustup
get deleted when saving cache
#16
Comments
Yes that was intentional. Since Under the assumption that runners get a fresh snapshot every time they run, it was a safe thing to do. |
This is not a safe assumption in the case of self-hosted runners, I think? We at @NZXTCorp are interested in giving this action a try, but currently our self-hosted runners just call |
I think a reasonable workaround in that case is to move the files that are not supposed to be cached away, and back after saving the cache. |
@Swatinem thanks for this useful action! Would you be open to a PR that adds an option to not touch .cargo/bin? E.g., for the self-hosted runner case? |
Instead of an option to not touch Lines 72 to 86 in b8e72aa
|
I had the exact same idea:
I just never put in the effort to make that happen ;-) But feel free to contribute here. :-) |
Would it be possible to change the cache paths ( Line 237 in d30f114
.cargo/bin folder?With more granular paths, we should be able to get rid of all of those deletion commands Lines 49 to 69 in d30f114
Or is there anything I'm overlooking? Okay, so looking at it a bit more, which this approach one would have to
And probably also deal with the registry and git folders. |
Since we switched to running on self-hosted runners, we noticed that some jobs failed because they couldn't find the
cargo
executable anymore. After some digging, we noticed that after a successful run with this action on the same machine,.cargo/bin
was empty, which is normally wherecargo
andrustup
are installed (when installing the rustup.rs way at least).Looking through the code, it seems that
.cargo/bin
gets cleaned apart for the binaries it finds a matching crate for, which would end up removingcargo
andrustup
. Was this intentional? If so, should I be doing something differently?The text was updated successfully, but these errors were encountered: