Repository navigation
Closed
Description
I setup a CI pipeline where a linux job downloads files from a remote repository and puts them into a cache.
Then jobs on different platforms (linux, macos, windows) are started that reference the cache.
All jobs receive a cache hit but on Windows the downloaded cache archive is empty.
It looks like on Windows the filename cache.tgz is expected but on Linux and MacOS cache.tzst is used.
These are the logs I get for the jobs using the cache:
Linux:
------
Run actions/cache@v2
with:
path: .extensions
key: extensions-802592892
restore-keys: extensions-
Received 129569068 of 129569068 (100.0%), 136.2 MBs/sec
Cache Size: ~124 MB (129569068 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/8f4a3549-d2e9-4b85-a044-4c0d37f47d60/cache.tzst -P -C /home/runner/work/vitcode/vitcode
Cache restored successfully
Cache restored from key: extensions-802592892
MacOS:
------
Run actions/cache@v2
with:
path: .extensions
key: extensions-802592892
restore-keys: extensions-
Received 129569068 of 129569068 (100.0%), 45.9 MBs/sec
Cache Size: ~124 MB (129569068 B)
/usr/local/bin/gtar --use-compress-program zstd -d -xf /Users/runner/work/_temp/d133514d-3d07-4e10-8844-14d51d463fff/cache.tzst -P -C /Users/runner/work/vitcode/vitcode --delay-directory-restore
Cache restored successfully
Cache restored from key: extensions-802592892
Windows:
--------
Run actions/cache@v2
with:
path: .extensions
key: extensions-802592892
restore-keys: extensions-
Received 30 of 30 (100.0%), 0.0 MBs/sec
Cache Size: ~0 MB (30 B)
C:\Windows\System32\tar.exe -z -xf D:/a/_temp/7133fe6d-5fa6-462d-a494-8faa9cdd0b31/cache.tgz -P -C D:/a/vitcode/vitcode
Cache restored successfully
Cache restored from key: extensions-802592892
Pseudo pipeline config:
name: Build
jobs:
download-extensions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .extensions
key: extensions-${{ github.run_id }}
restore-keys: extensions-
- name: "Downloading Extensions"
shell: bash
run: ... # execute commands that download files to ./.extensions
build-on-linux:
runs-on: ubuntu-latest
needs: [ download-extensions ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .extensions
key: extensions-${{ github.run_id }}
- name: "Build"
# ... build software
build-on-macos:
runs-on: macos-latest
needs: [ download-extensions ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .extensions
key: extensions-${{ github.run_id }}
- name: "Build"
# ... build software
windows-amd64:
runs-on: macos-latest
needs: [ download-extensions ]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: .extensions
key: extensions-${{ github.run_id }}
- name: "Build"
# ... build softwareMetadata
Metadata
Assignees
Labels
No labels
Activity
sebthom commentedon May 2, 2021
As a workaround I am now adding the GNU tar to the PATH before downloading the cache on windows:
rfay commentedon May 6, 2021
Thanks for this. My solution (on self-hosted Windows runner) was to put
C:\Program Files\Git\usr\binearly in the system path on the Windows machine and restart the runner service.I also had to install zstd.exe in C:\Program Files\Git\usr\bin to get it to work.
@sebthom since you sorted this out, could you please retitle and add to the OP what you learned? A title like "restoring cache fails if GNU tar is not the default tar in $PATH" would help people sort this out.
[-]Sharing cache between Linux/MacOS and Windows is not working[/-][+]Restoring cache on Winodws created on Linux silently fails if GNU tar is not on Windows Path[/+][-]Restoring cache on Winodws created on Linux silently fails if GNU tar is not on Windows Path[/-][+]Restoring cache on Windows created on Linux silently fails if GNU tar is not on Windows Path[/+]github-actions commentedon May 5, 2022
This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days.
rfay commentedon May 5, 2022
Since this hasn't been addressed... it needs to stay alive.
Phantsure commentedon May 11, 2022
@rfay You can't use cache created on Linux (using GNU tar) on windows (using BSD tar) as BSD can't be used to untar file created by GNU tar, and vice-versa.
Can you confirm if the cache restored on windows is never created on windows, i.e. by using the same key?