From: Jookia <166291@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] vm: Have qemu-image generate derivations instead.
Date: Wed, 30 Mar 2016 10:13:40 +1100 [thread overview]
Message-ID: <20160329231340.GA13977@jookia-eeepc.Home> (raw)
In-Reply-To: <87h9fphxtl.fsf@gnu.org>
On Tue, Mar 29, 2016 at 09:46:14PM +0200, Ludovic Courtès wrote:
> Damn, it’s been more than a month, please accept my apologies!
No problem!
> One of the reasons ‘os-drv’ and ‘grub.cfg’ are passed around is that
> recomputing them is relatively costly.
>
> There’s a solution to that in 4c2ade20c65e94c41dc8c65db73dd128343a0ad5
> (in ‘wip-build-systems-gexp’; it memoizes ‘operating-system-derivation’
> and others), so we could almost consider it solved.
>
> Nevertheless it’d be nice to make sure performance remains reasonable
> even in the absence of the above commit.
I thought it was only recomputed and used in once place now?
> > + (base-inputs (list 'grub.cfg 'system))
>
> [...]
>
> > + (mlet* %store-monad ((os-drv (operating-system-derivation os-configuration))
> > + (grub.cfg (operating-system-grub.cfg os-configuration))
> > + (inputs -> (append
> > + (if (member 'grub.cfg base-inputs)
> > + `(("grub.cfg" ,grub.cfg)) '())
> > + (if (member 'system base-inputs)
> > + `(("system" ,os-drv)) '())
>
> Use of “magic” values like 'grub.cfg here is undesirable IMO, because it
> introduces singularities in the API, and generally makes the interface
> non-obvious.
How much more non-obvious than how it is now with having to pass certain inputs?
But yes, you're right. If I was doing a bigger refactor I would've added them as
flags to the function.
> So I think I’d leave it up to the caller to pass
>
> #:inputs `(("grub.cfg" ,grub.cfg))
>
> Same for "system".
>
> All in all, I sympathize with the desire to avoid passing OS-DRV and
> GRUB.CFG around, but I’m not convinced that this approach can improve
> the situation.
>
> WDYT?
Well, I'm working here on the assumption that callers shouldn't have to know
about the contents of their os-configuration, specifically in this situation
which bootloader is being used. This is part of a bigger effort to organize
things a bit better so different bootloaders could be switched out. Having to
pass these things violate this assumption.
> Thank you!
>
> Ludo’.
Thank you,
Jookia.
next prev parent reply other threads:[~2016-03-29 23:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 11:41 [PATCH] vm: Have qemu-image generate derivations instead Jookia
2016-03-29 19:46 ` Ludovic Courtès
2016-03-29 23:13 ` Jookia [this message]
2016-04-11 22:21 ` Jookia
2016-04-12 0:01 ` Mathieu Lirzin
2016-04-26 9:23 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160329231340.GA13977@jookia-eeepc.Home \
--to=166291@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.