[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: same package defined in multiple channels?
From: |
Julien Lepiller |
Subject: |
Re: same package defined in multiple channels? |
Date: |
Fri, 09 Feb 2024 19:00:46 +0100 |
User-agent: |
K-9 Mail for Android |
Hi Andy,
They will all be available, and the one used will depend on the situation and
how you use them.
Consider 'foo' is not only in different channels, but also in different modules
(from the root of the channel, they are defined in different directories/files).
In that case, all versions are visible. From the command line, this is similar
to other packages that may have multiple versions in a single channel. For
instance 'guix install foo' will install the package with the greatest version
numbes, fsom any channel. 'guix install foo@3' will select the one that has the
greatest version, with major version starting with 3.
For dependencies, manifests or other scheme code, the story is different. Say
'bar' in guix depends on foo, and 'baz' in 'mychannel' depends on foo.
The code in guix would have a use-module (gnu packages foo) and use 'foo' from
this module as input for bar. It means it is always the guix's foo that is
being used to build bar in guix.
Similarly, mychannel can choose to import (gnu packages foo) and use guix's
version as dependency in baz, or (mychannel packages foo) to use its own
version of foo.
The fact that foo is implemented in both channels doesn't replace dependencies
in other channels: they are independent (unless they explicitly depend on
another channel).
Or, are they?
Well, if a channel were to redefine the same module as another one, say
mychannel defines a gnu/packages/foo.scm file, then all definitions in guix's
foo.scm are shadowed (or the other way around depending on channel order) and:
- shadowed versions are no longer available on the command line
- dependents will use the only one that is visible to scheme, so dependencies
can be rewritten that way.
Hope that makes things a bit clearer :)
Le 9 février 2024 09:15:02 GMT+01:00, Andy Tai <atai@atai.org> a écrit :
>Hi, I wonder if I have multiple Guix channels, and the same package is
>defined in multiple channels, of different versions, what would happen
>if I do guix pull? Would the first package definition encountered in
>the first channel containing the definition of this package in the
>channel list be used, shadowing the other definitions in later
>channels?
>