guix-devel
[Top][All Lists]
Advanced

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

Re: --with-store-dir and/or --localstatedir seem to be ignored


From: Ludovic Courtès
Subject: Re: --with-store-dir and/or --localstatedir seem to be ignored
Date: Fri, 15 May 2015 12:45:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Taylan Ulrich Kammer <address@hidden> skribis:

> From 97b43ab87a35fce3b197edf75f8545cfac5860f7 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
>  <address@hidden>
> 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):

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 #\-))
but this has to go to ‘core-updates’ because it may trigger a world rebuild.

Could you send updated patches?

Thank you!

Ludo’.

reply via email to

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