fsquillace / junest

The lightweight Arch Linux based distro that runs, without root privileges, on top of any other Linux distro.
GNU General Public License v3.0
2.08k stars 111 forks source link

AUR packages having `cp -a` throw `failed to preserve ownership` #305

Closed DroidFreak32 closed 1 year ago

DroidFreak32 commented 1 year ago

For example package android-sdk-cmdline-tools-latest:

cp: failed to preserve ownership for '/home/rushab/.cache/yay/android-sdk-cmdline-tools-latest/pkg/android-sdk-cmdline-tools-latest/opt/android-sdk/cmdline-tools/latest/lib/profgen': Invalid argument
cp: failed to preserve ownership for '/home/rushab/.cache/yay/android-sdk-cmdline-tools-latest/pkg/android-sdk-cmdline-tools-latest/opt/android-sdk/cmdline-tools/latest/lib': Invalid argument
cp: failed to preserve ownership for '/home/rushab/.cache/yay/android-sdk-cmdline-tools-latest/pkg/android-sdk-cmdline-tools-latest/opt/android-sdk/cmdline-tools/latest': Invalid argument

However replacing them with cp -r works totally fine

onemoresuza commented 1 year ago

It seams to be a problem with packages which, in some way, try to either change or preserve the ownership of a file.

The AUR package heroic-games-laucher-bin fails, for instance, with tar throwing the following error:

tar: \<name-of-the-file>: Cannot change ownership to uid 0, gid 0: Invalid argument

Which I believe is caused by makepkg, since downloading the .pacman file for 2.5.2 and running the same tar command --- tar -xJv --- doesn't cause this issue.

Conobi commented 1 year ago

tar: : Cannot change ownership to uid 0, gid 0: Invalid argument

Which I believe is caused by makepkg, since downloading the .pacman file for 2.5.2 and running the same tar command --- tar -xJv --- doesn't cause this issue.

I found a (dirty) way to mitigate this. You just have to pass FAKEROOTDONTTRYCHOWN=true to your Junest environment If anybody has a better way of doing this, it would be appreciated!

onemoresuza commented 1 year ago

Thanks for the workaround!, @Donokami.

It seems that will be the way, at least for now, for installing AUR packages whose PKGBUILDs try to preserve the ownership of files, as is with the ones brought up in this thread: android-sdk-cmdline-tools-latest and heroic-games-launcher-bin.

fsquillace commented 1 year ago

Thanks! I am updating JuNest image to include the variable FAKEROOTDONTTRYCHOWN set to true by default. This will fix the problem permanently.