-
-
Notifications
You must be signed in to change notification settings - Fork 645
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 cider-jack-in
breaks with cider-enrich-classpath
: No such file or directory
#3567
base: master
Are you sure you want to change the base?
Remote cider-jack-in
breaks with cider-enrich-classpath
: No such file or directory
#3567
Conversation
cider-jack-in
breaks with cider-enrich-classpath
: `No such file or directorycider-jack-in
breaks with cider-enrich-classpath
: No such file or directory
Hi @adrech ! I'm happy to hear you're using Enrich. The proposed branch would LGTM after the following feedback:
Thanks - V |
Let me know if you'd like to target this during the week, matching our fortcoming major release. Else of course, it's no issue - we could also shortcirtuit Enrich for the time being for the tramp code path. |
Will be on it! I spent the weekend learning more about tramp, shells, ssh & docker and sanitized how the tramp-sample-project sets up PATH, so I have something reliable to test against. Whats the target date? |
That's awesome to hear! Feel free to include that work as you wish. Perhaps separate PR since most likely we'll end up squashing stuff, so more commits is better.
Flexible - do not feel pressured, we can also simply cut bugfix releases later. |
This should essentially do the same thing in most cases:
In this draft I make the copy directly at
This is happening in So far, this draft works as expected with a minimal init.el on my pi and in clojure / lein docker containers, but it'll need more thorough testing, considering the moving parts. EDIT: did some manual testing with a renamed Let me know if I'm moving in the right direction and I'll split it up, add tests, docstrings. |
d7370f4
to
404224c
Compare
Happy to see these iterations 🙌 Please don't rename These files are also "APIs" that users can reference from .zshrc. Cheers - V |
Aye, of course, reverted the filenames. |
bab04c9
to
f656504
Compare
…lojure-emacs#3567 Fixes `cider-jack-in-clj` in tramp buffers throwing: ``` Could not start nREPL server: %s (%S) bash: /remote/path/to/cider/clojure.sh: No such file or directory\n" "exited abnormally with code 127") ``` in cases where cider is not installed in the same directory on the remote. To fix this, we create temporary copy of the enrich-classpath script named `.cider__<clojure.sh|lein.sh>__<random>` on the remote before starting the server. The possible locations of the script are, in this order: - tramp-tempdir (usually "/tmp") - clojure-project-dirj - default-directory If the script can't be created for any reason, the server is started with `cider-enrich-classpath` set to nil. Note: the temporary script will remove itself after use, but stick around when something goes wrong before the remote process is started.
d0c3e57
to
44622e5
Compare
`auto-save-visited-mode` will not create any tempfiles anyways, but only save the current file.
We don't need it (yet) and Emacs 26 does not support `split-string-shell-command`. Don't want to fiddle with shell-quoting unless really necessary.
8a4bd5d
to
72cab2f
Compare
72cab2f
to
8183c2b
Compare
There's a potential problem (with handling ssh remotes in general): All of this assumes, that tramp and the remote PATH are set up to work together. It will fail early in the process This would happen e.g. when one connects via ssh + relies on a PATH setup in the remotes
For more background, see:
A couple of ways to approach this:
|
This is an attempt to fix enrich-classpath erroring out, when
default-directory
is remote, by creating a copy of thelein.sh|clojure.sh
script on the remote before jacking in.The core of it is happening here.
Conversation from the original Issue below.
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Expected behavior
With point in a project-file visited via ssh/tramp and
cider-enrich-classpath
=t
,cider-jack-in-clj
creates a remote repl and connects to it.Actual behavior
nrepl-server-sentinel
throws:Reason
Cider is trying to use the local path (from
cider--get-enrich-classpath-clojure-cli-script
) on the remote, where it does not exist.Possible Workaround
Copy the script to the remote before starting the server.