compiler/embed: strip submod from d-r-p paths

Closes #2536
This commit is contained in:
Bogdan Popa 2021-04-30 09:01:41 +03:00 committed by Matthew Flatt
parent 60067d52ad
commit 849d66adaa
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,12 @@
#lang racket/base
(module+ main
(require (for-syntax racket/base)
racket/runtime-path)
(define-runtime-path license '(share "LICENSE-libscheme.txt"))
(with-output-to-file (build-path (find-system-path 'temp-dir) "stdout")
#:exists 'append
(lambda ()
(if (absolute-path? license)
(displayln "found license")
(displayln "not found")))))

View File

@ -438,6 +438,14 @@
(path->string (build-path (collection-path "tests" "compiler" "embed") "embed-me30.rkt")))
(try-exe (mk-dest mred?) "Hello from a place!\n" mred?)
;; raco exe on a module with a `main' submodule+ with a define-runtime-path within it
(system+ raco
"exe"
"-o" (path->string (mk-dest mred?))
(if mred? "--gui" "--")
(path->string (build-path (collection-path "tests" "compiler" "embed") "embed-me39.rkt")))
(try-exe (mk-dest mred?) "found license\n" mred?)
;; raco exe --launcher
(printf/flush ">>launcher\n")
(system+ raco

View File

@ -331,7 +331,7 @@
actual-file-path
use-source?))
(define (mod-file m) (car m))
(define (mod-file m) (strip-submod (car m)))
(define (mod-mod-path m) (cadr m))
(define (mod-code m) (caddr m))
(define (mod-name m) (list-ref m 3))