cl-jupyter icon indicating copy to clipboard operation
cl-jupyter copied to clipboard

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

Open WetHat opened this issue 7 years ago • 2 comments

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 avatar Nov 08 '18 16:11 WetHat

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*)   

WetHat avatar Nov 08 '18 17:11 WetHat

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

fredokun avatar Nov 09 '18 23:11 fredokun