unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: help-guix@gnu.org,Simon South <simon@simonsouth.net>
Subject: Re: Specifying dependencies among package outputs?
Date: Wed, 14 Oct 2020 20:07:06 -0400	[thread overview]
Message-ID: <4891EF4D-D931-4B0A-9553-8FE1BA8D588B@lepiller.eu> (raw)
In-Reply-To: <87eem0l9qc.fsf@simonsouth.net>

Le 14 octobre 2020 18:32:27 GMT-04:00, Simon South <simon@simonsouth.net> a écrit :
>Am I right in thinking there is no way to specify dependencies among
>the
>outputs of a single package? To specify that a package's "out" output
>depends on its "lib" output, for instance.

The notion of dependencies do not make a lot of sense in guix. We talk about inputs: things that are accessible during the build, but don't really declare which are needed at runtime and which are needed at build-time (granted usually the distinction between native and non native does that job).

For tracking runtime dependencies, guix uses another mechanism: when a package holds a reference to another package (by embedding the store path of that other package), it depends on it, anl guix will pull them both.

>
>I ask because the Knot package (in gnu/package/dns.scm) builds a number
>of logically distinct targets---daemon, libraries, administrative
>utilities, general-purpose utilities, and documentation---and it would
>be nice to separate at least some of these into individual outputs, in
>part because we could then specify only the libraries as a dependency
>of
>Knot Resolver.
>
>However, Knot's daemon and utilities have the same dependency on its
>own
>libraries, so pulling those into a separate "lib" output would be
>liable
>to break everything else.
>
>I've searched and can't find an example of this being done, nor can I
>find any mention of it in the documentation. So I assume it's simply
>not
>possible, and you would need to define an entirely separate package
>that
>builds from the same source code---right?

We actually do that for a few programs. Look at mariadb for an example of splitting lependencies to different outputs. Mariadb has binaries that require the libraries. During the build, the library path is recorded in the binaries (using the rpath mechanism). Since the path to the lib output is present in the binary, it dependg on it and that output is pulled by guix.

Knot could work the same. Specify the libdir and make sure the libdir path is embedded in the binaries. Then, guix will know that a lependency exists and will pull the libraries.

Any package that depends on the library rather than the binary will need to be adjusted to use knot:lib as an input. Other than that, no breakage.




  reply	other threads:[~2020-10-15  0:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 22:32 Specifying dependencies among package outputs? Simon South
2020-10-15  0:07 ` Julien Lepiller [this message]
2020-10-15  0:37 ` Tobias Geerinckx-Rice
2020-10-15  0:43   ` Tobias Geerinckx-Rice
2020-10-15 11:44   ` zimoun
2020-10-15 14:54   ` Simon South
2020-10-15 22:26     ` Tobias Geerinckx-Rice
2020-10-15 23:45       ` Simon South
2020-10-16 17:32         ` Tobias Geerinckx-Rice

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=4891EF4D-D931-4B0A-9553-8FE1BA8D588B@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=help-guix@gnu.org \
    --cc=simon@simonsouth.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).