Subject: Re: bug#65225: [PATCH] environment: Build the profile for the requested system.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 12 Aug 2023 22:51:41 +0200

Hi,

Josselin Poiret <[email-masked]> skribis:

> IMO, this is way too complicated to keep in mind at all times, and there
> are bugs lurking under the surface absolutely everywhere, waiting for a
> corner case to be uncovered.

Great writeup!  Yeah, that’s the sad situation of mixing parameters and
monads; it’s a longstanding issue and as you write, there have been
bugs.  The solution to these has been primarily to avoid relying on
default values and pass explicit values.  The other trick is what
‘lower-gexp’ does, with the comment you quoted, or what
‘gexp->derivation’ does.

The good news is that the monadic interface is kept internal
and not really exposed to users, who should stick to file-like objects
as much as possible.

Back to profile hooks: it seems that passing #:system #f to
‘gexp->derivation’ in each of these hooks would solve the problem, no?

Alternatively, each hook could take ‘system’ as a second argument.

Willing to give it a shot?

Thanks,
Ludo’.