code-iai / ros_emacs_utils

Emacs tools for ROS
17 stars 19 forks source link

Slime fails to launch/compile due to swank/slime version mis-match #15

Closed ClintLiddick closed 9 years ago

ClintLiddick commented 9 years ago

I'm trying to get slime_ros setup (I previously used slime from quicklisp-silme-helper), but when starting slime I get the error below. The relevant bit from my .emacs is below, and I've run rosrun slime_ros slime_ros_init. I believe the line

Symbol "CODE-TRACE-TABLE-OFFSET-SLOT" not found in the SB-VM package.

indicates that there is a version mismatch between slime and swank. When I tried to run slime without running slime_ros_init I got an explicit warning/error from emacs that "versions differ" between slime (2014-99-99) and swank (2015-06-01). I have no slime.elc files lying around.

I am building slime_ros and slime_wrapper from source using

 sudo ./src/catkin/bin/catkin_make_isolated --install --install-space /opt/ros/indigo

Do you have any ideas what this could be?

(cond
 ((ignore-errors
    (funcall 'require "asdf")
    (funcall
     (read-from-string "asdf:version-satisfies")
     (funcall
      (read-from-string "asdf:asdf-version"))
     "2.019"))
  (push
   (pathname "/opt/ros/indigo/share/emacs/site-lisp/slime/")
   (symbol-value
    (read-from-string "asdf:*central-registry*")))
  (funcall
   (read-from-string "asdf:load-system")
   :swank)
  (funcall
   (read-from-string "swank:start-server")
   "/tmp/slime.25475"))
 (t
  (progn
    (load "/opt/ros/indigo/share/emacs/site-lisp/slime/swank-loader.lisp" :verbose t)
    (funcall
     (read-from-string "swank-loader:init"))
    (funcall
     (read-from-string "swank:start-server")
     "/tmp/slime.25475"))))
This is SBCL 1.2.14.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* 
; compiling file "/opt/ros/indigo/share/common-lisp/source/slime/swank-sbcl.lisp" (written 09 AUG 2015 01:13:57 PM):
; compiling (IN-PACKAGE :SWANK-BACKEND)
[.... many compiling lines]
; compiling (DEFIMPLEMENTATION PROFILE-PACKAGE ...)
; compiling (DEFMETHOD EMACS-INSPECT ...)
; compiling (DEFMETHOD EMACS-INSPECT ...); 
; caught ERROR:
;   READ error during COMPILE-FILE:
;   
;     Symbol "CODE-TRACE-TABLE-OFFSET-SLOT" not found in the SB-VM package.
;   
;       Line: 1507, Column: 70, File-Position: 60197
;   
;       Stream: #<SB-INT:FORM-TRACKING-STREAM
;                 for "file /opt/ros/indigo/share/common-lisp/source/slime/swank-sbcl.lisp"
;                 {1006107D63}>

; compilation aborted after 0:00:00.900

debugger invoked on a UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread
#<THREAD "main thread" RUNNING {1003B86CD3}>:
  COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "swank" "swank-sbcl">

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "swank" "swank-sbcl">.
  1: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "swank" "swank-sbcl">
                                     as having been successful.
  2:                                 Retry ASDF operation.
  3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  4: [ABORT                        ] Exit debugger, returning to top level.

(UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "swank" "swank-sbcl">)))
0] 
(require 'slime-config "/opt/ros/indigo/share/slime_ros/slime-config.el")
; QuickLisp
;(load (expand-file-name "~/quicklisp/slime-helper.el"))
(setq inferior-lisp-program "sbcl")
;(require 'slime-autoloads)
;(slime-setup '(slime-fancy))
gaya- commented 9 years ago

Hi, this happens because you still have the slime from quicklisp, and it loads slime from slime_ros and swank from quicklisp. The only solution currently is to uninstall all other slimes except slime_ros. It's a bug and I haven't had time to fix it yet, unfortunately...

ClintLiddick commented 9 years ago

Hi, thanks for the quick response! I deleted my ~/quicklisp folder, removed the relevant lines from my .emacs and .sbclrc, and deleted the .cache/common-lisp folder entirely but I still get the same error. How else can I make sure there is only one version of slime/swank to load?

gaya- commented 9 years ago

Can it be that you installed a slime Debian? You can try sudo apt-get purge slime.

ClintLiddick commented 9 years ago

Sorry, nothing for either slime or swank.

gaya- commented 9 years ago

The installation doc says:

Then you need to run $ rosrun slime_ros slime_ros_init which will create .sbclrc-ros in your home directory and add an entry into your .sbclrc to load .sbclrc-ros.

Can it be that the entry was not added to your .sbclrc? It will look something like:

;;; AUTOGENERATED PART. PLEASE DO NOT DELETE THIS AND THE FOLLOWING 2 LINES
;;; ###sbclrc-ros### SLIME ROS RELATED STUFF
(load (merge-pathnames (make-pathname :name ".sbclrc-ros") (user-homedir-pathname)))
ClintLiddick commented 9 years ago

Yes, I did run the command have the above in my .sbclrc, along with an unmodified .sbclrc-ros beside it.

gaya- commented 9 years ago

Oh, this is not a slime/swank version problem. It's just that our slime version is outdated and only works with SBCL 1.1 and you have 1.2. I will fix this issue a bit later today.

This whole setup with a custom slime_wrapper is a bit ugly but it was the best I could think of. The problem is that we use functionality from a branch of slime that still hasn't been merged into the master...

ClintLiddick commented 9 years ago

Ah I see. Awesome, I look forward to the fix then. I'm excited to play around with ROS via CL. Yeah, I can't think of a better way to use non-mainline code, especially for such a "major" package.

gaya- commented 9 years ago

I couldn't update the whole slime to a newer version because there were way too many conflicts but I did get the commit that fixes your problem: https://github.com/code-iai/ros_emacs_utils/commit/bec9741db6734d64dc3b7b690829eee61aacb34b Please check if this helps. I will look into resolving the conflicts when I'm back from vacation in two weeks.

ClintLiddick commented 9 years ago

Hey great, I can load slime_ros! Thanks for the quick fix. Enjoy your vacation and no worries!

-- Clint