all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: itd <itd@net.in.tum.de>
To: 58250@debbugs.gnu.org
Subject: bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module
Date: Sun, 02 Oct 2022 16:26:37 +0200	[thread overview]
Message-ID: <871qrqfgiq.fsf@localhost> (raw)

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=/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'...
>  …10.tar.gz  709KiB                671KiB/s 00:01 [##################] 100.0%
> Backtrace:
>           14 (primitive-load "/home/itd/.config/guix/current/bin/…")
> 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 #<procedure 7efce407acf0 at ic…> …)
> In guix/scripts/import/json.scm:
>     91:16  9 (_)
> In ice-9/boot-9.scm:
>   1747:15  8 (with-exception-handler #<procedure 7efce407acc0 at ic…> …)
> In guix/import/json.scm:
>     86:18  7 (_)
> In guix/import/print.scm:
>    220:37  6 (package->code _)
>    161:17  5 (inputs->code (("gettext" #<package gettext@0.21 g…>) #))
> In srfi/srfi-1.scm:
>    586:29  4 (map1 (("gettext" #<package gettext@0.21 gnu/packa…>) #))
>    586:17  3 (map1 (("myotherhello" #<package myotherhello@2.12.1…>)))
> 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) # _ …)
>
> 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=.
> /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




             reply	other threads:[~2022-10-02 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 14:26 itd [this message]
     [not found] ` <handler.58250.B.16647208196976.ack@debbugs.gnu.org>
2022-10-02 14:35   ` bug#58250: [PATCH 1/2] modules: Remove load path prefix from module name itd
2022-12-23 13:49     ` bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module Ludovic Courtès
2022-10-02 14:38   ` bug#58250: [PATCH 2/2] import: print: Use file-name->module-name itd
2022-12-23 13:50     ` bug#58250: guix import json: GUIX_PACKAGE_PATH -- no code for module Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qrqfgiq.fsf@localhost \
    --to=itd@net.in.tum.de \
    --cc=58250@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.