[Top][All Lists]

[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


On Fri, 29 Apr 2022 at 10:47, Olivier Dion via <> 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))

 (fold-packages (lambda (package result)
                  (if (eq? (package-build-system package) r-build-system)
                      (cons package 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---
--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---
  (name 'nonguix)
  (url "";)
  (branch "master"))
 (channel               ; depends on channel:
  (name 'bimsb-nonfree) ;
  (url "";)
  (branch "master"))
 ;; (channel
 ;;  (name 'bimsb)
 ;;  (url "";)
 ;;  (branch "master"))
  (name 'past)
  (url "";)
  (branch "master"))
  (name 'genenet)
  (url "";)
  (branch "master"))
--8<---------------cut here---------------end--------------->8---

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


reply via email to

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