Handle loading revisions without the (guix lint) module
This is a recent addition, so to support loading revisions without it, better handle the error when loading the module.
This commit is contained in:
parent
15b94238c5
commit
c81d1e04ea
1 changed files with 65 additions and 56 deletions
|
|
@ -199,19 +199,6 @@ WHERE job_id = $1"
|
||||||
action time-taken)))))
|
action time-taken)))))
|
||||||
|
|
||||||
(define (all-inferior-lint-warnings inf store)
|
(define (all-inferior-lint-warnings inf store)
|
||||||
(define checkers
|
|
||||||
(inferior-eval
|
|
||||||
'(begin
|
|
||||||
(use-modules (guix lint))
|
|
||||||
(map (lambda (checker)
|
|
||||||
(list (lint-checker-name checker)
|
|
||||||
(lint-checker-description checker)
|
|
||||||
(if (memq checker %network-dependent-checkers)
|
|
||||||
#t
|
|
||||||
#f)))
|
|
||||||
%all-checkers))
|
|
||||||
inf))
|
|
||||||
|
|
||||||
(define locales
|
(define locales
|
||||||
'("cs_CZ.utf8"
|
'("cs_CZ.utf8"
|
||||||
"da_DK.utf8"
|
"da_DK.utf8"
|
||||||
|
|
@ -286,19 +273,41 @@ WHERE job_id = $1"
|
||||||
(check package))))
|
(check package))))
|
||||||
%package-table)))))
|
%package-table)))))
|
||||||
|
|
||||||
(map
|
(and
|
||||||
(match-lambda
|
(catch
|
||||||
((name description network-dependent?)
|
'misc-error
|
||||||
(cons
|
(lambda ()
|
||||||
(list name description network-dependent?)
|
(inferior-eval '(use-modules (guix lint)) inf)
|
||||||
(if network-dependent?
|
#t)
|
||||||
'()
|
(lambda (key . args)
|
||||||
(log-time
|
(simple-format (current-error-port)
|
||||||
(simple-format #f "getting ~A lint warnings" name)
|
"warning: failed to load the (guix lint) module: ~A ~A\n"
|
||||||
(lambda ()
|
key args)
|
||||||
(inferior-eval-with-store inf store (lint-warnings-for-checker
|
#f))
|
||||||
name))))))))
|
(let ((checkers
|
||||||
checkers))
|
(inferior-eval
|
||||||
|
'(begin
|
||||||
|
(map (lambda (checker)
|
||||||
|
(list (lint-checker-name checker)
|
||||||
|
(lint-checker-description checker)
|
||||||
|
(if (memq checker %network-dependent-checkers)
|
||||||
|
#t
|
||||||
|
#f)))
|
||||||
|
%all-checkers))
|
||||||
|
inf)))
|
||||||
|
(map
|
||||||
|
(match-lambda
|
||||||
|
((name description network-dependent?)
|
||||||
|
(cons
|
||||||
|
(list name description network-dependent?)
|
||||||
|
(if network-dependent?
|
||||||
|
'()
|
||||||
|
(log-time
|
||||||
|
(simple-format #f "getting ~A lint warnings" name)
|
||||||
|
(lambda ()
|
||||||
|
(inferior-eval-with-store inf store (lint-warnings-for-checker
|
||||||
|
name))))))))
|
||||||
|
checkers))))
|
||||||
|
|
||||||
(define (all-inferior-package-derivations store inf packages)
|
(define (all-inferior-package-derivations store inf packages)
|
||||||
(define inferior-%supported-systems
|
(define inferior-%supported-systems
|
||||||
|
|
@ -815,39 +824,39 @@ WHERE job_id = $1"
|
||||||
#t "debug: finished loading information from inferior\n")
|
#t "debug: finished loading information from inferior\n")
|
||||||
(close-inferior inf)
|
(close-inferior inf)
|
||||||
|
|
||||||
(let* ((lint-checker-ids
|
(let ((guix-revision-id
|
||||||
(lint-checkers->lint-checker-ids
|
(insert-guix-revision conn git-repository-id
|
||||||
conn
|
commit store-path)))
|
||||||
(map car inferior-lint-warnings)))
|
|
||||||
(lint-warning-ids
|
|
||||||
(insert-lint-warnings
|
|
||||||
conn
|
|
||||||
inferior-package-id->package-database-id
|
|
||||||
lint-checker-ids
|
|
||||||
inferior-lint-warnings))
|
|
||||||
(package-derivation-ids
|
|
||||||
(inferior-data->package-derivation-ids
|
|
||||||
conn inf inferior-package-id->package-database-id
|
|
||||||
inferior-data-4-tuples))
|
|
||||||
(guix-revision-id
|
|
||||||
(insert-guix-revision conn git-repository-id
|
|
||||||
commit store-path)))
|
|
||||||
|
|
||||||
(insert-guix-revision-lint-checkers conn
|
(when inferior-lint-warnings
|
||||||
guix-revision-id
|
(let* ((lint-checker-ids
|
||||||
lint-checker-ids)
|
(lint-checkers->lint-checker-ids
|
||||||
|
conn
|
||||||
|
(map car inferior-lint-warnings)))
|
||||||
|
(lint-warning-ids
|
||||||
|
(insert-lint-warnings
|
||||||
|
conn
|
||||||
|
inferior-package-id->package-database-id
|
||||||
|
lint-checker-ids
|
||||||
|
inferior-lint-warnings)))
|
||||||
|
(insert-guix-revision-lint-checkers conn
|
||||||
|
guix-revision-id
|
||||||
|
lint-checker-ids)
|
||||||
|
|
||||||
(insert-guix-revision-lint-warnings conn
|
(insert-guix-revision-lint-warnings conn
|
||||||
guix-revision-id
|
guix-revision-id
|
||||||
lint-warning-ids)
|
lint-warning-ids)))
|
||||||
|
(let ((package-derivation-ids
|
||||||
|
(inferior-data->package-derivation-ids
|
||||||
|
conn inf inferior-package-id->package-database-id
|
||||||
|
inferior-data-4-tuples)))
|
||||||
|
|
||||||
(insert-guix-revision-package-derivations conn
|
(insert-guix-revision-package-derivations conn
|
||||||
guix-revision-id
|
guix-revision-id
|
||||||
package-derivation-ids)
|
package-derivation-ids)
|
||||||
|
(simple-format
|
||||||
(simple-format
|
#t "Successfully loaded ~A package/derivation pairs\n"
|
||||||
#t "Successfully loaded ~A package/derivation pairs\n"
|
(length package-derivation-ids))))))
|
||||||
(length package-derivation-ids)))))
|
|
||||||
#t)
|
#t)
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(simple-format (current-error-port)
|
(simple-format (current-error-port)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue