From unknown Thu Aug 21 14:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#47786: Several build --keep-failed result in wrong env variables Resent-From: Dmitry Matveyev Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Apr 2021 04:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47786 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 47786@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Reply-To: greenfork.lists@yandex.com Received: via spool by submit@debbugs.gnu.org id=B.161845952827335 (code B ref -1); Thu, 15 Apr 2021 04:06:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Apr 2021 04:05:28 +0000 Received: from localhost ([127.0.0.1]:36163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWtFv-00076o-40 for submit@debbugs.gnu.org; Thu, 15 Apr 2021 00:05:28 -0400 Received: from lists.gnu.org ([209.51.188.17]:46938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWrnb-0004mH-Lk for submit@debbugs.gnu.org; Wed, 14 Apr 2021 22:32:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWrnb-0007fs-FA for bug-guix@gnu.org; Wed, 14 Apr 2021 22:32:07 -0400 Received: from forward101j.mail.yandex.net ([2a02:6b8:0:801:2::101]:46816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWrnY-0005Q2-1o for bug-guix@gnu.org; Wed, 14 Apr 2021 22:32:07 -0400 Received: from sas1-a99d60d0e232.qloud-c.yandex.net (sas1-a99d60d0e232.qloud-c.yandex.net [IPv6:2a02:6b8:c08:920:0:640:a99d:60d0]) by forward101j.mail.yandex.net (Yandex) with ESMTP id E0F9B1BE0541 for ; Thu, 15 Apr 2021 05:31:56 +0300 (MSK) Received: from sas8-6bf5c5d991b2.qloud-c.yandex.net (sas8-6bf5c5d991b2.qloud-c.yandex.net [2a02:6b8:c1b:2a1f:0:640:6bf5:c5d9]) by sas1-a99d60d0e232.qloud-c.yandex.net (mxback/Yandex) with ESMTP id p5mTMv1wFR-VuIWuReZ; Thu, 15 Apr 2021 05:31:56 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1618453916; bh=cqwHh5+im/IDrcQvqGv7iXdPOzQQb7IR07xXR4fiBJs=; h=Reply-To:Subject:To:From:Message-ID:Date; b=Fx47fwed7GHwrmsq+uIxWpU0i0gYtI+wCA+YowkNyKmr8nRfK/n0i8aA/8jK5F9IH xlHOhtDSC0m9Onxs+SgvNdQkGjXwjRBr6D2d7Ix00OyDs09VbR9WmSTDgNXkE7iY2K ejmr3dl2KaM4zP1FJgYxD4hfdrhy4yG9q94ph9PY= Authentication-Results: sas1-a99d60d0e232.qloud-c.yandex.net; dkim=pass header.i=@yandex.com Received: by sas8-6bf5c5d991b2.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id USPNE92vNu-VuKSKlJQ; Thu, 15 Apr 2021 05:31:56 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) User-agent: mu4e 1.4.15; emacs 27.2 From: Dmitry Matveyev Date: Thu, 15 Apr 2021 08:31:54 +0600 Message-ID: <87r1jc5ld1.fsf@yandex.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a02:6b8:0:801:2::101; envelope-from=greenfork.lists@yandex.com; helo=forward101j.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.2 (/) X-Mailman-Approved-At: Thu, 15 Apr 2021 00:05:25 -0400 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: -2.3 (--) Hello, I use guix on Arch Linux, version 050be36cbf3a42199f64f2e44c59f1cb1b3afab5. Several invocations of guix build --keep-failed creates directories in /tmp like this one guix-build-hello-2.10.drv-0 for 1st build and then guix-build-hello-2.10.drv-1 for 2nd and so on (with last digit increasing). But environment variables for all of them are set to point to the very 1st directory. Reproduce: $ guix build --check --keep-failed hello ^C $ guix build --check --keep-failed hello ^C $ cd /tmp/guix-build-hello-2.10.drv-1/ $ grep PWD environment-variables export OLDPWD export PWD="/tmp/guix-build-hello-2.10.drv-0/hello-2.10" Here although we are in directory /tmp/guix-build-hello-2.10.drv-1/, PWD is set to .drv-0 directory. Regards, Dmitry. From unknown Thu Aug 21 14:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#47786: Several build --keep-failed result in wrong env variables Resent-From: Leo Famulari Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Apr 2021 17:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47786 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Dmitry Matveyev Cc: 47786@debbugs.gnu.org Received: via spool by 47786-submit@debbugs.gnu.org id=B47786.161850641825937 (code B ref 47786); Thu, 15 Apr 2021 17:07:02 +0000 Received: (at 47786) by debbugs.gnu.org; 15 Apr 2021 17:06:58 +0000 Received: from localhost ([127.0.0.1]:39078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX5SD-0006kG-Md for submit@debbugs.gnu.org; Thu, 15 Apr 2021 13:06:57 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:44887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX5SC-0006k3-F6 for 47786@debbugs.gnu.org; Thu, 15 Apr 2021 13:06:56 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6FE135C004A; Thu, 15 Apr 2021 13:06:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 15 Apr 2021 13:06:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=mesmtp; bh=LJBKCaHWcjBXp4AE6yBR20lY Jz2tsCsT8o9GGFa4BsY=; b=q0IPTfc2FJunrbVWutO8sIWmjfZVq9IqrD7Xnx3A 5E0HU/BlEsdrMG7LmXM4uI0YayFvbQnujZPXpD3XOiZYsw7p5sYKnHOrhBxD6Hr4 O5qRTzSoTowYhZm8XMRYfOqomRr9gcuzGfus7vFvbOLI/DkYZKbkuuOXNVK42lUH Hw8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=LJBKCa HWcjBXp4AE6yBR20lYJz2tsCsT8o9GGFa4BsY=; b=LXuqrXstpbfqHvRvOflYtQ pzwYd6KfvZLKAwLAGEqYWeVhRPDd6uUqXGM4pegr8YWn8soaks5IxxlwIVPCj+Vw 5bWvBEq3DRVqteIgIpJxQ++D3vJTIBckYDeDlBU2CS/xba0zOKTE4CxZepx/RkA4 LiTqol17JGaLFi3Gnr6H7NlaFGHXKdLn7W3oWhY1RFQ2AxGoUt2EykyQ47002vpK V/hPWkv0tFCg0hKwM0xE8QxXtISA1DWomQqkvd1odUaZDSrZxa0qOZoqBGwRbWsP pp0cIKz0ltzfv1Y/0lET1KHKDu7O/pluAYZZmPIKFulnO6GN6G1nQyV040rBWNfg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttd ertddttddvnecuhfhrohhmpefnvghoucfhrghmuhhlrghrihcuoehlvghosehfrghmuhhl rghrihdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeeukeektdffvddtudegjeegtdevhf eufeeivdejiedtieegtdevjedvjeehffevgfenucfkphepuddttddruddurdduieelrddu udeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplh gvohesfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: Received: from localhost (pool-100-11-169-118.phlapa.fios.verizon.net [100.11.169.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 5827D108005B; Thu, 15 Apr 2021 13:06:50 -0400 (EDT) Date: Thu, 15 Apr 2021 13:06:47 -0400 From: Leo Famulari Message-ID: References: <87r1jc5ld1.fsf@yandex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r1jc5ld1.fsf@yandex.com> 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: -1.7 (-) On Thu, Apr 15, 2021 at 08:31:54AM +0600, Dmitry Matveyev wrote: > Hello, > > I use guix on Arch Linux, version > 050be36cbf3a42199f64f2e44c59f1cb1b3afab5. > > Several invocations of guix build --keep-failed creates directories in > /tmp like this one guix-build-hello-2.10.drv-0 for 1st build and then > guix-build-hello-2.10.drv-1 for 2nd and so on (with last digit > increasing). But environment variables for all of them are set to point > to the very 1st directory. > > Reproduce: > > $ guix build --check --keep-failed hello > ^C > $ guix build --check --keep-failed hello > ^C > $ cd /tmp/guix-build-hello-2.10.drv-1/ > $ grep PWD environment-variables > export OLDPWD > export PWD="/tmp/guix-build-hello-2.10.drv-0/hello-2.10" > > Here although we are in directory /tmp/guix-build-hello-2.10.drv-1/, PWD > is set to .drv-0 directory. I see, thanks for the report. This is probably because, within the build environment, the directory is always named '/tmp/guix-build-$name-$version.drv-0/', for reproducibility. We should see about changing the PWD variable after the build fails. From unknown Thu Aug 21 14:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#47786: Several build --keep-failed result in wrong env variables Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 15 Apr 2021 20:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47786 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: greenfork.lists@yandex.com, 47786@debbugs.gnu.org Received: via spool by 47786-submit@debbugs.gnu.org id=B47786.161851838828911 (code B ref 47786); Thu, 15 Apr 2021 20:27:01 +0000 Received: (at 47786) by debbugs.gnu.org; 15 Apr 2021 20:26:28 +0000 Received: from localhost ([127.0.0.1]:39330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX8ZH-0007W8-HO for submit@debbugs.gnu.org; Thu, 15 Apr 2021 16:26:27 -0400 Received: from world.peace.net ([64.112.178.59]:40972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lX8ZF-0007Vr-HY; Thu, 15 Apr 2021 16:26:26 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lX8Z9-0008Ef-45; Thu, 15 Apr 2021 16:26:19 -0400 From: Mark H Weaver In-Reply-To: <87r1jc5ld1.fsf@yandex.com> References: <87r1jc5ld1.fsf@yandex.com> Date: Thu, 15 Apr 2021 16:24:34 -0400 Message-ID: <875z0ni9cy.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) 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: -1.0 (-) tags 47786 + notabug close 47786 thanks Hi Dmitry, Dmitry Matveyev writes: > I use guix on Arch Linux, version > 050be36cbf3a42199f64f2e44c59f1cb1b3afab5. > > Several invocations of guix build --keep-failed creates directories in > /tmp like this one guix-build-hello-2.10.drv-0 for 1st build and then > guix-build-hello-2.10.drv-1 for 2nd and so on (with last digit > increasing). But environment variables for all of them are set to point > to the very 1st directory. This is the intended behavior, although I agree that it can be surprising. The environment variables refer to "/tmp/guix-build-=E2=80=A6.drv-0" because within the build container, the directory is _always_ named "/tmp/guix-build-=E2=80=A6.drv-0", regardless of what name was given to the directory outside of the build container. In general, where practical, we try to isolate the build container from irrelevant details about the host system (such as the contents of /tmp), because those details might leak into the build outputs, compromising reproducibility. For example, some packages retain the absolute file name of the build directory, as an aid to developers when users report bugs. Reproducibility of such package builds would be lost if the build directory name varied depending on the contents on /tmp on the host system. Does that make sense? Thanks for the report, Mark From unknown Thu Aug 21 14:54:22 2025 X-Loop: help-debbugs@gnu.org Subject: bug#47786: Several build --keep-failed result in wrong env variables Resent-From: Dmitry Matveyev Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 16 Apr 2021 04:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47786 X-GNU-PR-Package: guix X-GNU-PR-Keywords: notabug To: Mark H Weaver Cc: 47786@debbugs.gnu.org Reply-To: greenfork.lists@yandex.com Received: via spool by 47786-submit@debbugs.gnu.org id=B47786.161854858026741 (code B ref 47786); Fri, 16 Apr 2021 04:50:01 +0000 Received: (at 47786) by debbugs.gnu.org; 16 Apr 2021 04:49:40 +0000 Received: from localhost ([127.0.0.1]:39846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXGQG-0006xE-5f for submit@debbugs.gnu.org; Fri, 16 Apr 2021 00:49:40 -0400 Received: from forward101p.mail.yandex.net ([77.88.28.101]:39259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXGQC-0006wu-ED for 47786@debbugs.gnu.org; Fri, 16 Apr 2021 00:49:38 -0400 Received: from forward102q.mail.yandex.net (forward102q.mail.yandex.net [IPv6:2a02:6b8:c0e:1ba:0:640:516:4e7d]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 08BDC3281753; Fri, 16 Apr 2021 07:49:29 +0300 (MSK) Received: from vla5-d4be149c9aa7.qloud-c.yandex.net (vla5-d4be149c9aa7.qloud-c.yandex.net [IPv6:2a02:6b8:c18:3485:0:640:d4be:149c]) by forward102q.mail.yandex.net (Yandex) with ESMTP id 034E23A20002; Fri, 16 Apr 2021 07:49:29 +0300 (MSK) Received: from vla5-8422ddc3185d.qloud-c.yandex.net (vla5-8422ddc3185d.qloud-c.yandex.net [2a02:6b8:c18:3495:0:640:8422:ddc3]) by vla5-d4be149c9aa7.qloud-c.yandex.net (mxback/Yandex) with ESMTP id 58m8W1IO5L-nSIKApb9; Fri, 16 Apr 2021 07:49:29 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1618548569; bh=OrAr3+T4lASoJs8UwWLCuMqsFQV7EAOW89IdyOzOB3U=; h=In-reply-to:Reply-To:Subject:Cc:From:To:Date:References: Message-ID; b=rO1eNSyrnyOQu4n3M0LBZWPesZ2yUx51JHc/2XsrWx5K/SiMEn8weRyAEInawAwMn rxZqyPhtWKe7lp5EWVOy4/hDxpVrsVZETFo7bt8uUonLDz2B7mMKiE8Vp27DZmrZmb DtdCYdDt/BmmNpKLHuOnbxLo3Yv0Y3jPRQ4q3jvA= Authentication-Results: vla5-d4be149c9aa7.qloud-c.yandex.net; dkim=pass header.i=@yandex.com Received: by vla5-8422ddc3185d.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id HIqnNxrtnH-nRJiql5l; Fri, 16 Apr 2021 07:49:27 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) References: <87r1jc5ld1.fsf@yandex.com> <875z0ni9cy.fsf@netris.org> User-agent: mu4e 1.4.15; emacs 27.2 From: Dmitry Matveyev In-reply-to: <875z0ni9cy.fsf@netris.org> Date: Fri, 16 Apr 2021 10:49:25 +0600 Message-ID: <87a6py7s16.fsf@yandex.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) 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: -1.0 (-) Hi Mark, Mark H Weaver writes: > This is the intended behavior, although I agree that it can be > surprising. Thank you for explaining, I think it's clear now! Regards, Dmitry.