Hi Jan, On Tue 15 Feb 2011 16:35, Jan Nieuwenhuizen <janneke-l...@xs4all.nl> writes:
> From: Jan Nieuwenhuizen <jann...@gnu.org> > > 2011-02-04 Jan Nieuwenhuizen <jann...@gnu.org> > > * module/system/base/compile.scm (compiled-file-name): Add > directory separator and remove colon for Mingw. Fixes > compilation on Windows. > --- > module/system/base/compile.scm | 9 +++++++-- > 1 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm > index 7d46713..8c72e54 100644 > --- a/module/system/base/compile.scm > +++ b/module/system/base/compile.scm > @@ -100,11 +100,16 @@ > ".go") > (else (car %load-compiled-extensions)))) > (and %compile-fallback-path > - (let ((f (string-append > + (let* ((c (canonicalize-path file)) > + (f (string-append > %compile-fallback-path > ;; no need for '/' separator here, canonicalize-path > ;; will give us an absolute path > - (canonicalize-path file) > + (if (eq? (string-ref c 1) #\:) > + ;; on Mingw remove drive-letter separator `:' to > + ;; obtain valid file name > + (substring c 2) > + c) > (compiled-extension)))) > (and (false-if-exception (ensure-writable-dir (dirname f))) > f)))) I don't much like this approach. Besides mixing in a heuristic on all machines that is win32-specific, it makes c:/foo.scm collide with d:/foo.scm in the cache, and fails to also modify load.c which also does autocompilation in other contexts. I think we need a proper path library, and unfortunately I think it needs to be implemented at least partly in C, due to circularity issues. See http://docs.racket-lang.org/reference/pathutils.html for an example of what I'm talking about. Is anyone interested in implementing a path library? Andy -- http://wingolog.org/