diff options
author | Mark H Weaver <mhw@netris.org> | 2015-01-13 12:14:08 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-01-13 12:14:08 -0500 |
commit | a813710a5fb0822e9d95088462d70f6522fe8457 (patch) | |
tree | 35299db4712eda92c809635716d530d085223e81 /guix/derivations.scm | |
parent | d8cd15949092b7cd90ee1dcc4aefe87b3ba4a6fb (diff) | |
parent | 765f0ac8f9f67f775a667a4276faf85ddde6d7ea (diff) | |
download | gnu-guix-a813710a5fb0822e9d95088462d70f6522fe8457.tar gnu-guix-a813710a5fb0822e9d95088462d70f6522fe8457.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r-- | guix/derivations.scm | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm index ec438e833c..b48e7e604d 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -31,6 +31,7 @@ #:use-module (guix hash) #:use-module (guix base32) #:use-module (guix records) + #:use-module (guix sets) #:export (<derivation> derivation? derivation-outputs @@ -162,16 +163,18 @@ download with a fixed hash (aka. `fetchurl')." (define (derivation-prerequisites drv) "Return the list of derivation-inputs required to build DRV, recursively." - (let loop ((drv drv) - (result '())) - (let ((inputs (remove (cut member <> result) ; XXX: quadratic + (let loop ((drv drv) + (result '()) + (input-set (set))) + (let ((inputs (remove (cut set-contains? input-set <>) (derivation-inputs drv)))) - (fold loop - (append inputs result) - (map (lambda (i) - (call-with-input-file (derivation-input-path i) - read-derivation)) - inputs))))) + (fold2 loop + (append inputs result) + (fold set-insert input-set inputs) + (map (lambda (i) + (call-with-input-file (derivation-input-path i) + read-derivation)) + inputs))))) (define (offloadable-derivation? drv) "Return true if DRV can be offloaded, false otherwise." @@ -214,8 +217,8 @@ substituter many times." (append self deps result))) '() drv))) - (subst (substitutable-paths store paths))) - (cut member <> subst))) + (subst (list->set (substitutable-paths store paths)))) + (cut set-contains? subst <>))) (define* (derivation-prerequisites-to-build store drv #:key |