lem-project/lem

M-x slime process creation fails

rpx99 opened this issue · 7 comments

I tried the M-x slime command. It results in the following error when trying to create the sbcl process.

Do I need to tell LEM where to find the sbcl command?
What is directory for?
Does it work for you?

Here the LEM source code where it tries to do it:

(defun run-process (command &key name output-callback output-callback-type directory)
(setf command (uiop:ensure-list command))
(let ((buffer-stream (make-string-output-stream)))
(let* ((pointer (async-process:create-process command :nonblock nil :directory directory))
(process (make-instance 'process
:pointer pointer
:name name
:command command
:buffer-stream buffer-stream
;; :read-thread thread
:output-callback output-callback
:output-callback-type output-callback-type))
(thread (bt2:make-thread
(lambda ()
(loop
(unless (async-process:process-alive-p pointer)
(return))
(alexandria:when-let
(string (async-process:process-receive-output pointer))
(send-event (lambda ()
(write-to-buffer process string))))))
:name (format nil "run-process ~{~A~^ ~}" command))))
(set-process-read-thread thread process)
process)))

create-process failed: ("sbcl")
Backtrace for: #<SB-THREAD:THREAD tid=598901 "editor" RUNNING {1105F30093}>
0: ((LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE))
1: ((FLET "THUNK" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX))
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<FUNCTION (FLET "THUNK" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX) {7C95F926D4B}>)
3: (UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX #<FUNCTION (LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE) {110569405B}> :PACKAGE :CL)
4: (LEM-CORE:POP-UP-BACKTRACE #<SIMPLE-ERROR "create-process failed: ~S" {1105693F23}>)
5: ((LAMBDA (CONDITION) :IN LEM-CORE:COMMAND-LOOP) #<SIMPLE-ERROR "create-process failed: ~S" {1105693F23}>)
6: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "create-process failed: ~S" {1105693F23}>)
7: (ERROR "create-process failed: ~S" ("sbcl"))
8: (ASYNC-PROCESS:CREATE-PROCESS ("sbcl") :NONBLOCK NIL :ENCODE NIL :DIRECTORY "/home/rpx/lisp/lem/")
9: (LEM-PROCESS:RUN-PROCESS ("sbcl") :NAME NIL :OUTPUT-CALLBACK #<FUNCTION (LABELS LEM-LISP-MODE/INTERNAL::OUTPUT-CALLBACK :IN LEM-LISP-MODE/INTERNAL::RUN-LISP) {1105693A3B}> :OUTPUT-CALLBACK-TYPE NIL :DIRECTORY "/home/rpx/lisp/lem/")
10: (LEM-LISP-MODE/INTERNAL::RUN-LISP :COMMAND "sbcl" :PORT 56762 :DIRECTORY "/home/rpx/lisp/lem/")
11: (LEM-LISP-MODE/INTERNAL:RUN-SLIME "sbcl" :DIRECTORY NIL)
12: (LEM-CORE:CALL-COMMAND #<LEM-LISP-MODE/INTERNAL:SLIME {11026054F3}> NIL)
13: (LEM-CORE:CALL-COMMAND LEM-CORE/COMMANDS/OTHER:EXECUTE-COMMAND NIL)
14: (LEM-CORE::COMMAND-LOOP-BODY)
15: (LEM-CORE:COMMAND-LOOP)
16: (LEM-CORE::TOPLEVEL-COMMAND-LOOP #<FUNCTION (LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD) {110495EC2B}>)
17: ((LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD))
18: ((LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD))
19: ((FLET BORDEAUX-THREADS-2::RUN-FUNCTION :IN BORDEAUX-THREADS-2::ESTABLISH-DYNAMIC-ENV))
20: ((LABELS BORDEAUX-THREADS-2::%ESTABLISH-DYNAMIC-ENV-WRAPPER :IN BORDEAUX-THREADS-2::ESTABLISH-DYNAMIC-ENV))
21: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
22: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
24: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
25: (SB-THREAD::RUN)
26: ("foreign function: call_into_lisp_")
27: ("foreign function: funcall1")

Is there any output in buffer *Run Lisp swank/<pid>*?

Hm, I don't see this buffer

image

Maybe I need a different libasyncprocess.so in async-process ? How do you compile them?

Thank you. I managed to compile the file. It resulted in

static/amd64/OpenBSD/libasyncprocess.so

Thereafter I copied it into my .qlot location

tron$ pwd                             
/home/rpx/lisp/lem

tron$ find . -name libasyncprocess.so 
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/aarch64/Linux-musl/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/aarch64/Linux/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/arm64/Darwin/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/x86_64/Darwin/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/x86_64/Linux-musl/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/x86_64/Linux/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static/amd64/OpenBSD/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static_old0001-819cbf6/aarch64/Linux/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static_old0001-819cbf6/x86_64/Darwin/libasyncprocess.so
./.qlot/dists/async-process/software/async-process-ref-9690530fc92b59636d9f17d821afa7697e7c8ca4/static_old0001-819cbf6/x86_64/Linux/libasyncprocess.so

It seems it did something to make swank compile ?

tron$ gmake sdl2
qlot install
Reading '/home/rpx/lisp/lem/qlfile'...
Loaded 68 system files.
Ensuring 98 dependencies installed.
Successfully installed.
/usr/local/bin/sbcl --noinform --no-sysinit --no-userinit --load .qlot/setup.lisp --load scripts/build-sdl2.lisp
To load "lem-sdl2":
  Load 1 ASDF system:
    lem-sdl2
; Loading "lem-sdl2"
..................................................


[package swank/source-file-cache].................
[package swank/sbcl]..............................
[package swank/gray]..............................
.
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-util.lisp" (written 21 AUG 2024 05:20:33 PM):
.

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-util.fasl
; compilation finished in 0:00:00.010
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-repl.lisp" (written 21 AUG 2024 05:20:33 PM):
................................................
[package swank-repl].

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-repl.fasl
; compilation finished in 0:00:00.049
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-c-p-c.lisp" (written 21 AUG 2024 05:20:33 PM):
.

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-c-p-c.fasl
; compilation finished in 0:00:00.021
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-arglists.lisp" (written 21 AUG 2024 05:20:33 PM):
..............

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-arglists.fasl
; compilation finished in 0:00:00.385
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-fuzzy.lisp" (written 21 AUG 2024 05:20:33 PM):
..

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-fuzzy.fasl
; compilation finished in 0:00:00.041
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-fancy-inspector.lisp" (written 21 AUG 2024 05:20:33 PM):
.......

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-fancy-inspector.fasl
; compilation finished in 0:00:00.104
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-presentations.lisp" (written 21 AUG 2024 05:20:33 PM):
.

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-presentations.fasl
; compilation finished in 0:00:00.015
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-presentation-streams.lisp" (written 21 AUG 2024 05:20:33 PM):
.

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-presentation-streams.fasl
; compilation finished in 0:00:00.116
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-asdf.lisp" (written 21 AUG 2024 05:20:33 PM):
...

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-asdf.fasl
; compilation finished in 0:00:00.057
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-package-fu.lisp" (written 21 AUG 2024 05:20:33 PM):

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-package-fu.fasl
; compilation finished in 0:00:00.005
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-hyperdoc.lisp" (written 21 AUG 2024 05:20:33 PM):

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-hyperdoc.fasl
; compilation finished in 0:00:00.001
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-sbcl-exts.lisp" (written 21 AUG 2024 05:20:33 PM):
.

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-sbcl-exts.fasl
; compilation finished in 0:00:00.013
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-mrepl.lisp" (written 21 AUG 2024 05:20:33 PM):
.................................................
[package swank-api]...............................
[package swank-mrepl].

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-mrepl.fasl
; compilation finished in 0:00:00.026
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-trace-dialog.lisp" (written 21 AUG 2024 05:20:33 PM):
............................
[package swank-trace-dialog].

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-trace-dialog.fasl
; compilation finished in 0:00:00.017
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-macrostep.lisp" (written 21 AUG 2024 05:20:33 PM):
.....................
[package swank-macrostep].

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-macrostep.fasl
; compilation finished in 0:00:00.016
; compiling file "/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-quicklisp.lisp" (written 21 AUG 2024 05:20:33 PM):

; wrote /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/contrib/swank-quicklisp.fasl
; compilation finished in 0:00:00.001
........................
[package lem-scheme-syntax.data]..................
[package lem-scheme-syntax.indent]................
[package lem-scheme-syntax.syntax-table]..........


But after I copy the resulting lem file to my /usr/local/bin folder and starting lem again the error using M-x slime stays the same.

Wonder what's wrong here...

Here the information of this folder:

tron$ pwd    
/home/rpx/.slime/fasl/2.28

tron$ ls -la 
total 56
drwxr-xr-x  7 rpx  rpx  512 Jul 31 20:48 .
drwxr-xr-x  3 rpx  rpx  512 Dec  5  2023 ..
drwxr-xr-x  3 rpx  rpx  512 Dec  5  2023 sbcl-2.3.10.openbsd.sbcl-2.3.10-unix-x86-64
drwxr-xr-x  3 rpx  rpx  512 Dec  7  2023 sbcl-2.3.11.openbsd.sbcl-2.3.11-unix-x86-64
drwxr-xr-x  3 rpx  rpx  512 Jun  7 20:33 sbcl-2.4.5.openbsd.sbcl-2.4.5-unix-x86-64
drwxr-xr-x  3 rpx  rpx  512 Jul 29 08:44 sbcl-2.4.6.openbsd.sbcl-2.4.6-unix-x86-64
drwxr-xr-x  3 rpx  rpx  512 Jul 31 20:48 sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64

Okay, the really relevant stuff seems to be in here ?

tron$ cd /home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/

tron$ ls -la
total 2592
drwxr-xr-x  3 rpx  rpx     512 Aug  1 16:07 .
drwxr-xr-x  3 rpx  rpx     512 Aug  1 16:07 ..
-rw-r--r--  1 rpx  rpx  236382 Aug 21 17:31 backend.fasl
drwxr-xr-x  2 rpx  rpx     512 Aug 21 17:31 contrib
-rw-r--r--  1 rpx  rpx   41648 Aug 21 17:31 gray.fasl
-rw-r--r--  1 rpx  rpx   14250 Aug 21 17:31 match.fasl
-rw-r--r--  1 rpx  rpx    5503 Aug 21 17:31 packages.fasl
-rw-r--r--  1 rpx  rpx   20000 Aug 21 17:31 rpc.fasl
-rw-r--r--  1 rpx  rpx  286035 Aug 21 17:31 sbcl.fasl
-rw-r--r--  1 rpx  rpx   14985 Aug 21 17:31 source-file-cache.fasl
-rw-r--r--  1 rpx  rpx   27563 Aug 21 17:31 source-path-parser.fasl
-rw-r--r--  1 rpx  rpx  602127 Aug 21 17:31 swank.fasl

Well, not exactly the same - at least the directory path changed to

"/home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/"

Backtrace for: #<SB-THREAD:THREAD tid=454155 "editor" RUNNING {11060C8133}>
0: ((LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE))
1: ((FLET "THUNK" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX))
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<FUNCTION (FLET "THUNK" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX) {85123746D4B}>)
3: (UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX #<FUNCTION (LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE) {1104B71ADB}> :PACKAGE :CL)
4: (LEM-CORE:POP-UP-BACKTRACE #<SIMPLE-ERROR "create-process failed: ~S" {1104B719A3}>)
5: ((LAMBDA (CONDITION) :IN LEM-CORE:COMMAND-LOOP) #<SIMPLE-ERROR "create-process failed: ~S" {1104B719A3}>)
6: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "create-process failed: ~S" {1104B719A3}>)
7: (ERROR "create-process failed: ~S" ("sbcl"))
8: (ASYNC-PROCESS:CREATE-PROCESS ("sbcl") :NONBLOCK NIL :ENCODE NIL :DIRECTORY "/home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/")
9: (LEM-PROCESS:RUN-PROCESS ("sbcl") :NAME NIL :OUTPUT-CALLBACK #<FUNCTION (LABELS LEM-LISP-MODE/INTERNAL::OUTPUT-CALLBACK :IN LEM-LISP-MODE/INTERNAL::RUN-LISP) {1104B7097B}> :OUTPUT-CALLBACK-TYPE NIL :DIRECTORY "/home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/")
10: (LEM-LISP-MODE/INTERNAL::RUN-LISP :COMMAND "sbcl" :PORT 52940 :DIRECTORY "/home/rpx/.slime/fasl/2.28/sbcl-2.4.7.openbsd.sbcl-2.4.7-unix-x86-64/home/rpx/lisp/lem/.qlot/dists/quicklisp/software/slime-v2.28/")
11: (LEM-LISP-MODE/INTERNAL:RUN-SLIME "sbcl" :DIRECTORY NIL)
12: (LEM-CORE:CALL-COMMAND #<LEM-LISP-MODE/INTERNAL:SLIME {11026EB5F3}> NIL)
13: (LEM-CORE:CALL-COMMAND LEM-CORE/COMMANDS/OTHER:EXECUTE-COMMAND NIL)
14: (LEM-CORE::COMMAND-LOOP-BODY)
15: (LEM-CORE:COMMAND-LOOP)
16: (LEM-CORE::TOPLEVEL-COMMAND-LOOP #<FUNCTION (LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD) {1104806C2B}>)
17: ((LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD))
18: ((LAMBDA NIL :IN LEM-CORE::RUN-EDITOR-THREAD))
19: ((FLET BORDEAUX-THREADS-2::RUN-FUNCTION :IN BORDEAUX-THREADS-2::ESTABLISH-DYNAMIC-ENV))
20: ((LABELS BORDEAUX-THREADS-2::%ESTABLISH-DYNAMIC-ENV-WRAPPER :IN BORDEAUX-THREADS-2::ESTABLISH-DYNAMIC-ENV))
21: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
22: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
23: ((FLET SB-UNIX::BODY :IN SB-THREAD::RUN))
24: ((FLET "WITHOUT-INTERRUPTS-BODY-" :IN SB-THREAD::RUN))
25: (SB-THREAD::RUN)
26: ("foreign function: call_into_lisp_")
27: ("foreign function: funcall1")