diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-03-28 09:50:28 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-03-28 10:00:05 +0200 |
commit | bdb59b331bac0dea4a75b055334313ddc7bfecc8 (patch) | |
tree | 6315b51845afcab931955a4a229b81602b277665 /guix | |
parent | 7aeb4ffa5828206f89ec62226863c27f7c1c028d (diff) | |
download | gnu-guix-bdb59b331bac0dea4a75b055334313ddc7bfecc8.tar gnu-guix-bdb59b331bac0dea4a75b055334313ddc7bfecc8.tar.gz |
derivations: Do not fetch narinfos for non-substitutable items.
This avoids connections to substitute servers for derivations that are
not substitutable anyway, such as profiles.
Reported by Andy Wingo.
* guix/derivations.scm (substitution-oracle): Skip derivations that do
not pass 'substitutable-derivation?'.
* tests/derivations.scm ("substitution-oracle and #:substitute? #f"):
New test.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/derivations.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm index e02d1ee036..0846d54fa5 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -293,7 +293,14 @@ substituter many times." ;; to ask the substituter for just as much as needed, instead of asking it ;; for the whole world, which can be significantly faster when substitute ;; info is not already in cache. - (append-map derivation-input-output-paths + ;; Also, skip derivations marked as non-substitutable. + (append-map (lambda (input) + (let ((drv (call-with-input-file + (derivation-input-path input) + read-derivation))) + (if (substitutable-derivation? drv) + (derivation-input-output-paths input) + '()))) (derivation-prerequisites drv valid-input?))) (let* ((paths (delete-duplicates @@ -304,6 +311,8 @@ substituter many times." paths)))) (cond ((eqv? mode (build-mode check)) (cons (dependencies drv) result)) + ((not (substitutable-derivation? drv)) + (cons (dependencies drv) result)) ((every valid? self) result) (else |