From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2016 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 25242@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14823085804575 (code B ref -1); Wed, 21 Dec 2016 08:23:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2016 08:23:00 +0000 Received: from localhost ([127.0.0.1]:49641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcAt-0001Bi-Dj for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:23:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcAr-0001BO-8m for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcAk-0001bC-Vc for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcAk-0001b5-SF for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJcAj-0000Vi-LE for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcAg-0001a1-Dq for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:49 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33627) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcAg-0001Zp-5w for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:46 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 579A920530; Wed, 21 Dec 2016 03:22:42 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 21 Dec 2016 03:22:42 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=o6X TTdXIzdtjHXUt8s9inQASzYA=; b=TQqiKKUxNQGQXgh9ZJvcZCRoG50qcIY2ORP KcOMkbmjCy3BVOBeGJ574zjp6YyiLOWQujgFbZypZ+ZX37t3gG9T98pcZrxi85aY gE0tqyqNZD/KuLAPvMlW7zbz1sMaFjWmq00ZI0BOJqLWHpkzLQ4tlpAgw+ZNIL+t jyMNmYEg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=smtpout; bh=o6XTTdXIzdtjHXUt8s9inQASzYA=; b=U5DHi H6vd2WJMoerkSR7+L/lME7T3qMP4pbSFZTK8PK6+SLMYXq/JCQghxrbUEVLQ/zxO bURo1wx5SD+aGT8WKeGm0t7lumAixPmU04bkGaeakdcDG0lQVRNo//1qCvk8mwsp b/3fGnVMaTbGPEwzDbQxBy5GCpRKK8HAoMKwtM= X-ME-Sender: X-Sasl-enc: 7E/u9Bfm9BDtmRCQ+AI4j1opecwN9Ci7Yb79hZkldV+k 1482308562 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 14DAA243CF for ; Wed, 21 Dec 2016 03:22:42 -0500 (EST) Date: Wed, 21 Dec 2016 03:22:40 -0500 From: Leo Famulari Message-ID: <20161221082240.GA30326@jasmine> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Since Guix 0.11.0-4.1f41, I can't build source derivations while using a custom $TMPDIR. I first described this issue in , but I'm splitting it into its own report. On my Debian system, I set 'TMPDIR=/home/leo/tmp/guix-build'. Then, I can do this: $ ./pre-inst-env guix build nmap guix build: error: build failed: while setting up the build environment: changing into `/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0': No such file or directory And some monitoring of the TMPDIR: $ cd /home/leo/tmp/guix-build && inotifywait --monitor . Setting up watches. Watches established. ./ CREATE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ATTRIB,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ATTRIB,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ OPEN,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ACCESS,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ACCESS,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ CLOSE_NOWRITE,CLOSE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ DELETE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 I ran the guix-daemon with strace, and I see these relevant lines: 15337 [pid 30675] mkdir("/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0", 0700) = 0 15338 [pid 30675] getegid() = 0 15339 [pid 30675] chown("/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0", -1, 0) = 0 ... and just a bit later ... 15438 [pid 30693] chdir("/tmp/guix-build-nmap-7.40.tar.bz2.drv-0") = -1 ENOENT (No such file or directory) I'm still trying to figure out where the problem is in the code. I guess it's somewhere in these commits or code they interact with: 05ceb8dca download: Use the built-in 'download' builder when available. f9aefa2d5 daemon: Add 'built-in-builders' RPC. 94d92c779 daemon: Add "builtin:download" derivation builder. --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlhaO8wACgkQJkb6MLrK fwj2YQ/+NfU3G24hSBj4g+Ul56XzT2+mi1B1B+TpkSYGnYUUPGN0gTmL7rAexrOQ csrQMnQyCcIigSnTx+BQoymIvS7TSaekozFEFORAh295byUjFx8om5XUmwZwPvHA SJ1Otv5xf5WkanTzhOrAANEDrKQsPecrZx2B3TenIvvELPbCf/a/cA6/b5r9GhQF 5yJyVeiKQXTIqUdAnw1kOJUhnyFw6g5T+PMmq5txgNh4KOPQVyoXx/k6DDGPgi6I RvADmgwbZ/iZ7xPvmS8taxmHUcqVw/BbvAdO3Yd3iwZIKoe1xwHj7VXgbUO/JINu Y3oJx8XgaMFDvrMwNSdQUAWJRHNs+LSXzLBJ9/8W/BheibPn+gePithx1QXsezcX rbGn0fRro+WWBCgljB/83HbHns61xRB2zvWGOtfE8O1fKqNCdPd7k5J9b8qPs/6a NxCuxAaiIdaMcQPbFbYZ8gDSoeHtNXZTC3DC0hJsBH0RVqgG3G8XhaEthGAVWgDa MZdGhqKLQMY1WumaVKQxOh2If1Mo8L8spmgm2+nbRT4ExyH2Y2wXJKk80kmypsNi QtlEatvu51NbCSsrBo5EY24UEqT2cTgA3EJUkxPajjvPtljMaM/wuWfV6g0Q3rOU JdU1Whl5It7qUmR2aS6Dqxokh8Uzgk9HJJ6vJCOH1zz6PaKXcPw= =8NWS -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2016 08:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 25242@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.14823104788142 (code B ref -1); Wed, 21 Dec 2016 08:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2016 08:54:38 +0000 Received: from localhost ([127.0.0.1]:49661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcfV-00027G-VR for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:54:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcfU-00026w-6g for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:54:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcfO-0004ne-7T for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:54:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcfO-0004nY-3o for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:54:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJcfM-0006OL-RE for bug-guix@gnu.org; Wed, 21 Dec 2016 03:54:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcfJ-0004m0-QA for bug-guix@gnu.org; Wed, 21 Dec 2016 03:54:28 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:49845) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcfJ-0004lY-75 for bug-guix@gnu.org; Wed, 21 Dec 2016 03:54:25 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 607B220B20; Wed, 21 Dec 2016 03:54:22 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Wed, 21 Dec 2016 03:54:22 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=55Jf11v7Vtx0KZQgQHa2XFWByGw=; b=Kt09Ac 0JpYjB1nUU2kTkFU8ub1W9dTQIvtCr747PMT+ChndH4aEF8HMvFh+WO7unjidvbf OyQnNItOjiv8bY/1v9bOIrrpT6BP/NgTfYLI7ljwnU1KZrHgF1KkhvbBCGMPhCPt 4GW6P581z0FfWUzhjlqdhbXJQKOSgyuVCKNDw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=55Jf11v7Vtx0KZ QgQHa2XFWByGw=; b=ftW2XQltJKZpUBP69RvIDvHTGUgde7JRLxI5TPQb8jwBZE VrutFOh1a1lQxRi/xIf8mXvRHAu0JK5tDmMOkil255tjCYVX0Vl/XVPLOPip8Q8P +/WWSHuAVc9Qc0R+8zNI+o8yCFRjw3DtQxA90lJ9kOJten2bAg7+yzvHVyvYc= X-ME-Sender: X-Sasl-enc: sigqx4tDj5m9bgSMuF/NL11VwwfeHpxqQzzY0rtEwGKW 1482310462 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 190917EA0A for ; Wed, 21 Dec 2016 03:54:22 -0500 (EST) Date: Wed, 21 Dec 2016 03:54:21 -0500 From: Leo Famulari Message-ID: <20161221085421.GA32042@jasmine> References: <20161221082240.GA30326@jasmine> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9amGYk9869ThD9tj" Content-Disposition: inline In-Reply-To: <20161221082240.GA30326@jasmine> User-Agent: Mutt/1.7.1 (2016-10-04) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 21, 2016 at 03:22:40AM -0500, Leo Famulari wrote: > I ran the guix-daemon with strace, and I see these relevant lines: >=20 > 15337 [pid 30675] mkdir("/home/leo/tmp/guix-build/guix-build-nmap-7.40.ta= r.bz2.drv-0", 0700) =3D 0 > 15338 [pid 30675] getegid() =3D 0 > 15339 [pid 30675] chown("/home/leo/tmp/guix-build/guix-build-nmap-7.40.ta= r.bz2.drv-0", -1, 0) =3D 0 I believe this corresponds to the use of createTempDir() at nix/libstore/build.cc:1718. The path of the new directory is saved in the tmpDir variable. > 15438 [pid 30693] chdir("/tmp/guix-build-nmap-7.40.tar.bz2.drv-0") =3D -1= ENOENT (No such file or directory) And then later, at nix/libstore/build.cc:2204, we do this: 2204 if (chdir(tmpDirInSandbox.c_str()) =3D=3D -1) 2205 throw SysError(format("changing into `%1%'") % tmpDir); It tries to change to the wrong directory (the new "out of band" downloader doesn't use a chroot, IIUC), and then prints a misleading error message. This explains the discrepancy between what we see in strace and on stderr. --9amGYk9869ThD9tj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlhaQzkACgkQJkb6MLrK fwgBhQ//bpuTzwBXINTSHvE3lgZxh+PblNqpImnVYru6XyOe1+e7g8Mh6EHx9WbG ml+I4qkeweROsftz0bknVjVKTXoalHNWhy93zdAbAFNVPMqnm9aQSGwgs+4TX9XW qvJ1hhWzQPWJVa9dx/hJY12PvYfh6+crolDPYgGIj9yW+cP0hntyMRxrulkW4QPZ /lea8xbDhGyzvhRSAKol24EKbNRO9Xhfvml4tkIc1BvkBGQaApEeh3vDyJl+dL3H eZH3yZspV5//xO5173R52EJAJQBLS1Nv6ghb8WDsX7bmx+itWXSTtpIH/KqCppiI JNEps0YUpEZPSXBdGonWxsm51bjntATZ5ZNXCmghMGMei/Jnzd0TkzgCsa3bipk4 svRWl5N4zrr5rutF6JbzNcV9ALR3AjorpaxlIbtoYuUiaJ1EcTyt4AxdV0Qe+PzP N0uIdj8Qdi2OilNbs9cQV7lr3/5JqKeKdtJsGsnvYT+5X7l9JsZWlZWJZ20I4g5Z gZ3nBZvE52kZJKRUPz0aBrEQikTATzxLM3Z20MiyY+kLCLjDlRg6WhebuUbAsFON 62FJFkVQ/VjdhFZcuKFG+GJKNTY7gKxxyoNe0rYR87b9Uw2kXGhZPi3pM/1y11iK TXeUXnsBFvGoGPIYxVWa0FGtahDXUqd0pW438Murx/xdoKAL0MM= =WWrv -----END PGP SIGNATURE----- --9amGYk9869ThD9tj-- From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2016 09:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Leo Famulari Cc: 25242@debbugs.gnu.org Received: via spool by 25242-submit@debbugs.gnu.org id=B25242.148231203511054 (code B ref 25242); Wed, 21 Dec 2016 09:21:01 +0000 Received: (at 25242) by debbugs.gnu.org; 21 Dec 2016 09:20:35 +0000 Received: from localhost ([127.0.0.1]:49680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJd4d-0002sE-3E for submit@debbugs.gnu.org; Wed, 21 Dec 2016 04:20:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJd4b-0002rx-Lk for 25242@debbugs.gnu.org; Wed, 21 Dec 2016 04:20:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJd4R-0006RT-Vj for 25242@debbugs.gnu.org; Wed, 21 Dec 2016 04:20:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJd4R-0006RI-RJ; Wed, 21 Dec 2016 04:20:23 -0500 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:47600 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cJd4Q-0001VO-CR; Wed, 21 Dec 2016 04:20:22 -0500 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?UTF-8?Q?Niv=C3=B4se?= an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 21 Dec 2016 10:20:20 +0100 In-Reply-To: <20161221085421.GA32042@jasmine> (Leo Famulari's message of "Wed, 21 Dec 2016 03:54:21 -0500") Message-ID: <87r351myej.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Leo Famulari skribis: > On Wed, Dec 21, 2016 at 03:22:40AM -0500, Leo Famulari wrote: >> I ran the guix-daemon with strace, and I see these relevant lines: >>=20 >> 15337 [pid 30675] mkdir("/home/leo/tmp/guix-build/guix-build-nmap-7.40.t= ar.bz2.drv-0", 0700) =3D 0 >> 15338 [pid 30675] getegid() =3D 0 >> 15339 [pid 30675] chown("/home/leo/tmp/guix-build/guix-build-nmap-7.40.t= ar.bz2.drv-0", -1, 0) =3D 0 > > I believe this corresponds to the use of createTempDir() at > nix/libstore/build.cc:1718. The path of the new directory is saved in > the tmpDir variable. > >> 15438 [pid 30693] chdir("/tmp/guix-build-nmap-7.40.tar.bz2.drv-0") =3D -= 1 ENOENT (No such file or directory) > > And then later, at nix/libstore/build.cc:2204, we do this: > > 2204 if (chdir(tmpDirInSandbox.c_str()) =3D=3D -1) > 2205 throw SysError(format("changing into `%1%'") % tmpDir); > > It tries to change to the wrong directory (the new "out of band" > downloader doesn't use a chroot, IIUC), and then prints a misleading > error message. This explains the discrepancy between what we see in > strace and on stderr. Good catch! AFAICS the flaw is that there=E2=80=99s one place where I wrote: if (useChroot && !isBuiltin(drv)) while several other places just do something like: if (useChroot) Could the patch below solve the problem? --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index e823001..38048ce 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder() % drv.platform % settings.thisSystem % drvPath); } - useChroot = settings.useChroot; + /* Note: built-in builders are *not* running in a chroot environment so + that we can easily implement them in Guile without having it as a + derivation input (they are running under a separate build user, + though). */ + useChroot = settings.useChroot && !isBuiltin(drv); /* Construct the environment passed to the builder. */ env.clear(); @@ -2048,12 +2052,7 @@ void DerivationGoal::runChild() commonChildInit(builderOut); #if CHROOT_ENABLED - /* Note: built-in builders are *not* running in a chroot environment - so that we can easily implement them in Guile without having it as - a derivation input (they are running under a separate build user, - though). */ - - if (useChroot && !isBuiltin(drv)) { + if (useChroot) { /* Initialise the loopback interface. */ AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)); if (fd == -1) throw SysError("cannot open IP socket"); --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thanks! Ludo=E2=80=99. --=-=-=-- From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2016 16:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25242@debbugs.gnu.org Received: via spool by 25242-submit@debbugs.gnu.org id=B25242.148233851527238 (code B ref 25242); Wed, 21 Dec 2016 16:42:01 +0000 Received: (at 25242) by debbugs.gnu.org; 21 Dec 2016 16:41:55 +0000 Received: from localhost ([127.0.0.1]:50423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJjxi-00075G-Tm for submit@debbugs.gnu.org; Wed, 21 Dec 2016 11:41:55 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59883) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJjxg-000757-91 for 25242@debbugs.gnu.org; Wed, 21 Dec 2016 11:41:53 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2971420772; Wed, 21 Dec 2016 11:41:50 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 21 Dec 2016 11:41:50 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=opEBPKIIZZuWfmg lGLxJbrG50nE=; b=nfY/99ji665lqLGhwyqjXvE5WlKK5S+FR8Rbp8v6V+9oT2+ cLcdN+zIJAaQ2Q3kSkLqbCx1KZx6JLCL9tQzoWr6GkVj62grLT+WxyZu3qME43oT oRwyMY8PUFa2yDjoK3UDQHvpPpbxnW7lg9NczTkbxTW/ZEoxEGQ4IUNaxN9M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=opEBPKIIZZuWfmglGLxJbrG50nE=; b=dyYVmYa0GX68A+CYWqRM /ZhF3YJ0btx8ph6SthZftKj07y6wTzmvV7K9LvfhKdHLyOMYkJDgUqViuXqbf7Li hHMvsMAifUG+ywv3gdWMcCgNJmdOcqdz29CtFmhi2XABFM/46/kGbb3It8efZm/B 4+Pg56igU3xyz2q6EgZcZy0= X-ME-Sender: X-Sasl-enc: sWdnVq/3/LrqEb0vJIdD5mkq1SkqVWc3mXLNd55vBGUW 1482338509 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id D887E2442C; Wed, 21 Dec 2016 11:41:49 -0500 (EST) Date: Wed, 21 Dec 2016 11:41:49 -0500 From: Leo Famulari Message-ID: <20161221164149.GA5931@jasmine> References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r351myej.fsf@gnu.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Dec 21, 2016 at 10:20:20AM +0100, Ludovic Courtès wrote: > Good catch! > > AFAICS the flaw is that there’s one place where I wrote: > > if (useChroot && !isBuiltin(drv)) > > while several other places just do something like: > > if (useChroot) > > Could the patch below solve the problem? I'm not sure how to test patches to the daemon. Does it require creating a new guix-devel snapshot? > diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc > index e823001..38048ce 100644 > --- a/nix/libstore/build.cc > +++ b/nix/libstore/build.cc > @@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder() > % drv.platform % settings.thisSystem % drvPath); > } > > - useChroot = settings.useChroot; > + /* Note: built-in builders are *not* running in a chroot environment so > + that we can easily implement them in Guile without having it as a > + derivation input (they are running under a separate build user, > + though). */ > + useChroot = settings.useChroot && !isBuiltin(drv); > > /* Construct the environment passed to the builder. */ > env.clear(); > @@ -2048,12 +2052,7 @@ void DerivationGoal::runChild() > commonChildInit(builderOut); > > #if CHROOT_ENABLED > - /* Note: built-in builders are *not* running in a chroot environment > - so that we can easily implement them in Guile without having it as > - a derivation input (they are running under a separate build user, > - though). */ > - > - if (useChroot && !isBuiltin(drv)) { > + if (useChroot) { > /* Initialise the loopback interface. */ > AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)); > if (fd == -1) throw SysError("cannot open IP socket"); > > Thanks! > > Ludo’. From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 21 Dec 2016 21:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Leo Famulari Cc: 25242@debbugs.gnu.org Received: via spool by 25242-submit@debbugs.gnu.org id=B25242.14823557932497 (code B ref 25242); Wed, 21 Dec 2016 21:30:02 +0000 Received: (at 25242) by debbugs.gnu.org; 21 Dec 2016 21:29:53 +0000 Received: from localhost ([127.0.0.1]:50592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJoSP-0000eD-Fr for submit@debbugs.gnu.org; Wed, 21 Dec 2016 16:29:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJoSN-0000e0-R0 for 25242@debbugs.gnu.org; Wed, 21 Dec 2016 16:29:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJoSD-0001a1-SP for 25242@debbugs.gnu.org; Wed, 21 Dec 2016 16:29:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJoSD-0001Zt-Pp; Wed, 21 Dec 2016 16:29:41 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:34784 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cJoSC-0006g8-Cv; Wed, 21 Dec 2016 16:29:41 -0500 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> <20161221164149.GA5931@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 1 =?UTF-8?Q?Niv=C3=B4se?= an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 21 Dec 2016 22:29:38 +0100 In-Reply-To: <20161221164149.GA5931@jasmine> (Leo Famulari's message of "Wed, 21 Dec 2016 11:41:49 -0500") Message-ID: <87d1glvum5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) Leo Famulari skribis: > On Wed, Dec 21, 2016 at 10:20:20AM +0100, Ludovic Court=C3=A8s wrote: >> Good catch! >>=20 >> AFAICS the flaw is that there=E2=80=99s one place where I wrote: >>=20 >> if (useChroot && !isBuiltin(drv)) >>=20 >> while several other places just do something like: >>=20 >> if (useChroot) >>=20 >> Could the patch below solve the problem? > > I'm not sure how to test patches to the daemon. Does it require creating > a new guix-devel snapshot? You can apply it to your source tree and run: sudo ./pre-inst-env guix-daemon --build-users-group=3Dguixbuild from there (or similar). HTH! Ludo=E2=80=99. From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 23 Dec 2016 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25242@debbugs.gnu.org Received: via spool by 25242-submit@debbugs.gnu.org id=B25242.148245188711703 (code B ref 25242); Fri, 23 Dec 2016 00:12:02 +0000 Received: (at 25242) by debbugs.gnu.org; 23 Dec 2016 00:11:27 +0000 Received: from localhost ([127.0.0.1]:51945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKDSJ-00032h-4o for submit@debbugs.gnu.org; Thu, 22 Dec 2016 19:11:27 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:58730) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKDSF-00032U-Dr for 25242@debbugs.gnu.org; Thu, 22 Dec 2016 19:11:26 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DCEDF20545; Thu, 22 Dec 2016 19:11:22 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 22 Dec 2016 19:11:22 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=bzXtumK+IwVyhVm JVlkBHzf7Im0=; b=qHGlkeWP17LbE0d7rkFNlSwjZpz2CjxaEOq8Tx9K6lpzoaw SjJj5LuctYXBr+y0Cx7PG68JeKj3NKA3d+qqDLBpRDCgh1ECIbx1C2YHJN7lK4gv RiZwPSlSckKT3n4IXBslhdHgoc4c31U1rxpewum9DTRMKx7Pr7KUe3M9fQ6w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=bzXtumK+IwVyhVmJVlkBHzf7Im0=; b=D2z2zEtOcesJyk9SYyNw eycl5naqMKYet1b0LpqymsFU6dUh5o9CvSX/64m2mlUqpYnS0JYtE1L0mIE6KxRe TZjGyGnhop7lzASBrLH2obi0AwyF/2H26/9YO/tncQ8nShK8nwZrI1Tm49DCYfZC WmuFjnJnpP/KBUAKGnQo+P0= X-ME-Sender: X-Sasl-enc: BNyQ0e73jcpnFuwbWyJXQD+DOS2KeRKsIDuUNrpXewPE 1482451882 Received: from localhost (unknown [84.19.184.51]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FB127E2B2; Thu, 22 Dec 2016 19:11:22 -0500 (EST) Date: Thu, 22 Dec 2016 19:11:18 -0500 From: Leo Famulari Message-ID: <20161223001118.GA15208@jasmine> References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r351myej.fsf@gnu.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Dec 21, 2016 at 10:20:20AM +0100, Ludovic Courtès wrote: > AFAICS the flaw is that there’s one place where I wrote: > > if (useChroot && !isBuiltin(drv)) > > while several other places just do something like: > > if (useChroot) > > Could the patch below solve the problem? > > diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc > index e823001..38048ce 100644 > --- a/nix/libstore/build.cc > +++ b/nix/libstore/build.cc > @@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder() > % drv.platform % settings.thisSystem % drvPath); > } > > - useChroot = settings.useChroot; > + /* Note: built-in builders are *not* running in a chroot environment so > + that we can easily implement them in Guile without having it as a > + derivation input (they are running under a separate build user, > + though). */ > + useChroot = settings.useChroot && !isBuiltin(drv); > > /* Construct the environment passed to the builder. */ > env.clear(); > @@ -2048,12 +2052,7 @@ void DerivationGoal::runChild() > commonChildInit(builderOut); > > #if CHROOT_ENABLED > - /* Note: built-in builders are *not* running in a chroot environment > - so that we can easily implement them in Guile without having it as > - a derivation input (they are running under a separate build user, > - though). */ > - > - if (useChroot && !isBuiltin(drv)) { > + if (useChroot) { > /* Initialise the loopback interface. */ > AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)); > if (fd == -1) throw SysError("cannot open IP socket"); Yes, this does fix the problem! I wonder if I should commit this while Ludo is away? From unknown Sat Aug 16 18:32:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leo Famulari Subject: bug#25242: closed (Re: bug#25242: Cannot build source derivations with a custom TMPDIR) Message-ID: References: <87k2aihcny.fsf@gnu.org> <20161221082240.GA30326@jasmine> X-Gnu-PR-Message: they-closed 25242 X-Gnu-PR-Package: guix Reply-To: 25242@debbugs.gnu.org Date: Thu, 29 Dec 2016 17:24:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1483032242-29827-1" This is a multi-part message in MIME format... ------------=_1483032242-29827-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #25242: Cannot build source derivations with a custom TMPDIR which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 25242@debbugs.gnu.org. --=20 25242: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D25242 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1483032242-29827-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 25242-done) by debbugs.gnu.org; 29 Dec 2016 17:24:00 +0000 Received: from localhost ([127.0.0.1]:59327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMeQq-0007kr-C1 for submit@debbugs.gnu.org; Thu, 29 Dec 2016 12:24:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMeQo-0007kZ-3Z for 25242-done@debbugs.gnu.org; Thu, 29 Dec 2016 12:23:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMeQf-0007xU-UA for 25242-done@debbugs.gnu.org; Thu, 29 Dec 2016 12:23:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMeQf-0007xQ-RM; Thu, 29 Dec 2016 12:23:49 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:48918 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cMeQf-0003k0-7p; Thu, 29 Dec 2016 12:23:49 -0500 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#25242: Cannot build source derivations with a custom TMPDIR References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> <20161223001118.GA15208@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Niv=C3=B4se?= an 225 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 29 Dec 2016 18:23:45 +0100 In-Reply-To: <20161223001118.GA15208@jasmine> (Leo Famulari's message of "Thu, 22 Dec 2016 19:11:18 -0500") Message-ID: <87k2aihcny.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.2 (--------) X-Debbugs-Envelope-To: 25242-done Cc: 25242-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.2 (--------) Leo Famulari skribis: > On Wed, Dec 21, 2016 at 10:20:20AM +0100, Ludovic Court=C3=A8s wrote: >> AFAICS the flaw is that there=E2=80=99s one place where I wrote: >>=20 >> if (useChroot && !isBuiltin(drv)) >>=20 >> while several other places just do something like: >>=20 >> if (useChroot) >>=20 >> Could the patch below solve the problem? >>=20 > >> diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc >> index e823001..38048ce 100644 >> --- a/nix/libstore/build.cc >> +++ b/nix/libstore/build.cc >> @@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder() >> % drv.platform % settings.thisSystem % drvPath); >> } >>=20=20 >> - useChroot =3D settings.useChroot; >> + /* Note: built-in builders are *not* running in a chroot environmen= t so >> + that we can easily implement them in Guile without having it as a >> + derivation input (they are running under a separate build user, >> + though). */ >> + useChroot =3D settings.useChroot && !isBuiltin(drv); >>=20=20 >> /* Construct the environment passed to the builder. */ >> env.clear(); >> @@ -2048,12 +2052,7 @@ void DerivationGoal::runChild() >> commonChildInit(builderOut); >>=20=20 >> #if CHROOT_ENABLED >> - /* Note: built-in builders are *not* running in a chroot environment >> - so that we can easily implement them in Guile without having it as >> - a derivation input (they are running under a separate build user, >> - though). */ >> - >> - if (useChroot && !isBuiltin(drv)) { >> + if (useChroot) { >> /* Initialise the loopback interface. */ >> AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)); >> if (fd =3D=3D -1) throw SysError("cannot open IP socket"); > > Yes, this does fix the problem! Awesome! > I wonder if I should commit this while Ludo is away? You could have done it. :-) I=E2=80=99ve just pushed it as 8ecc3c6c447765b1f7c15b980f985d1826f48659. Thank you! Ludo=E2=80=99. ------------=_1483032242-29827-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Dec 2016 08:23:00 +0000 Received: from localhost ([127.0.0.1]:49641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcAt-0001Bi-Dj for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:23:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJcAr-0001BO-8m for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcAk-0001bC-Vc for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59940) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcAk-0001b5-SF for submit@debbugs.gnu.org; Wed, 21 Dec 2016 03:22:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJcAj-0000Vi-LE for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJcAg-0001a1-Dq for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:49 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33627) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJcAg-0001Zp-5w for bug-guix@gnu.org; Wed, 21 Dec 2016 03:22:46 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 579A920530; Wed, 21 Dec 2016 03:22:42 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 21 Dec 2016 03:22:42 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-type:date:from:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=o6X TTdXIzdtjHXUt8s9inQASzYA=; b=TQqiKKUxNQGQXgh9ZJvcZCRoG50qcIY2ORP KcOMkbmjCy3BVOBeGJ574zjp6YyiLOWQujgFbZypZ+ZX37t3gG9T98pcZrxi85aY gE0tqyqNZD/KuLAPvMlW7zbz1sMaFjWmq00ZI0BOJqLWHpkzLQ4tlpAgw+ZNIL+t jyMNmYEg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=smtpout; bh=o6XTTdXIzdtjHXUt8s9inQASzYA=; b=U5DHi H6vd2WJMoerkSR7+L/lME7T3qMP4pbSFZTK8PK6+SLMYXq/JCQghxrbUEVLQ/zxO bURo1wx5SD+aGT8WKeGm0t7lumAixPmU04bkGaeakdcDG0lQVRNo//1qCvk8mwsp b/3fGnVMaTbGPEwzDbQxBy5GCpRKK8HAoMKwtM= X-ME-Sender: X-Sasl-enc: 7E/u9Bfm9BDtmRCQ+AI4j1opecwN9Ci7Yb79hZkldV+k 1482308562 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 14DAA243CF for ; Wed, 21 Dec 2016 03:22:42 -0500 (EST) Date: Wed, 21 Dec 2016 03:22:40 -0500 From: Leo Famulari To: bug-guix@gnu.org Subject: Cannot build source derivations with a custom TMPDIR Message-ID: <20161221082240.GA30326@jasmine> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Since Guix 0.11.0-4.1f41, I can't build source derivations while using a custom $TMPDIR. I first described this issue in , but I'm splitting it into its own report. On my Debian system, I set 'TMPDIR=/home/leo/tmp/guix-build'. Then, I can do this: $ ./pre-inst-env guix build nmap guix build: error: build failed: while setting up the build environment: changing into `/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0': No such file or directory And some monitoring of the TMPDIR: $ cd /home/leo/tmp/guix-build && inotifywait --monitor . Setting up watches. Watches established. ./ CREATE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ATTRIB,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ATTRIB,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ OPEN,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ACCESS,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ ACCESS,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ CLOSE_NOWRITE,CLOSE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 ./ DELETE,ISDIR guix-build-nmap-7.40.tar.bz2.drv-0 I ran the guix-daemon with strace, and I see these relevant lines: 15337 [pid 30675] mkdir("/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0", 0700) = 0 15338 [pid 30675] getegid() = 0 15339 [pid 30675] chown("/home/leo/tmp/guix-build/guix-build-nmap-7.40.tar.bz2.drv-0", -1, 0) = 0 ... and just a bit later ... 15438 [pid 30693] chdir("/tmp/guix-build-nmap-7.40.tar.bz2.drv-0") = -1 ENOENT (No such file or directory) I'm still trying to figure out where the problem is in the code. I guess it's somewhere in these commits or code they interact with: 05ceb8dca download: Use the built-in 'download' builder when available. f9aefa2d5 daemon: Add 'built-in-builders' RPC. 94d92c779 daemon: Add "builtin:download" derivation builder. --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEsFFZSPHn08G5gDigJkb6MLrKfwgFAlhaO8wACgkQJkb6MLrK fwj2YQ/+NfU3G24hSBj4g+Ul56XzT2+mi1B1B+TpkSYGnYUUPGN0gTmL7rAexrOQ csrQMnQyCcIigSnTx+BQoymIvS7TSaekozFEFORAh295byUjFx8om5XUmwZwPvHA SJ1Otv5xf5WkanTzhOrAANEDrKQsPecrZx2B3TenIvvELPbCf/a/cA6/b5r9GhQF 5yJyVeiKQXTIqUdAnw1kOJUhnyFw6g5T+PMmq5txgNh4KOPQVyoXx/k6DDGPgi6I RvADmgwbZ/iZ7xPvmS8taxmHUcqVw/BbvAdO3Yd3iwZIKoe1xwHj7VXgbUO/JINu Y3oJx8XgaMFDvrMwNSdQUAWJRHNs+LSXzLBJ9/8W/BheibPn+gePithx1QXsezcX rbGn0fRro+WWBCgljB/83HbHns61xRB2zvWGOtfE8O1fKqNCdPd7k5J9b8qPs/6a NxCuxAaiIdaMcQPbFbYZ8gDSoeHtNXZTC3DC0hJsBH0RVqgG3G8XhaEthGAVWgDa MZdGhqKLQMY1WumaVKQxOh2If1Mo8L8spmgm2+nbRT4ExyH2Y2wXJKk80kmypsNi QtlEatvu51NbCSsrBo5EY24UEqT2cTgA3EJUkxPajjvPtljMaM/wuWfV6g0Q3rOU JdU1Whl5It7qUmR2aS6Dqxokh8Uzgk9HJJ6vJCOH1zz6PaKXcPw= =8NWS -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- ------------=_1483032242-29827-1-- From unknown Sat Aug 16 18:32:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 29 Dec 2016 17:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25242 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25242-done@debbugs.gnu.org Received: via spool by 25242-done@debbugs.gnu.org id=D25242.148303249330306 (code D ref 25242); Thu, 29 Dec 2016 17:29:01 +0000 Received: (at 25242-done) by debbugs.gnu.org; 29 Dec 2016 17:28:13 +0000 Received: from localhost ([127.0.0.1]:59337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMeUv-0007sk-56 for submit@debbugs.gnu.org; Thu, 29 Dec 2016 12:28:13 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56279) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMeUt-0007sb-30 for 25242-done@debbugs.gnu.org; Thu, 29 Dec 2016 12:28:12 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4516020947; Thu, 29 Dec 2016 12:28:07 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute4.internal (MEProxy); Thu, 29 Dec 2016 12:28:07 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=qRIiPB06mk7U/yQ u9LbvDEOu6Ck=; b=N20HMPubHShiD2CfLcPngmbhomgUj2c05FqRzS1O0p2dv7R fI76OobbPdfBJHTo/ZRnzoafyx0WdvwFmxEfqVbyxaFA5Gv9Tcj312xEhCn/e0Rh hWWQvBJO9EjU5CmCkDL9/ycm7XdG9Odlk5DzINtpuZaXatx3Q01kS+O+TnTo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=qRIiPB06mk7U/yQu9LbvDEOu6Ck=; b=lQ4z1G2uedj4iK17LOUE Dawb6iVQMVRdPesTk4DWO9s9rYxboadMDkDceRrmNIz+YyAxN4MyxGgdCK/RCWU/ P78wMwHbnI2O8+DXTnhgeCzyWPU9gJmsIYqLIo6nCEQmD5Yyfln2uRMBrHuvFDWI 3T0J9mfbI+BdZhkM7oTZHoo= X-ME-Sender: X-Sasl-enc: q5I0P9xK8YkXmJGOoq5smq6fUSnqX47U+K1B+2dvZiaj 1483032487 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 0858A7E7F1; Thu, 29 Dec 2016 12:28:07 -0500 (EST) Date: Thu, 29 Dec 2016 12:28:06 -0500 From: Leo Famulari Message-ID: <20161229172806.GA7950@jasmine> References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> <20161223001118.GA15208@jasmine> <87k2aihcny.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87k2aihcny.fsf@gnu.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Dec 29, 2016 at 06:23:45PM +0100, Ludovic Courtès wrote: > Leo Famulari skribis: > > I wonder if I should commit this while Ludo is away? > > You could have done it. :-) > > I’ve just pushed it as 8ecc3c6c447765b1f7c15b980f985d1826f48659. Okay, I'll be more confident in this area in the future!