diff --git a/collects/compiler/embed-unit.rkt b/collects/compiler/embed-unit.rkt index eb4d7952d1..315ea20fd1 100644 --- a/collects/compiler/embed-unit.rkt +++ b/collects/compiler/embed-unit.rkt @@ -800,7 +800,10 @@ (define (do-write-module-bundle outp verbose? modules config? literal-files literal-expressions collects-dest on-extension program-name compiler expand-namespace src-filter get-extra-imports on-decls-done) - (let* ([module-paths (map cadr modules)] + (let* ([program-name-bytes (if program-name + (path->bytes program-name) + #"?")] + [module-paths (map cadr modules)] [resolve-one-path (lambda (mp) (let ([f (resolve-module-path mp #f)]) (unless f @@ -882,7 +885,7 @@ ;; The program name isn't used. It just helps ensures that ;; there's plenty of room in the executable for patching ;; the path later when making a distribution. - (path->bytes program-name)))) + program-name-bytes))) extensions))]) (for-each (lambda (pr) (current-module-declare-name (make-resolved-module-path (cadr pr))) @@ -970,7 +973,7 @@ (build-path (path-only (mod-file nc)) p)))))) ;; As for the extension table, a placeholder to save ;; room likely needed by the distribution-mangler - (bytes-append #"................." (path->bytes program-name)))) + (bytes-append #"................." program-name-bytes))) (mod-runtime-paths nc) (mod-runtime-module-syms nc))) runtimes))]) @@ -1031,7 +1034,7 @@ (do-write-module-bundle (current-output-port) verbose? modules config? literal-files literal-expressions #f ; collects-dest on-extension - "?" ; program-name + #f ; program-name compiler expand-namespace src-filter get-extra-imports void)) diff --git a/collects/tests/racket/ctool.rkt b/collects/tests/racket/ctool.rkt new file mode 100644 index 0000000000..32c2e36907 --- /dev/null +++ b/collects/tests/racket/ctool.rkt @@ -0,0 +1,19 @@ +#lang racket +(require setup/dirs) + +(define raco (build-path (find-console-bin-dir) + (if (eq? (system-type) 'windows) + "raco.exe" + "raco"))) + +(define tmp (make-temporary-file)) + +(system* raco + "ctool" + "--3m" + "--c-mods" + tmp + "++lib" + "racket") + +(delete-file tmp)