oshazard / apacman

ArchLinux User Repository (AUR) helper and pacman wrapper
https://aur.archlinux.org/packages/apacman/
GNU General Public License v3.0
70 stars 11 forks source link

Issues building cockpit (npm package) #36

Open ramesh45345 opened 9 years ago

ramesh45345 commented 9 years ago

Running apacman as root (in this case, sudo apacman -Syu --noconfirm --needed) causes the cockpit package build to fail:

:: Starting full aur upgrade...

Aur Targets    (1): cockpit

:: Proceed with installation? [Y/n] 
==> Making package: cockpit 0.79-1 (Thu Oct  8 17:50:36 EDT 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading 0.79.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   129    0   129    0     0    703      0 --:--:-- --:--:-- --:--:--   701
100 3836k  100 3836k    0     0  3316k      0  0:00:01  0:00:01 --:--:-- 6418k
==> Validating source files with sha1sums...
    0.79.tar.gz ... Passed
==> Extracting sources...
  -> Extracting 0.79.tar.gz with bsdtar
==> Starting prepare()...
==> Starting build()...
++ dirname ../autogen.sh
+ srcdir=..
+ test -z ..
+ PKG_NAME=Cockpit
+ test -f ../src/ws/cockpit.service.in
++ pwd
+ olddir=/tmp/pkgbuild-0/cockpit/src/cockpit-0.79/build
+ cd ..
+ cd tools
+ npm install
npm ERR! Linux 4.2.2-1-ARCH
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v4.1.2
npm ERR! npm  v3.3.5
npm ERR! path /var/empty/.npm
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/var/empty/.npm'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, mkdir '/var/empty/.npm']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/var/empty/.npm',
npm ERR!   parent: 'CockpitDeps' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /tmp/pkgbuild-0/cockpit/src/cockpit-0.79/tools/npm-debug.log
==> ERROR: A failure occurred in build().
    Aborting...

==> ERROR: the build failed
  -> Status failed (1): cockpit
 local database is up to date

Looks like the nobody user doesn't have access to whatever folder npm is attempting to use. It also looks like fakeroot was not used either because the build() function was called instead of package(). This pacakge builds just fine as a normal user (who runs apacman -S cockpit).

Question: Perhaps this is most easily solved by having an option to use a particular uid (numeric user id or name) instead of the default nobody to build packages if apacman is called as root?

Alexander-Shukaev commented 7 years ago

Yet another package that fails for the same reason is arch-wiki-man. I also discovered that if ccache is used, then similar problem will happen due to /var/empty/.ccache (see #94). Looking forward to fix!