raco setup: allow dependency checking to continue after error
When reading a bytecode file fails, record the error and continue.
This commit is contained in:
parent
e46e791724
commit
17e5a56569
|
@ -28,7 +28,7 @@
|
||||||
coll-paths
|
coll-paths
|
||||||
coll-main?s
|
coll-main?s
|
||||||
coll-modes
|
coll-modes
|
||||||
setup-printf setup-fprintf
|
setup-printf setup-fprintf report-error
|
||||||
check-unused? fix? verbose?
|
check-unused? fix? verbose?
|
||||||
all-pkgs-lazily?
|
all-pkgs-lazily?
|
||||||
must-declare-deps?)
|
must-declare-deps?)
|
||||||
|
@ -369,32 +369,36 @@
|
||||||
(append (map path-element->string coll-path) (list base))
|
(append (map path-element->string coll-path) (list base))
|
||||||
"/")))
|
"/")))
|
||||||
(define zo-path (build-path dir zo-f))
|
(define zo-path (build-path dir zo-f))
|
||||||
(define mod-code (call-with-input-file*
|
(let/ec esc
|
||||||
zo-path
|
(define mod-code (with-handlers ([exn:fail? (lambda (exn)
|
||||||
(lambda (i)
|
(report-error exn)
|
||||||
(parameterize ([read-accept-compiled #t]
|
(esc (void)))])
|
||||||
[read-on-demand-source zo-path])
|
(call-with-input-file*
|
||||||
(read i)))))
|
zo-path
|
||||||
;; Recur to cover submodules:
|
(lambda (i)
|
||||||
(let loop ([mod-code mod-code])
|
(parameterize ([read-accept-compiled #t]
|
||||||
(define name (module-compiled-name mod-code))
|
[read-on-demand-source zo-path])
|
||||||
(unless (and (list? name)
|
(read i))))))
|
||||||
(memq (last name) build-only-submod-names))
|
;; Recur to cover submodules:
|
||||||
;; Check the module's imports:
|
(let loop ([mod-code mod-code])
|
||||||
(for* ([imports (in-list (module-compiled-imports mod-code))]
|
(define name (module-compiled-name mod-code))
|
||||||
[import (cdr imports)])
|
(unless (and (list? name)
|
||||||
(define mod (let ([m (collapse-module-path-index import in-mod)])
|
(memq (last name) build-only-submod-names))
|
||||||
(if (and (pair? m)
|
;; Check the module's imports:
|
||||||
(eq? (car m) 'submod))
|
(for* ([imports (in-list (module-compiled-imports mod-code))]
|
||||||
(cadr m)
|
[import (cdr imports)])
|
||||||
m)))
|
(define mod (let ([m (collapse-module-path-index import in-mod)])
|
||||||
(when (and (pair? mod) (eq? 'lib (car mod)))
|
(if (and (pair? m)
|
||||||
(check-mod! mod 'run pkg zo-f dir)))
|
(eq? (car m) 'submod))
|
||||||
;; Recur for submodules:
|
(cadr m)
|
||||||
(for-each loop
|
m)))
|
||||||
(append
|
(when (and (pair? mod) (eq? 'lib (car mod)))
|
||||||
(module-compiled-submodules mod-code #t)
|
(check-mod! mod 'run pkg zo-f dir)))
|
||||||
(module-compiled-submodules mod-code #f)))))))
|
;; Recur for submodules:
|
||||||
|
(for-each loop
|
||||||
|
(append
|
||||||
|
(module-compiled-submodules mod-code #t)
|
||||||
|
(module-compiled-submodules mod-code #f))))))))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
(define (find-compiled-directories path)
|
(define (find-compiled-directories path)
|
||||||
|
|
|
@ -2034,6 +2034,9 @@
|
||||||
'build
|
'build
|
||||||
'run))))
|
'run))))
|
||||||
setup-printf setup-fprintf
|
setup-printf setup-fprintf
|
||||||
|
(lambda (exn)
|
||||||
|
(set! exit-code 1)
|
||||||
|
(setup-printf #f "check failure: ~a" (exn->string exn)))
|
||||||
(check-unused-dependencies)
|
(check-unused-dependencies)
|
||||||
(fix-dependencies)
|
(fix-dependencies)
|
||||||
(verbose)
|
(verbose)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user