Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote slynk server tries to open local files to load contribs #569

Open
rpgoldman opened this issue Feb 15, 2023 · 1 comment
Open

Remote slynk server tries to open local files to load contribs #569

rpgoldman opened this issue Feb 15, 2023 · 1 comment

Comments

@rpgoldman
Copy link
Contributor

rpgoldman commented Feb 15, 2023

Trying to connect to a remote slynk server on a linux box from my Mac laptop I get this error from slynk:

Required module slynk-macrostep but no source file slynk-macrostep found in (/Users/rpg/.emacs.d/lisp/sly/contrib/
                                                                             /Users/rpg/.emacs.d/lisp/sly-asdf/
                                                                             /Users/rpg/.emacs.d/lisp/sly-macrostep/
                                                                             /home/rpg/.emacs.d/lisp/sly/slynk/)

This list of directories is the value of slynk-loader::*load-path*.

Looking at the above, you can see that the list of directories contains three directories for the sly contribs that come from the Mac filesystem (they start with /Users) and one from loading slynk proper (the one that starts with /home).

I believe that the *load-path* is populated as a side-effect of define-sly-contrib and then the invocation of sly-setup, which in turn invokes sly--setup-contribs.

I conjecture that while emacs knows how to translate filenames, using tramp, common lisp (the slynk server) has no corresponding magic applying to its `load-path.

It is possible that it would be easiest to fix this by using ASDF instead of the slynk-loader, but I'm not sure how to do this.

What I did in the debugger was:

(setf *load-path* 
  (mapcar #'(lambda (x) (if (equal (second (pathname-directory x)) "Users") 
                                             (make-pathname :directory (subst "home" "Users" (pathname-directory x) :test 'equal)      
																		   :defaults x) x)) 
                 *load-path*))

This almost works, but gives an unknown package error in slynk-macrostep.lisp (no "SLYNK-MACROSTEP" package).

I believe that this goes wrong because the slynk-loader tries to compile only slynk-macrostep instead of ASDF-loading the slynk-macrostep system, which would have first compiled and loaded slynk-macrostep/package.lisp.

I will see about using ASDF as the loading method; maybe that will fix things. I will report back.

Note that I have been using sly-macrostep and sly-asdf from GitHub rather than installing them using Emacs packages. I don't know if that would change anything.

@rpgoldman
Copy link
Contributor Author

I couldn't figure out how to get slynk to load slynk-macrostep from ASDF, but I did make this work by (yuck) doing the following on the server:

$ cp slynk-macrostep.lisp slynk-macrostep.lisp.orig
$ cat package.lisp collect-macro-forms.lisp slynk-macrostep.lisp.orig > slynk-macrostep.lisp

That makes slynk-macrostep into a one-file system, which can be loaded simply by loading that one file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant