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:
Matthew Flatt 2019-03-09 08:42:54 -07:00
parent e46e791724
commit 17e5a56569
2 changed files with 34 additions and 27 deletions

View File

@ -28,7 +28,7 @@
coll-paths
coll-main?s
coll-modes
setup-printf setup-fprintf
setup-printf setup-fprintf report-error
check-unused? fix? verbose?
all-pkgs-lazily?
must-declare-deps?)
@ -369,12 +369,16 @@
(append (map path-element->string coll-path) (list base))
"/")))
(define zo-path (build-path dir zo-f))
(define mod-code (call-with-input-file*
(let/ec esc
(define mod-code (with-handlers ([exn:fail? (lambda (exn)
(report-error exn)
(esc (void)))])
(call-with-input-file*
zo-path
(lambda (i)
(parameterize ([read-accept-compiled #t]
[read-on-demand-source zo-path])
(read i)))))
(read i))))))
;; Recur to cover submodules:
(let loop ([mod-code mod-code])
(define name (module-compiled-name mod-code))
@ -394,7 +398,7 @@
(for-each loop
(append
(module-compiled-submodules mod-code #t)
(module-compiled-submodules mod-code #f)))))))
(module-compiled-submodules mod-code #f))))))))
;; ----------------------------------------
(define (find-compiled-directories path)

View File

@ -2034,6 +2034,9 @@
'build
'run))))
setup-printf setup-fprintf
(lambda (exn)
(set! exit-code 1)
(setup-printf #f "check failure: ~a" (exn->string exn)))
(check-unused-dependencies)
(fix-dependencies)
(verbose)