[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names.
From: |
Andy Wingo |
Subject: |
Re: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names. |
Date: |
Fri, 29 Apr 2011 19:16:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi Jan,
On Tue 15 Feb 2011 16:35, Jan Nieuwenhuizen <address@hidden> writes:
> From: Jan Nieuwenhuizen <address@hidden>
>
> 2011-02-04 Jan Nieuwenhuizen <address@hidden>
>
> * 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/
- Re: [PATCH 2/5] [mingw]: Have compiled-file-name produce valid names.,
Andy Wingo <=