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: Ludovic Courtès
Subject: bug#31560: Commit 47a60325c broke tests/pack.scm
Date: Wed, 23 May 2018 09:46:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi Chris,

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")
>
> which evaluates to
>
> "../home/marusich/guix-upgrade-gnucash/test-tmp/store/3j3mrl1sf3bcx4fzlz655mzsp4bir54j-profile/bin/guile"
>
> which is not equal to
>
> "/home/marusich/guix-upgrade-gnucash/test-tmp/store/3j3mrl1sf3bcx4fzlz655mzsp4bir54j-profile/bin/guile"
>
> so the test fails.

Oooh, sorry about that.

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…

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

> 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

--8<---------------cut here---------------start------------->8---
$ ./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
--8<---------------cut here---------------end--------------->8---

(The “link to” line really shouldn’t be here but let’s ignore it.)

HTH!

Ludo’.





reply via email to

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