unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Olivier Dion <olivier.dion@polymtl.ca>,
	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: Fri, 29 Apr 2022 18:06:45 +0200	[thread overview]
Message-ID: <87tuabc1re.fsf@gmail.com> (raw)
In-Reply-To: <87bkwkq73s.fsf@laura>

Hi,

On Fri, 29 Apr 2022 at 10:47, Olivier Dion via <help-guix@gnu.org> wrote:

> Because importing the package using use-modules would yield the package
> from the instance of Guix driving the workflow instead of using the
> package of the inferior!  GWL will lookup for package in the inferior
> context when the package is a specification.
>
> Even if I were to import locally defined packages, their dependencies
> would come from the Guix's main channel!

Hum, ok.  Well, I am not enough familiar with recent GWL.  However, I am
still missing a point since using “string” is just a key to refer to
package object.  Anyway.


> So now imagine you have a specification -- or something like a DSL --
> for describing your full RFS.  You generate it and see that its total
> size is too much for your SD card using default packages.  But you have
> a channel with different variants of some packages.  You then apply a
> preference filter like 'diet=1' instead of changing the specification or
> the module imports.  And now you see that your RFS fits in your SD card.

What you are describing is already possible, somehow.  The specification
(manifest) is done by a DSL.  This manifest.scm file can contain complex
filters.  Well, for instance, let install only the packages which use
the ’r-build-system’ with:

    guix package -m manifest.scm -p /tmp/all-r

where manifest.scm reads,

--8<---------------cut here---------------start------------->8---
(use-modules (guix packages)
             (gnu packages)
             (guix build-system r))

(packages->manifest
 (fold-packages (lambda (package result)
                  (if (eq? (package-build-system package) r-build-system)
                      (cons package result)
                      result))
                '()))
--8<---------------cut here---------------end--------------->8---


> But yes, I would also describe it to be over-engineered if the intent is
> to only have channel preference when there's name collision.  But then
> again, we never know what are the future use case of Guix.

I think it is a better design to have a rich Scheme DSL to easily select
(or transform) the packages you want than something like:

--8<---------------cut here---------------start------------->8---
(specifications->manifest
  (list
    "guile@3.0.8:debug;channel=my-channel;some-metadata=foo"))
--8<---------------cut here---------------end--------------->8---


And I agree that some “selectors” as channel are currently missing. :-)


> Really this feature is almost not necessary with package's properties:
>
>   (package
>     ...
>     (properties '((channel . "my-project"))))

Instead of the string "my-project", it appears to me better to have the
symbols of the channel name defined by the file
~/.config/guix/channels.scm, e.g., 

--8<---------------cut here---------------start------------->8---
(cons*
 (channel
  (name 'nonguix)
  (url "https://gitlab.com/nonguix/nonguix.git")
  (branch "master"))
 (channel               ; .guix.channel depends on channel:
  (name 'bimsb-nonfree) ; github.com/BIMSBbioinfo/guix-bimsb.git
  (url "https://github.com/BIMSBbioinfo/guix-bimsb-nonfree.git")
  (branch "master"))
 ;; (channel
 ;;  (name 'bimsb)
 ;;  (url "https://github.com/BIMSBbioinfo/guix-bimsb.git")
 ;;  (branch "master"))
 (channel
  (name 'past)
  (url "https://gitlab.inria.fr/guix-hpc/guix-past.git")
  (branch "master"))
  (channel
  (name 'genenet)
  (url "https://gitlab.com/genenetwork/guix-bioinformatics.git")
  (branch "master"))
 %default-channels)
--8<---------------cut here---------------end--------------->8---



Thanks for the discussion. :-)  Cool, a new feature to implement. ;-)


Cheers,
simon


      parent reply	other threads:[~2022-04-29 16:57 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
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 [this message]

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