Hello lsit,
after a CVS checkout slime stopped to work. Diggin' into the problem i founds the following:
* (load "swank-loader.lisp" :verbose T)
; loading #P"/LISP/slime/swank-loader.lisp" STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN T * (swank-loader:init)
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial thread" {AE61689}>: The function SWANK::SETUP is undefined.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level.
(SB-KERNEL:%COERCE-CALLABLE-TO-FUN SWANK::SETUP) 0] 0
Any idea what's going on? My sank.lisp does indeed not contain a setup fuction. CVS blames "heller" (Helmut Eller, I assume) for the changes in version 1.78.
Cheers Ralf Mattes
Ralf Mattes wrote:
Hello lsit,
after a CVS checkout slime stopped to work. Diggin' into the problem i founds the following:
- (load "swank-loader.lisp" :verbose T)
; loading #P"/LISP/slime/swank-loader.lisp" STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN T
- (swank-loader:init)
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial thread" {AE61689}>: The function SWANK::SETUP is undefined.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [ABORT] Exit debugger, returning to top level.
(SB-KERNEL:%COERCE-CALLABLE-TO-FUN SWANK::SETUP) 0] 0
Any idea what's going on? My sank.lisp does indeed not contain a setup fuction. CVS blames "heller" (Helmut Eller, I assume) for the changes in version 1.78.
Your copy of 'swank.lisp' does *not* contain a definition for the function 'setup'? It may be that something happened during your CVS checkout or update.
$ cvs status swank.lisp =================================================================== File: swank.lisp Status: Up-to-date
Working revision: 1.532 Repository revision: 1.532 /project/slime/cvsroot/slime/swank.lisp,v
Here is the definition of 'setup' in swank.lisp:
2704 (defun setup (version load-path) 2705 (setq *swank-wire-protocol-version* version) 2706 (setq *load-path* load-path) 2707 (swank-backend::warn-unimplemented-interfaces) 2708 (run-hook *after-init-hook*))
$ cvs status swank-loader.lisp =================================================================== File: swank-loader.lisp Status: Up-to-date
Working revision: 1.80 Repository revision: 1.80 /project/slime/cvsroot/slime/swank-loader.lisp,v
Here is the call to swank::setup in swank-loader.lisp:
188 (defun setup () 189 (flet ((q (s) (read-from-string s))) 190 (load-site-init-file *source-directory*) 191 (load-user-init-file) 192 (eval `(pushnew 'compile-contribs ,(q "swank::*after-init-hook*"))) 193 (funcall (q "swank::setup") 194 (slime-version-string) 195 (list (contrib-dir *fasl-directory*) 196 (contrib-dir *source-directory*)))))
If there is no synchronization problem between your files and the CVS repository, then it may be helpful for you to provide the Emacs-lisp code that you use to setup and start SLIME.
On Tue, 19 Feb 2008 10:51:53 -0500, Mark Harig wrote:
Your copy of 'swank.lisp' does *not* contain a definition for the function 'setup'?
Erm, no, as I said.
It may be that something happened during your CVS checkout or update.
$ cvs status swank.lisp
File: swank.lisp Status: Up-to-date
Working revision: 1.532 Repository revision: 1.532 /project/slime/cvsroot/slime/swank.lisp,v
Here is the definition of 'setup' in swank.lisp:
2704 (defun setup (version load-path) 2705 (setq *swank-wire-protocol-version* version) 2706 (setq *load-path* load-path) 2707 (swank-backend::warn-unimplemented-interfaces) 2708 (run-hook *after-init-hook*))
Here:
ralf@mhflaptop01:/LISP/slime$ cvs status swank.lisp =================================================================== File: swank.lisp Status: Up-to-date
Working revision: 1.532 Repository revision: 1.532 /project/slime/cvsroot/slime/swank.lisp,v Sticky Tag: HEAD (revision: 1.532) Sticky Date: (none) Sticky Options: (none)
ralf@mhflaptop01:/LISP/slime$ sed -ne '2704,2708p' swank.lisp :content (content-range *inspectee-content* 0 500)))
(defun inspector-content (specs) (loop for part in specs collect (etypecase part ralf@mhflaptop01:/LISP/slime$
Strangely there _is_ as '(defun setup (version load-path))' at the end of the file .... so why do our files diff here?
If there is no synchronization problem between your files and the CVS repository,
I doubt it. I have since twice removed both swank-loader.lisp and swank.lisp and fetched the newest sources from CVS.
then it may be helpful for you to provide the Emacs-lisp code that you use to setup and start SLIME.
I'm currently trying to find out why slime breaks into the debugger during startup, hence i work from the REPL. This is a paste from my interaction:
ralf@mhflaptop01:/tmp$ cvs -d:pserver:anonymous@common-lisp.net:/project/slime/cvsroot co slime cvs checkout: Updating slime U slime/.cvsignore U slime/ChangeLog U slime/HACKING U slime/NEWS U slime/PROBLEMS U slime/README U slime/hyperspec.el U slime/metering.lisp
....
U slime/doc/slime.texi U slime/doc/texinfo-tabulate.awk ralf@mhflaptop01:/tmp$ cd slime ralf@mhflaptop01:/tmp/slime$ rlwrap sbcl --noinform --no-userinit * (load "swank-loader.lisp") STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN
T * (swank-loader:init)
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial thread" {AE616E1}>: The function SWANK::SETUP is undefined.
Cheers, RalfD
Ralf Mattes wrote:
Here:
ralf@mhflaptop01:/LISP/slime$ cvs status swank.lisp
File: swank.lisp Status: Up-to-date
Working revision: 1.532 Repository revision: 1.532 /project/slime/cvsroot/slime/swank.lisp,v Sticky Tag: HEAD (revision: 1.532) Sticky Date: (none) Sticky Options: (none)
ralf@mhflaptop01:/LISP/slime$ sed -ne '2704,2708p' swank.lisp :content (content-range *inspectee-content* 0 500)))
(defun inspector-content (specs) (loop for part in specs collect (etypecase part ralf@mhflaptop01:/LISP/slime$
Strangely there _is_ as '(defun setup (version load-path))' at the end of the file .... so why do our files diff here?
That was my mistake. I used the 'nl' utility to produce the line numbers, and, by default, it "helpfully" does not include the blank lines in the line numbering. Here is the swank.lisp listing of the 'setup' function definition with the correct line numbers:
3135 (add-hook *pre-reply-hook* 'sync-indentation-to-emacs) 3136 3137 (defun setup (version load-path) 3138 (setq *swank-wire-protocol-version* version) 3139 (setq *load-path* load-path) 3140 (swank-backend::warn-unimplemented-interfaces) 3141 (run-hook *after-init-hook*)) 3142 3143 ;;; swank.lisp ends here
ralf@mhflaptop01:/tmp/slime$ rlwrap sbcl --noinform --no-userinit
- (load "swank-loader.lisp")
STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN
T
- (swank-loader:init)
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial thread" {AE616E1}>: The function SWANK::SETUP is undefined.
I reproduced your commands after checking out SLIME into an empty directory. No errors resulted.
$ sbcl --version SBCL 1.0.13
I also removed the previously compiled lisp files from the ~/.slime/fasl date-specific directory to prompt a recompilation:
$ rm -rf ~/.slime/fasl/2008-02-17
On Tue, 19 Feb 2008 13:06:44 -0500, Mark Harig wrote:
Ralf Mattes wrote:
Here:
ralf@mhflaptop01:/LISP/slime$ cvs status swank.lisp
File: swank.lisp Status: Up-to-date
Working revision: 1.532 Repository revision: 1.532 /project/slime/cvsroot/slime/swank.lisp,v Sticky Tag: HEAD (revision: 1.532) Sticky Date: (none) Sticky Options: (none)
ralf@mhflaptop01:/LISP/slime$ sed -ne '2704,2708p' swank.lisp :content (content-range *inspectee-content* 0 500)))
(defun inspector-content (specs) (loop for part in specs collect (etypecase part ralf@mhflaptop01:/LISP/slime$
Strangely there _is_ as '(defun setup (version load-path))' at the end of the file .... so why do our files diff here?
That was my mistake. I used the 'nl' utility to produce the line numbers, and, by default, it "helpfully" does not include the blank lines in the line numbering. Here is the swank.lisp listing of the 'setup' function definition with the correct line numbers:
3135 (add-hook *pre-reply-hook* 'sync-indentation-to-emacs) 3136 3137 (defun setup (version load-path) 3138 (setq *swank-wire-protocol-version* version) 3139 (setq *load-path* load-path) 3140 (swank-backend::warn-unimplemented-interfaces) 3141 (run-hook *after-init-hook*)) 3142 3143 ;;; swank.lisp ends here
ralf@mhflaptop01:/tmp/slime$ rlwrap sbcl --noinform --no-userinit
- (load "swank-loader.lisp")
STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN
T
- (swank-loader:init)
debugger invoked on a UNDEFINED-FUNCTION in thread #<THREAD "initial thread" {AE616E1}>: The function SWANK::SETUP is undefined.
I reproduced your commands after checking out SLIME into an empty directory. No errors resulted.
$ sbcl --version SBCL 1.0.13
I also removed the previously compiled lisp files from the ~/.slime/fasl date-specific directory to prompt a recompilation:
$ rm -rf ~/.slime/fasl/2008-02-17
As my other post reports - it's a bug in slime.el (swank-loader:load-swank) never gets called and hence sank.lisp never get's loaded (verified by tracing load and compile-file). This all seems to be the result of the recent changes by Helmut and Marco.
Thanks for your help - and I shure would like to know why it's working on your box ... :-)
RalfD
Ralf Mattes wrote:
As my other post reports - it's a bug in slime.el (swank-loader:load-swank) never gets called and hence sank.lisp never get's loaded (verified by tracing load and compile-file). This all seems to be the result of the recent changes by Helmut and Marco.
Thanks for your help - and I shure would like to know why it's working on your box ... :-)
In the code below, from swank-loader.lisp, it can be seen that 'init' (which is called in slime.el) calls 'load-swank', or rather, calls it if the (when ...) condition is satisfied. Could it be that (find-package :swank) is failing on your system for some reason? Or, could it be that 'load-swank' is called (defined earlier in the listing) and it fails to compile the swank-src-files, or that *fasl-directory* is inaccessible on your system for some reason?
swank-loader.lisp (rev. 1.80): ----------------------------- 208 (defun load-swank (&key (src-dir *source-directory*) 209 (fasl-dir *fasl-directory*)) 210 (compile-files (swank-src-files src-dir) fasl-dir t)) 211 212 (defun compile-contribs (&key (src-dir (contrib-dir *source-directory*)) 213 (fasl-dir (contrib-dir *fasl-directory*))) 214 (compile-files (src-files *contribs* src-dir) fasl-dir nil)) 215 216 (defun setup () 217 (flet ((q (s) (read-from-string s))) 218 (load-site-init-file *source-directory*) 219 (load-user-init-file) 220 (eval `(pushnew 'compile-contribs ,(q "swank::*after-init-hook*"))) 221 (funcall (q "swank::setup") 222 (slime-version-string) 223 (list (contrib-dir *fasl-directory*) 224 (contrib-dir *source-directory*))))) 225 226 (defun init (&key delete reload) 227 (when (and delete (find-package :swank)) 228 (mapc #'delete-package '(:swank :swank-io-package :swank-backend))) 229 (when (or (not (find-package :swank)) reload) 230 (load-swank)) 231 (setup))
* Ralf Mattes [2008-02-19 17:53+0100] writes:
[...]
ralf@mhflaptop01:/tmp$ cd slime ralf@mhflaptop01:/tmp/slime$ rlwrap sbcl --noinform --no-userinit
- (load "swank-loader.lisp")
STYLE-WARNING: redefining LISP-VERSION-STRING in DEFUN STYLE-WARNING: redefining FILE-NEWER-P in DEFUN STYLE-WARNING: redefining SLIME-VERSION-STRING in DEFUN STYLE-WARNING: redefining BINARY-PATHNAME in DEFUN STYLE-WARNING: redefining HANDLE-LOADTIME-ERROR in DEFUN STYLE-WARNING: redefining LOAD-USER-INIT-FILE in DEFUN STYLE-WARNING: redefining LOAD-SITE-INIT-FILE in DEFUN STYLE-WARNING: redefining APPEND-DIR in DEFUN STYLE-WARNING: redefining LOAD-SWANK in DEFUN
It looks like swank-loader is already present in your lisp-image.
T
- (swank-loader:init)
The latest version of swank-loader:init doesn't reload swank if the package already exists. You can call it with
(swank-loader:init :reload t)
to override that. slime.el invokes swank-loader:init without arguments.
To solve your problem you could create a core with a new version of swank which has the swank:setup function, or customize slime-lisp-implementations so that swank-loader:init gets called differently.
Helmut.
* Helmut Eller m27ih0aa95.fsf@common-lisp.net Wrote on Tue, 19 Feb 2008 22:48:06 +0100: | |> * (swank-loader:init) | | The latest version of swank-loader:init doesn't reload swank if the | package already exists. You can call it with | | (swank-loader:init :reload t) | | to override that. slime.el invokes swank-loader:init without | arguments.
[Have not tested it yet] but the new behaviour will not support the use case I mentioned in my messages to Marco Baringer, because aiui (swank-loader:init :reload t) will delete packages.
The wisdom from ages has been to separate loading from initialization and to provide the mechanism to do both.[1]
I have not had a problem with reloading swank into a lisp image which already have swank, and when I do reload swank into a lisp image which has swank, I want the behaviour of DEFVAR and DEFPARAMETERs as documented in the Common Lisp Specification to be observed.
Deleting package seems to solve some problem for some combination of lisp + swank hacking/dumping swank to image that Marco is using, (again I have not had these problems), but if it speaks of a problem, the problem is not with original swank-loader, and trying to fix swank-loader only introduces new problems.
Marco did not respond to my messages asking which variables were giving the problems. However I can imagine he could have been dumping state into the core which should not be dumped like live connections, which would cause problems. In these cases a simple DEFVAR -> DEFPARAMETER should be enough to fix the problem
Anyway, what is happening is instead of fixing any actual problems, new problems are being introduced and mechanism being removed.
-- Madhu
[1] swank-loader originally did both, but _could_ be invoked by the user to support all behaviours via:
(when (find-package "SWANK") ;; or not ... (do-things-with "swank-loader.lisp"))
* Madhu [2008-02-21 03:27+0100] writes:
- Helmut Eller m27ih0aa95.fsf@common-lisp.net Wrote on Tue, 19 Feb 2008 22:48:06 +0100:
| |> * (swank-loader:init) | | The latest version of swank-loader:init doesn't reload swank if the | package already exists. You can call it with | | (swank-loader:init :reload t) | | to override that. slime.el invokes swank-loader:init without | arguments.
[Have not tested it yet] but the new behaviour will not support the use case I mentioned in my messages to Marco Baringer, because aiui (swank-loader:init :reload t) will delete packages.
Double-check your assumptions ...
The wisdom from ages has been to separate loading from initialization and to provide the mechanism to do both.[1]
before preaching about wisdom.
Helmut.
On Tue, 19 Feb 2008 10:51:53 -0500, Mark Harig wrote:
If there is no synchronization problem between your files and the CVS repository, then it may be helpful for you to provide the Emacs-lisp code that you use to setup and start SLIME.
As an addendum: my current deviations in the REPL all do:
(load "swank-loader.lisp") (swank-loader:init) (swank:start-server "/tmp/slime.foobar" :coding-system "utf-8-unix")
I'm trying to mimic what my slime startup does:
(progn (load "/LISP/slime/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.7449" :coding-system "utf-8-unix"))
(My indentation). Hmm, iff I change my REPL pattern to:
(load "swank-loader.lisp") (swank-loader:init) (swank-loader:load-swank) ; <====== (swank:start-server "/tmp/slime.foobar" :coding-system "utf-8-unix")
Everything works fine ....
Cheers, RalfD
On Tue, 19 Feb 2008 17:53:55 +0000, Ralf Mattes wrote:
On Tue, 19 Feb 2008 10:51:53 -0500, Mark Harig wrote:
If there is no synchronization problem between your files and the CVS repository, then it may be helpful for you to provide the Emacs-lisp code that you use to setup and start SLIME.
As an addendum: my current deviations in the REPL all do:
(load "swank-loader.lisp") (swank-loader:init) (swank:start-server "/tmp/slime.foobar" :coding-system "utf-8-unix")
I'm trying to mimic what my slime startup does:
(progn (load "/LISP/slime/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank-loader:init")) (funcall (read-from-string "swank:start-server") "/tmp/slime.7449" :coding-system "utf-8-unix"))
(My indentation). Hmm, iff I change my REPL pattern to:
(load "swank-loader.lisp") (swank-loader:init) (swank-loader:load-swank) ; <====== (swank:start-server "/tmp/slime.foobar" :coding-system "utf-8-unix")
Everything works fine ....
CVS annotate of the relevant slime.el code:
1.662 (heller 16-Oct-06): (format "%S\n\n" 1.662 (heller 16-Oct-06): `(progn 1.748 (mbaringe 17-Jan-07): (load ,(expand-file-name loader) :verbose t) 1.905 (heller 16-Feb-08): (funcall (read-from-string "swank-loader:init")) 1.662 (heller 16-Oct-06): (funcall (read-from-string "swank:start-server") 1.662 (heller 16-Oct-06): ,port-filename 1.689 (heller 19-Nov-06): :coding-system ,encoding))))) 1.59 (lgorrie 25-Oct-03):
(swank-loader:load-swank) clearly missing. Or it should be called from swank-loader:init, or whatever the startup method d'jour is ...
Cheers, RalfD
Cheers, RalfD