From owner-freebsd-ports@freebsd.org Sun Feb 25 07:20:39 2018 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74130F1E622 for ; Sun, 25 Feb 2018 07:20:39 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id EB7166FC3D for ; Sun, 25 Feb 2018 07:20:38 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by mailman.ysv.freebsd.org (Postfix) id B062CF1E621; Sun, 25 Feb 2018 07:20:38 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 894F9F1E620 for ; Sun, 25 Feb 2018 07:20:38 +0000 (UTC) (envelope-from adamw@adamw.org) Received: from apnoea.adamw.org (apnoea.adamw.org [104.225.5.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "apnoea.adamw.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1CE46FC22 for ; Sun, 25 Feb 2018 07:20:31 +0000 (UTC) (envelope-from adamw@adamw.org) Received: by apnoea.adamw.org (OpenSMTPD) with ESMTPSA id ae5ef9f2 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sun, 25 Feb 2018 00:20:22 -0700 (MST) Content-Type: text/plain; charset=us-ascii; delsp=yes; format=flowed Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: poudriere: "Permission denied" in the extract phase? From: Adam Weinberger In-Reply-To: Date: Sun, 25 Feb 2018 00:20:20 -0700 Cc: ports@FreeBSD.org Content-Transfer-Encoding: 7bit Message-Id: <371FB508-F90E-41E4-8B3D-85F7DA54FFAA@adamw.org> References: To: Marcin Cieslak X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 07:20:39 -0000 > On 24 Feb, 2018, at 19:53, Marcin Cieslak wrote: > > On Sun, 25 Feb 2018, Marcin Cieslak wrote: > >> Hello, >> >> why is poudriere on 11.1-STABLE trying to build by custom port which has >> the following >> in the Makefile: >> >> post-fetch: >> ${MKDIR} ${DISTDIR}/${PORTNAME} >> ${MKDIR} ${NPM_CACHE} >> ${CP} ${FILESDIR}/package-lock.json ${DISTDIR}/${PORTNAME} >> ${CP} ${FILESDIR}/package.json ${DISTDIR}/${PORTNAME} >> (cd ${DISTDIR}/${PORTNAME} && ${SETENV} NPM_CONFIG_CACHE=${NPM_CACHE} npm install --ignore-scripts) >> >> ( complete port: >> https://github.com/saper/ports-exp/tree/master/textproc/node-sass ) >> >> The results are those: > ( this was wrong, the full log is also corrected ) > > ===> Returning to build of node-sass-4.7.2 > =========================================================================== > =================================================== > ===> License MIT accepted by the user > ===> Fetching all distfiles required by node-sass-4.7.2 for building > /bin/mkdir -p /portdistfiles/node-sass > /bin/mkdir -p /portdistfiles/npm > /bin/cp /usr/ports/textproc/node-sass/files/package-lock.json > /portdistfiles/node-sass > /bin/cp /usr/ports/textproc/node-sass/files/package.json > /portdistfiles/node-sass > (cd /portdistfiles/node-sass && /usr/bin/env > NPM_CONFIG_CACHE=/portdistfiles/npm npm install --ignore-scripts) > npm WARN lifecycle node-sass@4.7.2~install: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 node scripts/install.js /portdistfiles/node-sass > npm WARN lifecycle node-sass@4.7.2~postinstall: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 node scripts/build.js /portdistfiles/node-sass > npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are > deprecated. > npm WARN prepublish-on-install Use `prepare` for build steps and > `prepublishOnly` for upload-only. > npm WARN prepublish-on-install See the deprecation note in `npm help > scripts` for more information. > npm WARN lifecycle node-sass@4.7.2~prepublish: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 not-in-install && node scripts/prepublish.js || > in-install /portdistfiles/node-sass > added 356 packages in 10.684s > =========================================================================== > =================================================== > ===> License MIT accepted by the user > ===> Fetching all distfiles required by node-sass-4.7.2 for building > /bin/mkdir -p /portdistfiles/node-sass > /bin/mkdir -p /portdistfiles/npm > /bin/cp /usr/ports/textproc/node-sass/files/package-lock.json > /portdistfiles/node-sass > /bin/cp /usr/ports/textproc/node-sass/files/package.json > /portdistfiles/node-sass > (cd /portdistfiles/node-sass && /usr/bin/env > NPM_CONFIG_CACHE=/portdistfiles/npm npm install --ignore-scripts) > npm WARN lifecycle node-sass@4.7.2~install: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 node scripts/install.js /portdistfiles/node-sass > npm WARN lifecycle node-sass@4.7.2~postinstall: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 node scripts/build.js /portdistfiles/node-sass > npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are > deprecated. > npm WARN prepublish-on-install Use `prepare` for build steps and > `prepublishOnly` for upload-only. > npm WARN prepublish-on-install See the deprecation note in `npm help > scripts` for more information. > npm WARN lifecycle node-sass@4.7.2~prepublish: cannot run in wd %s %s > (wd=%s) node-sass@4.7.2 not-in-install && node scripts/prepublish.js || > in-install /portdistfiles/node-sass > npm WARN ajv-keywords@1.5.1 requires a peer of ajv@>=4.10.0 but none is > installed. You must install peer dependencies yourself. > > up to date in 2.13s > => SHA256 Checksum OK for sass-node-sass-v4.7.2_GH0.tar.gz. > =========================================================================== > =================================================== > =========================================================================== > =================================================== > ===> License MIT accepted by the user > ===> Fetching all distfiles required by node-sass-4.7.2 for building > /bin/mkdir -p /portdistfiles/node-sass > /bin/mkdir -p /portdistfiles/npm > /bin/cp /usr/ports/textproc/node-sass/files/package-lock.json > /portdistfiles/node-sass > cp: /portdistfiles/node-sass/package-lock.json: Permission denied > *** Error code 1 > > Stop. > make: stopped in /usr/ports/textproc/node-sass > =>> Cleaning up wrkdir > ===> Cleaning for node-sass-4.7.2 > build of textproc/node-sass | node-sass-4.7.2 ended at Sun Feb 25 > 02:33:55 UTC 2018 > > >> (full log: >> https://gist.github.com/saper/0be3f9b4e9eb819d3ec00f5273705517#file-node-sass-4-7-2-log >> ) >> >> Why are /bin/mkdir -p and /bin/cp commands invoked again in the >> "extract" phase? >> >> FreeBSD 11.1-STABLE #10 r321629 running poudriere-3.2.4 (I have updated >> poudriere today) >> >> What's wrong? That part of port code didn't change for some time. >> >> Marcin First of all, just so you know, npm module ports won't be added to the ports tree. I just wanted to be clear in case you were planning on submitting it. There were a couple threads about this a while back. With that out of the way, you're hitting errors for two reasons here. The first problem is that npm needs network access, and poudriere prevents ports from dialing out. You can work around this with the ALLOW_NETWORKING_PACKAGES variable in poudriere.conf. The other problem you're hitting is that npm saves a cache, and for some reason you're trying to run it from /usr/ports/distfiles/node-sass. Ports themselves should never, ever have the ability to create files in /usr/ports/distfiles. If you run 'npm install' from ${WRKSRC}, then you can do: cd ${WRKSRC} && ${SETENV} HOME=/tmp npm install You'll have to redefine HOME there because npm writes to $HOME/.npm, which causes a stage-fs violation. # Adam -- Adam Weinberger adamw@adamw.org http://www.adamw.org