all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: bug-guix@gnu.org
Subject: Re: Assertion failure while building libtool
Date: Sat, 08 Jun 2013 16:35:26 +0200	[thread overview]
Message-ID: <8761xou0up.fsf@gnu.org> (raw)
In-Reply-To: <87vc5pxqu1.fsf@tines.lan> (Mark H. Weaver's message of "Fri, 07 Jun 2013 22:45:58 -0400")

[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

Hi Mark,

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Mark H Weaver <mhw@netris.org> skribis:
>>
>>> I did a clean rebuild of guix from git master (make clean; ./bootstrap;
>>> make), and then attempted to upgrade all packages.  After several
>>> successful builds, the daemon printed this:
>>>
>>> guix-daemon: nix/libstore/local-store.cc:526: void
>>> nix::canonicalisePathMetaData_(const Path&, uid_t,
>>> nix::InodesSeen&): Assertion `!((((st.st_mode)) & 0170000) ==
>>> (0040000))' failed.
>>
>> Yes, this is a daemon bug pending a fix:
>> <https://github.com/NixOS/nix/issues/122>.
>>
>> In the meantime, you can hopefully work around it by deleting the
>> already-present output–i.e., by running either:
>>
>>   guix gc --delete /nix/store/wbsypglflcy7fi08h4finffjy9mqzh12-libtool-2.4.2
>
> This command fails because there are still references:

OK.  I believe this (untested) patch fixes the underlying problem:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1033 bytes --]

diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 3f595e3..37b839a 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2288,8 +2288,15 @@ void DerivationGoal::computeClosure()
                     % path % i->second.hashAlgo % printHash16or32(h) % printHash16or32(h2));
         }
 
-        /* Get rid of all weird permissions. */
-        canonicalisePathMetaData(path, buildUser.enabled() ? buildUser.getUID() : -1);
+	/* Get rid of all weird permissions.  If `path' already existed (as
+	   can happen with multiple-output derivations), it is already owned
+	   by `root' and not by the build user.  In that case, skip
+	   canonicalisation altogether.
+	   See <https://github.com/NixOS/nix/issues/122> for details.  */
+	canonicalisePathMetaData(path,
+				 (buildUser.enabled() && st.st_uid == buildUser.getUID())
+				 ? buildUser.getUID()
+				 : -1);
 
         /* For this output path, find the references to other paths
            contained in it.  Compute the SHA-256 NAR hash at the same

[-- Attachment #3: Type: text/plain, Size: 131 bytes --]


Could you rebuild the daemon with that patch, relaunch the libtool
build, and check if it fixes the problem?

TIA,
Ludo’.

  reply	other threads:[~2013-06-08 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-07 17:25 Assertion failure while building libtool Mark H Weaver
2013-06-07 20:49 ` Ludovic Courtès
2013-06-08  2:45   ` Mark H Weaver
2013-06-08 14:35     ` Ludovic Courtès [this message]
2013-06-08 18:04       ` Mark H Weaver
2013-06-08 22:57         ` Ludovic Courtès
2013-06-15 13:20       ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761xou0up.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guix@gnu.org \
    --cc=mhw@netris.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 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.