From 264fdedb408ba3620d1e361de6c77e7925025301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 14 Mar 2016 22:49:51 +0100 Subject: [PATCH] grafts: Update the narinfo cache before building a derivation. * guix/grafts.scm (references-oracle)[references*]: Add call to 'substitution-oracle'. --- guix/grafts.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guix/grafts.scm b/guix/grafts.scm index af469575db..6bec999ad2 100644 --- a/guix/grafts.scm +++ b/guix/grafts.scm @@ -189,6 +189,12 @@ (define (references* items) (guard (c ((nix-protocol-error? c) ;; As a last resort, build DRV and query the references of the ;; 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)) (map (cut references store <>) items)))) (references/substitutes store items)))