Subject: Re: [PATCH] build-self: Try printing nicer error messages.

From: Maxime Devos <[email-masked]>
Date: Tue, 08 Mar 2022 19:58:45 +0100

> I sympathize with the goal but unsure about the implementation.
> 
> To me, compute-guix-derivation should remain as simple as possible
> and it shouldn't take care of UI concerns.  Having said that, I don't
> know how to address the problem above while sticking to this
> principle.
>
> WDYT?

*Something* should take care of UI concerns, and 'build-program' is in
a good position to do so.  I don't really see another way to do it
(except by serialising the exception and letting the Guix that is doing
the pulling report it, but that's even more fragile).  Where else could
the UI bits be done?

Additionally, while importing (guix ui) may seem rather daunting,
the error handling bits are only run when there's actually an error to
handle, so I expect it to be fine in practice --- it seems only
possible for this to break "guix pull" if "guix pull" would have failed
anyway.

I have one concern though: (guix ui) used with-exception-handler which
is new-ish with Guile 3.0 IIUC.  Do we need to support pulling from a
Guix of version Guile <2.2?  If so, a little compatibility code may
be necessary -- e.g., not doing the 'with-error-handling' when guile-
version=2.2.

I think the little bit of extra non-simplicity is worth the clarity
(not very much, but still useful) it brings to people on bug-guix and
people reporting the ‘guix pull: error: You found a bug: ...’ issues --
-- see the long list at
<https://issues.guix.gnu.org/search?query=%22you+found+a+bug%22>, and
compare it with the two extra lines of code.

In other terms, if we do a risk-benefit analysis, there is some risk,
but due to the large number of reports there would be much benefit.
And even though there is some risk (see e.g. the Guile 2.2/3.0 thing
above), whenever such an accident happens, it could quickly addressed
by pushing a new commit.

Greetings,
Maxime.