* bug#47786: Several build --keep-failed result in wrong env variables
@ 2021-04-15 2:31 Dmitry Matveyev
2021-04-15 17:06 ` Leo Famulari
2021-04-15 20:24 ` Mark H Weaver
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Matveyev @ 2021-04-15 2:31 UTC (permalink / raw)
To: 47786
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#47786: Several build --keep-failed result in wrong env variables
2021-04-15 2:31 bug#47786: Several build --keep-failed result in wrong env variables Dmitry Matveyev
@ 2021-04-15 17:06 ` Leo Famulari
2021-04-15 20:24 ` Mark H Weaver
1 sibling, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2021-04-15 17:06 UTC (permalink / raw)
To: Dmitry Matveyev; +Cc: 47786
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#47786: Several build --keep-failed result in wrong env variables
2021-04-15 2:31 bug#47786: Several build --keep-failed result in wrong env variables Dmitry Matveyev
2021-04-15 17:06 ` Leo Famulari
@ 2021-04-15 20:24 ` Mark H Weaver
2021-04-16 4:49 ` Dmitry Matveyev
1 sibling, 1 reply; 4+ messages in thread
From: Mark H Weaver @ 2021-04-15 20:24 UTC (permalink / raw)
To: greenfork.lists, 47786
tags 47786 + notabug
close 47786
thanks
Hi Dmitry,
Dmitry Matveyev <greenfork.lists@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#47786: Several build --keep-failed result in wrong env variables
2021-04-15 20:24 ` Mark H Weaver
@ 2021-04-16 4:49 ` Dmitry Matveyev
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Matveyev @ 2021-04-16 4:49 UTC (permalink / raw)
To: Mark H Weaver; +Cc: 47786
Hi Mark,
Mark H Weaver <mhw@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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-16 14:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-15 2:31 bug#47786: Several build --keep-failed result in wrong env variables Dmitry Matveyev
2021-04-15 17:06 ` Leo Famulari
2021-04-15 20:24 ` Mark H Weaver
2021-04-16 4:49 ` Dmitry Matveyev
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.