all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Olivier Dion via <help-guix@gnu.org>
To: zimoun <zimon.toutoune@gmail.com>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>,
	Olivier Dion via <help-guix@gnu.org>,
	Ricardo Wurmus <rekado@elephly.net>
Subject: Re: Questions regarding substitutes with debug output
Date: Thu, 28 Apr 2022 10:11:31 -0400	[thread overview]
Message-ID: <87mtg5qovg.fsf@laura> (raw)
In-Reply-To: <86mtg5eibr.fsf@gmail.com>

On Thu, 28 Apr 2022, zimoun <zimon.toutoune@gmail.com> wrote:
> Hi,
>
> On Fri, 22 Apr 2022 at 10:29, Olivier Dion via <help-guix@gnu.org> wrote:
>> On Fri, 22 Apr 2022, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>>> Channels can only extend, not override the default Guix channel (the
>>> world would be a bit of a mess if it did).  So the easiest path is to
>>> use a different name; alternatively for graph rewriting you could use
>>> the various APIs to effect package transformations.
>>
>> Would be nice to have some way to specify channel in a package
>> specification.  I don't think that it would break things if we
>> considerer channels as namespaces, i.e. different graph.  A
>> specification like:
>>
>>   {channel}package@version:output
>>
>> would be useful.  For now I will just rename them to "my/package".
>
> What do you mean by «different graph»?  From my understanding, the
> additions of channels makes just the graph bigger: extending the initial
> (upstream) graph with more nodes (channel). :-)

Right it's not a new graph per say since you're not introducing the full
dependencies themself.  You're only pulling more nodes into the graph.
I guess the correct term would be a "view" of the graph.

My point being it would be cool if we can specify a package with a
preference if two packages have the same name.  It could be the channel
name, but it could also be some metadata provided by Guix.  So really,
one could build a specific query (specification) until only a single
package is left from the setfff of matches.

Could be something like:
"guile@3.0.8:debug;channel=my-channel;some-metadata=foo"

I don't know, I'm making syntax up.  But I think it would be useful in
cases outside of mine.  I'm thinking about root filesystems for embedded
systems where you might want to use a variant of some package.

> IIUC, the question is how to refer to these nodes, and from my
> understanding, we use basically two ways:
>
>  1. by symbol; and thanks to Guile modules, this way provides
>  namespaces, somehow.
>  
>  2. by metadata (name, version, output); and here I am not convinced it
>  is doable to have a namespace but maybe mimic it.
>
> Therefore, since your question is rooted from GWL:
>
>         I need to specify the package programmatically as a string in
>         Guile.  More specifically in the process packages field of Guix
>         Workflow Language.
>
> maybe GWL could also accept a symbol instead of a name string.  Well, I
> have not used GWL since many months and I do not remember but I think it
> is doable.  Ricardo?

In my case, I prefer to avoid using package object directly.  As
mentioned in GWL' manual, the version of Guix running GWL and the
version of Guix used by GWL (the inferior) might not be the same.  Thus,
it is not okay for reproducibility in the long term.  In my case, I use
`guix time-machine --channels` as the inferior.

> Last, back to the feature you would like – be able to write:
>
>     (specifications->manifest (list "foo"))
>
> and select "foo" from your channel instead from upstream, right?  Or a
> way to specify the channel using the symbol from the name field in
> <channel>, right?

Correct.  In fact as I mentioned above, I think having a way to select a
package variant -- e.g. if you've introduced an existing package in your
channel -- is a more generic way of describing it.  Selection of channel
being only a type of metadata that can be used for selection of the
variant.  More metadata could be added in the future as well.

> Aside the syntax of the string – why not the one your are proposing –
> and so adapt ’package-name->name+version’ (or similar), the function
> ’find-best-packages-by-name’ requires some improvements.
>
> What I am missing is the mapping from channel name to package.  Well,
> Guix does not track this information at pull time.  And I miss how to
> implement such mapping.

I could not say.  I don't know much about the internal of Guix :-/.

> Therefore, assuming this mapping, the package cache
> (%package-cache-file) could be updated to also track such map.  Such
> feature would also simplify when searching; especially for variants
> (same as upstream but other arguments).

Yes that would be the idea!

Regards,
old

-- 
Olivier Dion
oldiob.dev


  parent reply	other threads:[~2022-04-28 14:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 17:32 Questions regarding substitutes with debug output Olivier Dion via
2022-04-22  4:22 ` Maxim Cournoyer
2022-04-22 14:29   ` Olivier Dion via
2022-04-24  3:38     ` Maxim Cournoyer
2022-04-24 14:56       ` Olivier Dion via
2022-04-25  4:10         ` Maxim Cournoyer
2022-04-28  8:13     ` zimoun
2022-04-28  8:58       ` Ricardo Wurmus
2022-04-28 14:11       ` Olivier Dion via [this message]
2022-04-28 14:18         ` Ricardo Wurmus
2022-04-28 14:25           ` Olivier Dion via
2022-04-29  5:06             ` Ricardo Wurmus
2022-04-28 14:20         ` Olivier Dion via
2022-04-29  8:49         ` zimoun
2022-04-29 14:47           ` Olivier Dion via
2022-04-29 16:01             ` Ricardo Wurmus
2022-04-29 16:17               ` Olivier Dion via
2022-04-29 20:08                 ` Ricardo Wurmus
2022-04-29 20:53                   ` Olivier Dion via
2022-05-09 10:33                   ` zimoun
2022-05-09 13:33                     ` Ricardo Wurmus
2022-05-09 14:37                       ` zimoun
2022-04-29 16:06             ` zimoun

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=87mtg5qovg.fsf@laura \
    --to=help-guix@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    --cc=olivier.dion@polymtl.ca \
    --cc=rekado@elephly.net \
    --cc=zimon.toutoune@gmail.com \
    /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.