diff --git a/guix/derivations.scm b/guix/derivations.scm index 92d50503ce..eb94fea55e 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -239,12 +239,17 @@ the store." "Return a list of inputs, such that when INPUTS contains the same DRV twice, they are coalesced, with their sub-derivations merged. This is needed because Nix itself keeps only one of them." + (define (derivation-file-name* obj) + (if (derivation? obj) + (derivation-file-name obj) + obj)) + (fold (lambda (input result) (match input - (($ (= derivation-file-name path) sub-drvs) + (($ (= derivation-file-name* path) sub-drvs) ;; XXX: quadratic (match (find (match-lambda - (($ (= derivation-file-name p) + (($ (= derivation-file-name* p) s) (string=? p path))) result) @@ -685,7 +690,7 @@ name of each input with that input's hash." (make-derivation-input hash sub-drvs)))) inputs))) (make-derivation outputs - (sort inputs + (sort (coalesce-duplicate-inputs inputs) (lambda (drv1 drv2) (string