Cache created on Linux is not restorable on Windows
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
we've noticed some inconsistencies with how cache behaves with setting enableCrossOsArchive to true:
- cache created on Windows can be restored on Linux
- cache created on Linux cannot be restored on Windows
I suspect that this might be related to the compression method that's being used as it's also included in the cache file path. Linux uses zstdmt for compression but Windows uses zstd -T0 command.
// actions/toolkit/packages/cache/src/internal/tar.ts // getCompressionProgram() does NOT receive enableCrossOsArchive parameter return ['--use-compress-program', IS_WINDOWS ? '"zstd -T0"' : 'zstdmt']
The testing was done on standard ubuntu-latest and windows-latest GitHub hosted runners.
Are you aware of the issue?
To Reproduce
Steps to reproduce the behavior:
- Cache any files on Linux runner with enableCrossOsArchive enabled
- Restore cache created on Linux on Windows runner - this step fails
Expected behavior
Cache created on Linux is restorable on Windows and the other way around.
Are you aware of this issue?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read actions/toolkit/packages/cache/src/internal/tar.ts and inspect getCompressionProgram(), especially the platform-specific compression commands. Reproduce the Linux-to-Windows restore failure with enableCrossOsArchive enabled, then verify that caches created on both platforms restore successfully across operating systems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100