raco exe: preserve lib form of runtime submodule references

Otherwise, executable creation can fail because a module is referenced
both through a `lib` path and through a filesystem path.
This commit is contained in:
Matthew Flatt 2015-02-27 12:27:27 -07:00
parent e345e44e00
commit 16a9f86f90

View File

@ -567,9 +567,15 @@
working))
(define (get-one-submodule-code m)
(define name (cadr (module-compiled-name m)))
(define mpi (module-path-index-join `(submod "." ,name) #f))
(define mp `(submod "." ,name))
(define mpi (module-path-index-join mp #f))
(get-one-code (resolve-module-path-index mpi filename)
(collapse-module-path-index mpi filename)
(if (is-lib-path? module-path)
;; Preserve `lib`-ness of module reference:
(collapse-module-path-index
(module-path-index-join mp module-path))
;; Ok to collapse based on filename:
(collapse-module-path-index mpi filename))
m))
;; Add code for pre submodules:
(for-each get-one-submodule-code pre-submods)