bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Assertion failure while building libtool


From: Ludovic Courtès
Subject: Re: Assertion failure while building libtool
Date: Sat, 08 Jun 2013 16:35:26 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Hi Mark,

Mark H Weaver <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>
>> Mark H Weaver <address@hidden> 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:

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
Could you rebuild the daemon with that patch, relaunch the libtool
build, and check if it fixes the problem?

TIA,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]