From: Chris Marusich <cmmarusich@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org, Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Subject: Re: Channel dependencies
Date: Tue, 23 Oct 2018 00:44:27 -0700 [thread overview]
Message-ID: <87va5t2jl0.fsf@gmail.com> (raw)
In-Reply-To: <87va5umbm1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 22 Oct 2018 14:04:06 +0200")
[-- Attachment #1: Type: text/plain, Size: 3896 bytes --]
ludo@gnu.org (Ludovic Courtès) writes:
> Good point. I agree that it’s similar to the question of propagated
> inputs, which we deal with by reporting an error when a collision
> arises.
>
> So, similarly, I think the safe way would be to report an error when
> channel requirements conflict.
With profiles, two packages conflict if and only if a file exists at the
same relative path in both packages' outputs. In other words, both
packages provide "the same" file.
With channels, we build a profile containing the union of the channels.
So, normal profile conflicts will definitely occur in the profile if two
channels provide the same module (e.g., $out/my/awesome/packages.scm),
right? Because we're putting the two channels into a single profile, I
think the normal conflict resolution mechanism will force us to use only
one module in the resulting profile. And I think that if two channels
provide the same module, it's definitely a conflict of some kind.
Furthermore, if two channels both provide "the same" package definition
for a tool called my-awesome-program in two different modules, Guile
scheme code can still specify precisely which my-awesome-program should
be used. In that sense, there is no conflict. However, if both package
definition use the same name and version, then a command like "guix
package -i my-awesome-program" (and the APIs that convert package
specifications to packages) will have to choose one specific package,
right? In that sense, there is a conflict.
It seems to me that these kinds of conflicts are what we want to avoid.
Regardless of what the channel is named, regardless of what URI it comes
from, regardless of what commit it came from, if it provides the same
modules or the same packages as another channel, there's a "channel
conflict".
However, detecting that sort of conflict seems pretty complicated. I
don't have a good idea for how to detect it. It seems like you would
have to traverse the entire set of modules and packages that a channel
provides, and cross-check it with other channels to make sure there are
no conflicts. We might have to use multiple inferiors to do that, like
you mentioned.
Also like you said, we can try to implement some heuristics to reject
situations in which a "channel conflict" is likely. Would it be hard to
change the channel mechanism so that it fails if there are any (normal)
conflicts while generating the profile that contains all the channels?
If we could prevent those (normal) conflicts while generating the
profile, it would prevent a certain class of channel conflicts: namely,
it would be impossible for two channels to provide the same guile
modules.
> We must define what it means for two <channel>s to conflict:
>
> • if a channel’s ‘commit’ is #f, then any channel with the same name
> but a different ‘uri’ and/or a different ‘branch’ and/or a non-#f
> commit conflicts;
>
> • if a channel’s ‘commit’ is not #f, then any channel with the same
> name and otherwise different fields conflicts.
This seems like a reasonable heuristic. What will we do when two
channels differ only in their name? What about when two channels only
have identical fields? Maybe in those cases we should just pick one,
ignore the other, and log a warning, since their content will be the
same.
> If we have inspiration later, we can liberalize this, for instance by
> using several inferiors. It would be quite a bit of extra work, and
> it’s not immediately clear to me how that could work. I believe what
> Ricardo proposes already covers many use cases anyway.
You're probably right. I'm just trying to think about how we might
apply the functional model to this problem, rather than implementing
heuristics. But maybe heuristics are good enough!
--
Chris
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2018-10-23 7:44 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87va5t2jl0.fsf@gmail.com \
--to=cmmarusich@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.