-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Hello!
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.