-
Notifications
You must be signed in to change notification settings - Fork 96
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
[CI] Make Ubuntu 20.04 and 22.04 use different rust cache #197
Conversation
Signed-off-by: Jorge Prendes <[email protected]>
@Mossaka PTAL 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow nice catch! I was wondering why a cache messed up the glibc library on the build and this is exactly why!! 🤯
Just made one comment on the use of env
@@ -32,6 +32,8 @@ jobs: | |||
run: "mount | grep cgroup" | |||
- uses: actions/checkout@v3 | |||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be env-vars
according to this doc
I am confused how previous builds didn't hit this problem before #189 removed the cache as we weren't using any env vars to prefix the cache key to a verison of ubuntu before. |
It looks like it's still using the old cache key at this run |
IIUC, by default This was not a problem for #187 because it was bumping the crate with a build script, so it wasn't hitting the cache. #189 did hit the issue. |
The job is part of the cache key, so the fmt job doesn't share the cache with the builds. I didn't add any env-var there as it doesn't run in multiple OSes. |
I don't understand how I checked the action source code of |
I'm not sure how
Maybe another cleaner approach would be to disable cache in |
Thanks for the explaination! That makes a lot of sense.
This is the comment that explains it, which I missed! Thanks again. I can merge it right now if you want |
@jprendes good catch and thanks for helping track that one down 💯 |
Currently Ubuntu 20.04 and 22.04 are sharing the same cache.
This is a problem as 20.04 and 22.04 ship differente glibc versions.
This prevents the buil scripts compiled and cached in 22.04 from running in 20.04.
actions-rust-lang/setup-rust-toolchain@v1
usesSwatinem/rust-cache@v2
, which uses all environment variables matchingRUST*
as hash for the cache key. See the description ofenv-vars
here.This PR adds an environment variable
RUST_CACHE_KEY_OS
so that different OS use different caches.This fixes #193.