GNU bug report logs -
#32184
‘guix pack --bootstrap’ is ineffective
Previous Next
Full log
Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi Chris,
Chris Marusich <cmmarusich <at> gmail.com> skribis:
> Basically, we're manually doing dependency injection here depending on
> whether or not --bootstrap was given, right? Instead of parameterizing
> the dependencies, what if we used a dependency injector (or "oracle", or
> "container", or whatever you want to call it) that, when invoked, would
> give us the dependency that is appropriate for the current context?
> Perhaps we could control the context via a single parameter. For
> example, something like this:
>
> (parameterize ((test-environment? #t))
> (injector-get-dependency guile))
>
> would return the bootstrap guile, but something like this:
>
> (parameterize ((test-environment? #f))
> (injector-get-dependency guile))
>
> would return the usual guile. This isn't much different from using
> parameters like we're already doing, except that it might save us from
> having to remember multiple parameters, and it might make the code
> cleaner by hiding the dependency selection/construction logic behind the
> injector abstraction.
>
> What do you think of that idea?
Yes, that makes sense. Or we could simply have something like:
(define (lookup-package name)
(if (test-environment?)
(match name
("guile" …)
…)
(match name
…)))
Another option that comes to mind is using the little-known
‘map-derivation’ procedure: we would compute the ‘guix pack’ derivation
as usual, but at the end we’d call ‘map-derivation’ to replace
libgcrypt.drv, guile-sqlite3.drv, etc. with dummy variants. That might
turn out to be more complicated that the above solution, though.
Ludo’.
This bug report was last modified 6 years and 237 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.