GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Cache save fails with Cygwin in PATH · Issue #1073 · actions/cache

Cache save fails with Cygwin in PATH #1073

New issue
Copy link
New issue
Copy link
Closed
Closed
Cache save fails with Cygwin in PATH#1073
Copy link
Assignees
lvpx

Description

@me-and
me-and
opened on Jan 13, 2023
Issue body actions

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.

Reacted by Jason Meisel and Søren Havelund Welling

Activity

  1. github-actions
    assigned
    tiwarishub
    on Jan 13, 2023
  2. me-and
    added a commit that references this issue on Jan 13, 2023

    Pin actions/cache to v3.2.0

    7abbfc2
  3. jbcallej commented on Jan 16, 2023

    @jbcallej
    jbcallej
    on Jan 16, 2023
    More actions

    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

  4. mmuetzel
    added a commit that references this issue on Jan 17, 2023

    CI (cygwin): Revert to cache action version 3.2.2

    6c52f95
  5. mmuetzel commented on Jan 17, 2023

    @mmuetzel
    mmuetzel
    on Jan 17, 2023
    Contributor
    More actions

    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
  6. mmuetzel
    added a commit that references this issue on Jan 18, 2023

    CI (cygwin): Revert to cache action version 3.2.2

    32bef71
  7. siko1056
    added a commit that references this issue on Jan 18, 2023

    GitHub-CI (cygwin): Revert to cache action version 3.2.2.

    f6f22ae
  8. bishal-pdMSFT commented on Jan 19, 2023

    @bishal-pdMSFT
    bishal-pdMSFT
    on Jan 19, 2023
    More actions

    @Phantsure @pdotl

  9. sebthom commented on Jan 19, 2023

    @sebthom
    sebthom
    on Jan 19, 2023
    More actions

    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"     
  10. me-and commented on Jan 19, 2023

    @me-and
    me-and
    on Jan 19, 2023
    ContributorAuthor
    More actions

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

  11. lvpx
    assigned
    lvpx
    and unassigned
    tiwarishub
    on Jan 20, 2023
  12. jbcallej commented on Jan 20, 2023

    @jbcallej
    jbcallej
    on Jan 20, 2023
    More actions

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

  13. andreasabel
    added 7 commits that reference this issue on Feb 12, 2023

    CI mac/win: do not add MSYS2 to PATH (breaks caching)

    53b4d09

    CI mac/win: do not add MSYS2 to PATH (breaks caching)

    8b45255

    CI mac/win: do not add MSYS2 to PATH (breaks caching)

    718756d

    CI mac/win: do not add MSYS2/usr/bin to PATH (breaks caching)

    bdb7853

    CI mac/win: do not add MSYS2/usr/bin to PATH (breaks caching)

    b3c58bd

    [ workflows ] Fix #6501: care with MSYS2 PATH; use pkg-config for ICU…

    30eeac2

    [ workflows ] Fix #6501: care with MSYS2 PATH; use pkg-config for ICU…

    9edadae
  14. dscho commented on Feb 21, 2023

    @dscho
    dscho
    on Feb 21, 2023
    More actions

    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?

  15. Phantsure commented on Mar 1, 2023

    @Phantsure
    Phantsure
    on Mar 1, 2023
    Contributor
    More actions

    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

    Reacted by Johannes Schindelin
  16. Phantsure
    closed this as completedon Mar 1, 2023
  17. mtmiller
    added a commit that references this issue on Oct 16, 2023

    GitHub-CI (cygwin): Revert to cache action version 3.2.2.

    727e5a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lvpx
    lvpx

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.