Subject: Re: [bug#71038] [PATCH v2 2/2] guix: channels: Enable specifiying available builtin builders.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 04 Jul 2024 11:17:05 +0200

Christopher Baines <[email-masked]> skribis:

> When computing channel instance derivations.
>
> This is useful when you want to generate compatible derivations that can be
> run with a daemon that potentially doesn't support builtin builders that the
> daemon you're using to generate the derivations has.
>
> I'm looking at this in particular because I want to use this in the data
> service, since it provides substitutes for derivations, and since these can be
> built on other machines, it's useful to control which builtin builders they
> depend on.
>
> Fixes: <https://issues.guix.gnu.org/67250>.
>
> * build-aux/build-self.scm (build-program): Accept
>  #:assume-available-builtin-builders and pass along to port->connection or
> open-connection as approriate.
> (build): Accept and pass on #:assume-available-builtin-builders.
> * guix/channels.scm (build-from-source, build-channel-instance,
> channel-instance-derivations, channel-instances->manifest,
> channel-instances->derivation): Accept and pass on
>  #:assume-available-builtin-builders.
>
> Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea

I would have hoped we could avoid this, because it’s make tricky code a
bit harder to read, but as you said, it’s a real issue that needs
fixing: on build farms or for anyone using offloading and potentially
not upgrading all the machines in lockstep.

> +                                            #:version proto
> +                                            #$@(if assume-available-builtin-builders
> +                                                   #~(#:assume-available-builtin-builders
> +                                                      '(#$@assume-available-builtin-builders))
> +                                                   '()))

Here (in ‘build-program’), we can assume we’re using the current (guix
store) module, so we can safely pass #:built-in-builders unconditionally.

That’s it!

The series LGTM with these changes.

Thank you! :-)