From: Sarah Morgensen <iskarian@mgsn.dev>
To: Christine Lemmer-Webber <cwebber@dustycloud.org>
Cc: 50441@debbugs.gnu.org
Subject: bug#50441: Wrong build directory number shown in environment-variables file
Date: Mon, 06 Sep 2021 21:44:59 -0700 [thread overview]
Message-ID: <86eea1hu44.fsf@mgsn.dev> (raw)
In-Reply-To: <87a6kpcs85.fsf@dustycloud.org> (Christine Lemmer-Webber's message of "Mon, 06 Sep 2021 17:22:55 -0400 (7 hours, 5 minutes, 7 seconds ago)")
Hello Christine,
Christine Lemmer-Webber <cwebber@dustycloud.org> writes:
> I was doing guix build with "--keep-missing" and looking around in a few
> of the output directories. I was peeking in:
>
> /tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-4
>
> But wait... the "environment-variables" file says:
>
> #+BEGIN_SRC sh
> export TEMP=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TEMPDIR=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TMP=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> export TMPDIR=\
> "/tmp/guix-build-u-boot-mnt-reform2-2021.06.drv-0"
> #+END_SRC
>
> Now wait a minute. Look at that last number. What the hell is going on
> here? Is this a bug in Guix? Why is it pointing at -0 in the -4 build
> directory?
>
> Does this point at a more serious issue? What's going on?
I've definitely noticed this before as well, and had to work around it
(I needed to inspect temp caches). Thanks for actually sending a bug
report :)
I'm not at all familiar with the nix code, but it looks like this might
be related:
nix/libstore/build.cc:1654
--8<---------------cut here---------------start------------->8---
/* In a sandbox, for determinism, always use the same temporary
directory. */
tmpDirInSandbox = useChroot ? canonPath("/tmp", true) + "/guix-build-" + drvName + "-0" : tmpDir;
/* For convenience, set an environment pointing to the top build
directory. */
env["NIX_BUILD_TOP"] = tmpDirInSandbox;
/* Also set TMPDIR and variants to point to this directory. */
env["TMPDIR"] = env["TEMPDIR"] = env["TMP"] = env["TEMP"] = tmpDirInSandbox;
/* Explicitly set PWD to prevent problems with chroot builds. In
particular, dietlibc cannot figure out the cwd because the
inode of the current directory doesn't appear in .. (because
getdents returns the inode of the mount point). */
env["PWD"] = tmpDirInSandbox;
--8<---------------cut here---------------end--------------->8---
I'm not entirely sure what's going on. I think we build in chroot by
default, which would explain why the temp vars get set to "-0" even
though everything else seems to work okay.
--
Sarah
next prev parent reply other threads:[~2021-09-07 4:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 21:22 bug#50441: Wrong build directory number shown in environment-variables file Christine Lemmer-Webber
2021-09-07 4:34 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2021-09-07 14:26 ` Christine Lemmer-Webber
2021-09-14 7:47 ` Ludovic Courtès
2021-09-07 4:44 ` Sarah Morgensen [this message]
2021-09-07 14:25 ` Christine Lemmer-Webber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86eea1hu44.fsf@mgsn.dev \
--to=iskarian@mgsn.dev \
--cc=50441@debbugs.gnu.org \
--cc=cwebber@dustycloud.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).