grafts: Update the narinfo cache before building a derivation.

* guix/grafts.scm (references-oracle)[references*]: Add call to
'substitution-oracle'.
This commit is contained in:
Ludovic Courtès 2016-03-14 22:49:51 +01:00
parent 026ca50fa4
commit 264fdedb40

View file

@ -189,6 +189,12 @@ (define (references* items)
(guard (c ((nix-protocol-error? c) (guard (c ((nix-protocol-error? c)
;; As a last resort, build DRV and query the references of the ;; As a last resort, build DRV and query the references of the
;; build result. ;; build result.
;; Warm up the narinfo cache, otherwise each derivation build
;; will result in one HTTP request to get one narinfo, which is
;; much less efficient than fetching them all upfront.
(substitution-oracle store (list drv))
(and (build-derivations store (list drv)) (and (build-derivations store (list drv))
(map (cut references store <>) items)))) (map (cut references store <>) items))))
(references/substitutes store items))) (references/substitutes store items)))