joaotavora / sly

Sylvester the Cat's Common Lisp IDE
1.26k stars 142 forks source link

Invalid Argument SBCL On Windows #538

Open lloy0076 opened 1 year ago

lloy0076 commented 1 year ago

I do package-install sly and then m-x sly and get in the debugger:

Debugger entered--Lisp error: (file-error "Spawning child process" #("Invalid argument" 0 16 (charset windows-1252)))
  make-process(:name "inferior-lisp" :buffer #<buffer *sly-started inferior-lisp for Program*> :command ("c:/Program" "Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  apply(make-process (:name "inferior-lisp" :buffer #<buffer *sly-started inferior-lisp for Program*> :command ("c:/Program" "Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe")))
  start-process("inferior-lisp" #<buffer *sly-started inferior-lisp for Program*> "c:/Program" "Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe")
  apply(start-process "inferior-lisp" #<buffer *sly-started inferior-lisp for Program*> "c:/Program" ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  start-file-process("inferior-lisp" #<buffer *sly-started inferior-lisp for Program*> "c:/Program" "Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe")
  apply(start-file-process "inferior-lisp" #<buffer *sly-started inferior-lisp for Program*> "c:/Program" ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  comint-exec-1("inferior-lisp" #<buffer *sly-started inferior-lisp for Program*> "c:/Program" ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  comint-exec(#<buffer *sly-started inferior-lisp for Program*> "inferior-lisp" "c:/Program" nil ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  sly-start-lisp("c:/Program" ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe") nil nil "*sly-started inferior-lisp for Program*")
  sly-maybe-start-lisp("c:/Program" ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe") nil nil "*sly-started inferior-lisp for Program*")
  sly-start(:program "c:/Program" :program-args ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe"))
  apply(sly-start (:program "c:/Program" :program-args ("Files" "(x86)/Steel" "Bank" "Common" "Lisp/sbcl.exe")))
  sly(nil nil t)
  funcall-interactively(sly nil nil t)
  call-interactively(sly record nil)
  command-execute(sly record)
  execute-extended-command(nil "sly" "sly")
  funcall-interactively(execute-extended-command nil "sly" "sly")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

I'm getting that and I'm not sure what is happening.

For reference, Slime is installed and it works as expected.

GNU Emacs 27.2 (build 1, x86_64-w64-mingw32)
 of 2021-03-26
c:\laragon\webroots\work\edusourced-app>sbcl --version
SBCL 2.1.10

I'm not sure what else to provide.

If I had to guess it's got something to do with Windows but I can't tell what and the backtrace doesn't really help.

Reihar commented 1 year ago

Hi @lloy0076, I just encountered the same problem and found a fix. You have to set up your inferior-lisp program, to not have any warning telling you to set one up, but more importantly to make emacs work with Windows paths.

You're facing two issues: backslashes, which you can either replace with slashes, or escape with another backslash, and spaces. For the latter quoting the string works.

Here's a line I added to my init.el (.emacs works too):

(setq inferior-lisp-program "\"c:/Program Files/Steel Bank Common Lisp/1.4.14/sbcl.exe\"")

As you can see, I should probably update SBCL but that is how I solved the issue.