summaryrefslogtreecommitdiff
path: root/guix/self.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/self.scm')
-rw-r--r--guix/self.scm71
1 files changed, 33 insertions, 38 deletions
diff --git a/guix/self.scm b/guix/self.scm
index 89c5428039..5ad644b1df 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -112,6 +112,27 @@ GUILE-VERSION (\"2.0\" or \"2.2\"), or #f if none of the packages matches."
(dependencies node-dependencies) ;list of nodes
(compiled node-compiled)) ;node -> lowerable object
+;; File mappings are essentially an alist as passed to 'imported-files'.
+(define-record-type <file-mapping>
+ (file-mapping name alist)
+ file-mapping?
+ (name file-mapping-name)
+ (alist file-mapping-alist))
+
+(define-gexp-compiler (file-mapping-compiler (mapping <file-mapping>)
+ system target)
+ ;; Here we use 'imported-files', which can arrange to directly import all
+ ;; the files instead of creating a derivation, when possible.
+ (imported-files (map (match-lambda
+ ((destination (? local-file? file))
+ (cons destination
+ (local-file-absolute-file-name file)))
+ ((destination source)
+ (cons destination source))) ;silliness
+ (file-mapping-alist mapping))
+ #:name (file-mapping-name mapping)
+ #:system system))
+
(define (node-fold proc init nodes)
(let loop ((nodes nodes)
(visited (setq))
@@ -166,8 +187,8 @@ must be present in the search path."
(closure modules
(node-modules/recursive dependencies))))
(module-files (map module->import modules))
- (source (imported-files (string-append name "-source")
- (append module-files extra-files))))
+ (source (file-mapping (string-append name "-source")
+ (append module-files extra-files))))
(node name modules source dependencies
(compiled-modules name source
(map car module-files)
@@ -343,7 +364,7 @@ DOMAIN, a gettext domain."
(define* (guix-command modules #:optional compiled-modules
#:key source (dependencies '())
- (guile-version (effective-version)))
+ guile (guile-version (effective-version)))
"Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its
load path."
(program-file "guix-command"
@@ -383,15 +404,17 @@ load path."
;; XXX: It would be more convenient to change it to:
;; (exit (apply guix-main (command-line)))
- (apply guix-main (command-line))))))
+ (apply guix-main (command-line))))
+ #:guile guile))
(define* (whole-package name modules dependencies
#:key
(guile-version (effective-version))
compiled-modules
- info daemon
+ info daemon guile
(command (guix-command modules
#:dependencies dependencies
+ #:guile guile
#:guile-version guile-version)))
"Return the whole Guix package NAME that uses MODULES, a derivation of all
the modules, and DEPENDENCIES, a list of packages depended on. COMMAND is the
@@ -630,10 +653,12 @@ assumed to be part of MODULES."
(command (guix-command modules compiled
#:source source
#:dependencies dependencies
+ #:guile guile-for-build
#:guile-version guile-version)))
(whole-package name modules dependencies
#:compiled-modules compiled
#:command command
+ #:guile guile-for-build
;; Include 'guix-daemon'. XXX: Here we inject an
;; older snapshot of guix-daemon, but that's a good
@@ -762,38 +787,6 @@ assumed to be part of MODULES."
;;; Building.
;;;
-(define (imported-files name files)
- ;; This is a non-monadic, simplified version of 'imported-files' from (guix
- ;; gexp).
- (define same-target?
- (match-lambda*
- (((file1 . _) (file2 . _))
- (string=? file1 file2))))
-
- (define build
- (with-imported-modules (source-module-closure
- '((guix build utils)))
- #~(begin
- (use-modules (ice-9 match)
- (guix build utils))
-
- (mkdir (ungexp output)) (chdir (ungexp output))
- (for-each (match-lambda
- ((final-path store-path)
- (mkdir-p (dirname final-path))
-
- ;; Note: We need regular files to be regular files, not
- ;; symlinks, as this makes a difference for
- ;; 'add-to-store'.
- (copy-file store-path final-path)))
- '#$(delete-duplicates files same-target?)))))
-
- ;; We're just copying files around, no need to substitute or offload it.
- (computed-file name build
- #:options '(#:local-build? #t
- #:substitutable? #f
- #:env-vars (("COLUMNS" . "200")))))
-
(define* (compiled-modules name module-tree module-files
#:optional
(dependencies '())
@@ -903,8 +896,10 @@ running Guile."
(module-ref (resolve-interface '(gnu packages guile))
'guile-2.2.2))
("2.2"
+ ;; Use the latest version, which has fixes for
+ ;; <https://bugs.gnu.org/30602> and VM stack-marking issues.
(canonical-package (module-ref (resolve-interface '(gnu packages guile))
- 'guile-2.2/fixed)))
+ 'guile-2.2.4)))
("2.0"
(module-ref (resolve-interface '(gnu packages guile))
'guile-2.0))))