From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AKuTAvGqOWMONAEAbAwnHQ (envelope-from ) for ; Sun, 02 Oct 2022 17:14:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gPWRAvGqOWODGwEAauVa8A (envelope-from ) for ; Sun, 02 Oct 2022 17:14:57 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9537147DFF for ; Sun, 2 Oct 2022 17:14:56 +0200 (CEST) Received: from localhost ([::1]:58758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1of0gB-0002a7-JY for larch@yhetil.org; Sun, 02 Oct 2022 11:14:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oezvq-00014r-Gh for bug-guix@gnu.org; Sun, 02 Oct 2022 10:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48679) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oezvq-0006DO-6u for bug-guix@gnu.org; Sun, 02 Oct 2022 10:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oezvq-0001ol-1x for bug-guix@gnu.org; Sun, 02 Oct 2022 10:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module Resent-From: itd Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 02 Oct 2022 14:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58250 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58250@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16647208196976 (code B ref -1); Sun, 02 Oct 2022 14:27:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 Oct 2022 14:26:59 +0000 Received: from localhost ([127.0.0.1]:47757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oezvm-0001oR-27 for submit@debbugs.gnu.org; Sun, 02 Oct 2022 10:26:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:43704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oezvk-0001oH-A4 for submit@debbugs.gnu.org; Sun, 02 Oct 2022 10:26:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oezvk-00014S-2L for bug-guix@gnu.org; Sun, 02 Oct 2022 10:26:56 -0400 Received: from mailout3.rbg.tum.de ([131.159.0.8]:33399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oezvh-0006Bx-Ur for bug-guix@gnu.org; Sun, 02 Oct 2022 10:26:55 -0400 Received: from mailrelay1.rbg.tum.de (mailrelay1.in.tum.de [131.159.254.14]) by mailout3.rbg.tum.de (Postfix) with ESMTPS id E383910038C for ; Sun, 2 Oct 2022 16:26:40 +0200 (CEST) Received: by mailrelay1.rbg.tum.de (Postfix, from userid 112) id D516A1A8; Sun, 2 Oct 2022 16:26:40 +0200 (CEST) Received: from mailrelay1.rbg.tum.de (localhost [127.0.0.1]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id DBE001A1 for ; Sun, 2 Oct 2022 16:26:38 +0200 (CEST) Received: from mail.net.in.tum.de (mail.net.in.tum.de [IPv6:2001:4ca0:2001:14:216:3eff:fe52:ed14]) by mailrelay1.rbg.tum.de (Postfix) with ESMTP id DA611CD for ; Sun, 2 Oct 2022 16:26:38 +0200 (CEST) Received: from amnesix.net.in.tum.de (amnesix.net.in.tum.de [131.159.20.238]) by mail.net.in.tum.de (Postfix) with ESMTP id B90FC28D0804; Sun, 2 Oct 2022 16:26:38 +0200 (CEST) From: itd Date: Sun, 02 Oct 2022 16:26:37 +0200 Message-ID: <871qrqfgiq.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=131.159.0.8; envelope-from=itd@net.in.tum.de; helo=mailout3.rbg.tum.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 02 Oct 2022 11:14:47 -0400 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664723696; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qX1LPevv/g4WwB5QDWoNHU2aphiEGH7XVjueqeRpLVc=; b=YbC6wkRP9YkTQAhVqtymkwi6X/pmlQ4YwpCeKiJIlj2xhxT0oo8vkFLPjWtdUVUNo9whuY UEbMRAstlZgsVKiuoCuwsyc3IUQTjdWqDgmg5yNIssCAl3Hnsk366ruWgUoFRM6ewBaMeu iDlZimpc6BM9EJYwXm7IUTULlMX8vwzotns36ogexUxiSzespfyoyJaenxB1XJCngKZgDD 26ccfqrGHqBqYZoxAT7ZfYxfEQiQBs8E7MRRlE/eM3W3gms0NzZ3yQRzTrJZbRM0q/5W8n DTCGJlCcQDTp0UgEu3RjMRn0ZuNBFt9wQLFjHZ86ehwhusRdRlX9h7BIHBwSnw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664723696; a=rsa-sha256; cv=none; b=Z5HCntFuBRcSP163/mX8WF8dMGV/jFTEapziMSSB1Foka72W7AbWjeONp80j7vE4fox3JS MQzXFacy7885pPnAt4GwUxHaXWiG/VE0WSeday7Dc4BgyF1jfAUI/x+N7Y++qoVNKgwvzw JjZPaPrtI1/e5UhD7VIs0D4Pvu4OBDKL+2hx8lGfnZ/1ZPU9icyEW/aBw0LqOTZHVvTSlH 2Xvx0KCRMeXMnNvEG9TlXr8wNlcae7/6/DHgHHWmRypYBmxxBDtUQuQo0UC99d/9X/I6WL pMCbD3lmWd7xJpnZ1AUlQlQbkrd0nsILtBP0B+ttiCZEOE8BNx56aGH9A3rURQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=tum.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.56 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=tum.de (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9537147DFF X-Spam-Score: 3.56 X-Migadu-Scanner: scn1.migadu.com X-TUID: Aimy9BjtfyRL Hi, I'm having an issue with the JSON importer. The following example attempts to illustrate the problem: > $ cd $(mktemp -d) # -> /tmp/tmp.J3f9qsyDIL > /tmp/tmp.J3f9qsyDIL$ cat myhello.json > { > "name": "myhello", > "version": "2.10", > "source": "mirror://gnu/hello/hello-2.10.tar.gz", > "build-system": "gnu", > "license": "GPL-3.0+", > "native-inputs": ["gettext", "myotherhello"] > } > /tmp/tmp.J3f9qsyDIL$ cat non-gnu.scm > (define-module (non-gnu) > #:use-module (gnu packages base) > #:use-module (guix packages)) > > (define-public myotherhello > (package (inherit hello) (name "myotherhello"))) As expected, both `hello` and `myotherhello` are found by `guix search -L /tmp/tmp.J3f9qsyDIL hello`: > name: hello > ... > location: gnu/packages/base.scm:86:2 > ... > name: myotherhello > ... > location: /tmp/tmp.J3f9qsyDIL/non-gnu.scm:6:2 But importing `myhello` fails: > /tmp/tmp.J3f9qsyDIL$ export GUIX_PACKAGE_PATH=3D/tmp/tmp.J3f9qsyDIL/ > /tmp/tmp.J3f9qsyDIL$ guix import json myhello.json > > Starting download of /tmp/guix-file.bQ5VSS > From https://ftpmirror.gnu.org/gnu/hello/hello-2.10.tar.gz... > following redirection to `https://gnu.askapache.com/hello/hello-2.10.tar.= gz'... > =E2=80=A610.tar.gz 709KiB 671KiB/s 00:01 [##############= ####] 100.0% > Backtrace: > 14 (primitive-load "/home/itd/.config/guix/current/bin/=E2=80= =A6") > In guix/ui.scm: > 2263:7 13 (run-guix . _) > 2226:10 12 (run-guix-command _ . _) > In guix/scripts/import.scm: > 92:11 11 (guix-import . _) > In ice-9/boot-9.scm: > 1747:15 10 (with-exception-handler # =E2=80=A6) > In guix/scripts/import/json.scm: > 91:16 9 (_) > In ice-9/boot-9.scm: > 1747:15 8 (with-exception-handler # =E2=80=A6) > In guix/import/json.scm: > 86:18 7 (_) > In guix/import/print.scm: > 220:37 6 (package->code _) > 161:17 5 (inputs->code (("gettext" #= ) #)) > In srfi/srfi-1.scm: > 586:29 4 (map1 (("gettext" #= ) #)) > 586:17 3 (map1 (("myotherhello" #))) > In guix/import/print.scm: > 164:40 2 (_ _) > 60:31 1 (variable-name _ (#{}# tmp tmp.J3f9qsyDIL non-gnu)) > In ice-9/boot-9.scm: > 3330:6 0 (resolve-interface (#{}# tmp tmp.J3f9qsyDIL non-gnu) # _ =E2= =80=A6) > > ice-9/boot-9.scm:3330:6: In procedure resolve-interface: > no code for module (#{}# tmp tmp.J3f9qsyDIL non-gnu) One can influence the name of the mentioned module via GUIX_PACKAGE_PATH, e.g.: > /tmp/tmp.J3f9qsyDIL$ export GUIX_PACKAGE_PATH=3D. > /tmp/tmp.J3f9qsyDIL$ guix import json myhello.json > ... > ice-9/boot-9.scm:3330:6: In procedure resolve-interface: > no code for module (#{.}# non-gnu) But the issue remains. Suspected cause: the value of GUIX_PACKAGE_PATH is considered part of the module name but shouldn't. This results in an unexpected module name / missing module. Idea: when constructing the module name from the file name, this prefix should be removed. Regards itd