diff options
author | Christopher Baines <mail@cbaines.net> | 2024-06-24 14:43:46 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-07-18 11:18:29 +0100 |
commit | d82ac48b076dca156319c16e78acfadab52fd3e5 (patch) | |
tree | a3a7d98cd55a40f5a7633aa2274d8bff9be0d053 /build-aux | |
parent | f002371767df04238e3fc6dfacb6930f5529144b (diff) |
guix: channels: Enable specifiying available builtin builders.
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
#:built-in-builders and pass along to port->connection or
open-connection as approriate.
(build): Accept and pass on #:built-in-builders.
* guix/channels.scm (build-from-source, build-channel-instance,
channel-instance-derivations, channel-instances->manifest,
channel-instances->derivation): Accept and pass on
#:built-in-builders.
Change-Id: I315c990de66c6f7dca25a859165a5568abe385ea
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/build-self.scm | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 02822a2ee8..d9299b9af2 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -241,8 +241,12 @@ interface (FFI) of Guile.") (define* (build-program source version #:optional (guile-version (effective-version)) - #:key (pull-version 0) (channel-metadata #f)) - "Return a program that computes the derivation to build Guix from SOURCE." + #:key (pull-version 0) (channel-metadata #f) + built-in-builders) + "Return a program that computes the derivation to build Guix from SOURCE. +If BUILT-IN-BUILDERS is provided, it should be a list of +strings and this will be used instead of the builtin builders provided by the +build daemon, from within the generated build program." (define select? ;; Select every module but (guix config) and non-Guix modules. ;; Also exclude (guix channels): it is autoloaded by (guix describe), but @@ -331,11 +335,16 @@ interface (FFI) of Guile.") ;; case, attempt to open a new connection. (let* ((proto (string->number protocol-version)) (store (if (integer? proto) - (port->connection (duplicate-port - (current-input-port) - "w+0") - #:version proto) - (open-connection))) + (port->connection + (duplicate-port + (current-input-port) + "w+0") + #:version proto + #:built-in-builders + '#$built-in-builders) + (open-connection + #:built-in-builders + '#$built-in-builders))) (sock (socket AF_UNIX SOCK_STREAM 0))) ;; Connect to BUILD-OUTPUT and send it the raw ;; build output. @@ -406,7 +415,7 @@ Display a spinner when nothing happens." (guile-version (if (> pull-version 0) "3.0" (effective-version))) - + built-in-builders #:allow-other-keys #:rest rest) "Return a derivation that unpacks SOURCE into STORE and compiles Scheme @@ -415,7 +424,9 @@ files." ;; SOURCE. (mlet %store-monad ((build (build-program source version guile-version #:channel-metadata channel-metadata - #:pull-version pull-version)) + #:pull-version pull-version + #:built-in-builders + built-in-builders)) (system (if system (return system) (current-system))) (home -> (getenv "HOME")) |