[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/11: DRAFT gexp: Add 'raw-derivation-closure'.
From: |
guix-commits |
Subject: |
04/11: DRAFT gexp: Add 'raw-derivation-closure'. |
Date: |
Wed, 11 Dec 2019 18:21:52 -0500 (EST) |
civodul pushed a commit to branch wip-system-bootstrap
in repository guix.
commit 292b9fa57b34d973519362cd4ac382cc4cc51fea
Author: Ludovic Courtès <address@hidden>
Date: Fri Dec 6 23:18:57 2019 +0100
DRAFT gexp: Add 'raw-derivation-closure'.
DRAFT: Add tests.
* guix/gexp.scm (<raw-derivation-closure>): New record type.
(sorted-references): New procedure.
(raw-derivation-closure-compiler): New gexp compiler.
---
guix/gexp.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 34df49f..8c05a39 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -81,6 +81,9 @@
raw-derivation-file
raw-derivation-file?
+ raw-derivation-closure
+ raw-derivation-closure?
+
load-path-expression
gexp-modules
@@ -290,6 +293,29 @@ The expander specifies how an object is converted to its
sexp representation."
(derivation-file-name lowered)
lowered)))
+;; File containing the closure of a raw .drv file, in topological order. This
+;; works around a deficiency of #:references-graphs that can produce the
+;; reference graph of an output, but not that of a raw .drv file.
+(define-record-type <raw-derivation-closure>
+ (raw-derivation-closure obj)
+ raw-derivation-closure?
+ (obj raw-derivation-closure-object))
+
+(define sorted-references
+ (store-lift (lambda (store item)
+ (topologically-sorted store (list item)))))
+
+(define-gexp-compiler (raw-derivation-closure-compiler
+ (obj <raw-derivation-closure>)
+ system target)
+ (mlet %store-monad ((obj (lower-object
+ (raw-derivation-closure-object obj)
+ system #:target target)))
+ (if (derivation? obj)
+ (mlet %store-monad ((refs (sorted-references (derivation-file-name
obj))))
+ (text-file "graph" (object->string refs)))
+ (return obj))))
+
;;;
;;; File declarations.
- branch wip-system-bootstrap created (now f97e759), guix-commits, 2019/12/11
- 01/11: utils: 'version-compare' delays 'dynamic-link' code., guix-commits, 2019/12/11
- 03/11: DRAFT gexp: Add 'raw-derivation-file'., guix-commits, 2019/12/11
- 02/11: monads: Add portability to Guile 2.0., guix-commits, 2019/12/11
- 04/11: DRAFT gexp: Add 'raw-derivation-closure'.,
guix-commits <=
- 07/11: guile-build-system: Add #:implicit-inputs., guix-commits, 2019/12/11
- 08/11: gnu: Add guile-hashing., guix-commits, 2019/12/11
- 10/11: DRAFT serialization: Avoid 'define-values', for the sake of Guile 2.0., guix-commits, 2019/12/11
- 05/11: DRAFT gexp: Add 'object-sources'., guix-commits, 2019/12/11
- 09/11: bootstrap: Add %bootstrap-guile+guild., guix-commits, 2019/12/11
- 11/11: system: bootstrap: Compute and print the result's hash., guix-commits, 2019/12/11
- 06/11: DRAFT system: Add (gnu system bootstrap)., guix-commits, 2019/12/11