unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* same package defined in multiple channels?
@ 2024-02-09  8:15 Andy Tai
  2024-02-09 12:34 ` Irfan S
  2024-02-09 18:00 ` Julien Lepiller
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Tai @ 2024-02-09  8:15 UTC (permalink / raw)
  To: help-guix

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?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: same package defined in multiple channels?
  2024-02-09  8:15 same package defined in multiple channels? Andy Tai
@ 2024-02-09 12:34 ` Irfan S
  2024-02-09 17:38   ` Andy Tai
  2024-02-09 18:00 ` Julien Lepiller
  1 sibling, 1 reply; 5+ messages in thread
From: Irfan S @ 2024-02-09 12:34 UTC (permalink / raw)
  To: Andy Tai; +Cc: help-guix

Andy Tai <atai@atai.org> writes:

> 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?

Hi Andy,

In such a case, both versions of the package will be available to install. You could either specify the version like, e.g. ‘guix package -i mypackage@specific-version’, or if you omit it, the newer version will be picked automatically.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: same package defined in multiple channels?
  2024-02-09 12:34 ` Irfan S
@ 2024-02-09 17:38   ` Andy Tai
  2024-02-09 19:04     ` Irfan S
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Tai @ 2024-02-09 17:38 UTC (permalink / raw)
  To: Irfan S; +Cc: help-guix

Hi, thanks.  What if it is the case of the same package, same version, but
say j\ust differs in configure, compile or link flags (from multiple
definitions)?

On Fri, Feb 9, 2024 at 4:34 AM Irfan S <irfan@irfus.in> wrote:

> Andy Tai <atai@atai.org> writes:
>
> > 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?
>
> Hi Andy,
>
> In such a case, both versions of the package will be available to install.
> You could either specify the version like, e.g. ‘guix package -i
> mypackage@specific-version’, or if you omit it, the newer version will be
> picked automatically.
>


-- 
Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat:
andytai1010
Year 2023 民國112年
自動的精神力是信仰與覺悟
自動的行為力是勞動與技能

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: same package defined in multiple channels?
  2024-02-09  8:15 same package defined in multiple channels? Andy Tai
  2024-02-09 12:34 ` Irfan S
@ 2024-02-09 18:00 ` Julien Lepiller
  1 sibling, 0 replies; 5+ messages in thread
From: Julien Lepiller @ 2024-02-09 18:00 UTC (permalink / raw)
  To: help-guix, Andy Tai

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?
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: same package defined in multiple channels?
  2024-02-09 17:38   ` Andy Tai
@ 2024-02-09 19:04     ` Irfan S
  0 siblings, 0 replies; 5+ messages in thread
From: Irfan S @ 2024-02-09 19:04 UTC (permalink / raw)
  To: Andy Tai; +Cc: help-guix

Andy Tai <atai@atai.org> writes:

> Hi, thanks.  What if it is the case of the same package, same version, but say j\ust differs in configure, compile or link flags (from
> multiple definitions)?

The convention I’ve seen is to define such package variants under different names, e.g emacs and emacs-xwidgets. I do not know guix or guile enough to say what would happen if that convention were not followed.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-14 21:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09  8:15 same package defined in multiple channels? Andy Tai
2024-02-09 12:34 ` Irfan S
2024-02-09 17:38   ` Andy Tai
2024-02-09 19:04     ` Irfan S
2024-02-09 18:00 ` Julien Lepiller

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).