cache icon indicating copy to clipboard operation
cache copied to clipboard

windows-latest cache is not compatible with windows-11-arm

Open pedrolcl opened this issue 6 months ago • 3 comments

Using actions/cache/save@v4 in jobs under windows-11-arm, even when using enableCrossOsArchive: true, results in "Cache not found for input keys" when trying to restore the cache key in other OS using actions/cache/restore@v4, and vice-versa.

This minimal project's pull request illustrates the problem: https://github.com/pedrolcl/cachetest/actions/runs/15818554368/job/44582204888?pr=1 The result is that two caches are produced with the same key: https://github.com/pedrolcl/cachetest/actions/caches?query=key%3Asoundfont.dls

Image

The problem seems to be that in the windows-11-arm image zstd is omitted, so the gzip method is used instead. Every other image, like Windows-2022, has zstd and it is the preferred method. Funny thing is that the gzip cache version is smaller than the zstd one in this case.

Is there any known workaround for this? If not, maybe we could request another input for "preferred compression method"?

pedrolcl avatar Jun 23 '25 10:06 pedrolcl

Your analysis is exactly right and I once again am bit by this problem too.

That the "version" is lower is irrelevant, it is just a hash value calculated over the cache paths, the compression method and the setting for enableCrossOsArchive.

Years ago I already requested the configurable compression method you suggested in #389, unfortunately it was denied in favor of enableCrossOsArchive. Unfortunately, as you already found out, this does not work for this scenario. :-( Let's hope that they either finally add the possibility to select the compression method explicitly, or at least fix the enableCrossOsArchive flag for the current situation.

Only work-around I'm aware of is to not use the cache, but publish what you want to restore as artifact and then download the artifact. Drawback is, that you cannot delete artifacts once they were published, or at least it was not possible back then.

Vampire avatar Jul 02 '25 17:07 Vampire

As I just found in https://github.com/actions/partner-runner-images/issues/99, you can add a run-step with choco install zstandard to add zstd. With that I was able to restore the cache that was saved on the windows-latest runner. :-)

Vampire avatar Jul 03 '25 00:07 Vampire

Big thanks to @Vampire : the workaround worked perfectly !!!

Simply adding this step before a cache operation:

  - name: 'Workaround for missing zstd in windows-11-arm'
    if: matrix.os == 'windows-11-arm'
    run: choco install zstandard

pedrolcl avatar Jul 03 '25 04:07 pedrolcl