help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to reference a module defined in another package?


From: Maxime Devos
Subject: Re: How to reference a module defined in another package?
Date: Sun, 25 Apr 2021 18:08:06 +0200
User-agent: Evolution 3.34.2

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: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]