GNU bug report logs - #17935
Dealing with symlinks in the build-time store directory

Previous Next

Package: guix;

Reported by: Alex Kost <alezost <at> gmail.com>

Date: Fri, 4 Jul 2014 15:42:02 UTC

Severity: normal

Found in version 0.6

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 17935 in the body.
You can then email your comments to 17935 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#17935; Package guix. (Fri, 04 Jul 2014 15:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Kost <alezost <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 04 Jul 2014 15:42:03 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: make check failed
Date: Fri, 04 Jul 2014 19:40:45 +0400
[Message part 1 (text/plain, inline)]
Hello,

I am on i686 and I tried to build guix from git like this:
1) ./configure  (successful)
2) "make check" failed; "test-suite.log" attached

[test-suite.log (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Fri, 04 Jul 2014 17:13:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Fri, 04 Jul 2014 19:12:14 +0200
[Message part 1 (text/plain, inline)]
Alex Kost <alezost <at> gmail.com> skribis:

>  525: 0 [add-text-to-store # "guile-bootstrap-2.0.drv" ...]
>
> guix/store.scm:525:9: In procedure add-text-to-store:
> guix/store.scm:525:9: Throw to key `srfi-34' with args `(#<condition &nix-protocol-error [message: "derivation `/home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv' has incorrect output `/media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0', should be `/home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'" status: 1] 9529090>)'.

Can you confirm that the output of “sha1sum
gnu/packages/bootstrap/i686-linux/*” is (from our IRC discussion, it
seems you’re on i686-linux):

--8<---------------cut here---------------start------------->8---
87ebb7ed64a62467bae8afd60c30146d29b974dd  gnu/packages/bootstrap/i686-linux/bash
b0122cf4cf16e2b8a471163550178527b0306586  gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz
9df288907e9031e6cf1db6b3bdaf08c956da28da  gnu/packages/bootstrap/i686-linux/mkdir
59b06438f6f673f3b7311277a256d164cb174337  gnu/packages/bootstrap/i686-linux/tar
0cfe1ecb8916c9e515c5f844671039a7fe76d261  gnu/packages/bootstrap/i686-linux/xz
--8<---------------cut here---------------end--------------->8---

Could you try running this command:

  ./test-env guix build guile-bootstrap

Assuming it fails as above, could you apply the patch below, run the
command again, and send its standard output?

[Message part 2 (text/x-patch, inline)]
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 5ca516a..eb758b1 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -701,7 +701,7 @@ derivations where the costs of data transfers would outweigh the benefits."
                                    (derivation->string drv)
                                    (map derivation-input-path
                                         inputs))))
-      (set-file-name drv file))))
+      (pk 'debug-drv (set-file-name drv file)))))
 
 (define* (map-derivation store drv mapping
                          #:key (system (%current-system)))
[Message part 3 (text/plain, inline)]
Thanks in advance!

Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Fri, 04 Jul 2014 18:24:01 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Fri, 04 Jul 2014 22:23:25 +0400
[Message part 1 (text/plain, inline)]
Ludovic Courtès (2014-07-04 21:12 +0400) wrote:

> Alex Kost <alezost <at> gmail.com> skribis:
>
>>  525: 0 [add-text-to-store # "guile-bootstrap-2.0.drv" ...]
>>
>> guix/store.scm:525:9: In procedure add-text-to-store:
>> guix/store.scm:525:9: Throw to key `srfi-34' with args `(#<condition
>> &nix-protocol-error [message: "derivation
>> /home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv'
>> has incorrect output
>> /media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0',
>> should be
>> /home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'"
>> status: 1] 9529090>)'.
>
> Can you confirm that the output of “sha1sum
> gnu/packages/bootstrap/i686-linux/*” is (from our IRC discussion, it
> seems you’re on i686-linux):
>
> 87ebb7ed64a62467bae8afd60c30146d29b974dd  gnu/packages/bootstrap/i686-linux/bash
> b0122cf4cf16e2b8a471163550178527b0306586  gnu/packages/bootstrap/i686-linux/guile-2.0.9.tar.xz
> 9df288907e9031e6cf1db6b3bdaf08c956da28da  gnu/packages/bootstrap/i686-linux/mkdir
> 59b06438f6f673f3b7311277a256d164cb174337  gnu/packages/bootstrap/i686-linux/tar
> 0cfe1ecb8916c9e515c5f844671039a7fe76d261  gnu/packages/bootstrap/i686-linux/xz

Yes the sums are the same.

> Could you try running this command:
>
>   ./test-env guix build guile-bootstrap
>
> Assuming it fails as above, could you apply the patch below, run the
> command again, and send its standard output?

Yes, it failed.

> diff --git a/guix/derivations.scm b/guix/derivations.scm
> index 5ca516a..eb758b1 100644
> --- a/guix/derivations.scm
> +++ b/guix/derivations.scm
> @@ -701,7 +701,7 @@ derivations where the costs of data transfers would outweigh the benefits."
>                                     (derivation->string drv)
>                                     (map derivation-input-path
>                                          inputs))))
> -      (set-file-name drv file))))
> +      (pk 'debug-drv (set-file-name drv file)))))
>
>  (define* (map-derivation store drv mapping
>                           #:key (system (%current-system)))

After applying the patch and running "./test-env guix build
guile-bootstrap" I got the following:

[Message part 2 (text/plain, inline)]
;;; note: source file /home/alexx/src/guix/guix/derivations.scm
;;;       newer than compiled /home/alexx/src/guix/guix/derivations.go
accepted connection from pid 9834, uid 1000
spurious SIGPOLL
spurious SIGPOLL
guix build: error: build failed: derivation `/home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv' has incorrect output `/media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0', should be `/home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'
9 operations
./test-env: line 1:  9833 Terminated              "/home/alexx/src/guix/pre-inst-env" "/home/alexx/src/guix/guix-daemon" --disable-chroot

[Message part 3 (text/plain, inline)]
I don't know if it relates, but my "/home/alexx/src" is a symlink to
"/media/storage/src".

Also I have tried guix 0.6 (from ftp://alpha.gnu.org/gnu/guix/) and it
was built successfully (no fails in "make check").

--
Alex Kost

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Fri, 04 Jul 2014 21:31:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Fri, 04 Jul 2014 23:30:22 +0200
[Message part 1 (text/plain, inline)]
Alex Kost <alezost <at> gmail.com> skribis:

> guix build: error: build failed: derivation `/home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv' has incorrect output `/media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0', should be `/home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'
> 9 operations
> ./test-env: line 1:  9833 Terminated              "/home/alexx/src/guix/pre-inst-env" "/home/alexx/src/guix/guix-daemon" --disable-chroot
>
>
> I don't know if it relates, but my "/home/alexx/src" is a symlink to
> "/media/storage/src".

Ah yes, I hadn’t noticed that in the error message, but this is a source
of confusion for the daemon.

Could you try that command again with this patch:

[Message part 2 (text/x-patch, inline)]
diff --git a/test-env.in b/test-env.in
index a3b3536..f11c014 100644
--- a/test-env.in
+++ b/test-env.in
@@ -27,8 +27,11 @@
 if [ -x "@abs_top_builddir@/guix-daemon" ]
 then
     NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
-    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
-    NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
+
+    # Canonicalize the store directory name in an attempt to avoid symlinks in
+    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
+    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
+
     NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
     NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
     NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
[Message part 3 (text/plain, inline)]
> Also I have tried guix 0.6 (from ftp://alpha.gnu.org/gnu/guix/) and it
> was built successfully (no fails in "make check").

But was it also from this symlinked directory?

Thanks,
Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 08:49:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 12:48:21 +0400
Ludovic Courtès (2014-07-05 01:30 +0400) wrote:

> Alex Kost <alezost <at> gmail.com> skribis:
>
>> guix build: error: build failed: derivation
>> /home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv'
>> has incorrect output
>> /media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0',
>> should be
>> /home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'
>> 9 operations
>> ./test-env: line 1: 9833 Terminated
>> "/home/alexx/src/guix/pre-inst-env" "/home/alexx/src/guix/guix-daemon"
>> --disable-chroot
>>
>>
>> I don't know if it relates, but my "/home/alexx/src" is a symlink to
>> "/media/storage/src".
>
> Ah yes, I hadn’t noticed that in the error message, but this is a source
> of confusion for the daemon.
>
> Could you try that command again with this patch:
>
> diff --git a/test-env.in b/test-env.in
> index a3b3536..f11c014 100644
> --- a/test-env.in
> +++ b/test-env.in
> @@ -27,8 +27,11 @@
>  if [ -x "@abs_top_builddir@/guix-daemon" ]
>  then
>      NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
> -    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
> -    NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
> +
> +    # Canonicalize the store directory name in an attempt to avoid symlinks in
> +    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
> +    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
> +
>      NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
>      NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
>      NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
>
>> Also I have tried guix 0.6 (from ftp://alpha.gnu.org/gnu/guix/) and it
>> was built successfully (no fails in "make check").
>
> But was it also from this symlinked directory?

No, it was compiled from a direct path (no symlinks).

I tried to compile guix from git from a path without symlinks and it was
successful as well.  So apparently the problem is with symlinked paths.

As for the symlinked directory, with your patch, "./test-env guix build
guile-bootstrap" also failed.  Then I tried to start a build process
with your patch from the beginning (from "./bootstrap" in a fresh git
tree), and I have got 3 fails (without your patch there were 14).

"test-suite.log" tells:

    ./test-env: line 33: cd: /home/alexx/src/guix/test-tmp/store: No such file or directory

So I think the problem with the patch is that “@GUIX_TEST_ROOT@/store”
directory does not exist when “`cd "@GUIX_TEST_ROOT@/store"; pwd -P`” is
being invoked.

>
> Thanks,
> Ludo’.

--
Alex Kost




Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 09:43:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 11:42:39 +0200
[Message part 1 (text/plain, inline)]
Alex Kost <alezost <at> gmail.com> skribis:

> Ludovic Courtès (2014-07-05 01:30 +0400) wrote:
>
>> Alex Kost <alezost <at> gmail.com> skribis:
>>
>>> guix build: error: build failed: derivation
>>> /home/alexx/src/guix/test-tmp/store/kaz0wkisszxrjh38znhgks2pc2g7dqgh-guile-bootstrap-2.0.drv'
>>> has incorrect output
>>> /media/storage/src/guix/test-tmp/store/ym7nnqd4yqk3mn8pg52d19xyy2j3hz54-guile-bootstrap-2.0',
>>> should be
>>> /home/alexx/src/guix/test-tmp/store/zlj0z1dpwl2qccb56rwgdk3k8qnwwaz8-guile-bootstrap-2.0'
>>> 9 operations
>>> ./test-env: line 1: 9833 Terminated
>>> "/home/alexx/src/guix/pre-inst-env" "/home/alexx/src/guix/guix-daemon"
>>> --disable-chroot
>>>
>>>
>>> I don't know if it relates, but my "/home/alexx/src" is a symlink to
>>> "/media/storage/src".
>>
>> Ah yes, I hadn’t noticed that in the error message, but this is a source
>> of confusion for the daemon.
>>
>> Could you try that command again with this patch:
>>
>> diff --git a/test-env.in b/test-env.in
>> index a3b3536..f11c014 100644
>> --- a/test-env.in
>> +++ b/test-env.in
>> @@ -27,8 +27,11 @@
>>  if [ -x "@abs_top_builddir@/guix-daemon" ]
>>  then
>>      NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
>> -    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
>> -    NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
>> +
>> +    # Canonicalize the store directory name in an attempt to avoid symlinks in
>> +    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
>> +    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
>> +
>>      NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
>>      NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
>>      NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
>>
>>> Also I have tried guix 0.6 (from ftp://alpha.gnu.org/gnu/guix/) and it
>>> was built successfully (no fails in "make check").
>>
>> But was it also from this symlinked directory?
>
> No, it was compiled from a direct path (no symlinks).
>
> I tried to compile guix from git from a path without symlinks and it was
> successful as well.  So apparently the problem is with symlinked paths.

Yes.

> As for the symlinked directory, with your patch, "./test-env guix build
> guile-bootstrap" also failed.

[...]

> So I think the problem with the patch is that “@GUIX_TEST_ROOT@/store”
> directory does not exist when “`cd "@GUIX_TEST_ROOT@/store"; pwd -P`” is
> being invoked.

Oops, indeed.  Could you try this version, again from a directory with
symlinks?

[Message part 2 (text/x-patch, inline)]
diff --git a/test-env.in b/test-env.in
index a3b3536..9d0c8cc 100644
--- a/test-env.in
+++ b/test-env.in
@@ -27,8 +27,15 @@
 if [ -x "@abs_top_builddir@/guix-daemon" ]
 then
     NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
-    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
     NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
+
+    # Do that because store.scm calls `canonicalize-path' on it.
+    mkdir -p "$NIX_STORE_DIR"
+
+    # Canonicalize the store directory name in an attempt to avoid symlinks in
+    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
+    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
+
     NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
     NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
     NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
@@ -71,9 +78,6 @@ then
         GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES				\
         NIX_CONF_DIR XDG_CACHE_HOME
 
-    # Do that because store.scm calls `canonicalize-path' on it.
-    mkdir -p "$NIX_STORE_DIR"
-
     # Launch the daemon without chroot support because is may be
     # unavailable, for instance if we're not running as root.
     "@abs_top_builddir@/pre-inst-env"				\
[Message part 3 (text/plain, inline)]
Thanks in advance,
Ludo’.

Changed bug title to 'Dealing with symlinks in the build-time store directory' from 'make check failed' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Sat, 05 Jul 2014 09:48:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 0.6. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Sat, 05 Jul 2014 09:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 13:35:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 17:33:46 +0400
[Message part 1 (text/plain, inline)]
Ludovic Courtès (2014-07-05 13:42 +0400) wrote:
>
> [...]
>
>> So I think the problem with the patch is that “@GUIX_TEST_ROOT@/store”
>> directory does not exist when “`cd "@GUIX_TEST_ROOT@/store"; pwd -P`” is
>> being invoked.
>
> Oops, indeed.  Could you try this version, again from a directory with
> symlinks?
>
> diff --git a/test-env.in b/test-env.in
> index a3b3536..9d0c8cc 100644
> --- a/test-env.in
> +++ b/test-env.in
> @@ -27,8 +27,15 @@
>  if [ -x "@abs_top_builddir@/guix-daemon" ]
>  then
>      NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
> -    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
>      NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
> +
> +    # Do that because store.scm calls `canonicalize-path' on it.
> +    mkdir -p "$NIX_STORE_DIR"
> +
> +    # Canonicalize the store directory name in an attempt to avoid symlinks in
> +    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
> +    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
> +
>      NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
>      NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
>      NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
> @@ -71,9 +78,6 @@ then
>          GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES				\
>          NIX_CONF_DIR XDG_CACHE_HOME
>
> -    # Do that because store.scm calls `canonicalize-path' on it.
> -    mkdir -p "$NIX_STORE_DIR"
> -
>      # Launch the daemon without chroot support because is may be
>      # unavailable, for instance if we're not running as root.
>      "@abs_top_builddir@/pre-inst-env"				\
>
> Thanks in advance,
> Ludo’.

I have tried that.  Unfortunately 2 tests failed.  I'm attaching
"test-suite.log" and 2 "package.log"-s: the first "package.log" is the
one from the failed built (from a symlinked path) and the second one is
from the succeeded built (from a real path).

Also I think
    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
may be replaced with:
    NIX_STORE_DIR="`realpath "@GUIX_TEST_ROOT@/store"`"

[test-suite.log (text/plain, attachment)]
[packages.log (text/plain, attachment)]
[packages.log (text/plain, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 14:00:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 15:59:01 +0200
[Message part 1 (text/plain, inline)]
Alex Kost <alezost <at> gmail.com> skribis:

> Ludovic Courtès (2014-07-05 13:42 +0400) wrote:
>>
>> [...]
>>
>>> So I think the problem with the patch is that “@GUIX_TEST_ROOT@/store”
>>> directory does not exist when “`cd "@GUIX_TEST_ROOT@/store"; pwd -P`” is
>>> being invoked.
>>
>> Oops, indeed.  Could you try this version, again from a directory with
>> symlinks?
>>
>> diff --git a/test-env.in b/test-env.in
>> index a3b3536..9d0c8cc 100644
>> --- a/test-env.in
>> +++ b/test-env.in
>> @@ -27,8 +27,15 @@
>>  if [ -x "@abs_top_builddir@/guix-daemon" ]
>>  then
>>      NIX_SETUID_HELPER="@abs_top_builddir@/nix-setuid-helper" # normally unused
>> -    NIX_IGNORE_SYMLINK_STORE=1	# in case the store is a symlink
>>      NIX_STORE_DIR="@GUIX_TEST_ROOT@/store"
>> +
>> +    # Do that because store.scm calls `canonicalize-path' on it.
>> +    mkdir -p "$NIX_STORE_DIR"
>> +
>> +    # Canonicalize the store directory name in an attempt to avoid symlinks in
>> +    # it or its parent directories.  See <http://bugs.gnu.org/17935>.
>> +    NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
>> +
>>      NIX_LOCALSTATE_DIR="@GUIX_TEST_ROOT@/var"
>>      NIX_LOG_DIR="@GUIX_TEST_ROOT@/var/log/guix"
>>      NIX_DB_DIR="@GUIX_TEST_ROOT@/db"
>> @@ -71,9 +78,6 @@ then
>>          GUIX_ALLOW_UNAUTHENTICATED_SUBSTITUTES				\
>>          NIX_CONF_DIR XDG_CACHE_HOME
>>
>> -    # Do that because store.scm calls `canonicalize-path' on it.
>> -    mkdir -p "$NIX_STORE_DIR"
>> -
>>      # Launch the daemon without chroot support because is may be
>>      # unavailable, for instance if we're not running as root.
>>      "@abs_top_builddir@/pre-inst-env"				\
>>
>> Thanks in advance,
>> Ludo’.
>
> I have tried that.  Unfortunately 2 tests failed.

OK, we’re making progress.  ;-)

> Also I think
>     NIX_STORE_DIR="`cd "@GUIX_TEST_ROOT@/store"; pwd -P`"
> may be replaced with:
>     NIX_STORE_DIR="`realpath "@GUIX_TEST_ROOT@/store"`"

This is virtually equivalent, but probably less portable.

> FAIL: tests/guix-register
> =========================

[...]

> + guix-register -p /home/alexx/src/guix/t-register-7895
> error: the path `/home/alexx/src' is a symlink; this is not allowed for the Nix store and its parent directories

Can you check whether the patch below (in addition to the previous one)
solves the problem?

[Message part 2 (text/x-patch, inline)]
diff --git a/tests/guix-register.sh b/tests/guix-register.sh
index 019a451..f18de8d 100644
--- a/tests/guix-register.sh
+++ b/tests/guix-register.sh
@@ -58,7 +58,7 @@ guile -c "
 
 mkdir -p "$new_store/$storedir"
 new_store_dir="`cd "$new_store/$storedir" ; pwd`"
-new_store="`cd "$new_store" ; pwd`"
+new_store="`cd "$new_store" ; pwd -P`"
 
 to_copy="`guix build guile-bootstrap`"
 cp -r "$to_copy" "$new_store_dir"
@@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure"
 
 # Now make sure this is recognized as valid.
 
-NIX_IGNORE_SYMLINK_STORE=1
 NIX_STORE_DIR="$new_store_dir"
 NIX_STATE_DIR="$new_store$localstatedir"
 NIX_LOG_DIR="$new_store$localstatedir/log/guix"
[Message part 3 (text/plain, inline)]
> Test begin:
>   test-name: "package-field-location, relative file name"
>   source-file: "/media/storage/src/guix/./tests/packages.scm"
>   source-line: 85
>   source-form: (test-equal "package-field-location, relative file name" (location-file (package-location %bootstrap-guile)) (with-fluids ((%file-port-name-canonicalization (quote absolute))) (location-file (package-field-location %bootstrap-guile (quote version)))))
> Test end:
>   result-kind: fail
>   actual-value: "./gnu/packages/bootstrap.scm"
>   expected-value: "gnu/packages/bootstrap.scm"

I’m not sure if this one relates to the symlink story, but it’s harmless
anyway.

Thanks,
Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 15:31:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 19:30:48 +0400
[Message part 1 (text/plain, inline)]
Ludovic Courtès (2014-07-05 17:59 +0400) wrote:

> Alex Kost <alezost <at> gmail.com> skribis:
>
>> FAIL: tests/guix-register
>> =========================
>
> [...]
>
>> + guix-register -p /home/alexx/src/guix/t-register-7895
>> error: the path `/home/alexx/src' is a symlink; this is not allowed for the Nix store and its parent directories
>
> Can you check whether the patch below (in addition to the previous one)
> solves the problem?
>
> diff --git a/tests/guix-register.sh b/tests/guix-register.sh
> index 019a451..f18de8d 100644
> --- a/tests/guix-register.sh
> +++ b/tests/guix-register.sh
> @@ -58,7 +58,7 @@ guile -c "
>
>  mkdir -p "$new_store/$storedir"
>  new_store_dir="`cd "$new_store/$storedir" ; pwd`"
> -new_store="`cd "$new_store" ; pwd`"
> +new_store="`cd "$new_store" ; pwd -P`"
>
>  to_copy="`guix build guile-bootstrap`"
>  cp -r "$to_copy" "$new_store_dir"
> @@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure"
>
>  # Now make sure this is recognized as valid.
>
> -NIX_IGNORE_SYMLINK_STORE=1
>  NIX_STORE_DIR="$new_store_dir"
>  NIX_STATE_DIR="$new_store$localstatedir"
>  NIX_LOG_DIR="$new_store$localstatedir/log/guix"

After this patch “guix-register” test failed again, but when I modified
“new_store_dir” in the same way, it passed.  Here is the modified patch:

[Message part 2 (text/x-patch, inline)]
diff --git a/tests/guix-register.sh b/tests/guix-register.sh
index 019a451..28b799b 100644
--- a/tests/guix-register.sh
+++ b/tests/guix-register.sh
@@ -57,8 +57,8 @@ guile -c "
 #
 
 mkdir -p "$new_store/$storedir"
-new_store_dir="`cd "$new_store/$storedir" ; pwd`"
-new_store="`cd "$new_store" ; pwd`"
+new_store_dir="`cd "$new_store/$storedir" ; pwd -P`"
+new_store="`cd "$new_store" ; pwd -P`"
 
 to_copy="`guix build guile-bootstrap`"
 cp -r "$to_copy" "$new_store_dir"
@@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure"
 
 # Now make sure this is recognized as valid.
 
-NIX_IGNORE_SYMLINK_STORE=1
 NIX_STORE_DIR="$new_store_dir"
 NIX_STATE_DIR="$new_store$localstatedir"
 NIX_LOG_DIR="$new_store$localstatedir/log/guix"

[Message part 3 (text/plain, inline)]
>> Test begin:
>>   test-name: "package-field-location, relative file name"
>>   source-file: "/media/storage/src/guix/./tests/packages.scm"
>>   source-line: 85
>>   source-form: (test-equal "package-field-location, relative file
>> name" (location-file (package-location %bootstrap-guile)) (with-fluids
>> ((%file-port-name-canonicalization (quote absolute))) (location-file
>> (package-field-location %bootstrap-guile (quote version)))))
>> Test end:
>>   result-kind: fail
>>   actual-value: "./gnu/packages/bootstrap.scm"
>>   expected-value: "gnu/packages/bootstrap.scm"
>
> I’m not sure if this one relates to the symlink story, but it’s harmless
> anyway.

It's harmless but “make check” fails because of this and now it's the
only fail left unsolved.  I don't understand why those paths become so
fancy, but it happens only when I build from a symlinked directory and
doesn't happen in an absolute directory.  I don't insist but perhaps it
would be better to make a less strict test.

Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 17:21:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 19:20:04 +0200
Alex Kost <alezost <at> gmail.com> skribis:

> Ludovic Courtès (2014-07-05 17:59 +0400) wrote:
>
>> Alex Kost <alezost <at> gmail.com> skribis:
>>
>>> FAIL: tests/guix-register
>>> =========================
>>
>> [...]
>>
>>> + guix-register -p /home/alexx/src/guix/t-register-7895
>>> error: the path `/home/alexx/src' is a symlink; this is not allowed for the Nix store and its parent directories
>>
>> Can you check whether the patch below (in addition to the previous one)
>> solves the problem?
>>
>> diff --git a/tests/guix-register.sh b/tests/guix-register.sh
>> index 019a451..f18de8d 100644
>> --- a/tests/guix-register.sh
>> +++ b/tests/guix-register.sh
>> @@ -58,7 +58,7 @@ guile -c "
>>
>>  mkdir -p "$new_store/$storedir"
>>  new_store_dir="`cd "$new_store/$storedir" ; pwd`"
>> -new_store="`cd "$new_store" ; pwd`"
>> +new_store="`cd "$new_store" ; pwd -P`"
>>
>>  to_copy="`guix build guile-bootstrap`"
>>  cp -r "$to_copy" "$new_store_dir"
>> @@ -81,7 +81,6 @@ guix-register --prefix "$new_store" "$closure"
>>
>>  # Now make sure this is recognized as valid.
>>
>> -NIX_IGNORE_SYMLINK_STORE=1
>>  NIX_STORE_DIR="$new_store_dir"
>>  NIX_STATE_DIR="$new_store$localstatedir"
>>  NIX_LOG_DIR="$new_store$localstatedir/log/guix"
>
> After this patch “guix-register” test failed again, but when I modified
> “new_store_dir” in the same way, it passed.  Here is the modified patch:

Excellent, thanks.  Committed in 8ad4949.

>>> Test begin:
>>>   test-name: "package-field-location, relative file name"
>>>   source-file: "/media/storage/src/guix/./tests/packages.scm"
>>>   source-line: 85
>>>   source-form: (test-equal "package-field-location, relative file
>>> name" (location-file (package-location %bootstrap-guile)) (with-fluids
>>> ((%file-port-name-canonicalization (quote absolute))) (location-file
>>> (package-field-location %bootstrap-guile (quote version)))))
>>> Test end:
>>>   result-kind: fail
>>>   actual-value: "./gnu/packages/bootstrap.scm"
>>>   expected-value: "gnu/packages/bootstrap.scm"
>>
>> I’m not sure if this one relates to the symlink story, but it’s harmless
>> anyway.
>
> It's harmless but “make check” fails because of this and now it's the
> only fail left unsolved.  I don't understand why those paths become so
> fancy, but it happens only when I build from a symlinked directory and
> doesn't happen in an absolute directory.  I don't insist but perhaps it
> would be better to make a less strict test.

Could you run “./pre-inst-env guile”, type these 3 expressions at the
prompt, and send the result:

  (with-fluids ((%file-port-name-canonicalization 'relative))
    (call-with-input-file (search-path %load-path "gnu/packages/bootstrap.scm")
       port-filename))

  (search-path %load-path "gnu/packages/bootstrap.scm")

  (version)

TIA,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#17935; Package guix. (Sat, 05 Jul 2014 18:03:02 GMT) Full text and rfc822 format available.

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

From: Alex Kost <alezost <at> gmail.com>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 17935 <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sat, 05 Jul 2014 22:01:54 +0400
Ludovic Courtès (2014-07-05 21:20 +0400) wrote:
>
> Could you run “./pre-inst-env guile”, type these 3 expressions at the
> prompt, and send the result:
>
>   (with-fluids ((%file-port-name-canonicalization 'relative))
>     (call-with-input-file (search-path %load-path "gnu/packages/bootstrap.scm")
>        port-filename))
>
>   (search-path %load-path "gnu/packages/bootstrap.scm")
>
>   (version)
>
> TIA,
> Ludo’.

Here it is:

scheme@(guile-user)> (with-fluids ((%file-port-name-canonicalization 'relative))
    (call-with-input-file (search-path %load-path "gnu/packages/bootstrap.scm")
       port-filename))
$1 = "/home/alexx/src/guix/gnu/packages/bootstrap.scm"
scheme@(guile-user)> (search-path %load-path "gnu/packages/bootstrap.scm")
$2 = "/home/alexx/src/guix/gnu/packages/bootstrap.scm"
scheme@(guile-user)> (version)
$3 = "2.0.11"





Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Sun, 06 Jul 2014 19:32:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Kost <alezost <at> gmail.com>:
bug acknowledged by developer. (Sun, 06 Jul 2014 19:32:03 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Alex Kost <alezost <at> gmail.com>
Cc: 17935-done <at> debbugs.gnu.org
Subject: Re: bug#17935: make check failed
Date: Sun, 06 Jul 2014 21:31:01 +0200
I’ve reproduced the setup here, and found out a couple of issues, now
fixed with commits c2d7747, 6171070, and 59c51be.

I think we’re all set, but let me know if you encounter other problems!

Thanks,
Ludo’.




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

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

Previous Next


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