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