fix raco exe' for cycles created via
define-runtime-module-path'
This commit is contained in:
parent
a0378d956a
commit
e640041dd6
|
@ -341,9 +341,10 @@
|
||||||
|
|
||||||
;; Loads module code, using .zo if there, compiling from .scm if not
|
;; Loads module code, using .zo if there, compiling from .scm if not
|
||||||
(define (get-code filename module-path codes prefixes verbose? collects-dest on-extension
|
(define (get-code filename module-path codes prefixes verbose? collects-dest on-extension
|
||||||
compiler expand-namespace get-extra-imports)
|
compiler expand-namespace get-extra-imports working)
|
||||||
(let ([a (assoc filename (unbox codes))])
|
(let ([a (assoc filename (unbox codes))])
|
||||||
(if a
|
(cond
|
||||||
|
[a
|
||||||
;; Already have this module. Make sure that library-referenced
|
;; Already have this module. Make sure that library-referenced
|
||||||
;; modules are consistently referenced through library paths:
|
;; modules are consistently referenced through library paths:
|
||||||
(let ([found-lib? (is-lib-path? (mod-mod-path a))]
|
(let ([found-lib? (is-lib-path? (mod-mod-path a))]
|
||||||
|
@ -355,12 +356,17 @@
|
||||||
(error 'find-module
|
(error 'find-module
|
||||||
"module referenced both as a library and through a path: ~a"
|
"module referenced both as a library and through a path: ~a"
|
||||||
filename)]
|
filename)]
|
||||||
[else 'ok]))
|
[else 'ok]))]
|
||||||
|
[(hash-ref working filename #f)
|
||||||
|
;; in the process of loading the module; a cycle
|
||||||
|
;; is possible through `define-runtime-path'
|
||||||
|
'ok]
|
||||||
|
[else
|
||||||
;; First use of the module. Get code and then get code for imports.
|
;; First use of the module. Get code and then get code for imports.
|
||||||
(begin
|
|
||||||
(when verbose?
|
(when verbose?
|
||||||
(fprintf (current-error-port) "Getting ~s\n" filename))
|
(fprintf (current-error-port) "Getting ~s\n" filename))
|
||||||
(let ([actual-filename filename]) ; `set!'ed below to adjust file suffix
|
(let ([actual-filename filename]) ; `set!'ed below to adjust file suffix
|
||||||
|
(hash-set! working filename #t)
|
||||||
(let ([code (get-module-code filename
|
(let ([code (get-module-code filename
|
||||||
"compiled"
|
"compiled"
|
||||||
compiler
|
compiler
|
||||||
|
@ -455,7 +461,8 @@
|
||||||
on-extension
|
on-extension
|
||||||
compiler
|
compiler
|
||||||
expand-namespace
|
expand-namespace
|
||||||
get-extra-imports))
|
get-extra-imports
|
||||||
|
working))
|
||||||
(append sub-files extra-files)
|
(append sub-files extra-files)
|
||||||
(append sub-paths normalized-extra-paths))
|
(append sub-paths normalized-extra-paths))
|
||||||
(when verbose?
|
(when verbose?
|
||||||
|
@ -521,7 +528,7 @@
|
||||||
name #f #f
|
name #f #f
|
||||||
null null null
|
null null null
|
||||||
actual-filename)
|
actual-filename)
|
||||||
(unbox codes)))])))))))
|
(unbox codes)))])))])))
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
@ -822,7 +829,8 @@
|
||||||
[get-code-at (lambda (f mp)
|
[get-code-at (lambda (f mp)
|
||||||
(get-code f mp codes prefix-mapping verbose? collects-dest
|
(get-code f mp codes prefix-mapping verbose? collects-dest
|
||||||
on-extension compiler expand-namespace
|
on-extension compiler expand-namespace
|
||||||
get-extra-imports))]
|
get-extra-imports
|
||||||
|
(make-hash)))]
|
||||||
[__
|
[__
|
||||||
;; Load all code:
|
;; Load all code:
|
||||||
(for-each get-code-at files collapsed-mps)]
|
(for-each get-code-at files collapsed-mps)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user