GNU bug report logs - #47786
Several build --keep-failed result in wrong env variables

Previous Next

Package: guix;

Reported by: greenfork.lists <at> yandex.com

Date: Thu, 15 Apr 2021 04:06:01 UTC

Severity: normal

Tags: notabug

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47786 in the body.
You can then email your comments to 47786 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#47786; Package guix. (Thu, 15 Apr 2021 04:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to greenfork.lists <at> yandex.com:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 15 Apr 2021 04:06:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Matveyev <greenfork.lists <at> yandex.com>
To: bug-guix <at> gnu.org
Subject: Several build --keep-failed result in wrong env variables
Date: Thu, 15 Apr 2021 08:31:54 +0600
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.




Information forwarded to bug-guix <at> gnu.org:
bug#47786; Package guix. (Thu, 15 Apr 2021 17:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 47786 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Dmitry Matveyev <greenfork.lists <at> yandex.com>
Cc: 47786 <at> debbugs.gnu.org
Subject: Re: bug#47786: Several build --keep-failed result in wrong env
 variables
Date: Thu, 15 Apr 2021 13:06:47 -0400
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.




Information forwarded to bug-guix <at> gnu.org:
bug#47786; Package guix. (Thu, 15 Apr 2021 20:27:01 GMT) Full text and rfc822 format available.

Message #11 received at 47786 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: greenfork.lists <at> yandex.com, 47786 <at> debbugs.gnu.org
Subject: Re: bug#47786: Several build --keep-failed result in wrong env
 variables
Date: Thu, 15 Apr 2021 16:24:34 -0400
tags 47786 + notabug
close 47786
thanks

Hi Dmitry,

Dmitry Matveyev <greenfork.lists <at> yandex.com> 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-….drv-0" because
within the build container, the directory is _always_ named
"/tmp/guix-build-….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




Added tag(s) notabug. Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Thu, 15 Apr 2021 20:27:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 47786 <at> debbugs.gnu.org and greenfork.lists <at> yandex.com Request was from Mark H Weaver <mhw <at> netris.org> to control <at> debbugs.gnu.org. (Thu, 15 Apr 2021 20:27:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#47786; Package guix. (Fri, 16 Apr 2021 04:50:01 GMT) Full text and rfc822 format available.

Message #18 received at 47786 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Matveyev <greenfork.lists <at> yandex.com>
To: Mark H Weaver <mhw <at> netris.org>
Cc: 47786 <at> debbugs.gnu.org
Subject: Re: bug#47786: Several build --keep-failed result in wrong env
 variables
Date: Fri, 16 Apr 2021 10:49:25 +0600
Hi Mark,

Mark H Weaver <mhw <at> netris.org> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 14 May 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 98 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.