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 110 forks source link

yay closes with an error when chown root is executed in pkgbuild #312

Closed Nidrop closed 1 year ago

Nidrop commented 1 year ago

I use ns mode. An error occurs when installing ungoogled-chromium-bin:

:: (1/1) Parsing SRCINFO: ungoogled-chromium-bin
==> Making package: ungoogled-chromium-bin 108.0.5359.124-1 (Wed Jan  4 14:30:10 2023)
==> Retrieving sources...
  -> Found ungoogled-chromium-108.0.5359.124-1-x86_64.pkg.tar.zst
==> Validating source files with sha256sums...
    ungoogled-chromium-108.0.5359.124-1-x86_64.pkg.tar.zst ... Passed
==> Making package: ungoogled-chromium-bin 108.0.5359.124-1 (Wed Jan  4 14:30:11 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found ungoogled-chromium-108.0.5359.124-1-x86_64.pkg.tar.zst
==> Validating source files with sha256sums...
    ungoogled-chromium-108.0.5359.124-1-x86_64.pkg.tar.zst ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting ungoogled-chromium-108.0.5359.124-1-x86_64.pkg.tar.zst with bsdtar
==> Sources are ready.
==> Making package: ungoogled-chromium-bin 108.0.5359.124-1 (Wed Jan  4 14:30:13 2023)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Removing existing $pkgdir/ directory...
==> Entering fakeroot environment...
==> Starting package()...
chown: changing ownership of '/home/user/.cache/yay/ungoogled-chromium-bin/pkg/ungoogled-chromium-bin/usr/lib/chromium/chrome-sandbox': Invalid argument
==> ERROR: A failure occurred in package().
    Aborting...
 -> error making: ungoogled-chromium-bin

Workaround: yay --editmenu -S ungoogled-chromium-bin and remove the line with chown.

fsquillace commented 1 year ago

I guess no much we can do here. In theory if you run the same chown command with sudo it should work:

sudo chown root <file>

This is because junest uses a fake sudo version based on fakeroot with FAKEROOTDONTTRYCHOWN set to true.

Nidrop commented 1 year ago

so for working package pkgbuild should be changed in any case. Closing the issue