8000 Cache save fails with Cygwin in PATH · Issue #1073 · actions/cache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cache save fails with Cygwin in PATH #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
me-and opened this issue Jan 13, 2023 · 8 comments
Closed

Cache save fails with Cygwin in PATH #1073

me-and opened this issue Jan 13, 2023 · 8 comments
Assignees

Comments

@me-and
Copy link
Contributor
me-and commented Jan 13, 2023

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.

me-and added a commit to me-and/cygwin-install-action that referenced this issue Jan 13, 2023
This pre-dates the problems introduced in v3.2.1, reported at
actions/cache#1073.
@jbcallej
Copy link

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 added a commit to mmuetzel/octave that referenced this issue Jan 17, 2023
That version was before the changes causing the issue described in
actions/cache#1073
were merged again.
@mmuetzel
Copy link
Contributor

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

mmuetzel added a commit to mmuetzel/octave that referenced this issue Jan 18, 2023
That version was before the changes causing the issue described in
actions/cache#1073
were merged again.
siko1056 pushed a commit to gnu-octave/octave that referenced this issue Jan 18, 2023
* .github/workflows/make.yaml (cygwin): Recent changes to the cache action made
it incompatible with Cygwin.
See also: actions/cache#1073
Revert to a version of the action that was still working with Cygwin.
@bishal-pdMSFT
Copy link
Contributor

@Phantsure @pdotl

@sebthom
Copy link
sebthom commented 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
Copy link
Contributor Author
me-and commented Jan 19, 2023

@sebthom sadly I'd rather use GNU tar if possible: I'm not sure if it's because it's using zstandard over gzip, or just that Windows' tar implementation is less performant, but I've found it to be much more efficient based on my not-yet-very-scientific testing using the cache-perf.yml action at https://github.com/me-and/cygwin-install-action/tree/cache-wip. And just hiding Cygwin's tar doesn't help.

@lvpx lvpx assigned lvpx and unassigned tiwarishub Jan 20, 2023
@jbcallej
Copy link

@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"

andreasabel added a commit to andreasabel/text-icu that referenced this issue Feb 12, 2023
See: actions/cache#1073

We rather invoke pacman in its absolute location.
andreasabel added a commit to andreasabel/text-icu that referenced this issue Feb 12, 2023
See: actions/cache#1073

We rather invoke pacman in its absolute location.
andreasabel added a commit to andreasabel/text-icu that referenced this issue Feb 12, 2023
See: actions/cache#1073

We rather invoke pacman in its absolute location.
andreasabel added a commit to andreasabel/text-icu that referenced this issue Feb 12, 2023
See: actions/cache#1073

We rather only add this path locally when we invoke pacman.
andreasabel added a commit to andreasabel/text-icu that referenced this issue Feb 12, 2023
See: actions/cache#1073

We rather only add this path locally when we invoke pacman.
andreasabel added a commit to agda/agda that referenced this issue Feb 12, 2023
…_VER

Do not add the MSYS /usr/bin PATH globally because it disrupts the
cache action, see: actions/cache#1073

Only add this path locally for calling pacman.

The /mingw64/bin PATH is benign; we add it globally so pkg-config can
be invoked anytime (directly and from cabal).
We use pkg-config (rather than uconv) to get the ICU version.
andreasabel added a commit to agda/agda that referenced this issue Feb 12, 2023
…_VER

Do not add the MSYS /usr/bin PATH globally because it disrupts the
cache action, see: actions/cache#1073

Only add this path locally for calling pacman.

The /mingw64/bin PATH is benign; we add it globally so pkg-config can
be invoked anytime (directly and from cabal).
We use pkg-config (rather than uconv) to get the ICU version.
@dscho
Copy link
dscho commented 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
Copy link
Contributor

I re-ran the workflow used by author: https://github.com/Phantsure/macos-cache-slowness/actions/runs/4301183995
It seems to have resolved the issue now. Seems okay to close the issue

Thanks @dscho

mtmiller pushed a commit to mtmiller/octave that referenced this issue Oct 16, 2023
* .github/workflows/make.yaml (cygwin): Recent changes to the cache action made
it incompatible with Cygwin.
See also: actions/cache#1073
Revert to a version of the action that was still working with Cygwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants
0