Clozure / ccl

Clozure Common Lisp
http://ccl.clozure.com
Apache License 2.0
857 stars 103 forks source link

run-program fails in Windows with spaces in the executable path #184

Closed billstclair closed 2 days ago

billstclair commented 5 years ago

Running a recent Windows 10 in a VMWare VM, with a week-old CCL master download. The problem appears to be in ccl::make-windows-command-line.

Error 2 is "The system cannot find the file specified."

I worked around it by making a copy of my CCL directory on the Z drive, which is mapped to a VMWare shared directory with the Mac host.

? z:\v8>"c:\Users\Bill St. Clair\lisp\ccl\wx86cl64" -n
"c:\Users\Bill St. Clair\lisp\ccl\wx86cl64" -n
Clozure Common Lisp Version 1.12-dev (v1.12-dev.4-3-gdd5622e9) WindowsX8664

For more information about CCL, please see http://ccl.clozure.com.

CCL is free software.  It is distributed under the terms of the Apache
Licence, Version 2.0.
? (first (ccl::command-line-arguments))
"c:\\Users\\Bill St. Clair\\lisp\\ccl\\wx86cl64"
? (ccl:run-program * nil)
#<EXTERNAL-PROCESS (c:\Users\Bill St. Clair\lisp\ccl\wx86cl64)[NIL] (ERROR : 2) #x21004BA36D>
? (run-program "z:\\lisp\\ccl\\wx86cl64" '("-e" "(#_exit 0)"))
#<EXTERNAL-PROCESS (z:\lisp\ccl\wx86cl64 -e (#_exit 0))[NIL] (EXITED : 0) #x21004B6C1D>
? (ccl::make-windows-command-line '("c:\\Users\\Bill St. Clair\\lisp\\ccl\\wx86cl64"))
"c:\\Users\\Bill\" \"St.\" \"Clair\\lisp\\ccl\\wx86cl64"
?
gmpalter commented 2 days ago

I just ran into this problem this week as well.

The problem is that ccl::make-windows-command-line needs to special case quoting the first string (i.e., the program name) as Windows' command line parser has different rules for parsing the program name vs. its arguments. See Parsing C command-line arguments. (Sigh)

I have a fix that I will check in shortly.