fix `raco make -j'

Closes PR 12491

Merge to 5.2.1
(cherry picked from commit 350d0b1edf)
This commit is contained in:
Matthew Flatt 2012-01-19 07:31:42 -07:00 committed by Ryan Culpepper
parent 15f36f1873
commit 87254941f5
2 changed files with 33 additions and 1 deletions

View File

@ -198,7 +198,7 @@
[(cons hd tail)
(define-values (dir file b) (split-path hd))
(set! filelist tail)
(values hd (list (->bytes hd) (->bytes dir) (->bytes file)))]
(values hd (list (->bytes hd) (->bytes dir) (->bytes file) null))]
[(list) null]))
(define/public (has-jobs?) (not (null? filelist)))
(define/public (jobs-cnt) (length filelist))

View File

@ -0,0 +1,32 @@
#lang racket
(require setup/parallel-build)
(define tmp1 (make-temporary-file))
(define tmp2 (make-temporary-file))
(define (mk file)
(with-output-to-file file
#:exists 'truncate
(lambda ()
(printf "#lang racket/base\n"))))
(mk tmp1)
(mk tmp2)
(parallel-compile-files
(list tmp1 tmp2)
#:worker-count 2
#:handler (lambda (type work msg out err)
(match type
['done (printf " Made ~a\n" work)]
['output (printf " Output from: ~a\n~a~a" work out err)]
[else (eprintf " Error compiling ~a\n~a\n~a~a" work msg out err)])))
(define (delete-files f)
(delete-file f)
(let-values ([(base name dir?) (split-path f)])
(delete-file (build-path base "compiled" (path-add-suffix name #".dep")))
(delete-file (build-path base "compiled" (path-add-suffix name #".zo")))))
(delete-files tmp1)
(delete-files tmp2)