racocs make: repair --no-deps destination

This commit is contained in:
Matthew Flatt 2019-04-30 19:00:52 -06:00
parent 9e2ef48293
commit 635c64e8bb
2 changed files with 13 additions and 7 deletions

View File

@ -2,7 +2,8 @@
(require setup/dirs
racket/path
racket/file
racket/system)
racket/system
compiler/find-exe)
(define orig-src (collection-file-path "old-make-zo.rkt" "tests" "racket"))
@ -10,16 +11,18 @@
(define src (build-path tmp-dir (file-name-from-path orig-src)))
(copy-file orig-src src)
(define compiled (car (use-compiled-file-paths)))
(define (exe s)
(if (eq? (system-type) 'windows)
(string-append s ".exe")
s))
(define me (path-replace-suffix (find-exe) #""))
(define ending (bytes->string/utf-8 (cadr (regexp-match #rx#"(?i:racket)([cs3mg]*)$" me))))
(string-append s ending (if (eq? (system-type) 'windows) ".exe" "")))
(define (check auto-dir? v)
(unless v (error "failed"))
(let ([src (if auto-dir?
(let-values ([(base name dir?) (split-path src)])
(build-path base "compiled" name))
(build-path base compiled name))
src)])
(delete-file (path-add-suffix src #".zo"))))
@ -28,7 +31,7 @@
(system* (build-path (find-console-bin-dir) (exe "mzc"))
"-z"
(path->string src)))
(check
#t
(system* (build-path (find-console-bin-dir) (exe "raco"))

View File

@ -78,7 +78,10 @@
(build-path
(if (eq? destination-directory 'auto)
(let ([d (build-path (if (eq? base 'relative) 'same base)
"compiled")])
(let ([l (use-compiled-file-paths)])
(if (pair? l)
(car l)
"compiled")))])
(unless (directory-exists? d) (make-directory* d))
d)
destination-directory)