Subject: [bug#70895] [PATCH] grafts: Only compute necessary graft derivations.

From: David Elsing <[email-masked]>
Date: Sun, 19 Jan 2025 21:30:12 +0000

Hi,

Ludovic Courtès <[email-masked]> writes:

> What you did is correct.  #:guile-for-build and #:system are use to
> specify the default value in case it’s not already specified; passing
> them here is unnecessary but it cannot hurt.

Ok, thanks!

>> As an alternative, is it possible to 'ungexp' a value in the store monad
>> which returns a derivation? Then the derivation for the 'replacement'
>> field could be calculated in 'mapping' in 'graft-derivation/shallow'.
>> I wouldn't know how to define a gexp-compiler though, except by defining
>> one for any procedure and assuming it is a value in the store monad.
>
> I’m not sure what you mean since there’s no gexp here.

I meant that in 'graft-derivation/shallow', the 'mapping' variable is a
list of gexps, where 'ungexp' is called on the graft-replacement of the
grafts. So instead of turning the monadic value into a derivation
beforehand, this could be done here instead, right? Considering a
gexp-compiler returns a store monad value of a derivation (IIUC), my
question was whether it is possible to use such a value in a gexp
directly (i.e. without the 'return' in the gexp-compiler for a
derivation, such that the evaluation of the derivation is delayed until
the gexp is lowered to a derivation). These values would still need to
be identified by 'procedure?' I guess, so it would not be better than
currently.
Does this make sense or did I misunderstand something?

Cheers,
David