unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* --with-store-dir and/or --localstatedir seem to be ignored
@ 2015-05-15  4:07 Alex Vorobiev
  2015-05-15  9:03 ` Taylan Ulrich Kammer
  2015-05-15 10:40 ` Ludovic Courtès
  0 siblings, 2 replies; 15+ messages in thread
From: Alex Vorobiev @ 2015-05-15  4:07 UTC (permalink / raw)
  To: guix-devel

Hi,
I have built guix-0.8.2 and specified both --with-store-dir and --
localstatedir (both directories are world-writable) but when I started 
guix-daemon (as myself) and tried to install a package I got:

$ guix package -i mc
guix package: error: build failed: creating directory `/gnu': Permission 
denied

Am I doing anything wrong? Why would it want to go to /gnu? I am using 
RHEL-6.5.

Thanks,
Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15  4:07 --with-store-dir and/or --localstatedir seem to be ignored Alex Vorobiev
@ 2015-05-15  9:03 ` Taylan Ulrich Kammer
  2015-05-15 10:45   ` Ludovic Courtès
  2015-05-15 10:40 ` Ludovic Courtès
  1 sibling, 1 reply; 15+ messages in thread
From: Taylan Ulrich Kammer @ 2015-05-15  9:03 UTC (permalink / raw)
  To: Alex Vorobiev; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2382 bytes --]

Alex Vorobiev <alexander.vorobiev@gmail.com> writes:

> Hi,
> I have built guix-0.8.2 and specified both --with-store-dir and --
> localstatedir (both directories are world-writable) but when I started 
> guix-daemon (as myself) and tried to install a package I got:
>
> $ guix package -i mc
> guix package: error: build failed: creating directory `/gnu': Permission 
> denied
>
> Am I doing anything wrong? Why would it want to go to /gnu? I am using 
> RHEL-6.5.
>
> Thanks,
> Alex

The local state dir would be 'var' (e.g. /var, /usr/var, /usr/local/var,
depending on the value for $prefix), and I've used that option before
and believe it works fine.  (At the very least I've seen --prefix affect
its default value.)

So I believe your problem is about --with-store-dir only.

I've grepped a fresh guix clone for the raw string '/gnu/store' in .c,
.cc, .scm, and .sh files, and outside of comments and docstrings, found
the following:

guix/build/utils.scm:

  (define (%store-directory)
    "Return the directory name of the store."
    (or (getenv "NIX_STORE")
        "/gnu/store"))

guix/packages.scm (patch-and-repack):

  (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))

gnu/packages/busybox.scm (busybox):

  (substitute* "testsuite/cpio.tests"
     (("/usr/bin") "/gnu/store")
     (("usr") "gnu"))

(There are also some matches in the tests/ directory but I think they're
harmless.)

Those should probably use %store-directory from (guix config).  Here's a
patch doing that, but note that:

- In the busybox recipe, the "gnu" is replaced by (car (filter (negate
  string-null?) (string-split (%store-directory) #\/))) meaning it
  assumes (%store-directory) not to be the root directory.  (Note that
  this uses the %store-directory procedure from (guix build utils); see
  next point.)

- (guix build utils) has its own %store-directory bound to a procedure
  doing environment variable look-up on NIX_STORE instead of
  NIX_STORE_DIR (which determines the value of %store-directory from
  (guix config)); I preserved this semantics by importing
  %store-directory from (guix config) with a rename and falling back to
  it only if NIX_STORE is unset.

- Similarly, packages.scm checks NIX_STORE and not NIX_STORE_DIR, and I
  preserved this semantics by falling back to %store-directory only if
  NIX_STORE is unset.

Are these decisions right?

The patch:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Parameterize-references-to-gnu-store.patch --]
[-- Type: text/x-diff, Size: 3057 bytes --]

From 97b43ab87a35fce3b197edf75f8545cfac5860f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Fri, 15 May 2015 10:59:44 +0200
Subject: [PATCH] Parameterize references to /gnu/store.

* gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
  utils) instead of referencing "/gnu/store" directly.

* guix/build/utils.scm (%store-directory): Fall back to the value of
  %store-directory from (guix config) instead of "/gnu/store".

* guix/packages.scm (patch-and-repack): Likewise.
---
 gnu/packages/busybox.scm | 5 +++--
 guix/build/utils.scm     | 3 ++-
 guix/packages.scm        | 4 +++-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm
index d200cd7..13630b3 100644
--- a/gnu/packages/busybox.scm
+++ b/gnu/packages/busybox.scm
@@ -53,8 +53,9 @@
 
            ;; There is no /usr/bin or /bin - replace it with /gnu/store
            (substitute* "testsuite/cpio.tests"
-              (("/usr/bin") "/gnu/store")
-              (("usr") "gnu"))
+              (("/usr/bin") (%store-directory))
+              (("usr") (car (filter (negate string-null?)
+                                    (string-split (%store-directory) #\/)))))
 
            (substitute* "testsuite/date/date-works-1"
              (("/bin/date") (which "date")))
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 676a012..903cea9 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -19,6 +19,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix build utils)
+  #:use-module ((guix config) #:prefix config)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-60)
@@ -80,7 +81,7 @@
 (define (%store-directory)
   "Return the directory name of the store."
   (or (getenv "NIX_STORE")
-      "/gnu/store"))
+      config:%store-directory))
 
 (define (store-file-name? file)
   "Return true if FILE is in the store."
diff --git a/guix/packages.scm b/guix/packages.scm
index c955b35..d312d05 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -18,6 +18,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix packages)
+  #:use-module ((guix config) #:prefix config)
   #:use-module (guix utils)
   #:use-module (guix records)
   #:use-module (guix store)
@@ -445,7 +446,8 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
 
           ;; SOURCE may be either a directory or a tarball.
           (and (if (file-is-directory? #+source)
-                   (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))
+                   (let* ((store     (or (getenv "NIX_STORE")
+                                         config:%store-directory))
                           (len       (+ 1 (string-length store)))
                           (base      (string-drop #+source len))
                           (dash      (string-index base #\-))
-- 
2.2.1


[-- Attachment #3: Type: text/plain, Size: 8 bytes --]


Taylan

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15  4:07 --with-store-dir and/or --localstatedir seem to be ignored Alex Vorobiev
  2015-05-15  9:03 ` Taylan Ulrich Kammer
@ 2015-05-15 10:40 ` Ludovic Courtès
  1 sibling, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-15 10:40 UTC (permalink / raw)
  To: Alex Vorobiev; +Cc: guix-devel

Alex Vorobiev <alexander.vorobiev@gmail.com> skribis:

> I have built guix-0.8.2 and specified both --with-store-dir and --
> localstatedir (both directories are world-writable) but when I started 
> guix-daemon (as myself) and tried to install a package I got:
>
> $ guix package -i mc
> guix package: error: build failed: creating directory `/gnu': Permission 
> denied

‘guix-daemon’ and ‘guix’ should definitely honor whatever was
--with-store-dir was given.  Perhaps there were stale compiled files?

Could you try:

  ./configure --with-store-dir=/what/you/want && \
     make clean && make && make install

?

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15  9:03 ` Taylan Ulrich Kammer
@ 2015-05-15 10:45   ` Ludovic Courtès
  2015-05-15 14:03     ` Taylan Ulrich Kammer
  0 siblings, 1 reply; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-15 10:45 UTC (permalink / raw)
  To: Taylan Ulrich Kammer; +Cc: guix-devel, Alex Vorobiev

[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]

Taylan Ulrich Kammer <taylanbayirli@gmail.com> skribis:

> From 97b43ab87a35fce3b197edf75f8545cfac5860f7 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Fri, 15 May 2015 10:59:44 +0200
> Subject: [PATCH] Parameterize references to /gnu/store.
>
> * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
>   utils) instead of referencing "/gnu/store" directly.

OK for this part.

> * guix/build/utils.scm (%store-directory): Fall back to the value of
>   %store-directory from (guix config) instead of "/gnu/store".

This won’t work: (guix config) is meant as a “host-side” module, and
anyway the daemon always defines ‘NIX_STORE’ in the build environment,
so it’s unnecessary.

> * guix/packages.scm (patch-and-repack): Likewise.

[...]

>  (define-module (guix packages)
> +  #:use-module ((guix config) #:prefix config)
>    #:use-module (guix utils)
>    #:use-module (guix records)
>    #:use-module (guix store)
> @@ -445,7 +446,8 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
>  
>            ;; SOURCE may be either a directory or a tarball.
>            (and (if (file-is-directory? #+source)
> -                   (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))
> +                   (let* ((store     (or (getenv "NIX_STORE")
> +                                         config:%store-directory))

This won’t work: the code here is within a gexp, which will run in a
different context where (guix config) is not available.

The right fix would be to refer to the one from (guix build utils):


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 662 bytes --]

diff --git a/guix/packages.scm b/guix/packages.scm
index c955b35..7c2788c 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -445,7 +445,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
 
           ;; SOURCE may be either a directory or a tarball.
           (and (if (file-is-directory? #+source)
-                   (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))
+                   (let* ((store     (%store-directory))
                           (len       (+ 1 (string-length store)))
                           (base      (string-drop #+source len))
                           (dash      (string-index base #\-))

[-- Attachment #3: Type: text/plain, Size: 145 bytes --]


but this has to go to ‘core-updates’ because it may trigger a world rebuild.

Could you send updated patches?

Thank you!

Ludo’.

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 10:45   ` Ludovic Courtès
@ 2015-05-15 14:03     ` Taylan Ulrich Kammer
  2015-05-15 14:35       ` Ludovic Courtès
  2015-05-19 22:17       ` Mark H Weaver
  0 siblings, 2 replies; 15+ messages in thread
From: Taylan Ulrich Kammer @ 2015-05-15 14:03 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, Alex Vorobiev

[-- Attachment #1: Type: text/plain, Size: 1294 bytes --]

ludo@gnu.org (Ludovic Courtès) writes:

>> * guix/build/utils.scm (%store-directory): Fall back to the value of
>>   %store-directory from (guix config) instead of "/gnu/store".
>
> This won’t work: (guix config) is meant as a “host-side” module, and
> anyway the daemon always defines ‘NIX_STORE’ in the build environment,
> so it’s unnecessary.
>
>> * guix/packages.scm (patch-and-repack): Likewise.
>
> [...]
>
>>  (define-module (guix packages)
>> +  #:use-module ((guix config) #:prefix config)
>>    #:use-module (guix utils)
>>    #:use-module (guix records)
>>    #:use-module (guix store)
>> @@ -445,7 +446,8 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
>>  
>>            ;; SOURCE may be either a directory or a tarball.
>>            (and (if (file-is-directory? #+source)
>> -                   (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))
>> +                   (let* ((store     (or (getenv "NIX_STORE")
>> +                                         config:%store-directory))
>
> This won’t work: the code here is within a gexp, which will run in a
> different context where (guix config) is not available.

I see, thanks for the explanation!

Here's the updated patch, against core-updates:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Parameterize-references-to-gnu-store.patch --]
[-- Type: text/x-diff, Size: 1897 bytes --]

From 2dcd57e71c86c780e0e06ae5579c2f8e65b3de91 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Fri, 15 May 2015 10:59:44 +0200
Subject: [PATCH] Parameterize references to /gnu/store.

* gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
  utils) instead of referencing "/gnu/store" directly.

* guix/packages.scm (patch-and-repack): Likewise.
---
 gnu/packages/busybox.scm | 5 +++--
 guix/packages.scm        | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm
index d200cd7..13630b3 100644
--- a/gnu/packages/busybox.scm
+++ b/gnu/packages/busybox.scm
@@ -53,8 +53,9 @@
 
            ;; There is no /usr/bin or /bin - replace it with /gnu/store
            (substitute* "testsuite/cpio.tests"
-              (("/usr/bin") "/gnu/store")
-              (("usr") "gnu"))
+              (("/usr/bin") (%store-directory))
+              (("usr") (car (filter (negate string-null?)
+                                    (string-split (%store-directory) #\/)))))
 
            (substitute* "testsuite/date/date-works-1"
              (("/bin/date") (which "date")))
diff --git a/guix/packages.scm b/guix/packages.scm
index a979f31..f6dda45 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -466,7 +466,7 @@ IMPORTED-MODULES specify modules to use/import for use by SNIPPET."
 
           ;; SOURCE may be either a directory or a tarball.
           (and (if (file-is-directory? #+source)
-                   (let* ((store     (or (getenv "NIX_STORE") "/gnu/store"))
+                   (let* ((store     (%store-directory))
                           (len       (+ 1 (string-length store)))
                           (base      (string-drop #+source len))
                           (dash      (string-index base #\-))
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 14:03     ` Taylan Ulrich Kammer
@ 2015-05-15 14:35       ` Ludovic Courtès
  2015-05-15 14:58         ` Taylan Ulrich Kammer
  2015-05-19 22:17       ` Mark H Weaver
  1 sibling, 1 reply; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-15 14:35 UTC (permalink / raw)
  To: Taylan Ulrich Kammer; +Cc: guix-devel, Alex Vorobiev

Taylan Ulrich Kammer <taylanbayirli@gmail.com> skribis:

> From 2dcd57e71c86c780e0e06ae5579c2f8e65b3de91 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Fri, 15 May 2015 10:59:44 +0200
> Subject: [PATCH] Parameterize references to /gnu/store.
>
> * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
>   utils) instead of referencing "/gnu/store" directly.

Could you push this part to master...

> * guix/packages.scm (patch-and-repack): Likewise.

... and that part to ‘core-updates’?

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 14:35       ` Ludovic Courtès
@ 2015-05-15 14:58         ` Taylan Ulrich Kammer
  2015-05-15 16:51           ` Ludovic Courtès
  0 siblings, 1 reply; 15+ messages in thread
From: Taylan Ulrich Kammer @ 2015-05-15 14:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, Alex Vorobiev

ludo@gnu.org (Ludovic Courtès) writes:

>> * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
>>   utils) instead of referencing "/gnu/store" directly.
>
> Could you push this part to master...
>
>> * guix/packages.scm (patch-and-repack): Likewise.
>
> ... and that part to ‘core-updates’?

Indeed, done.


(For clearness's sake: this means these patches don't fix the bug, if
there is one, since the only thing that functionally changed is the
busybox recipe; the other change is merely aesthetic since the code was
doing the same thing as the function it now calls.)

Taylan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 14:58         ` Taylan Ulrich Kammer
@ 2015-05-15 16:51           ` Ludovic Courtès
  2015-05-15 20:22             ` ftp " Alex Vorobiev
  0 siblings, 1 reply; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-15 16:51 UTC (permalink / raw)
  To: Taylan Ulrich Kammer; +Cc: guix-devel, Alex Vorobiev

Taylan Ulrich Kammer <taylanbayirli@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>>> * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
>>>   utils) instead of referencing "/gnu/store" directly.
>>
>> Could you push this part to master...
>>
>>> * guix/packages.scm (patch-and-repack): Likewise.
>>
>> ... and that part to ‘core-updates’?
>
> Indeed, done.

Thank you!

> (For clearness's sake: this means these patches don't fix the bug, if
> there is one, since the only thing that functionally changed is the
> busybox recipe; the other change is merely aesthetic since the code was
> doing the same thing as the function it now calls.)

Right.

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* ftp Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 16:51           ` Ludovic Courtès
@ 2015-05-15 20:22             ` Alex Vorobiev
  2015-05-16 19:42               ` Ludovic Courtès
  0 siblings, 1 reply; 15+ messages in thread
From: Alex Vorobiev @ 2015-05-15 20:22 UTC (permalink / raw)
  To: guix-devel

Hi,

Thanks! I pulled the master from git and rebuilt/reinstalled guix. Now I 
don't see that error! But I do see another one:

$ guix package -i bash
looking for the latest release of GNU bash...FTP to `ftp.gnu.org' failed:
530: User access denied.

I do know that ftp connections are not allowed on my corporate network 
for security reasons (http is fine). Is there any way to tell guix not to 
use ftp repositories at all?

Thanks,
Alex

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ftp Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 20:22             ` ftp " Alex Vorobiev
@ 2015-05-16 19:42               ` Ludovic Courtès
  2015-05-21  2:42                 ` Alex Vorobiev
  0 siblings, 1 reply; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-16 19:42 UTC (permalink / raw)
  To: Alex Vorobiev; +Cc: guix-devel

Alex Vorobiev <alexander.vorobiev@gmail.com> skribis:

> Thanks! I pulled the master from git and rebuilt/reinstalled guix. Now I 
> don't see that error! But I do see another one:
>
> $ guix package -i bash
> looking for the latest release of GNU bash...FTP to `ftp.gnu.org' failed:
> 530: User access denied.

This is annoying but harmless: ‘guix package’ is looking for the latest
Bash version available at ftp.gnu.org to tell you whether a newer one is
available upstream.  Here it cannot do that, so it just proceeds with
installation.

Perhaps we should allow users to somehow turn off this feature
altogether.  Thoughts?

> I do know that ftp connections are not allowed on my corporate network 
> for security reasons (http is fine). Is there any way to tell guix not to 
> use ftp repositories at all?

This particular feature (checking for newer upstream packages) is only
supported for GNU packages, and it’s ignored when it fails.

Substitutes are always downloaded over HTTP.

Source code for which no substitutes are available could be downloaded
either over HTTP, HTTPS, or FTP, depending on the package and mirrors.
I expect few are available solely over FTP, but for those, there’s no
workaround.

Then again, with substitutes enabled, you’re unlikely to stumble upon
such a case.

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-15 14:03     ` Taylan Ulrich Kammer
  2015-05-15 14:35       ` Ludovic Courtès
@ 2015-05-19 22:17       ` Mark H Weaver
  2015-05-20  7:27         ` Taylan Ulrich Bayırlı/Kammer
  1 sibling, 1 reply; 15+ messages in thread
From: Mark H Weaver @ 2015-05-19 22:17 UTC (permalink / raw)
  To: Taylan Ulrich Kammer; +Cc: guix-devel, Alex Vorobiev

Hi Taylan,

Taylan Ulrich Kammer <taylanbayirli@gmail.com> writes:

> From 2dcd57e71c86c780e0e06ae5579c2f8e65b3de91 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <taylanbayirli@gmail.com>
> Date: Fri, 15 May 2015 10:59:44 +0200
> Subject: [PATCH] Parameterize references to /gnu/store.
>
> * gnu/packages/busybox.scm (busybox): Call %store-directory from (guix build
>   utils) instead of referencing "/gnu/store" directly.
>
> * guix/packages.scm (patch-and-repack): Likewise.
> ---
>  gnu/packages/busybox.scm | 5 +++--
>  guix/packages.scm        | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
>
>
> diff --git a/gnu/packages/busybox.scm b/gnu/packages/busybox.scm
> index d200cd7..13630b3 100644
> --- a/gnu/packages/busybox.scm
> +++ b/gnu/packages/busybox.scm
> @@ -53,8 +53,9 @@
>  
>             ;; There is no /usr/bin or /bin - replace it with /gnu/store
>             (substitute* "testsuite/cpio.tests"
> -              (("/usr/bin") "/gnu/store")
> -              (("usr") "gnu"))
> +              (("/usr/bin") (%store-directory))
> +              (("usr") (car (filter (negate string-null?)
> +                                    (string-split (%store-directory) #\/)))))

What is the rationale for replacing "usr" with "gnu" here?  In the
general case where (%store-directory) might be almost anything, I fail
to see why "usr" should be replaced with the first component of
(%store-directory).

      Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-19 22:17       ` Mark H Weaver
@ 2015-05-20  7:27         ` Taylan Ulrich Bayırlı/Kammer
  2015-05-20 16:53           ` Mark H Weaver
  0 siblings, 1 reply; 15+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2015-05-20  7:27 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel, Alex Vorobiev

Mark H Weaver <mhw@netris.org> writes:

>>             ;; There is no /usr/bin or /bin - replace it with /gnu/store
>>             (substitute* "testsuite/cpio.tests"
>> -              (("/usr/bin") "/gnu/store")
>> -              (("usr") "gnu"))
>> +              (("/usr/bin") (%store-directory))
>> +              (("usr") (car (filter (negate string-null?)
>> +                                    (string-split (%store-directory) #\/)))))
>
> What is the rationale for replacing "usr" with "gnu" here?  In the
> general case where (%store-directory) might be almost anything, I fail
> to see why "usr" should be replaced with the first component of
> (%store-directory).

The test suite contains:

testing "cpio -p with absolute paths" \
"echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?;
ls cpio.testdir" \
"\
1 blocks
0
usr
" "" ""

Where the second argument is code to evaluate and the third argument the
expected output; it expects the cpio command to print "1 blocks", the
'echo $?' command to print "0", and the ls command to print "usr"
because that directory has been copied there (without its contents).

I believe this works in all cases except where (%store-directory) is /.
Should we try to prevent such a limitation?

Taylan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-20  7:27         ` Taylan Ulrich Bayırlı/Kammer
@ 2015-05-20 16:53           ` Mark H Weaver
  0 siblings, 0 replies; 15+ messages in thread
From: Mark H Weaver @ 2015-05-20 16:53 UTC (permalink / raw)
  To: Taylan Ulrich "Bayırlı/Kammer"
  Cc: guix-devel, Alex Vorobiev

taylanbayirli@gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:

> Mark H Weaver <mhw@netris.org> writes:
>
>>>             ;; There is no /usr/bin or /bin - replace it with /gnu/store
>>>             (substitute* "testsuite/cpio.tests"
>>> -              (("/usr/bin") "/gnu/store")
>>> -              (("usr") "gnu"))
>>> +              (("/usr/bin") (%store-directory))
>>> +              (("usr") (car (filter (negate string-null?)
>>> +                                    (string-split (%store-directory) #\/)))))
>>
>> What is the rationale for replacing "usr" with "gnu" here?  In the
>> general case where (%store-directory) might be almost anything, I fail
>> to see why "usr" should be replaced with the first component of
>> (%store-directory).
>
> The test suite contains:
>
> testing "cpio -p with absolute paths" \
> "echo /usr/bin | cpio -dp cpio.testdir 2>&1; echo \$?;
> ls cpio.testdir" \
> "\
> 1 blocks
> 0
> usr
> " "" ""
>
> Where the second argument is code to evaluate and the third argument the
> expected output; it expects the cpio command to print "1 blocks", the
> 'echo $?' command to print "0", and the ls command to print "usr"
> because that directory has been copied there (without its contents).
>
> I believe this works in all cases except where (%store-directory) is /.

Ah, okay, thanks for the explanation.

> Should we try to prevent such a limitation?

No, I think we can reasonably assume that (%store-directory) won't be /.

     Thanks!
       Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ftp Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-16 19:42               ` Ludovic Courtès
@ 2015-05-21  2:42                 ` Alex Vorobiev
  2015-05-21  8:20                   ` Ludovic Courtès
  0 siblings, 1 reply; 15+ messages in thread
From: Alex Vorobiev @ 2015-05-21  2:42 UTC (permalink / raw)
  To: guix-devel

Ludovic Courtès <ludo <at> gnu.org> writes:

> 
> Alex Vorobiev <alexander.vorobiev <at> gmail.com> skribis:
> 
> > Thanks! I pulled the master from git and rebuilt/reinstalled guix. Now 
I 
> > don't see that error! But I do see another one:
> >
> > $ guix package -i bash
> > looking for the latest release of GNU bash...FTP to `ftp.gnu.org' 
failed:
> > 530: User access denied.
> 
> This is annoying but harmless: ‘guix package’ is looking for the latest
> Bash version available at ftp.gnu.org to tell you whether a newer one is
> available upstream.  Here it cannot do that, so it just proceeds with
> installation.

Hi,
How is it harmless? The error just causes the command to show the backtrace 
and quit. It does not proceed with the installation.

Thanks,
Alex



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: ftp Re: --with-store-dir and/or --localstatedir seem to be ignored
  2015-05-21  2:42                 ` Alex Vorobiev
@ 2015-05-21  8:20                   ` Ludovic Courtès
  0 siblings, 0 replies; 15+ messages in thread
From: Ludovic Courtès @ 2015-05-21  8:20 UTC (permalink / raw)
  To: Alex Vorobiev; +Cc: guix-devel

Alex Vorobiev <alexander.vorobiev@gmail.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> 
>> Alex Vorobiev <alexander.vorobiev <at> gmail.com> skribis:
>> 
>> > Thanks! I pulled the master from git and rebuilt/reinstalled guix. Now 
> I 
>> > don't see that error! But I do see another one:
>> >
>> > $ guix package -i bash
>> > looking for the latest release of GNU bash...FTP to `ftp.gnu.org' 
> failed:
>> > 530: User access denied.
>> 
>> This is annoying but harmless: ‘guix package’ is looking for the latest
>> Bash version available at ftp.gnu.org to tell you whether a newer one is
>> available upstream.  Here it cannot do that, so it just proceeds with
>> installation.
>
> Hi,
> How is it harmless? The error just causes the command to show the backtrace 
> and quit. It does not proceed with the installation.

I actually experience the same thing yesterday on a network that blocked
FTP, and noticed that this was indeed not working as intended.

Commit 820a403 fixes that (you can get it with “guix pull”.)

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-05-21  8:21 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15  4:07 --with-store-dir and/or --localstatedir seem to be ignored Alex Vorobiev
2015-05-15  9:03 ` Taylan Ulrich Kammer
2015-05-15 10:45   ` Ludovic Courtès
2015-05-15 14:03     ` Taylan Ulrich Kammer
2015-05-15 14:35       ` Ludovic Courtès
2015-05-15 14:58         ` Taylan Ulrich Kammer
2015-05-15 16:51           ` Ludovic Courtès
2015-05-15 20:22             ` ftp " Alex Vorobiev
2015-05-16 19:42               ` Ludovic Courtès
2015-05-21  2:42                 ` Alex Vorobiev
2015-05-21  8:20                   ` Ludovic Courtès
2015-05-19 22:17       ` Mark H Weaver
2015-05-20  7:27         ` Taylan Ulrich Bayırlı/Kammer
2015-05-20 16:53           ` Mark H Weaver
2015-05-15 10:40 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).