bug-guix
[Top][All Lists]
Advanced

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

bug#31560: Commit 47a60325c broke tests/pack.scm


From: Chris Marusich
Subject: bug#31560: Commit 47a60325c broke tests/pack.scm
Date: Fri, 01 Jun 2018 00:45:34 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi Ludo,

I believe the attached patches fix the issue when applied to the master
branch.  The failing test now passes (along with all the other "make
check" tests).  What do you think?  If you approve, then I'll commit it
to the master branch.

address@hidden (Ludovic Courtès) writes:

> Chris Marusich <address@hidden> skribis:
>
>> It seems that tests/pack.scm began to fail at commit
>> 47a60325ca650e8fc1a291c8655b4297f4de8deb.  This commit made the
>> following change in guix/scripts/pack.scm:
>>
>>            (define symlink->directives
>>              ;; Return "populate directives" to make the given symlink and 
>> its
>>              ;; parent directories.
>>              (match-lambda
>>                ((source '-> target)
>>                 (let ((target (string-append #$profile "/" target)))
>>                   `((directory ,(dirname source))
>> -                   (,source -> ,target))))))
>> +                   (,source
>> +                    -> ,(relative-file-name (dirname source) target)))))))
>>
>> It seems this causes the test to fail because it calls
>> relative-file-name like this in the test:
>>
>> (relative-file-name "/bin"
>> "/home/marusich/guix-upgrade-gnucash/test-tmp/store/3j3mrl1sf3bcx4fzlz655mzsp4bir54j-profile/bin/guile")
>>
>> ...
>
> Oooh, sorry about that.

No worries!  Hopefully the fix is as simple as I think it is.

> However what happens here is more something like:
>
>   (relative-file-name
>     
> "/home/marusich/guix-upgrade-gnucash/test-tmp/store/3j3mrl1sf3bcx4fzlz655mzsp4bir54j-profile/bin"
>     
> "/home/marusich/guix-upgrade-gnucash/test-tmp/store/3j3mrl1sf3bcx4fzlz655mzsp4bir54j-profile/bin/guile")
>
> No?  Hmm not sure…

On my system, when I ran the test (tests/pack.scm) just now, the
variables in symlink->directives had the following values (I used pk to
view their values - if you know of a better way, I'd love to know!):

  source = "/bin/Guile"
  target = 
"/home/marusich/guix/test-tmp/store/p8y0nby1mybh5h75hi4hd1x0x36insnd-profile/bin/guile"
  parent = "/bin"

I believe the issue here was that we were not distinguishing between the
"source parent" and the "target parent" directories.  When calling
relative-file-name, I think we need to pass in the "target parent",
which I've done in the attached patches.

> I suppose the test should ensure we get an appropriate relative
>symlink.

Well, the test did catch the problem, so I think the test is OK as
currently written.

>> What is the purpose of calling relative-file-name here?
>
> The goal is to create only relative symlinks so that the tarball is
> relocatable:
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31360
>
> $ ./pre-inst-env guix pack bash-static -S /bin/B=bin/bash
> /gnu/store/7dks90572s5i8nnziippsskm7f4iyqhg-tarball-pack.tar.gz
> $ tar tvf /gnu/store/7dks90572s5i8nnziippsskm7f4iyqhg-tarball-pack.tar.gz 
> |grep bin/B
> lrwxrwxrwx root/root         0 1970-01-01 01:00 ./bin/B -> 
> ../gnu/store/xqgyj976y375wv8gaqh5mz0ysbfdk7f6-profile/bin/bash
> hrwxrwxrwx root/root         0 1970-01-01 01:00 ./bin/B link to ./bin/B
>
> (The “link to” line really shouldn’t be here but let’s ignore it.)

Understood!  Thank you for clarifying the intent.  I figured it was
something like that.  I just wanted to be certain.

-- 
Chris

Attachment: 0001-tests-Call-self-contained-tarball-correctly.patch
Description: Text Data

Attachment: 0002-pack-Create-the-populate-directives-correctly.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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