Commit 38595f29 authored by Helmut Eller's avatar Helmut Eller

(Re)Introduce something like a SLIME version and put fasl files for

different versions in different directories.  A common problem is that
newbies download the latest release and discover that it doesn't
compile with the brand new CLISP or SBCL; then they download the CVS
version but the loader doesn't recompile the needed files because time
stamp of the borken fasl files are newer than source files in CVS.

(default-fasl-directory): Include the SLIME version.
(slime-version-string): New.
parent bd2eeca7
......@@ -27,6 +27,11 @@
(cl:in-package :swank-loader)
(defvar *source-directory*
(let ((p (or *load-pathname* *default-pathname-defaults*)))
(if p (directory-namestring p)))
"The directory where to look for the source.")
(defparameter *sysdep-files*
......@@ -99,11 +104,27 @@ operating system, and hardware architecture."
"Returns true if NEW-FILE is newer than OLD-FILE."
(> (file-write-date new-file) (file-write-date old-file)))
;; Currently just use the modification time of the ChangeLog. We
;; could also try to use one of those CVS keywords.
(defun slime-version-string ()
"Return a string identifying the SLIME version.
Return nil if nothing appropriate is available."
(let* ((changelog (merge-pathnames "ChangeLog" *source-directory*))
(date (file-write-date changelog)))
(cond (date (multiple-value-bind (_s _m _h date month year)
(decode-universal-time date)
(declare (ignore _s _m _h))
(format nil "~D-~2,'0D-~2,'0D" year month date)))
(t nil))))
(defun default-fasl-directory ()
:directory `(:relative ".slime" "fasl" ,(unique-directory-name)))
:directory `(:relative ".slime" "fasl"
,@(if (slime-version-string) (list (slime-version-string)))
(defun binary-pathname (source-pathname binary-directory)
"Return the pathname where SOURCE-PATHNAME's binary should be compiled."
......@@ -112,7 +133,6 @@ operating system, and hardware architecture."
:type (pathname-type cfp))
(defun compile-files-if-needed-serially (files fasl-directory)
"Compile each file in FILES if the source is newer than
its corresponding binary, or the file preceding it was
......@@ -155,20 +175,16 @@ recompiled."
(defun load-site-init-file (directory)
(load (make-pathname :name "site-init" :type "lisp"
:defaults directory)
:directory (pathname-directory directory))
:if-does-not-exist nil))
(defun swank-source-files (source-directory)
(mapcar (lambda (name)
(merge-pathnames (make-pathname :name name :type "lisp")
(make-pathname :name name :type "lisp"
:directory (pathname-directory source-directory)))
`("swank-backend" ,@*sysdep-files* "swank")))
(defvar *source-directory* (or *load-pathname*
"The directory where to look for the source.")
(defvar *fasl-directory* (default-fasl-directory)
(defvar *fasl-directory* (directory-namestring (default-fasl-directory))
"The directory where fasl files should be placed.")
(defun load-swank (&key
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment