From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: --with-store-dir and/or --localstatedir seem to be ignored Date: Fri, 15 May 2015 12:45:01 +0200 Message-ID: <87vbfu15n6.fsf@gnu.org> References: <87h9refc0y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtD76-0004ZS-IB for guix-devel@gnu.org; Fri, 15 May 2015 06:45:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtD72-0002eP-Hg for guix-devel@gnu.org; Fri, 15 May 2015 06:45:08 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtD72-0002e1-EV for guix-devel@gnu.org; Fri, 15 May 2015 06:45:04 -0400 In-Reply-To: <87h9refc0y.fsf@gmail.com> (Taylan Ulrich Kammer's message of "Fri, 15 May 2015 11:03:25 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Taylan Ulrich Kammer Cc: guix-devel@gnu.org, Alex Vorobiev --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Taylan Ulrich Kammer skribis: > From 97b43ab87a35fce3b197edf75f8545cfac5860f7 Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Taylan=3D20Ulrich=3D20Bay=3DC4=3DB1rl=3DC4=3DB1/Kammer?= =3D > > 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 bu= ild > 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=E2=80=99t work: (guix config) is meant as a =E2=80=9Chost-side=E2= =80=9D module, and anyway the daemon always defines =E2=80=98NIX_STORE=E2=80=99 in the build e= nvironment, so it=E2=80=99s 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 us= e by SNIPPET." >=20=20 > ;; SOURCE may be either a directory or a tarball. > (and (if (file-is-directory? #+source) > - (let* ((store (or (getenv "NIX_STORE") "/gnu/stor= e")) > + (let* ((store (or (getenv "NIX_STORE") > + config:%store-directory)) This won=E2=80=99t 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): --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 #\-)) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable but this has to go to =E2=80=98core-updates=E2=80=99 because it may trigger= a world rebuild. Could you send updated patches? Thank you! Ludo=E2=80=99. --=-=-=--