Skip to content

Cache created on Linux is not restorable on Windows #2181

@mikolaj-matuszny-ext-sonarsource

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:

  1. Cache any files on Linux runner with enableCrossOsArchive enabled
  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions