summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2024-06-24 14:43:46 +0100
committerChristopher Baines <mail@cbaines.net>2024-07-18 11:18:29 +0100
commitd82ac48b076dca156319c16e78acfadab52fd3e5 (patch)
treea3a7d98cd55a40f5a7633aa2274d8bff9be0d053 /build-aux
parentf002371767df04238e3fc6dfacb6930f5529144b (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.scm29
1 files changed, 20 insertions, 9 deletions
diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm
index 02822a2ee84..d9299b9af25 100644
--- a/build-aux/build-self.scm
+++ b/build-aux/build-self.scm
@@ -241,8 +241,12 @@ interface (FFI) of Guile.")
241 241
242(define* (build-program source version 242(define* (build-program source version
243 #:optional (guile-version (effective-version)) 243 #:optional (guile-version (effective-version))
244 #:key (pull-version 0) (channel-metadata #f)) 244 #:key (pull-version 0) (channel-metadata #f)
245 "Return a program that computes the derivation to build Guix from SOURCE." 245 built-in-builders)
246 "Return a program that computes the derivation to build Guix from SOURCE.
247If BUILT-IN-BUILDERS is provided, it should be a list of
248strings and this will be used instead of the builtin builders provided by the
249build daemon, from within the generated build program."
246 (define select? 250 (define select?
247 ;; Select every module but (guix config) and non-Guix modules. 251 ;; Select every module but (guix config) and non-Guix modules.
248 ;; Also exclude (guix channels): it is autoloaded by (guix describe), but 252 ;; Also exclude (guix channels): it is autoloaded by (guix describe), but
@@ -331,11 +335,16 @@ interface (FFI) of Guile.")
331 ;; case, attempt to open a new connection. 335 ;; case, attempt to open a new connection.
332 (let* ((proto (string->number protocol-version)) 336 (let* ((proto (string->number protocol-version))
333 (store (if (integer? proto) 337 (store (if (integer? proto)
334 (port->connection (duplicate-port 338 (port->connection
335 (current-input-port) 339 (duplicate-port
336 "w+0") 340 (current-input-port)
337 #:version proto) 341 "w+0")
338 (open-connection))) 342 #:version proto
343 #:built-in-builders
344 '#$built-in-builders)
345 (open-connection
346 #:built-in-builders
347 '#$built-in-builders)))
339 (sock (socket AF_UNIX SOCK_STREAM 0))) 348 (sock (socket AF_UNIX SOCK_STREAM 0)))
340 ;; Connect to BUILD-OUTPUT and send it the raw 349 ;; Connect to BUILD-OUTPUT and send it the raw
341 ;; build output. 350 ;; build output.
@@ -406,7 +415,7 @@ Display a spinner when nothing happens."
406 (guile-version (if (> pull-version 0) 415 (guile-version (if (> pull-version 0)
407 "3.0" 416 "3.0"
408 (effective-version))) 417 (effective-version)))
409 418 built-in-builders
410 #:allow-other-keys 419 #:allow-other-keys
411 #:rest rest) 420 #:rest rest)
412 "Return a derivation that unpacks SOURCE into STORE and compiles Scheme 421 "Return a derivation that unpacks SOURCE into STORE and compiles Scheme
@@ -415,7 +424,9 @@ files."
415 ;; SOURCE. 424 ;; SOURCE.
416 (mlet %store-monad ((build (build-program source version guile-version 425 (mlet %store-monad ((build (build-program source version guile-version
417 #:channel-metadata channel-metadata 426 #:channel-metadata channel-metadata
418 #:pull-version pull-version)) 427 #:pull-version pull-version
428 #:built-in-builders
429 built-in-builders))
419 (system (if system (return system) (current-system))) 430 (system (if system (return system) (current-system)))
420 (home -> (getenv "HOME")) 431 (home -> (getenv "HOME"))
421 432