Fork me on GitHub

Is there a way I can have my source code locally and edit it with emacs/cider, yet starting the java process on a remote machine?


@U7S5E44DB look at You could use this to start lein repl on the remote machine and then cider-connect:

# on remote machine
lein repl :start :port 40000

# on localhost
ssh -NL 40000:localhost:40000 [email protected]
# THEN: lein repl :connect OR cider-connet
lein repl :connect localhost:40000


In this case then the source code is in the remote machine, right?


Yes, that's right - you need that; but you can reload the code based on local changes


What's your use case?


Dev mostly on my laptop, but when doing some intensive computation spin up a remote instance from scratch and start a java process from there (using CIDER)


How are you going to "deploy" the program to the remote machine? Seems like pushing code there could be an option?


Yes indeed, I think that's the simplest solution to this, in which what you linked will help

👍 1

or an uberjar?


I don't know if you can run lein repl using an uberjar instead of source code


If your remote machine has all the dependencies you need, then you don’t actually need to send your own source code. You can just connect to the remote REPL and start evaluating code.


That’s of course the whole point of this exercise; but you need the initial version to run Leon repo, I think


You could also use socket repl with Uber jar but i don’t think cider supports this


When I used to do this, both tramp (source+repl on the remote instance) and hybrid (local source + forwarded ssh port connected to the remote instance running a repl) worked fine. At the time I had to match the folder structure for "hybrid" to work properly, otherwise cider would try to find the source files using the remote's paths. Now there's a configuration option for that as well.

Eamonn Sullivan12:03:00

I have a small project using tools.cli (deps.edn) to manage dependencies and stuff. Running clj -A:test:runner runs all of my unittests, but I can't convince cider that this project has any. In my leiningen projects, I've gotten to like running C-c , ... to run my tests, but when I try that in cider for this project, I get errors about No test namespace. Maybe I've configured something incorrectly? Does this work for someone else? Can you share a snippet of your deps.edn?