This issue goes back a while with a few different proposed fixes. http://common-lisp.net/pipermail/slime-devel/2006-March/004679.html being where I first know about it.
This solution is pretty simple, except that it uses functions from the asdf in swank-loader.lisp. Is there anyone using swank-loader directly that does not have asdf and swank properly setup? If asdf is setup properly you can still directly invoke swank-loader.
(defvar *source-directory* - (make-pathname :name nil :type nil - :defaults (or *load-pathname* *default-pathname-defaults*)) + (asdf:component-pathname (asdf:find-system :swank))
The reason being that when cl-launch loads the system, it puts the swank-loader.fasl in its own cache, and then when it loads that, the *load-pathname* is apparently nil and it can't find the source files. Slime still puts the fasls in its own cache.
With this the source files are always found relative to the location of the asd file, which should be pretty dependable right?
I've tested this with ACL on windows loading swank directly. And on debian sbcl loading swank directly, and cl-launch loading swank.
Nathan Bird
* Nathan Bird [2006-07-04 00:22+0200] writes:
This issue goes back a while with a few different proposed fixes. http://common-lisp.net/pipermail/slime-devel/2006-March/004679.html being where I first know about it.
This solution is pretty simple, except that it uses functions from the asdf in swank-loader.lisp. Is there anyone using swank-loader directly that does not have asdf and swank properly setup?
I don't have asdf in my image and don't load it by default. SLIME's default startup sequence uses swank-loader directly. And I think few (if any) CL implementations ship with asdf properly configured by default. If we make SLIME dependent on asdf, we add another hurdle for newbies.
If asdf is setup properly you can still directly invoke swank-loader.
(defvar *source-directory*
- (make-pathname :name nil :type nil
:defaults (or *load-pathname*
*default-pathname-defaults*))
- (asdf:component-pathname (asdf:find-system :swank))
Would it be acceptable to patch swank.asd instead? Like so:
--- swank.asd.old 2005-09-01 08:41:32.000000000 +0200 +++ swank.asd 2006-07-05 19:02:25.000000000 +0200 @@ -22,3 +22,7 @@ (asdf:defsystem :swank :components ((:file "swank-loader")))
+(defpackage :swank-loader) +(defparameter swank-loader::*source-directory* + (asdf:component-pathname (asdf:find-system :swank))) +
Helmut Eller wrote:
I don't have asdf in my image and don't load it by default. SLIME's default startup sequence uses swank-loader directly. And I think few (if any) CL implementations ship with asdf properly configured by default. If we make SLIME dependent on asdf, we add another hurdle for newbies.
I was afraid this might be the case. As a recent lisp newbie asdf is what I found recommended everywhere so this may change. :-)
Would it be acceptable to patch swank.asd instead? Like so:
--- swank.asd.old 2005-09-01 08:41:32.000000000 +0200 +++ swank.asd 2006-07-05 19:02:25.000000000 +0200 @@ -22,3 +22,7 @@ (asdf:defsystem :swank :components ((:file "swank-loader")))
+(defpackage :swank-loader) +(defparameter swank-loader::*source-directory*
- (asdf:component-pathname (asdf:find-system :swank)))
That patch handles every problem that I have been testing for just fine and doesn't introduce a new dependency to the default slime package: awesome!
Nathan