Compute lint warnings in parallel

This commit is contained in:
Christopher Baines 2024-02-01 13:16:08 +01:00
parent 0468bc4321
commit 7ecb13e403

View file

@ -349,6 +349,11 @@
(ensure-gds-inferior-packages-defined! inf)
(inferior-eval '(and (resolve-module '(guix lint) #:ensure #f)
(use-modules (guix lint))
#t)
inf)
(with-time-logging (simple-format #f "getting ~A lint warnings"
checker-name)
(inferior-eval-with-store/non-blocking
@ -1442,27 +1447,29 @@
(simple-format #t "debug: extract-information-from: ~A\n" store-path)
(letpar& ((inferior-lint-checkers-and-warnings-data
(with-resource-from-pool inf-and-store-pool res
(match res
((inferior . inferior-store)
(let ((inferior-lint-checkers-data
(inferior-lint-checkers inferior)))
(cons
inferior-lint-checkers-data
(if inferior-lint-checkers-data
(with-time-logging "fetching inferior lint warnings"
(map
(match-lambda
((checker-name _ network-dependent?)
(and (and (not network-dependent?)
;; Running the derivation linter is
;; currently infeasible
(not (eq? checker-name 'derivation)))
(inferior-lint-warnings inferior
inferior-store
checker-name))))
inferior-lint-checkers-data))
#f)))))))
(let ((inferior-lint-checkers-data
(with-resource-from-pool inf-and-store-pool res
(match res
((inferior . inferior-store)
(inferior-lint-checkers inferior))))))
(cons
inferior-lint-checkers-data
(and inferior-lint-checkers-data
(with-time-logging "fetching inferior lint warnings"
(par-map&
(match-lambda
((checker-name _ network-dependent?)
(and (and (not network-dependent?)
;; Running the derivation linter is
;; currently infeasible
(not (eq? checker-name 'derivation)))
(with-resource-from-pool inf-and-store-pool res
(match res
((inferior . inferior-store)
(inferior-lint-warnings inferior
inferior-store
checker-name)))))))
inferior-lint-checkers-data))))))
(inferior-packages-system-and-target-to-derivations-alist
(with-time-logging "getting inferior derivations"
(par-map&