[slime-devel] suggestion for ~/.slime/fasl/*

Some lisp implementation can be run on different architectures. If users keep the same home on different computers this will lead to collision in ~/.slime/fasl/* directories. To generate the directory name for fasl files, I use the following function, adding the machine type: (defun first-word (text) (let ((pos (position (character " ") text))) (if pos (subseq text 0 pos) text))) (defun implementation-id () (format nil "~A-~A-~A" (first-word (lisp-implementation-type)) (first-word (lisp-implementation-version)) (first-word (machine-type))));;implementation-id -- __Pascal Bourguignon__ http://www.informatimago.com/ Voting Democrat or Republican is like choosing a cabin in the Titanic.

On Fri, 22 Oct 2004 05:11:27 +0200 (CEST), "Pascal J.Bourguignon" <pjb@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. /). __Martin

Martin Simmons writes:
On Fri, 22 Oct 2004 05:11:27 +0200 (CEST), "Pascal J.Bourguignon" <pjb@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. -- __Pascal Bourguignon__ http://www.informatimago.com/ Voting Democrat or Republican is like choosing a cabin in the Titanic.

On Fri, 22 Oct 2004 21:02:12 +0200, "Pascal J.Bourguignon" <pjb@informatimago.com> said: Pascal> Content-Language: en
Pascal> Martin Simmons writes:
> On Fri, 22 Oct 2004 05:11:27 +0200 (CEST), "Pascal J.Bourguignon" <pjb@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. /).
Pascal> We could do further filtering, or once such an implementation is Pascal> identified, we could map the values it returns to sane words. I see that the #+cmu code does that already. __Martin

Martin Simmons writes:
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
I see that the #+cmu code does that already.
That's just one more proof of the evilness of #+ and #-. -- __Pascal Bourguignon__ http://www.informatimago.com/ Voting Democrat or Republican is like choosing a cabin in the Titanic.

Pascal J.Bourguignon schrieb:
Martin Simmons writes:
>On Fri, 22 Oct 2004 05:11:27 +0200 (CEST), "Pascal J.Bourguignon" <pjb@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.
This problems also bite me on clisp-cygwin against clisp-win32. fasl and filenames are incompatible. `uname -m` gives i386 which doesn't help. uname -s is required in this case. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/

On Sun, 24 Oct 2004 01:07:32 +0200, Reini Urban <rurban@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@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. __Martin

Martin Simmons schrieb:
On Sun, 24 Oct 2004 01:07:32 +0200, Reini Urban <rurban@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@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/

On Mon, 25 Oct 2004, Reini Urban wrote:
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.
What about (software-type) and (software-version)? Cheers, -- Nikodemus Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs."

Nikodemus Siivola schrieb:
On Mon, 25 Oct 2004, Reini Urban wrote:
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.
What about (software-type) and (software-version)?
not much better. you may now guess which is which. hint: prompt. $ clisp-base -norc -x "(software-version)" "GNU C 3.3.3 (cygwin special)" $ clisp-base -norc -x "(software-type)" "gcc -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAMIC_FFI -I. -x none -lintl libcharset.a libavcall.a libcallback.a -lreadline -lncurses -liconv -L/usr/local/lib -lsigsegv -L/usr/X11R6/lib -lX11 SAFETY=0 HEAPCODES STANDARD_HEAPCODES SPVW_PAGES SPVW_MIXED"
clisp -q -norc -x "(software-version)" "GNU C 3.3.1 (cygming special)" clisp -q -norc -x "(software-type)" "ANSI C program"
just removing the "/" from the (machine-type) is needed. for clisp windows afaik. -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/

On Mon, 25 Oct 2004 15:06:34 +0200, Reini Urban <rurban@x-ray.at> said:
Reini> Martin Simmons schrieb:
> On Sun, 24 Oct 2004 01:07:32 +0200, Reini Urban <rurban@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@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.
Reini> Sure: Reini> "CLISP-2.33-PC/386" (win32) Reini> vs Reini> "CLISP-2.33-I686" (cygwin) Reini> So Pascal's version does work fine for our the current case. Apart from the problem with the / character. __Martin

Some lisp implementation can be run on different architectures.
If users keep the same home on different computers this will lead to collision in ~/.slime/fasl/* directories.
Talking about that, SLIME obviously made his own way to solve this problem. I wonder if you can do that using ASDF? That is, generating fasl file into a "build" directory and not into the root of your project. It's really really annoying. I guess ASDF is enough extensile to do that, but the lack of doc make it difficult to extend. -- Frederic Brunel
participants (5)
-
Frédéric Brunel
-
Martin Simmons
-
Nikodemus Siivola
-
Pascal J.Bourguignon
-
Reini Urban