From: ludo@gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich@gmail.com>
Cc: 32184@debbugs.gnu.org
Subject: bug#32184: ‘guix pack --bootstrap’ is ineffective
Date: Thu, 26 Jul 2018 15:26:50 +0200 [thread overview]
Message-ID: <87r2jqyvol.fsf@gnu.org> (raw)
In-Reply-To: <87r2k1ul77.fsf@gmail.com> (Chris Marusich's message of "Tue, 17 Jul 2018 23:11:56 -0700")
Hi Chris,
Chris Marusich <cmmarusich@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’.
next prev parent reply other threads:[~2018-07-26 13:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 9:24 bug#32184: ‘guix pack --bootstrap’ is ineffective Ludovic Courtès
2018-07-18 6:11 ` Chris Marusich
2018-07-26 13:26 ` Ludovic Courtès [this message]
2018-10-19 16:43 ` Ludovic Courtès
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=87r2jqyvol.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=32184@debbugs.gnu.org \
--cc=cmmarusich@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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).