raco exe: fix problem with submodules
A recent revision to the way modules are instantiated for handling runtime paths did not work right for modules from source (i.e., no bytecode available) that have submodules. Closes #2486
This commit is contained in:
parent
acb7be83d5
commit
0fefd6936a
9
pkgs/compiler-test/tests/compiler/embed/embed-me36.rkt
Normal file
9
pkgs/compiler-test/tests/compiler/embed/embed-me36.rkt
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang racket/base
|
||||
|
||||
;; Make sure this module doesn't get compiled, because the intent is
|
||||
;; to test `raco exe` on the module in source form.
|
||||
|
||||
(module sub racket/base
|
||||
'ok-36)
|
||||
|
||||
(require 'sub)
|
|
@ -11,7 +11,8 @@
|
|||
"embed-bsla.rkt"
|
||||
"embed-isl.rkt"
|
||||
"embed-isll.rkt"
|
||||
"embed-asl.rkt"))
|
||||
"embed-asl.rkt"
|
||||
"embed-me36.rkt"))
|
||||
|
||||
(define test-omit-paths '("embed-me9.rkt"
|
||||
"embed-planet-1"
|
||||
|
|
|
@ -268,7 +268,8 @@
|
|||
(one-mz-test "embed-me21.rkt" "This is 21.\n" #f)
|
||||
(one-mz-test "embed-me31.rkt" "This is 31.\n" #f)
|
||||
(one-mz-test "embed-me34.rkt" "This is 34 in a second place.\n" #f)
|
||||
(one-mz-test "embed-me35.rkt" "'ok-35\n" #f))
|
||||
(one-mz-test "embed-me35.rkt" "'ok-35\n" #f)
|
||||
(one-mz-test "embed-me36.rkt" "'ok-36\n" #f))
|
||||
|
||||
;; Try unicode expr and cmdline:
|
||||
(prepare dest "unicode")
|
||||
|
|
|
@ -543,12 +543,6 @@
|
|||
;; check for run-time paths by visiting the module in an
|
||||
;; expand-time namespace:
|
||||
(parameterize ([current-namespace expand-namespace])
|
||||
(define no-submodule-code
|
||||
;; Strip away submodules to avoid re-declaring them:
|
||||
(module-compiled-submodules
|
||||
(module-compiled-submodules code #f null)
|
||||
#t
|
||||
null))
|
||||
(let ([module-path
|
||||
(if (path? module-path)
|
||||
(path->complete-path module-path)
|
||||
|
@ -558,7 +552,7 @@
|
|||
(module-path-index-resolve (module-path-index-join
|
||||
module-path
|
||||
#f))])
|
||||
(eval no-submodule-code)))
|
||||
(eval code)))
|
||||
(define e (expand `(,#'module m racket/kernel
|
||||
(#%require (only ,module-path)
|
||||
racket/runtime-path)
|
||||
|
|
Loading…
Reference in New Issue
Block a user