aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-12-26 17:27:32 +0000
committerChristopher Baines <mail@cbaines.net>2019-12-26 17:27:32 +0000
commitefce65171bddf06c3f9dbb52f44764fbcbf654bd (patch)
tree0f2d4387f4f1dd200f75b6d2995314aa35b60269
parentc27f69ba49901fee7b6923bf07e45607fa07c587 (diff)
downloadguix-speed-up-the-derivation-linter.tar
guix-speed-up-the-derivation-linter.tar.gz
scripts: lint: Set the %link-checker-store-connection parameter.speed-up-the-derivation-linter
If set, this parameter provides a store connection used by the derivation linter. Without this being set, the derivation linter establishes a new connection for each package. With this change, I saw the time taken to lint all packages with the derivation linter drop from over 4 minutes to around 3 minutes. * guix/scripts/lint.scm (guix-lint): Set the %lint-checker-store-connection) parameter.
-rw-r--r--guix/scripts/lint.scm22
1 files changed, 13 insertions, 9 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 8d08c484f5..47c104217d 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -28,6 +28,7 @@
(define-module (guix scripts lint)
#:use-module (guix packages)
+ #:use-module (guix store)
#:use-module (guix lint)
#:use-module (guix ui)
#:use-module (guix scripts)
@@ -167,12 +168,15 @@ run the checkers on all packages.\n"))
(_ #f))
(reverse opts)))
(checkers (or (assoc-ref opts 'checkers) %all-checkers)))
- (cond
- ((assoc-ref opts 'list?)
- (list-checkers-and-exit checkers))
- ((null? args)
- (fold-packages (lambda (p r) (run-checkers p checkers)) '()))
- (else
- (for-each (lambda (spec)
- (run-checkers (specification->package spec) checkers))
- args)))))
+ (with-store store
+ (parameterize
+ ((%lint-checker-store-connection store))
+ (cond
+ ((assoc-ref opts 'list?)
+ (list-checkers-and-exit checkers))
+ ((null? args)
+ (fold-packages (lambda (p r) (run-checkers p checkers)) '()))
+ (else
+ (for-each (lambda (spec)
+ (run-checkers (specification->package spec) checkers))
+ args)))))))