[slime-devel] suggestion for ~/.slime/fasl/*
Reini Urban
rurban at x-ray.at
Mon Oct 25 13:06:34 UTC 2004
Martin Simmons schrieb:
>>>>>>On Sun, 24 Oct 2004 01:07:32 +0200, Reini Urban <rurban at x-ray.at> said:
>
>
> Reini> Pascal J.Bourguignon schrieb:
>
> >> Martin Simmons writes:
> >>
> >>>>>>>> On Fri, 22 Oct 2004 05:11:27 +0200 (CEST), "Pascal J.Bourguignon" <pjb at informatimago.com> said:
> >>>
> Pascal> Some lisp implementation can be run on different architectures.
> >>>
> Pascal> If users keep the same home on different computers this will lead to
> Pascal> collision in ~/.slime/fasl/* directories.
> >>>
> Pascal> To generate the directory name for fasl files, I use the following
> Pascal> function, adding the machine type:
> >>>
> Pascal> (defun first-word (text)
> Pascal> (let ((pos (position (character " ") text)))
> Pascal> (if pos (subseq text 0 pos) text)))
> >>>
> Pascal> (defun implementation-id ()
> Pascal> (format nil "~A-~A-~A"
> Pascal> (first-word (lisp-implementation-type))
> Pascal> (first-word (lisp-implementation-version))
> Pascal> (first-word (machine-type))));;implementation-id
> >>>
> >>> This could be problematic if any of the functions returns a string containing
> >>> illegal filename characters (e.g. /).
> >>
> >>
> >> We could do further filtering, or once such an implementation is
> >> identified, we could map the values it returns to sane words.
> >>
> >> Anyway, the point here is to add the machine type (uname -m) to be
> >> able to have in the same NFS-mounted home directory both
> >> SBCL-0.8.14.9-X86 and SBCL-0.8.14.9-PowerPC.
>
> Reini> This problems also bite me on clisp-cygwin against clisp-win32.
> Reini> fasl and filenames are incompatible.
> Reini> `uname -m` gives i386 which doesn't help. uname -s is required in this case.
>
> OK, but more interesting is what the proposed implementation-id function
> returns.
Sure:
"CLISP-2.33-PC/386" (win32)
vs
"CLISP-2.33-I686" (cygwin)
So Pascal's version does work fine for our the current case.
The second word from (lisp-implementation-version) is also a hint
=> "2.33 (2004-03-17) (built 3288528537) (memory 3304787349)" but also
quite fragile. Whenever Sam build the cygwin and native version at the
same day it will fail.
Sam should know which function is better to get the at the build_os string.
(machine-version) is almost the same. (just "PC/686" for win32)
(machine-instance) doesn't help since both are the same.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
More information about the slime-devel
mailing list