GeezerVison is showing github.com — Cache save fails with Cygwin in PATH · Issue #1073 · actions/cache
Cache save fails with Cygwin in PATH #1073DescriptionHello!
Currently, this action will fail to store a cache on a Windows runner that has Cygwin binaries installed and in the PATH. I've produced a simple repository reproducing the problem on GitHub runners, at https://github.com/me-and/repro-cygwin-cache-woe, where the error is as follows:
"C:\Program Files\Git\usr\bin\tar.exe" --posix -cf cache.tzst --exclude cache.tzst -P -C D:/a/repro-cygwin-cache-woe/repro-cygwin-cache-woe --files-from manifest.txt --force-local --use-compress-program "zstd -T0"
/usr/bin/tar: cache.tzst: Cannot write: Broken pipe
/usr/bin/tar: Child returned status 127
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Failed to save: "C:\Program failed with error: The process 'C:\Program Files\Git\usr\bin\tar.exe' failed with exit code 2
Warning: Cache save failed.
(That's taken from this run on the main branch)
The issue appears to be that the action (and the cache code in general) is hard-coded to use the version of tar that's included with Git for Windows, but it isn't hardcoded to only use all the libraries and so forth that tar needs from the same place. If I install an old version of Cygwin – specifically one using the same old version of the cygwin1.dll library that Git for Windows is still based on – things start working again.
Bisecting the failure shows the problem was introduced at 9b0be58.
This seems plausibly related to actions/toolkit#1311, which is the same error, and presumably has a similar trigger, but which is apparently not caused by Cygwin being in the PATH. Reacted by Jason Meisel and Søren Havelund Welling Activityjbcallej commented on Jan 16, 2023 Having the same issue on my self hosted runner. Tar.exe is running from C:\Program Files\Git\usr\bin\tar.exe instead of C:\Windows\System32\tar.exe since #1039. I tried adding C:\Windows\System32 to PATH but didn't help either.
Fail log:
Post job cleanup.
"C:\Program Files\Git\usr\bin\tar.exe" --posix -cf cache.tgz --exclude cache.tgz -P -C C:/myPath --files-from manifest.txt --force-local -z
/bin/sh: gzip: command not found
/usr/bin/tar: cache.tgz: Cannot write: Broken pipe
/usr/bin/tar: Child returned status 127
/usr/bin/tar: Error is not recoverable: exiting now
Warning: Failed to save: "C:\Program failed with error: The process 'C:\Program Files\Git\usr\bin\tar.exe' failed with exit code 2
Previous passing log:
Post job cleanup.
C:\WINDOWS\System32\tar.exe --posix -z -cf cache.tgz --exclude cache.tgz -P -C C:/myPath --files-from manifest.txt
Cache Size: ~35 MB (36906119 B)
Cache saved successfully
Cache saved with key: keyName-hash
mmuetzel commented on Jan 17, 2023 It looks like the changes causing this issue were reverted for v3.2.2 here:
#1049
But merged back in for v3.2.3 here:
#1056 Reacted by Jason Meisel, myildiz-axendo and niekvanderreest Reacted by Søren Havelund Welling bishal-pdMSFT commented on Jan 19, 2023 sebthom commented on Jan 19, 2023 Dirty workaround as last step:
- name: Remove cygwin/msys2 tar binaries
shell: bash
run: |
# https://github.com/actions/cache/issues/1073
rm -rfv \
/usr/bin/tar \
"/cygdrive/c/Program Files/Git/usr/bin/tar.exe" me-and commented on Jan 19, 2023 ContributorAuthor More actions jbcallej commented on Jan 20, 2023 @sebthom thanks, this worked for me. Once it did not find "C:\Program Files\Git\usr\bin\tar.exe", it had to fall back to "C:\WINDOWS\System32\tar.exe" dscho commented on Feb 21, 2023 I hope that this is no longer an issue, since Git for Windows v2.39.2 shipped with a fix that is supposed to prevent its MSYS2 runtime from trying to use Cygwin's cygheap.
If it still is an issue, could you test replacing the msys-2.0.dll with the version from the msys2-runtime-3.3.6-4-x86_64.pkg.tar.zst archive contained in the msys2-packages.zip from this build? Phantsure commented on Mar 1, 2023 Reacted by Johannes Schindelin
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|