Skip to content

Cache saving fails on Windows #102

Closed

Description

@eregon

See https://github.com/ruby/setup-ruby/runs/1370892940?check_suite_focus=true

  Saving cache
  C:\msys64\usr\bin\tar.exe --posix --use-compress-program "zstd -T0" -cf cache.tzst -P -C D:/a/setup-ruby/setup-ruby --files-from manifest.txt --force-local
  /usr/bin/tar: vendor\bundle: Cannot stat: No such file or directory
  /usr/bin/tar: Exiting with failure status due to previous errors
  Warning: Tar failed with error: The process 'C:\msys64\usr\bin\tar.exe' failed with exit code 2

I guess this is due to using MSYS's tar and not one of the other tar.

It seems we get in this branch:
https://github.com/actions/toolkit/blob/e7eb2c741847a05686a1b8df93dea4b244640b17/packages/cache/src/internal/tar.ts#L16-L18
when probably we should be in this branch:
https://github.com/actions/toolkit/blob/e7eb2c741847a05686a1b8df93dea4b244640b17/packages/cache/src/internal/tar.ts#L20
or use the GNU tar but not MSYS's one.

cc @MSP-Greg

Activity

  1. eregon commented on Nov 8, 2020

    @eregon
    MemberAuthor

    One possible solution would be to save/restore the PATH around saving the cache, but it seems rather inconvenient.

  2. MSP-Greg commented on Nov 8, 2020

    @MSP-Greg
    Collaborator

    As you can see, there are a few utilities that exist both in 'Windows' and in MSYS2. I know they're trying to sort it out in the 'virtual-environments' repo, have to go look. I wish they'd hard coded the paths when that happens so the correct tool is chosen, rather then depending on Path...

  3. eregon commented on Nov 12, 2020

    @eregon
    MemberAuthor

    On https://github.com/eregon/setup-ruby/runs/1392737782?check_suite_focus=true#step:3:100 we can see the cache paths written to manifest.txt is ["vendor\\bundle"] but it should most likely uses / as separator for GNU tar.

  4. MSP-Greg commented on Nov 12, 2020

    @MSP-Greg
    Collaborator

    Sorry, I forgot to mention the backslashes. Almost all the MSFT programs/commands one would use in a shell (PowerShell or cmd) accept forward slashes...

  5. eregon commented on Nov 12, 2020

    @eregon
    MemberAuthor

    I filed an issue upstream: actions/toolkit#632

  6. eregon commented on Dec 12, 2020

    @eregon
    MemberAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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