From 9a7d0460629835e601d917f1cf09cf9f318eb393 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 29 Jul 2015 13:22:34 -0600 Subject: [PATCH] raco setup: clean collections before compiling any In case a collection "a" is composed from two places, and in case the first place has a bytecode file for "x.rkt" while only the second place has the source of "x.rkt" (probably it was recently moved), then `raco setup` should delete the sourceless bytecode so that any dependency on "x.rkt" will reference the right version. --- racket/collects/setup/setup-core.rkt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/racket/collects/setup/setup-core.rkt b/racket/collects/setup/setup-core.rkt index d294b20129..55107fb912 100644 --- a/racket/collects/setup/setup-core.rkt +++ b/racket/collects/setup/setup-core.rkt @@ -899,9 +899,11 @@ [compile-notify-handler doing-path]) (thunk))))) - (define (clean-cc cc dir info) + (define (clean-cc cc) ;; Clean up bad .zos: (unless (assume-virtual-sources? cc) + (define dir (cc-path cc)) + (define info (cc-info cc)) (define roots ;; If there's more than one relative root, then there will ;; be multiple ways to get to a ".zo" file, and our strategy @@ -994,7 +996,6 @@ (lambda () (define dir (cc-path cc)) (define info (cc-info cc)) - (clean-cc cc dir info) (compile-directory-zos dir info #:omit-root (cc-omit-root cc) #:managed-compile-zo caching-managed-compile-zo @@ -1039,16 +1040,14 @@ (move-to 'end (list #rx"/drracket") (sort-collections-tree (collection-tree-map top-level-plt-collects))))) - (iterate-cct (lambda (cc) - (define dir (cc-path cc)) - (define info (cc-info cc)) - (clean-cc cc dir info)) - cct) + (iterate-cct clean-cc cct) (parallel-compile (parallel-workers) setup-fprintf handle-error cct) (for/fold ([gcs 0]) ([cc planet-dirs-to-compile]) (compile-cc cc gcs))))) (with-specified-mode (lambda () + (for ([cc ccs-to-compile]) + (clean-cc cc)) (for/fold ([gcs 0]) ([cc ccs-to-compile]) (compile-cc cc gcs))))))