-
-
Notifications
You must be signed in to change notification settings - Fork 652
Description
Expected behavior
In the upcoming Emacs 29, it will be possible to use TRAMP to edit files inside Docker and Podman containers. When editing a such file, the path looks like this:
/podman:ubuntu-20-04:~/path/to/file.clj
I'd expect CIDER to work the same way how it works when editing files over SSH on the remote machine, however, upon calling cider-jack-in
an error occurs.
Actual behavior
Toggling the debug on error, shows me the following stack trace:
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
nrepl--ssh-tunnel-connect("ubuntu-20-04" 37095)
nrepl-connect("ubuntu-20-04" 37095)
nrepl-start-client-process("ubuntu-20-04" 37095 #<process nrepl-server> #f(compiled-function (_) #<bytecode -0x1ac3296481b2b3d5>) nil)
cider-nrepl-connect((:project-dir "/podman:ubuntu-20-04:~/Projects/clj-utils/" :jack-in-cmd "lein update-in :dependencies conj \\[nrepl/nrepl\\ \\..." :host "ubuntu-20-04" :port 37095 :project-dir "/podman:ubuntu-20-04:~/Projects/clj-utils/" :server #<process nrepl-server> :server-command "lein update-in :dependencies conj \\[nrepl/nrepl\\ \\..." :repl-init-function nil :repl-type clj :session-name nil))
cider-connect-sibling-clj((:project-dir "/podman:ubuntu-20-04:~/Projects/clj-utils/" :jack-in-cmd "lein update-in :dependencies conj \\[nrepl/nrepl\\ \\...") #<buffer *nrepl-server Projects/clj-utils:localhost*>)
#f(compiled-function (server-buffer) #<bytecode 0x16dd942a8941f890>)(#<buffer *nrepl-server Projects/clj-utils:localhost*>)
nrepl-server-filter(#<process nrepl-server> "nREPL server started on port 37095 on host localho...")
So it appears, cider issues an ssh connection to a Podman container.
There's also another error that can appear when connection is issued via Podman:
[2022-12-28T10:54:43.285] Tramp: Opening connection nrepl-server for ubuntu using podman...
[2022-12-28T10:54:43.472] Tramp: Opening connection nrepl-server for ubuntu using podman...done
[2022-12-28T10:54:43.489] [nREPL] Starting server via clojure -J-XX:-OmitStackTraceInFastThrow -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.29.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: nil ("exited abnormally with code 127")
error in process sentinel: Could not start nREPL server: nil ("exited abnormally with code 127")
I'm not sure what's causing one or another.
Steps to reproduce the problem
To easily create a container, use distrobox:
distrobox create -i ubuntu:20.04 -n ubuntu
It will make it possible to access your home directory in the container, so all your projects are available there.distrobox enter ubuntu
to initialize container- In regularly running Emacs 29 (e.g. outside container):
C-x C-f /podman:ubuntu:path/to/file.clj
M-x cider-jack-in
Environment & Version information
CIDER version information
Include here the version string displayed when
CIDER's REPL is launched. Here's an example:
;; CIDER 1.6.0-snapshot (package: 1.6.0-snapshot), nREPL 1.0.0
;; Clojure 1.11.1, Java 17.0.5
Lein / Clojure CLI version
Leiningen 2.9.10 on Java 17.0.5 OpenJDK 64-Bit Server VM
Emacs version
GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-12-19
Operating system
Fedora 37