cache: Linux -> Mac & enableCrossOsArchive -> Cache not found for input keys
When creating a simple cache of downloaded content in my Linux steps, and caching it, each Linux machine has no problem mounting the created cache and reusing the content.
When the workflow gets to the OSX machine, it does not register a cache hit, and instead creates a new cache instance with the identical key.
Config:
Linux Machines (happy to use the cache):
- name: Ansible Lint -- Mount Ansible Cache
uses: actions/cache@v3
with:
enableCrossOsArchive: true
key: ansible-${{ hashFiles('./template/{{cookiecutter.profile_slug}}/profile/requirements.yml') }}-${{ env.CACHE_TTL }}
path: ansible_cache
OSX Machine (creates it’s own cache):
- name: Apply Profile -- Mount Ansible Cache
uses: actions/cache@v3
with:
enableCrossOsArchive: true
key: "ansible-${{ hashFiles('./template/{{cookiecutter.profile_slug}}/profile/requirements.yml') }}-${{ env.CACHE_TTL }}"
path: ansible_cache
Am I assuming functionality that does not exist?
Example Workflow Run: https://github.com/osx-provisioner/profile-generator/actions/runs/4197900167/jobs/7280858264
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 8
- Comments: 19 (2 by maintainers)
Here’s a temporary workaround for both Windows and macOS:
(see e.g. commit https://github.com/kleisauke/wasm-vips/commit/d475fb3b61f5b458fc444943dd035c1b42827f75)
I’ve added this step to my workflow as a temporary workaround
@rohanKanojia That won’t be helpful, due to the fact, that the hosted runner needs to get downgraded in the version of zstd until the issue is fixed here.
You can do this on hosted runner (Ubuntu):
I only tested it on ubuntu-20.04, but ubuntu-latest (22.04) should also have an older zstd version.
The issue need to be fixed here: https://raw.githubusercontent.com/actions/cache/main/dist/restore-only/index.js Line 1182:
@kleisauke mentioned the corresponding commit on zstd, thanks for that!
It looks like most (all?) of the GitHub hosted runners have updated to zstd 1.5.4, so they’re working together by falling back to gzip instead. However, we have some self hosted runners still on zstd 1.5.0, so now I’m using this workaround on Linux too.
… commit https://github.com/facebook/zstd/commit/9c93dd71cdb301595a8a9e364348967a173c010c seems to be the culprit (released in zstd 1.5.4)