actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.59k stars 1.23k forks source link

Cache not working on macOS #948

Closed rsubtil closed 2 years ago

rsubtil commented 2 years ago

Today the CI started failing for macOS systems. I need to obtain a MacOS SDK from a macOS instance, and then pass it to an Ubuntu instance for cross-compilling libraries.

For that I used cache: I firstly extract the MacOS SDK and upload it to a cache directory. The Ubuntu instance then receives that cache and can start compilling.

This worked without issue a few months ago, but as of today it doesn't. It looks like the macOS instances are successfully uploading the cache as it reports a 51MB size: image

And the cache is being received on the Ubuntu instance, also reporting that 51MB size: image

However, the cached files never appear (it should be MacOSX12.3.sdk.tar.xz): image

Here's one such failed run. And the CI file is available here.

I've tried:

The cache is working on the other system builds (Windows and Linux) which run exclusively on Ubuntu instances, however. If this is an issue with the macOS runner itself, I can move the issue there.

rsubtil commented 2 years ago

Seems like the paths work differently. From what I've gathered, macOS starts with ~ (/Users/runner), while Linux starts on project work dir (e.g. /home/runner/work/retrohub/retrohub).

I claimed this worked before but it's likely I had an old cache that was created using artifacts. Because it got evicted it now had a mismatch on paths.

Either way, it's solved, so I'll close this.