Skip to content
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

Feature request: support unpacking a cache generated with different UID/GID #33

Open
zyla opened this issue Nov 2, 2021 · 0 comments
Open

Comments

@zyla
Copy link

zyla commented Nov 2, 2021

When I try to unpack a cache created by an user with different UID or GID, I get this error:

cache-s3: /home/user/.stack: setOwnerAndGroup: permission denied (Operation not permitted)

This happens because tar-conduit tries to restore the original owner of the file when unpacking.

It's reasonable to ask why someone would need this. The use case is: we download caches from the CI system onto our development machines to speed up compilation after a branch change. The environment is compatible enough that it works, but sometimes we have different user or group IDs.

What would be the best way to implement this? I see several options:

  • Copy-paste restoreFile from tar-conduit, and remove changing permissions. Not elegant.
  • Modify the FileInfo passed to restoreFile and set UID/GID to the current user. This would work, but it seems like a hack.
  • Extend tar-conduit, adding an option to skip setting UID/GID.
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

1 participant