unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: mbcladwell@stihie.net, help-guix@gnu.org
Subject: Re: How to reference a module defined in another package?
Date: Sun, 25 Apr 2021 18:08:06 +0200	[thread overview]
Message-ID: <da96bb9d46be80f681f284c3741f521a9a415851.camel@telenet.be> (raw)
In-Reply-To: <20210423145700.Horde.eqD2H-89KhXCmJyIaPtzwGz@www.stihie.net>

[-- Attachment #1: Type: text/plain, Size: 2440 bytes --]

mbcladwell@stihie.net schreef op vr 23-04-2021 om 14:57 [-0500]:
> Hi,
> I am trying to package an application, my guix.scm is below.  The  
> build starts OK but fails with the error:
> 
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> no code for module (artanis utils)
> make: *** [Makefile:1878: limsn/app/controllers/target.go] Error 1
> command "make" "-j" "4" failed with status 2

When I do "guix edit artanis", I see the "artanis" package currently
uses guile-2.2.  You should: (a) change artanis to use guile-3.0 instead,
or (b) change your package to use guile-2.2 instead of guile-3.0.

> artanis/utils.scm is a file within artanis. I use-module (artanis  
> utils) to no effect.  Within artanis, utils is defined as a module:
> 
> (define-module (artanis artanis)
>    #:use-module (artanis utils)
>    #:use-module (artanis config)
>    #:use-module (artanis env).....
> 
> I tried ("artanis:utils" ,artanis "utils") but that doesn't work.
> How do I specify artanis/utils.scm as an input module?

Just use ("artanis" ,artanis).  The ("package:x" ,x "output") construction
is only needed for very few package, that split the documentation or binaries
out in a separate output, for space reasons.

> Do I need to package artanis/utils.scm separately?
No, all artanis stuff is packaged in the artanis package.
(Maybe the documentation is separate, I dunno, but you're not looking
for documentation.)

> >[...]
>    (native-inputs
>      `(("autoconf" ,autoconf)
>        ("automake" ,automake)
>        ("pkg-config" ,pkg-config)
>        ("texinfo" ,texinfo)
>        ("artanis" ,artanis)

artanis must most likely be placed in 'propagated-inputs', and not 'inputs'.
It's a bit complicated to explain why though, particularily if you're from
a ‘classical distro’ (e.g. Debian).  python and guile libraries usually need
to go into 'propagated-inputs' instead of 'inputs'.

It will build just fine if you put it in 'inputs' instead, but at run-time in
a pure profile, your package won't find artanis, as your package most likely
refers to artanis by module name (artanis utils) instead of by absolute file
name "/gnu/store/...-artanis-.../SOME-DIR-WITH-GUILE-STUFF".

Maybe when cross-compiling, it should _also_ be placed in native-inputs,
not sure though. (If you don't know what cross-compiling is, you're
most likely not doing it.)

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2021-04-25 16:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 19:57 How to reference a module defined in another package? mbcladwell
2021-04-23 22:08 ` Vincent Legoll
2021-04-23 22:13   ` Vincent Legoll
2021-04-24 12:56     ` mbcladwell
2021-04-24 18:18       ` Vincent Legoll
2021-04-25 16:08 ` Maxime Devos [this message]
2021-04-26  8:19 ` Ricardo Wurmus

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=da96bb9d46be80f681f284c3741f521a9a415851.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=help-guix@gnu.org \
    --cc=mbcladwell@stihie.net \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).