lispgames / cl-sdl2

Common Lisp bindings for SDL2 using C2FFI.
MIT License
304 stars 82 forks source link

Component "swank" not found #74

Closed ghost closed 6 years ago

ghost commented 8 years ago

I am trying to install cl-sdl2. After i evaluate this line (ql:quickload "sdl2") in a .lisp file i get following errors:

`Component "swank" not found [Condition of type ASDF/FIND-SYSTEM:MISSING-COMPONENT]

Restarts: 0: [TRY-RECOMPILING] Recompile optional-deps and try loading it again 1: [RETRY] Retry loading FASL for #<CL-SOURCE-FILE "sdl2" "optional-deps">. 2: [ACCEPT] Continue, treating loading FASL for #<CL-SOURCE-FILE "sdl2" "optional-deps"> as having been successful. 3: [RETRY] Retry ASDF operation. 4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration. 5: [ABORT] Give up on "sdl2" --more--

Backtrace: 0: ((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP "swank") [fast-method] 1: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) # # ASDF/LISP-ACTION:LOAD-OP "swank") 2: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE)) 3: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "swank") [fast-method] 4: (ASDF/OPERATE:LOAD-SYSTEM "swank") 5: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /home/amir/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/amir/quicklisp/local-projects/cl-sdl2/src/optional-.. 6: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /home/amir/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/amir/quicklisp/local-projects/cl-sdl2/src/optional-deps.fasl" {1007279983}> NIL NIL) 7: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /home/amir/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/amir/quicklisp/local-projects/cl-sdl2/src/optional-deps.fasl" {1007279.. 8: (LOAD #P"/home/amir/.cache/common-lisp/sbcl-1.3.1.debian-linux-x64/home/amir/quicklisp/local-projects/cl-sdl2/src/optional-deps.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEF.. 9: (UIOP/UTILITY:CALL-WITH-MUFFLED-CONDITIONS #<CLOSURE (LAMBDA NIL :IN UIOP/LISP-BUILD:LOAD) {10072771BB}> ("Overwriting already existing readtable ~S." #(#:FINALIZERS-OFF-WARNING :ASDF-FINALIZERS))) 10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) # # #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/LISP-ACTION:CL-SOURCE-FILE "sdl2" "optional-deps">) 11: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS (ASDF/LISP-ACTION:LOAD-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)) #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/LISP-ACTION:CL-SOURCE-FILE "sdl2" "optional-deps.. 12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/LISP-ACTION:CL-SOURCE-FILE "sdl2" "optional-deps">) [fast-method] 13: ((:METHOD ASDF/PLAN:PERFORM-PLAN (LIST)) ((#1=#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/SYSTEM:SYSTEM "alexandria">) (#<ASDF/LISP-ACTION:PREPARE-OP > . #2=#<ASDF/SYSTEM:SYSTEM "uiop">) (#1# . #2#) (#<A.. 14: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT)) 15: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) ((#1=#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/SYSTEM:SYSTEM "alexandria">) (#<ASDF/LISP-ACTION:PREPARE-OP > . #2=#<ASDF/SYSTEM:SYSTEM "uiop">) (#1# . #2#).. 16: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT)) 17: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1006976FF3}> :VERBOSE NIL) [fast-method] 18: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/SYSTEM:SYSTEM "sdl2"> :VERBOSE NIL) [fast-method] 19: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) # # #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/SYSTEM:SYSTEM "sdl2"> :VERBOSE NIL) 20: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE)) 21: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP :VERBOSE NIL> #<ASDF/SYSTEM:SYSTEM "sdl2"> :VERBOSE NIL) [fast-method] 22: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) # # ASDF/LISP-ACTION:LOAD-OP "sdl2" :VERBOSE NIL) 23: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE)) 24: (ASDF/CACHE:CALL-WITH-ASDF-CACHE #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100696C88B}> :OVERRIDE NIL :KEY NIL) 25: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "sdl2" :VERBOSE NIL) [fast-method] 26: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "sdl2" :VERBOSE NIL) [fast-method] 27: (ASDF/OPERATE:LOAD-SYSTEM "sdl2" :VERBOSE NIL) 28: (QUICKLISP-CLIENT::CALL-WITH-MACROEXPAND-PROGRESS #<CLOSURE (LAMBDA NIL :IN QUICKLISP-CLIENT::APPLY-LOAD-STRATEGY) {100695BD2B}>) 29: (QUICKLISP-CLIENT::AUTOLOAD-SYSTEM-AND-DEPENDENCIES "sdl2" :PROMPT NIL) 30: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION (T T)) # #<CLOSURE (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {100694410B}>) [fast-method] 31: ((:METHOD QL-IMPL-UTIL::%CALL-WITH-QUIET-COMPILATION :AROUND (QL-IMPL:SBCL T)) #<QL-IMPL:SBCL {10076B4693}> #<CLOSURE (FLET QUICKLISP-CLIENT::QL :IN QUICKLISP-CLIENT:QUICKLOAD) {100694410B}>) [fast-me.. 32: ((:METHOD QUICKLISP-CLIENT:QUICKLOAD (T)) # :PROMPT NIL :SILENT NIL :VERBOSE NIL) [fast-method] 33: (QL-DIST::CALL-WITH-CONSISTENT-DISTS #<CLOSURE (LAMBDA NIL :IN QUICKLISP-CLIENT:QUICKLOAD) {10069393FB}>) 34: (SB-INT:SIMPLE-EVAL-IN-LEXENV (QUICKLISP-CLIENT:QUICKLOAD "sdl2") #) 35: (EVAL (QUICKLISP-CLIENT:QUICKLOAD "sdl2")) 36: ((LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL)) 37: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME interactive evaluation request." #<CLOSURE (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL) {1006938B0B}>) 38: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK:INTERACTIVE-EVAL) {1006938AEB}>) 39: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK:INTERACTIVE-EVAL "(ql:quickload \"sdl2\")") #) 40: (EVAL (SWANK:INTERACTIVE-EVAL "(ql:quickload \"sdl2\")")) 41: (SWANK:EVAL-FOR-EMACS (SWANK:INTERACTIVE-EVAL "(ql:quickload \"sdl2\")") "COMMON-LISP-USER" 10) 42: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)) 43: (SWANK/SBCL::CALL-WITH-BREAK-HOOK # #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {100700589B}>) 44: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/home/amir/.emacs.d/elpa/slime-20160704.1500/swank/sbcl.lisp") # #<FUNCTION (LAMBDA NIL :IN SWANK::SPAWN-WORKER-TH.. 45: (SWANK::CALL-WITH-BINDINGS ((STANDARD-INPUT . #1=#<SWANK/GRAY::SLIME-INPUT-STREAM {1004B17133}>) (STANDARD-OUTPUT . #2=#<SWANK/GRAY::SLIME-OUTPUT-STREAM {1004BEFAB3}>) (TRACE-OUTPUT . #2#) (ERR.. 46: ((LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD)) 47: ((FLET #:WITHOUT-INTERRUPTS-BODY-1156 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)) 48: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE)) 49: ((FLET #:WITHOUT-INTERRUPTS-BODY-359 :IN SB-THREAD::CALL-WITH-MUTEX)) 50: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {7FFFF2186D5B}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THR.. 51: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "worker" RUNNING {10069308C3}> NIL #<CLOSURE (LAMBDA NIL :IN SWANK::SPAWN-WORKER-THREAD) {100693084B}> (#<SB-THREAD:THREAD "worker" RU.. 52: ("foreign function: call_into_lisp") 53: ("foreign function: new_thread_trampoline")`

Why is this happening and how can i fix it?

I have installed cl-sdl2 using quicklisp and git: `cd $HOME/quicklisp/local-projects

git clone https://github.com/rpav/cl-autowrap.git

git clone https://github.com/lispgames/cl-sdl2.git`

rpav commented 8 years ago

Erp, the swank stuff should all be behind #+swank .. did you previously load this in emacs with slime?

ghost commented 8 years ago

No. I got the errors as i first time evaluate (ql:quickload "sdl2")

rpav commented 8 years ago

What is in your *FEATURES*? The only way for that to get loaded is if :swank is somehow in *FEATURES*, or if it was previously loaded with swank, and then swank was removed from the system or otherwise became inaccessible. Perhaps something is erroneously setting the feature though.

ghost commented 8 years ago

(print *features*)

=> (:BORDEAUX-THREADS :CL-PPCRE CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA.0.DEV::SEQUENCE-EMPTYP :THREAD-SUPPORT :CL-JSON-CLOS :CL-JSON :SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF-PACKAGE-SYSTEM :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :64-BIT :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPARE-AND-SWAP-VOPS :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :ELF :FLOAT-EQL-VOPS :FP-AND-PC-STANDARD-SAVE :GENCGC :IEEE-FLOATING-POINT :INLINE-CONSTANTS :INTEGER-EQL-VOP :INTERLEAVED-RAW-SLOTS :LARGEFILE :LINKAGE-TABLE :LINUX :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES :PRECISE-ARG-COUNT-ERROR :RAW-INSTANCE-INIT-VOPS :SB-AFTER-XC-CORE :SB-CORE-COMPRESSION :SB-DOC :SB-EVAL :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-LOCATIONS :SB-TEST :SB-THREAD :SB-UNICODE :SB-XREF-FOR-INTERNALS :SBCL :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)

:swank is there!

rpav commented 8 years ago

I'm not sure how this could be happening other than stale fasls then; I can quickload a new sdl2 into a bare SBCL with no problems. (Nor is there a swank package after doing so, so it's not getting loaded from what I can tell.)

rpav commented 8 years ago

If you enter something like #+swank (+ 1 1) it returns nothing right?

ghost commented 8 years ago

In a slime session entering it returns this:

CL-USER> #+swank (+ 1 1)

2 Is that what you meant?

rpav commented 8 years ago

Err, wait. You do have :SWANK in *FEATURES*! Apparently I can't forward-search today. That would be a problem, if you don't actually have it loaded or available (at least via ASDF?).

rogersm commented 8 years ago

I have the same issue.

In my case I download and install swank manually during emacs/ccl installation without using quicklisp.

rpav commented 8 years ago

QuickLisp isn't required here per se ... just make sure ASDF can find swank.asd. You could symlink this into ~/.local/share/common-lisp/source or possibly ~/quicklisp/local-projects or something.

mfiano commented 8 years ago

I had the same problem when quickloading outside of SLIME, and clearing fasl's fixed it.

borodust commented 8 years ago

Same problem for me on fresh install (inside SLIME). "Fixed" by quickloading swank directly.

rogersm commented 8 years ago

@rpav take into account some of us don't have swank in asdf/quicklisp as we clone the github repo directly and then point to it in our .emacs file.

That means that when we do 'M-x slime' in emacs the slime elisp starts the lisp image loading swank.lisp correctly, but then is not available via asdf.

Two possible solutions:

a) Changing the dependencies not to have swank as mandatory b) Document this case and ask the user to continue without loading swank.

rpav commented 8 years ago

I'll simply disable the features if swank is not available via ASDF. There's not really another reliable way to depend on it otherwise. Not having swank available via ASDF is essentially erroneous, but apparently people use it this way, so I'll at least make cl-sdl2 check for the situation.

rpav commented 8 years ago

This should now load without ASDF being able to find swank/slynk. Note this does not fix removing swank/slynk after the fact; you will have to remove the fasls and recompile for that.

rpav commented 8 years ago

(Note I also clone sly directly.)

mfiano commented 6 years ago

Fixed.

ryukinix commented 6 years ago

image I still can replicate this issue. There is something need to apply the fixed that was mentioned? I'm using Quicklisp and already update the dist for the latest.

mfiano commented 6 years ago

This is most likely due to compiling this outside of SLIME. Try removing your fasl cache and reload from a SLIME or Sly REPL.

ryukinix commented 6 years ago

I fixed doing (ql:quickload 'swank) on SLIME REPL directly, thanks anyway.

mfiano commented 6 years ago

That is an ugly workaround. To be sure I'd need to see your *FEATURES* list in a fresh image, after you have removed your FASL cache.

collinalexbell commented 6 years ago

bump

(ql:quickload :cepl)
(ql:quickload :cepl.sdl2)

fails in a new repl on emacs+slime