Make parallel-build send the whole filename to the worker.

Closes PR 15000.
This commit is contained in:
Eric Dobson 2015-04-26 22:38:13 -07:00 committed by Matthew Flatt
parent 06634b74d5
commit 4e3a7c420a
2 changed files with 12 additions and 12 deletions

View File

@ -10,4 +10,5 @@
(define temporary-directory (make-temporary-file "parallel-build~a" 'directory))
(check-false (parallel-compile-files (list temporary-directory)))
(check-false (parallel-compile-files (list (build-path temporary-directory "new-directory" ".."))))
(delete-directory/files temporary-directory)

View File

@ -136,10 +136,9 @@
(define (retry) (get-job workerid))
(define (build-job cc file last)
(values
(list cc file last)
(list (->bytes (cc-name cc))
(dir->bytes (cc-path cc))
(->bytes file)
(list cc file last)
(list (->bytes (cc-name cc))
(->bytes (build-path (cc-path cc) file))
options)))
(match cc
[(list)
@ -251,8 +250,8 @@
(define-values (dir file b) (split-path hd))
(set! filelist tail)
(handler workerid 'start hd "" "" "")
(values hd (list (->bytes hd) (dir->bytes dir) (->bytes file) null))]
[(list) null]))
(values hd (list (->bytes hd) (->bytes hd) null))]))
(define/public (has-jobs?) (not (null? filelist)))
(define/public (jobs-cnt) (length filelist))
(define/public (get-results) results)
@ -274,10 +273,10 @@
(define cmc (make-caching-managed-compile-zo))
(match-message-loop
[(list name _dir _file options)
(DEBUG_COMM (eprintf "COMPILING ~a ~a ~a ~a\n" worker-id name _file _dir))
(define dir (bytes->path _dir))
(define file (bytes->path _file))
[(list name _full-file options)
(DEBUG_COMM (eprintf "COMPILING ~a ~a ~a\n" worker-id name _full-file))
(define full-file (bytes->path _full-file))
(define-values (dir file _) (split-path full-file))
(define out-str-port (open-output-string))
(define err-str-port (open-output-string))
(define cip (current-input-port))
@ -291,7 +290,7 @@
(define (lock-client cmd fn)
(match cmd
['lock
(DEBUG_COMM (eprintf "REQUESTING LOCK ~a ~a ~a ~a\n" worker-id name _file _dir))
(DEBUG_COMM (eprintf "REQUESTING LOCK ~a ~a ~a\n" worker-id name _full-file))
(match (send/recv (list (list 'LOCK (path->bytes fn)) "" ""))
[(list 'locked) #t]
[(list 'compiled) #f]
@ -299,7 +298,7 @@
[x (send/error (format "DIDNT MATCH B ~v\n" x))]
[else (send/error (format "DIDNT MATCH B\n"))])]
['unlock
(DEBUG_COMM (eprintf "UNLOCKING ~a ~a ~a ~a\n" worker-id name _file _dir))
(DEBUG_COMM (eprintf "UNLOCKING ~a ~a ~a\n" worker-id name _full-file))
(send/msg (list (list 'UNLOCK (path->bytes fn)) "" ""))]
[x (send/error (format "DIDNT MATCH C ~v\n" x))]
[else (send/error (format "DIDNT MATCH C\n"))]))