unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Roel Janssen <roel@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 23376@debbugs.gnu.org
Subject: bug#23376: Bootstrap failure on'binutils-cross-boot0-2.25.1: cannot find -lstdc++
Date: Wed, 04 May 2016 10:07:54 +0200	[thread overview]
Message-ID: <87inyuw8it.fsf@gnu.org> (raw)
In-Reply-To: <87h9eeki4d.fsf@gnu.org>

[-- Attachment #1: build-gcc-boot0.log --]
[-- Type: text/plain, Size: 208 bytes --]

/hpc/store/fh67pcp88zm2d7aqrvb5xr6iyh9dgjbh-gcc-cross-boot0-4.9.3
/hpc/store/xy1pzgmhfk2v0rb2yfyl4v91bsyxwf4h-gcc-cross-boot0-4.9.3-lib
/hpc/store/5h2ihlfjcdxpq6w59kf3ldbralxd3k2h-gcc-cross-boot0-4.9.3-debug

[-- Attachment #2: build-gcc-final.log.gz --]
[-- Type: application/gzip, Size: 532830 bytes --]

[-- Attachment #3: guix-userspace.patch --]
[-- Type: text/x-patch, Size: 3547 bytes --]

diff -crB guix-master/nix/libstore/build.cc guix-userspace/nix/libstore/build.cc
*** guix-master/nix/libstore/build.cc	Wed May  4 09:56:21 2016
--- guix-userspace/nix/libstore/build.cc	Mon Apr 25 16:39:29 2016
***************
*** 1811,1818 ****
          buildUser.kill();
  
          /* Change ownership of the temporary build directory. */
!         if (chown(tmpDir.c_str(), buildUser.getUID(), buildUser.getGID()) == -1)
!             throw SysError(format("cannot change ownership of '%1%'") % tmpDir);
      }
  
      if (useChroot) {
--- 1811,1818 ----
          buildUser.kill();
  
          /* Change ownership of the temporary build directory. */
!         //if (chown(tmpDir.c_str(), buildUser.getUID(), buildUser.getGID()) == -1)
!         //    throw SysError(format("cannot change ownership of '%1%'") % tmpDir);
      }
  
      if (useChroot) {
***************
*** 1832,1839 ****
          if (mkdir(chrootRootDir.c_str(), 0750) == -1)
              throw SysError(format("cannot create ‘%1%’") % chrootRootDir);
  
!         if (chown(chrootRootDir.c_str(), 0, buildUser.getGID()) == -1)
!             throw SysError(format("cannot change ownership of ‘%1%’") % chrootRootDir);
  
          /* Create a writable /tmp in the chroot.  Many builders need
             this.  (Of course they should really respect $TMPDIR
--- 1832,1839 ----
          if (mkdir(chrootRootDir.c_str(), 0750) == -1)
              throw SysError(format("cannot create ‘%1%’") % chrootRootDir);
  
!         //if (chown(chrootRootDir.c_str(), 0, buildUser.getGID()) == -1)
!         //    throw SysError(format("cannot change ownership of ‘%1%’") % chrootRootDir);
  
          /* Create a writable /tmp in the chroot.  Many builders need
             this.  (Of course they should really respect $TMPDIR
***************
*** 1889,1896 ****
          createDirs(chrootStoreDir);
          chmod_(chrootStoreDir, 01775);
  
!         if (chown(chrootStoreDir.c_str(), 0, buildUser.getGID()) == -1)
!             throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir);
  
          foreach (PathSet::iterator, i, inputPaths) {
              struct stat st;
--- 1889,1896 ----
          createDirs(chrootStoreDir);
          chmod_(chrootStoreDir, 01775);
  
!         //if (chown(chrootStoreDir.c_str(), 0, buildUser.getGID()) == -1)
!         //    throw SysError(format("cannot change ownership of ‘%1%’") % chrootStoreDir);
  
          foreach (PathSet::iterator, i, inputPaths) {
              struct stat st;
***************
*** 1999,2010 ****
--- 1999,2014 ----
      */
  #if CHROOT_ENABLED
      if (useChroot) {
+         pid = fork();
+         if (pid == 0) runChild();
+ 	/*
  	char stack[32 * 1024];
  	int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS | SIGCHLD;
  	if (!fixedOutput) flags |= CLONE_NEWNET;
  	pid = clone(childEntry, stack + sizeof(stack) - 8, flags, this);
  	if (pid == -1)
  	    throw SysError("cloning builder process");
+ 	*/
      } else
  #endif
      {
***************
*** 2045,2051 ****
  
          commonChildInit(builderOut);
  
! #if CHROOT_ENABLED
          if (useChroot) {
              /* Initialise the loopback interface. */
              AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));
--- 2049,2055 ----
  
          commonChildInit(builderOut);
  
! #if CHROOT_ENABLED && 0
          if (useChroot) {
              /* Initialise the loopback interface. */
              AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));

[-- Attachment #4: Type: text/plain, Size: 2289 bytes --]


Ludovic Courtès writes:

> Roel Janssen <roel@gnu.org> skribis:
>
>> In an attempt to bootstrap Guix, I repeatedly encounter the same error.
>> I attached the last 5000 lines of the build output of the command:
>>   guix build bootstrap-tarballs
>>
>> When running the daemon, I used the following environment variables:
>> NIX_STORE_DIR=/hpc/store
>> NIX_CONF_DIR=/hpc/etc/guix
>> NIX_STATE_DIR=/hpc/var/guix
>> NIX_LOG_DIR=/hpc/log
>
> And TMPDIR?

I didn't set TMPDIR.  Should I do that?

> (For recent versions of guix-daemon, TMPDIR has no effect on the build
> chroot.  I assume this uses a recent guix-daemon.)

Checkout out and compiled at the day I submitted the bug report.

> Note that these environment variables are undocumented; use at your own
> risks.  :-)

Ha!  I found them in the code for the guix-daemon.  Unrelated to this
bugreport, but don't you think we should rename these to GUIX_*
equivalent environment variables?

>> The same environment variables (and values) were set when running the
>> guix build command.
>>
>> What am I doing that causes the build to fail?
>
> Did you pass the --disable-chroot or --chroot-directory options of
> guix-daemon?

No, but I have made some modifications to the code to make it run
completely in userspace.  The code should effectively disable chrooting
(unfortunately).

I attached a patch displaying the differences between the version I used
and commit 85f0945.

> The log you sent suggests a failure to build (@@ (gnu packages
> commencement) gcc-final) because the directory is called “gcc-4.9.3”,
> not “gcc-cross-boot0-4.9.3”.  However, it also shows that
> binutils-cross-boot0 is used, which is not the case for ‘gcc-final’.
>
> What Guix commit are you using?

I'm using commit 85f09459162d12e7ce7874995ae2837164ed17ee (with the
modifications in my patch).

> Could you identify more precisely what’s failing to build?  For
> instance, you can run:
>
>   guix build -e '(@@ (gnu packages commencement) gcc-boot0)'
>   guix build -e '(@@ (gnu packages commencement) gcc-final)'

It seems the problem arises when building gcc-final.  I attached the
complete output of both commands.  Because the output for gcc-final is
rather large, I compressed it.

Thanks for your time!

Kind regards,
Roel Janssen

  reply	other threads:[~2016-05-04  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r3dte4kx.fsf@gnu.org>
2016-05-03 20:21 ` bug#23376: Bootstrap failure on'binutils-cross-boot0-2.25.1: cannot find -lstdc++ Ludovic Courtès
2016-05-04  8:07   ` Roel Janssen [this message]
2016-05-05 15:40     ` Ludovic Courtès

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=87inyuw8it.fsf@gnu.org \
    --to=roel@gnu.org \
    --cc=23376@debbugs.gnu.org \
    --cc=ludo@gnu.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).