fredokun / cl-jupyter

An enhanced interactive Shell for Common Lisp (based on the Jupyter protocol)
BSD 2-Clause "Simplified" License
199 stars 29 forks source link

cl-jupyter fails on Windows if started on a different drive than it was installed on #47

Open WetHat opened 5 years ago

WetHat commented 5 years ago

When jupyter is started on a drive which is different from the drive where cl-jupyter was installed, the cl-jupyter kernel does not start any more on Windows. This failure is caused by registration code in cl-jupyter.lisp:

(push (truename (format nil "~Asrc/" (directory-namestring *load-truename*)))
          asdf:*central-registry*)

On Windows (directory-namestring *load-truename*) does not include the drive letter. Therefore, if the lisp kernel is started from a drive different, it fails. I have fixed this locally in cl-jupyter.lisp like so:

(if (member :win32 *features*)
   (push (truename (format nil "~A:~Asrc/" (pathname-device *load-truename*)(directory-namestring *load-truename*)))
          asdf:*central-registry*)
;else
   (push (truename (format nil "~Asrc/" (directory-namestring *load-truename*)))
          asdf:*central-registry*)
)

This works on SBCL and Clisp. I'm not sure about other lisp flavors

WetHat

WetHat commented 5 years ago

I have to take this works for Clisp back. The issue is SBCL specific (not sure about other LISP flavors). So the fix might be better written as:

#+(and sbcl win32)(push (truename (format nil "~A:~Asrc/" (pathname-device *load-truename*)(directory-namestring *load-truename*)))
                   asdf:*central-registry*)
#-(and sbcl win32)(push (truename (format nil "~Asrc/" (directory-namestring *load-truename*)))
                   asdf:*central-registry*)   
fredokun commented 5 years ago

Thx for the proposed fix. I have now a windows box so I will try ASAP and patch master accordingly.