Narrow the ~/.cache directory to just nix and devbox
Why
We are using chmod u+s "$(command -v tar)" to setuid on tar (This is needed because we are caching /nix/ and other directories outside of ~, which is owned by root)
This has a problem where it changes the parent directory of ~/.cache/nix to be owned by root instead of runner.
What
This PR tries to reduce side effects by:
tar
command to its original stateWhy
We are using
chmod u+s "$(command -v tar)"
to setuid on tar (This is needed because we are caching/nix/
and other directories outside of~
, which is owned byroot
)This has a problem where it changes the parent directory of
~/.cache/nix
to be owned byroot
instead ofrunner
.I thought https://github.com/jetpack-io/devbox-install-action/pull/22 had fixed it, but we ran into similar issues when we use a go cache on top of the devbox cache.
Caveat
Cache enabled on self hosted Linux may stop working