summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/build-self.scm29
-rw-r--r--guix/channels.scm67
2 files changed, 70 insertions, 26 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
diff --git a/guix/channels.scm b/guix/channels.scm
index 0d7bc541ccc..34f63eb8330 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -704,11 +704,15 @@ that unconditionally resumes the continuation."
704 store)))) 704 store))))
705 705
706(define* (build-from-source instance 706(define* (build-from-source instance
707 #:key core verbose? (dependencies '()) system) 707 #:key core verbose? (dependencies '()) system
708 built-in-builders)
708 "Return a derivation to build Guix from INSTANCE, using the self-build 709 "Return a derivation to build Guix from INSTANCE, using the self-build
709script contained therein. When CORE is true, build package modules under 710script contained therein. When CORE is true, build package modules under
710SOURCE using CORE, an instance of Guix. By default, build for the current 711SOURCE using CORE, an instance of Guix. By default, build for the current
711system, or SYSTEM if specified." 712system, or SYSTEM if specified. If BUILT-IN-BUILDERS is
713provided, it should be a list of strings and this will be used instead of the
714builtin builders provided by the build daemon for store connections used
715during this process."
712 (define name 716 (define name
713 (symbol->string 717 (symbol->string
714 (channel-name (channel-instance-channel instance)))) 718 (channel-name (channel-instance-channel instance))))
@@ -750,20 +754,28 @@ system, or SYSTEM if specified."
750 #:verbose? verbose? #:version commit 754 #:verbose? verbose? #:version commit
751 #:system system 755 #:system system
752 #:channel-metadata (channel-instance->sexp instance) 756 #:channel-metadata (channel-instance->sexp instance)
753 #:pull-version %pull-version)))) 757 #:pull-version %pull-version
758 #:built-in-builders
759 built-in-builders))))
754 760
755 ;; Build a set of modules that extend Guix using the standard method. 761 ;; Build a set of modules that extend Guix using the standard method.
756 (standard-module-derivation name source core dependencies))) 762 (standard-module-derivation name source core dependencies)))
757 763
758(define* (build-channel-instance instance system 764(define* (build-channel-instance instance system
759 #:optional core (dependencies '())) 765 #:optional core (dependencies '())
766 #:key built-in-builders)
760 "Return, as a monadic value, the derivation for INSTANCE, a channel 767 "Return, as a monadic value, the derivation for INSTANCE, a channel
761instance, for SYSTEM. DEPENDENCIES is a list of extensions providing Guile 768instance, for SYSTEM. DEPENDENCIES is a list of extensions providing Guile
762modules that INSTANCE depends on." 769modules that INSTANCE depends on. If BUILT-IN-BUILDERS is
770provided, it should be a list of strings and this will be used instead of the
771builtin builders provided by the build daemon for store connections used
772during this process."
763 (build-from-source instance 773 (build-from-source instance
764 #:core core 774 #:core core
765 #:dependencies dependencies 775 #:dependencies dependencies
766 #:system system)) 776 #:system system
777 #:built-in-builders
778 built-in-builders))
767 779
768(define (resolve-dependencies instances) 780(define (resolve-dependencies instances)
769 "Return a procedure that, given one of the elements of INSTANCES, returns 781 "Return a procedure that, given one of the elements of INSTANCES, returns
@@ -793,9 +805,13 @@ list of instances it depends on."
793 (lambda (instance) 805 (lambda (instance)
794 (vhash-foldq* cons '() instance edges))) 806 (vhash-foldq* cons '() instance edges)))
795 807
796(define* (channel-instance-derivations instances #:key system) 808(define* (channel-instance-derivations instances #:key system
809 built-in-builders)
797 "Return the list of derivations to build INSTANCES, in the same order as 810 "Return the list of derivations to build INSTANCES, in the same order as
798INSTANCES. Build for the current system by default, or SYSTEM if specified." 811INSTANCES. Build for the current system by default, or SYSTEM if specified.
812If BUILT-IN-BUILDERS is provided, it should be a list of
813strings and this will be used instead of the builtin builders provided by the
814build daemon for store connections used during this process."
799 (define core-instance 815 (define core-instance
800 ;; The 'guix' channel is treated specially: it's an implicit dependency of 816 ;; The 'guix' channel is treated specially: it's an implicit dependency of
801 ;; all the other channels. 817 ;; all the other channels.
@@ -809,11 +825,15 @@ INSTANCES. Build for the current system by default, or SYSTEM if specified."
809 (define (instance->derivation instance) 825 (define (instance->derivation instance)
810 (mlet %store-monad ((system (if system (return system) (current-system)))) 826 (mlet %store-monad ((system (if system (return system) (current-system))))
811 (mcached (if (eq? instance core-instance) 827 (mcached (if (eq? instance core-instance)
812 (build-channel-instance instance system) 828 (build-channel-instance instance system
829 #:built-in-builders
830 built-in-builders)
813 (mlet %store-monad ((core (instance->derivation core-instance)) 831 (mlet %store-monad ((core (instance->derivation core-instance))
814 (deps (mapm %store-monad instance->derivation 832 (deps (mapm %store-monad instance->derivation
815 (edges instance)))) 833 (edges instance))))
816 (build-channel-instance instance system core deps))) 834 (build-channel-instance instance system core deps
835 #:built-in-builders
836 built-in-builders)))
817 instance 837 instance
818 system))) 838 system)))
819 839
@@ -915,10 +935,13 @@ derivation."
915 intro)))))) 935 intro))))))
916 '())))) 936 '()))))
917 937
918(define* (channel-instances->manifest instances #:key system) 938(define* (channel-instances->manifest instances #:key system
939 built-in-builders)
919 "Return a profile manifest with entries for all of INSTANCES, a list of 940 "Return a profile manifest with entries for all of INSTANCES, a list of
920channel instances. By default, build for the current system, or SYSTEM if 941channel instances. By default, build for the current system, or SYSTEM if
921specified." 942specified. If BUILT-IN-BUILDERS is provided, it should be a
943list of strings and this will be used instead of the builtin builders provided
944by the build daemon for store connections used during this process."
922 (define (instance->entry instance drv) 945 (define (instance->entry instance drv)
923 (let ((commit (channel-instance-commit instance)) 946 (let ((commit (channel-instance-commit instance))
924 (channel (channel-instance-channel instance))) 947 (channel (channel-instance-channel instance)))
@@ -934,8 +957,11 @@ specified."
934 (properties 957 (properties
935 `((source ,(channel-instance->sexp instance))))))) 958 `((source ,(channel-instance->sexp instance)))))))
936 959
937 (mlet* %store-monad ((derivations (channel-instance-derivations instances 960 (mlet* %store-monad ((derivations (channel-instance-derivations
938 #:system system)) 961 instances
962 #:system system
963 #:built-in-builders
964 built-in-builders))
939 (entries -> (map instance->entry instances derivations))) 965 (entries -> (map instance->entry instances derivations)))
940 (return (manifest entries)))) 966 (return (manifest entries))))
941 967
@@ -990,10 +1016,17 @@ be used as a profile hook."
990 ;; The default channel profile hooks. 1016 ;; The default channel profile hooks.
991 (cons package-cache-file %default-profile-hooks)) 1017 (cons package-cache-file %default-profile-hooks))
992 1018
993(define (channel-instances->derivation instances) 1019(define* (channel-instances->derivation instances
1020 #:key built-in-builders)
994 "Return the derivation of the profile containing INSTANCES, a list of 1021 "Return the derivation of the profile containing INSTANCES, a list of
995channel instances." 1022channel instances. If BUILT-IN-BUILDERS is provided, it
996 (mlet %store-monad ((manifest (channel-instances->manifest instances))) 1023should be a list of strings and this will be used instead of the builtin
1024builders provided by the build daemon for store connections used during this
1025process."
1026 (mlet %store-monad ((manifest (channel-instances->manifest
1027 instances
1028 #:built-in-builders
1029 built-in-builders)))
997 ;; Emit a profile in format version so that, if INSTANCES denotes an old 1030 ;; Emit a profile in format version so that, if INSTANCES denotes an old
998 ;; Guix, it can still read that profile, for instance for the purposes of 1031 ;; Guix, it can still read that profile, for instance for the purposes of
999 ;; 'guix describe'. 1032 ;; 'guix describe'.