Subject: Computing the guix self derivations can require builds

From: Christopher Baines <[email-masked]>
Date: Wed, 18 Dec 2024 11:15:48 +0000

I wasn't aware of a issue for this, so I'm creating one. I did send some
patches in an attempt to fix this to #61363.

The derivations used by guix pull, guix time-machine and other
operations work differently to package derivations. I might have
understood exactly how in the past, but unfortunately I've forgotten the
details. I think the rough summary is that in contrast to packages, you
can't view the guix self derivations grafting as a transformation on the
built outputs, but rather that transformation is somehow muddled up with
computing the derivations.

As noted in #61363, the data service is affected by this since it relies
on computing derivations being inexpensive to do, and having to
potentially perform many builds for some arbitrary architecture when
attempting to compute derivations can be very expensive. Note that since
the bad behaviour here is dependent on grafts, this only happens when
packages involved in the guix self derivations have replacements.

I think there's probably other implications of this as well, substitute
servers don't store grafted outputs generally, although I think the use
of grafting here probably means that they are storing and providing
substitutes for grafted outputs.

However this is fixed, I think you'd need to end up with two
properties. Computing the derivations doesn't require performing builds,
and grafting is a transformation on the outputs of those computed
derivations.