GNU bug report logs - #17083
‘union-build’ does not handle collisions between a leaf and a sub-tree

Previous Next

Package: guix;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Mon, 24 Mar 2014 14:16:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17083 in the body.
You can then email your comments to 17083 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#17083; Package guix. (Mon, 24 Mar 2014 14:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ludo <at> gnu.org (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 24 Mar 2014 14:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw <at> netris.org>, bug-guix <at> gnu.org
Cc: guix-devel <at> gnu.org
Subject: ‘union-build’ does not handle
 collisions between a leaf and a sub-tree
Date: Mon, 24 Mar 2014 15:15:34 +0100
(Adding bug-guix.)

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

> On the Loongson 3A machine, I finished building all the packages from
> core-updates that I use in my profile, and then tried installing them.
> I got this:
>
> In /gnu/store/9sqx55rgygyrcyg350cfqwy8wqb4fr69-module-import/guix/build/union.scm:
>  226: 1 [loop # #]
> In unknown file:
>    ?: 0 [mkdir "/gnu/store/c30bsax58scw5qwcnbma16k6z88s1lh3-profile/./include" ...]
>
> ERROR: In procedure mkdir:
> ERROR: In procedure mkdir: File exists
> builder for `/gnu/store/17w6kggffh79drmmrdnxy1yhgr6p2in5-profile.drv' failed with exit code 1
>
> The problem turns out to be that 'libffi' makes 'include' a symlink to
> 'lib/libffi-3.0.13/include', and union.scm cannot cope with conflicts
> between a directory and a symlink.

Ouch, good catch.

I’ve come up with a test that reproduces it:

--8<---------------cut here---------------start------------->8---
(test-assert "union-build with symlink to directory"
  (let* ((builder '(begin
                     (use-modules (guix build union) (guix build utils)
                                  (srfi srfi-26))
                     (mkdir-p "one/foo")
                     (call-with-output-file "one/foo/one"
                       (cut display "one" <>))
                     (mkdir-p "two/bar")
                     (symlink "bar" "two/foo")
                     (call-with-output-file "two/foo/two"
                       (cut display "two" <>))

                     (union-build (assoc-ref %outputs "out") '("one" "two"))))
         (drv
          (build-expression->derivation %store "union-collision-symlink"
                                        builder
                                        #:modules '((guix build union)
                                                    (guix build utils)))))
    (and (build-derivations %store (list drv))
         (with-directory-excursion (derivation->output-path drv)
           (and (file-exists? "one/foo/one")
                (file-exists? "two/foo/two")
                (file-exists? "two/bar/two"))))))
--8<---------------cut here---------------end--------------->8---

Actually union.scm cannot handle collisions between a leaf and a
directory in general, which should be fixed.

I can think of these cases:

  1. If the leaf is a regular file, error out.

  2. If the leaf is a symlink:

     a. If it points to a directory, union the directories.

     b. Otherwise, error out.

Does that make sense?

Do you think you could come up with a patch?  Alternately we could apply
Sree’s proposed workaround as a stopgap measure.

Thanks,
Ludo’.




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Wed, 02 Apr 2014 21:44:01 GMT) Full text and rfc822 format available.

Notification sent to ludo <at> gnu.org (Ludovic Courtès):
bug acknowledged by developer. (Wed, 02 Apr 2014 21:44:03 GMT) Full text and rfc822 format available.

Message #10 received at 17083-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: mhw <at> netris.org
Cc: 17083-done <at> debbugs.gnu.org, guix-devel <at> gnu.org
Subject: Re: bug#17083: ‘union-build’ does not
 handle collisions between a leaf and a sub-tree
Date: Wed, 02 Apr 2014 23:43:43 +0200
ludo <at> gnu.org (Ludovic Courtès) skribis:

> Mark H Weaver <mhw <at> netris.org> skribis:
>
>> On the Loongson 3A machine, I finished building all the packages from
>> core-updates that I use in my profile, and then tried installing them.
>> I got this:
>>
>> In /gnu/store/9sqx55rgygyrcyg350cfqwy8wqb4fr69-module-import/guix/build/union.scm:
>>  226: 1 [loop # #]
>> In unknown file:
>>    ?: 0 [mkdir "/gnu/store/c30bsax58scw5qwcnbma16k6z88s1lh3-profile/./include" ...]
>>
>> ERROR: In procedure mkdir:
>> ERROR: In procedure mkdir: File exists
>> builder for `/gnu/store/17w6kggffh79drmmrdnxy1yhgr6p2in5-profile.drv' failed with exit code 1
>>
>> The problem turns out to be that 'libffi' makes 'include' a symlink to
>> 'lib/libffi-3.0.13/include', and union.scm cannot cope with conflicts
>> between a directory and a symlink.
>
> Ouch, good catch.

This is fixed with the new union.scm (commit 1212999.)

> I’ve come up with a test that reproduces it:

This test was actually bogus, so I committed a correct one (commit
a53a9ae.)

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 01 May 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.