From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:60646) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikXSV-0008Nn-KP for guix-patches@gnu.org; Thu, 26 Dec 2019 13:02:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikXSU-0004dH-IU for guix-patches@gnu.org; Thu, 26 Dec 2019 13:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50243) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikXSU-0004dB-Fd for guix-patches@gnu.org; Thu, 26 Dec 2019 13:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ikXSU-0007hP-E3 for guix-patches@gnu.org; Thu, 26 Dec 2019 13:02:02 -0500 Subject: [bug#38754] [PATCH 2/2] scripts: lint: Set the %link-checker-store-connection parameter. Resent-Message-ID: From: Christopher Baines Date: Thu, 26 Dec 2019 18:01:04 +0000 Message-Id: <20191226180104.10888-2-mail@cbaines.net> In-Reply-To: <20191226180104.10888-1-mail@cbaines.net> References: <8736d7rnzg.fsf@cbaines.net> <20191226180104.10888-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38754@debbugs.gnu.org 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. --- guix/scripts/lint.scm | 22 +++++++++++++--------- 1 file 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))))))) -- 2.24.1