[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#36578] [PATCH 1/9] derivations: 'derivation' primitive accepts <der
From: |
Ludovic Courtès |
Subject: |
[bug#36578] [PATCH 1/9] derivations: 'derivation' primitive accepts <derivation> and #:sources. |
Date: |
Wed, 10 Jul 2019 19:11:20 +0200 |
This brings us closer to the <derivation> data type.
* guix/derivations.scm (derivation): Add #:sources parameter.
[input->derivation-input]: Add clause for 'derivation-input?'.
Honor SOURCES.
---
guix/derivations.scm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 731f1f698f..bd0af320c4 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -708,7 +708,8 @@ name of each input with that input's hash."
(define* (derivation store name builder args
#:key
(system (%current-system)) (env-vars '())
- (inputs '()) (outputs '("out"))
+ (inputs '()) (sources '())
+ (outputs '("out"))
hash hash-algo recursive?
references-graphs
allowed-references disallowed-references
@@ -833,6 +834,8 @@ derivation. It is kept as-is, uninterpreted, in the
derivation."
(define input->derivation-input
(match-lambda
+ ((? derivation-input? input)
+ input)
(((? derivation? drv))
(make-derivation-input drv '("out")))
(((? derivation? drv) sub-drvs ...)
@@ -858,7 +861,8 @@ derivation. It is kept as-is, uninterpreted, in the
derivation."
hash recursive?)))
(sort outputs string<?)))
(sources (sort (delete-duplicates
- (filter-map input->source inputs))
+ (append (filter-map input->source inputs)
+ sources))
string<?))
(inputs (sort (coalesce-duplicate-inputs
(filter-map input->derivation-input inputs))
--
2.22.0
- [bug#36578] [PATCH 0/9] Modernize the API of the 'derivation' primitive, Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 1/9] derivations: 'derivation' primitive accepts <derivation> and #:sources.,
Ludovic Courtès <=
- [bug#36578] [PATCH 4/9] download: Use the new 'derivation' calling convention., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 3/9] gnu: guile-bootstrap: Use the new 'derivation' calling convention., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 5/9] derivations: 'map-derivation' uses the new 'derivation' calling convention., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 9/9] channels: Avoid use of 'derivation-input-path'., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 8/9] gexp: 'lowered-gexp-guile' now returns a <derivation-input>., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 2/9] gexp: <lowered-gexp> separates sources from derivation inputs., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 7/9] derivations: Deprecate the previous calling convention., Ludovic Courtès, 2019/07/10
- [bug#36578] [PATCH 6/9] derivations: Update tests to use new calling convention., Ludovic Courtès, 2019/07/10
- bug#36578: [PATCH 0/9] Modernize the API of the 'derivation' primitive, Ludovic Courtès, 2019/07/15