From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Using the Guile json module in a gexp Date: Mon, 11 Sep 2017 14:12:34 +0200 Message-ID: <87377ta0y5.fsf@gnu.org> References: <20170911075841.13e75eb9@cbaines.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drNa0-0001IC-3S for help-guix@gnu.org; Mon, 11 Sep 2017 08:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drNZs-00036q-AH for help-guix@gnu.org; Mon, 11 Sep 2017 08:12:44 -0400 In-Reply-To: <20170911075841.13e75eb9@cbaines.net> (Christopher Baines's message of "Mon, 11 Sep 2017 07:58:41 +0100") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Christopher Baines Cc: help-guix@gnu.org Hello! Christopher Baines skribis: > So I'm having some trouble using the Guile json module in a gexp. > I've added (with-imported-modules '((json)) ...), and the > module-import-compiled builder crashes. > > Backtrace: > 4 (primitive-load "/gnu/store/35zv0m9wwd2nz3agyywv09d3k5v?") > In srfi/srfi-1.scm: > 640:9 3 (for-each # ?) > In ice-9/eval.scm: > 245:16 2 (_ #(#(# "/gn?") #)) > In ice-9/boot-9.scm: > 1519:24 1 (_ "./json.scm") > In unknown file: > 0 (stat "./json.scm" #) > > ERROR: In procedure stat: > ERROR: In procedure stat: No such file or directory: "./json.scm" This would have the effect of importing the (json) module of the host environment into the build environment, which is not desirable for a couple of reasons: 1. It would require having Guile-JSON installed in the host environment, and the right version of it. 2. It would hinder reproducibility since different users may have different Guile-JSON variants installed on the host side. To overcome this, you have to do like (guix scripts package) does: #~(begin (add-to-load-path #$(file-append guile-json "/share/guile/site/" (effective-version))) =E2=80=A6) It would be nice to simplify this somehow, though. HTH! Ludo=E2=80=99.