I asked this question over on sbcl-help already. Stas objected. So I'll ask it again here.
Last night I started running into the debugger when trying to start slime in emacs. This morning I decided to delete all my .slime/ fasls, all of .cache/common-lisp/ all of ~/quicklisp and start with a fresh copy of quicklisp.lisp. I updated my arch system (slightly newer version of emacs) then tried to reinstall quicklisp.
The problem occurs upstream of emacs ever being started. I can reproduce the problem with these steps:
$ rm -rf .slime .cache/common-lisp/* quicklisp $ curl -O https://beta.quicklisp.org/quicklisp.lisp $ sbcl --load quicklisp.lisp
* (quicklisp-quickstart:install)
* (ql:quickload "quicklisp-slime-helper")
To load "quicklisp-slime-helper": Load 1 ASDF system: asdf Install 3 Quicklisp releases: alexandria quicklisp-slime-helper slime ; Fetching #<URL "http://beta.quicklisp.org/archive/slime/2022-02-20/slime-v2.27.tgz%22%3E ; 803.72KB ================================================== 823,006 bytes in 0.09 seconds (9273.62KB/sec) ; Fetching #<URL "http://beta.quicklisp.org/archive/alexandria/2022-02-20/alexandria-20220220-... ; 55.16KB ================================================== 56,486 bytes in 0.01 seconds (5516.21KB/sec) ; Fetching #<URL "http://beta.quicklisp.org/archive/quicklisp-slime-helper/2015-07-09/quicklis... ; 2.16KB ================================================== 2,211 bytes in 0.00 seconds (0.00KB/sec) ; Loading "quicklisp-slime-helper" [package swank-loader]............................ [package swank/backend]........................... [package swank/rpc]............................... [package swank/match]............................. [package swank-mop]............................... [package swank]................................... [package swank/source-path-parser]................ [package swank/source-file-cache]................. [package swank/sbcl].............................. [package swank/gray].............................. ........ ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-util.lisp" (written 24 MAR 2022 12:08:30 PM): .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-util.fasl ; compilation finished in 0:00:00.010 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-repl.lisp" (written 24 MAR 2022 12:08:30 PM): ......................................... [package swank-repl]..
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-repl.fasl ; compilation finished in 0:00:00.040 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-c-p-c.lisp" (written 24 MAR 2022 12:08:30 PM): .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-c-p-c.fasl ; compilation finished in 0:00:00.030 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-arglists.lisp" (written 24 MAR 2022 12:08:30 PM): ................
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-arglists.fasl ; compilation finished in 0:00:00.360 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-fuzzy.lisp" (written 24 MAR 2022 12:08:30 PM): ...
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-fuzzy.fasl ; compilation finished in 0:00:00.080 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-fancy-inspector.lisp" (written 24 MAR 2022 12:08:30 PM): ........ .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-fancy-inspector.fasl ; compilation finished in 0:00:00.163 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-presentations.lisp" (written 24 MAR 2022 12:08:30 PM): ;; ;; Error compiling /home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-presentations.lisp: ;; SWANK-REPL also exports the following symbols: ;; (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE ;; SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE ;; SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT) ;; See also: ;; The ANSI Standard, Macro DEFPACKAGE ;;
debugger invoked on a SB-INT:PACKAGE-AT-VARIANCE-ERROR in thread #<THREAD "main thread" RUNNING {10019B0073}>: SWANK-REPL also exports the following symbols: (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT) See also: The ANSI Standard, Macro DEFPACKAGE
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [DROP-THEM ] Unexport them. 1: [KEEP-THEM ] Keep exporting them. 2: [TRY-RECOMPILING ] Recompile swank-loader and try loading it again 3: [RETRY ] Retry loading FASL for #<SWANK-LOADER-FILE "swank" "swank-loader">. 4: [ACCEPT ] Continue, treating loading FASL for #<SWANK-LOADER-FILE "swank" "swank-loader"> as having been successful. 5: Retry ASDF operation. 6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration. 7: Retry ASDF operation. 8: Retry ASDF operation after resetting the configuration. 9: [ABORT ] Give up on "quicklisp-slime-helper" 10: [REGISTER-LOCAL-PROJECTS ] Register local projects and try again. 11: Exit debugger, returning to top level.
(SB-IMPL::NOTE-PACKAGE-VARIANCE :FORMAT-CONTROL "~A also exports the following symbols:~% ~S" :FORMAT-ARGUMENTS ("SWANK-REPL" (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT)) :PACKAGE #<PACKAGE "SWANK-REPL">) 0]
Neither locate nor find show any signs of any other copy of swank or slime on this system. The only thing in my .sbclrc is this:
;;; The following lines added by ql:add-to-init-file: ;;#-quicklisp (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init)))
;;; Added this to test reading bad char streams (setf sb-impl::*default-external-format* :utf-8)
;;; Added this so I can change the names of package symbols and get ;;; prompted about whether or not I want to drop them: (setf sb-ext:*on-package-variance* '(:error t))
I'm running out of ideas. Does anyone have any?
Thanks.
--Jeff
Another piece of information. I have a more or less identical production server which isn't having this problem. But I haven't run dist-upgrade on it recently. The latest version of slime it has is v2.26.1. It's running sbcl 2.2.1.
The system giving me trouble is v2.27 slime and 2.2.2 sbcl.
--Jeff
On Thu, 24 Mar 2022 12:13:00 -0700 Jeff Cunningham jeffrey@jkcunningham.com wrote:
I asked this question over on sbcl-help already. Stas objected. So I'll ask it again here.
Last night I started running into the debugger when trying to start slime in emacs. This morning I decided to delete all my .slime/ fasls, all of .cache/common-lisp/ all of ~/quicklisp and start with a fresh copy of quicklisp.lisp. I updated my arch system (slightly newer version of emacs) then tried to reinstall quicklisp.
The problem occurs upstream of emacs ever being started. I can reproduce the problem with these steps:
$ rm -rf .slime .cache/common-lisp/* quicklisp $ curl -O https://beta.quicklisp.org/quicklisp.lisp $ sbcl --load quicklisp.lisp
(quicklisp-quickstart:install)
(ql:quickload "quicklisp-slime-helper")
To load "quicklisp-slime-helper": Load 1 ASDF system: asdf Install 3 Quicklisp releases: alexandria quicklisp-slime-helper slime ; Fetching #<URL "http://beta.quicklisp.org/archive/slime/2022-02-20/slime-v2.27.tgz%22%3E ; 803.72KB ================================================== 823,006 bytes in 0.09 seconds (9273.62KB/sec) ; Fetching #<URL "http://beta.quicklisp.org/archive/alexandria/2022-02-20/alexandria-20220220-... ; 55.16KB ================================================== 56,486 bytes in 0.01 seconds (5516.21KB/sec) ; Fetching #<URL "http://beta.quicklisp.org/archive/quicklisp-slime-helper/2015-07-09/quicklis... ; 2.16KB ================================================== 2,211 bytes in 0.00 seconds (0.00KB/sec) ; Loading "quicklisp-slime-helper" [package swank-loader]............................ [package swank/backend]........................... [package swank/rpc]............................... [package swank/match]............................. [package swank-mop]............................... [package swank]................................... [package swank/source-path-parser]................ [package swank/source-file-cache]................. [package swank/sbcl].............................. [package swank/gray].............................. ........ ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-util.lisp" (written 24 MAR 2022 12:08:30 PM): .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-util.fasl ; compilation finished in 0:00:00.010 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-repl.lisp" (written 24 MAR 2022 12:08:30 PM): ......................................... [package swank-repl]..
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-repl.fasl ; compilation finished in 0:00:00.040 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-c-p-c.lisp" (written 24 MAR 2022 12:08:30 PM): .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-c-p-c.fasl ; compilation finished in 0:00:00.030 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-arglists.lisp" (written 24 MAR 2022 12:08:30 PM): ................
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-arglists.fasl ; compilation finished in 0:00:00.360 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-fuzzy.lisp" (written 24 MAR 2022 12:08:30 PM): ...
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-fuzzy.fasl ; compilation finished in 0:00:00.080 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-fancy-inspector.lisp" (written 24 MAR 2022 12:08:30 PM): ........ .
; wrote /home/jcunningham/.slime/fasl/2.27/sbcl-2.2.2-linux-x86-64/contrib/swank-fancy-inspector.fasl ; compilation finished in 0:00:00.163 ; compiling file "/home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-presentations.lisp" (written 24 MAR 2022 12:08:30 PM): ;; ;; Error compiling /home/jcunningham/quicklisp/dists/quicklisp/software/slime-v2.27/contrib/swank-presentations.lisp: ;; SWANK-REPL also exports the following symbols: ;; (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE ;; SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE ;; SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT) ;; See also: ;; The ANSI Standard, Macro DEFPACKAGE ;;
debugger invoked on a SB-INT:PACKAGE-AT-VARIANCE-ERROR in thread #<THREAD "main thread" RUNNING {10019B0073}>: SWANK-REPL also exports the following symbols: (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT) See also: The ANSI Standard, Macro DEFPACKAGE
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name): 0: [DROP-THEM ] Unexport them. 1: [KEEP-THEM ] Keep exporting them. 2: [TRY-RECOMPILING ] Recompile swank-loader and try loading it again 3: [RETRY ] Retry loading FASL for #<SWANK-LOADER-FILE "swank" "swank-loader">. 4: [ACCEPT ] Continue, treating loading FASL for #<SWANK-LOADER-FILE "swank" "swank-loader"> as having been successful. 5: Retry ASDF operation. 6: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration. 7: Retry ASDF operation. 8: Retry ASDF operation after resetting the configuration. 9: [ABORT ] Give up on "quicklisp-slime-helper" 10: [REGISTER-LOCAL-PROJECTS ] Register local projects and try again. 11: Exit debugger, returning to top level.
(SB-IMPL::NOTE-PACKAGE-VARIANCE :FORMAT-CONTROL "~A also exports the following symbols:~% ~S" :FORMAT-ARGUMENTS ("SWANK-REPL" (SWANK-REPL:CREATE-REPL SWANK-REPL:LISTENER-GET-VALUE SWANK-REPL:CLEAR-REPL-VARIABLES SWANK-REPL:LISTENER-SAVE-VALUE SWANK-REPL:LISTENER-EVAL SWANK-REPL:REDIRECT-TRACE-OUTPUT)) :PACKAGE #<PACKAGE "SWANK-REPL">) 0]
Neither locate nor find show any signs of any other copy of swank or slime on this system. The only thing in my .sbclrc is this:
;;; The following lines added by ql:add-to-init-file: ;;#-quicklisp (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init)))
;;; Added this to test reading bad char streams (setf sb-impl::*default-external-format* :utf-8)
;;; Added this so I can change the names of package symbols and get ;;; prompted about whether or not I want to drop them: (setf sb-ext:*on-package-variance* '(:error t))
I'm running out of ideas. Does anyone have any?
Thanks.
--Jeff
Yes, I can repeat this in LispWorks after setting
(setq hcl:*handle-existing-defpackage* '(:error :modify))
I assume this is the same thing that sb-ext:*on-package-variance* is designed to control.
It happens in v2.26.1 as well.
The problem is that defslimefun exports the fun name. In swank-repl.lisp, there is a defpackage followed by some defslimefun forms for names that are not exported in the defpackage.
During compilation of swank-repl.lisp, the defpackage and exports are evaluated at compile time.
During later compilation of swank-presentations.lisp, the previously compiled swank-repl.lisp is loaded (this is hidden by a binding of *load-print*).
As a result, the defpackage is evaluated again with fewer exports than in the current state of the package, which has undefined consequences according to the ANSI CL standard (see http://www.lispworks.com/documentation/HyperSpec/Body/m_defpkg.htm).
The only portable fix is to move the exports into the defpackage.
On Thu, 24 Mar 2022 at 19:14, Jeff Cunningham jeffrey@jkcunningham.com wrote:
;;; Added this so I can change the names of package symbols and get ;;; prompted about whether or not I want to drop them: (setf sb-ext:*on-package-variance* '(:error t))
Try (setf sb-ext:*on-package-variance* '(:warn (:swank :swank-backend) :error t)) instead.
Cheers, Luís