From 635c64e8bb447e9c8702d4ed3a0f1d25b0b10bc2 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 30 Apr 2019 19:00:52 -0600 Subject: [PATCH] racocs make: repair `--no-deps` destination --- pkgs/racket-test/tests/racket/old-make-zo.rkt | 15 +++++++++------ racket/collects/compiler/compiler.rkt | 5 ++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/racket-test/tests/racket/old-make-zo.rkt b/pkgs/racket-test/tests/racket/old-make-zo.rkt index eed95c1cfe..ffb30be0e2 100644 --- a/pkgs/racket-test/tests/racket/old-make-zo.rkt +++ b/pkgs/racket-test/tests/racket/old-make-zo.rkt @@ -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")) diff --git a/racket/collects/compiler/compiler.rkt b/racket/collects/compiler/compiler.rkt index a6ff50af08..b7de0740f1 100644 --- a/racket/collects/compiler/compiler.rkt +++ b/racket/collects/compiler/compiler.rkt @@ -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)