From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel@gnu.org, Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Subject: Re: Channel dependencies
Date: Mon, 15 Oct 2018 11:29:18 +0200 [thread overview]
Message-ID: <877eijk175.fsf@gnu.org> (raw)
In-Reply-To: <871s8soo26.fsf@elephly.net> (Ricardo Wurmus's message of "Sun, 14 Oct 2018 11:49:40 +0200")
Hello,
Ricardo Wurmus <rekado@elephly.net> skribis:
>>> (define (latest-channel-instances store channels)
>>> "Return a list of channel instances corresponding to the latest checkouts of
>>> -CHANNELS."
>>> - (map (lambda (channel)
>>> - (format (current-error-port)
>>> - (G_ "Updating channel '~a' from Git repository at '~a'...~%")
>>> - (channel-name channel)
>>> - (channel-url channel))
>>> - (let-values (((checkout commit)
>>> - (latest-repository-commit store (channel-url channel)
>>> - #:ref (channel-reference
>>> - channel))))
>>> - (channel-instance channel commit checkout)))
>>> - channels))
>>> +CHANNELS and the channels on which they depend."
>>> + (append-map (lambda (channel)
>>> + (format (current-error-port)
>>> + (G_ "Updating channel '~a' from Git repository at '~a'...~%")
>>> + (channel-name channel)
>>> + (channel-url channel))
>>> + (let-values (((checkout commit)
>>> + (latest-repository-commit store (channel-url channel)
>>> + #:ref (channel-reference
>>> + channel))))
>>> + (let ((instance (channel-instance channel commit checkout)))
>>> + (cons instance (latest-channel-instances
>>> + store
>>> + (channel-instance-dependencies instance))))))
>>> + channels))
>>
>> What happens if the dependency list contains duplicate channels? This
>> might happen if two unrelated channels mutually depend upon a third
>> channel.
>>
>> What happens if the dependency list contains two channels that differ
>> only in their branch (or commit), and are the same in every other way?
>> This might happen if two unrelated channels mutually depend upon two
>> different versions of the same third channel.
We should error out in this case because at run time, there can be only
one Guile module with a given name. Thus, conflicting dependencies
cannot be honored. (Not like Node.js, for better or worse. ;-))
> I was going to write an email about this just now. This is indeed a
> problem with this naive implementation.
>
> For reproducibility a user may want to pin all channels to a certain
> commit, but channels that are dependencies are exempt from that
> mechanism as they are added to the list of channels to be instantiated
> during the run of “guix pull”.
>
> It should be possible to pin *all* channels, even if they are
> dependencies of other channels. One way is to treat all channels and
> their dependencies as a unique set where duplicates are replaced with
> the most specific description (e.g. those specifying a commit). This
> way users could fully specify dependencies, which would then be used
> instead of the channel’s declared dependency.
Of course it’s easier to pin all channels when they are directly
expressed in ~/.config/guix/channels.scm.
Say, I need channel A, which depends on B.
What we could do is that if B is already in ~/.config/guix/channels.scm,
then we take this particular B; if it’s not there, we take the latest
version.
In terms of the dependency code, it means that dependencies found in
.guix-channels file are added if and only if they are not already
present in the user-provided channel list.
Does that make sense?
Thanks!
Ludo’.
next prev parent reply other threads:[~2018-10-15 9:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-13 6:54 Channel dependencies Ricardo Wurmus
2018-10-13 11:09 ` Pierre Neidhardt
2018-10-14 2:16 ` Chris Marusich
2018-10-14 9:49 ` Ricardo Wurmus
2018-10-15 9:29 ` Ludovic Courtès [this message]
2018-10-15 9:35 ` Ricardo Wurmus
2018-10-15 11:49 ` Ludovic Courtès
2018-10-15 9:41 ` Ludovic Courtès
2018-10-18 20:24 ` Ricardo Wurmus
2018-10-20 20:52 ` Chris Marusich
2018-10-22 12:04 ` Ludovic Courtès
2018-10-23 7:44 ` Chris Marusich
2018-10-24 13:14 ` Ludovic Courtès
2018-10-22 12:14 ` Ludovic Courtès
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=877eijk175.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guix-devel@gnu.org \
--cc=rekado@elephly.net \
--cc=ricardo.wurmus@mdc-berlin.de \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).