help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions regarding substitutes with debug output


From: zimoun
Subject: Re: Questions regarding substitutes with debug output
Date: Fri, 29 Apr 2022 18:06:45 +0200

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]