create-embedding-executable: fix namespace and module-declaration problem

This commit is contained in:
Matthew Flatt 2014-03-09 08:43:40 -06:00
parent 252e4ce590
commit 8253994434
3 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,3 @@
#lang racket
"Ok"

View File

@ -620,3 +620,16 @@
(try-reader)
(try-planet)
(try-*sl)
;; ----------------------------------------
;; Make sure that embedding does not break future module declarations
(let ()
(parameterize ([current-output-port (open-output-bytes)])
(write-module-bundle
#:modules (list (list #f (collection-file-path "embed-me24.rkt" "tests" "compiler" "embed")))))
(parameterize ([read-accept-reader #t]
[current-namespace (make-base-namespace)])
(eval (read (open-input-string "#lang racket 10")))))

View File

@ -489,10 +489,16 @@
;; avoid potentially trying to redeclare cross-phase persistent modules,
;; since redeclaration isn't allowed:
null
;; check for run-time paths by visinting the module in a fresh
;; namespace:
;; check for run-time paths by visiting the module in an
;; expand-time namespace:
(parameterize ([current-namespace expand-namespace])
(eval code)
(define no-submodule-code
;; Strip away submodules to avoid re-declaring them:
(module-compiled-submodules
(module-compiled-submodules code #f null)
#t
null))
(eval no-submodule-code)
(let ([module-path
(if (path? module-path)
(path->complete-path module-path)