cider
cider copied to clipboard
Can't cider-jack-in to projects with private git dependencies
Expected behavior
cider-jack-in works in projects with private git repos
Actual behavior
I'm getting some text in the nrepl-server buffer that asks for my passphrase but there's no interactive prompt, so I can't provide it to complete the process. Here's the exact message "prompt" as it appears in the nrepl buffer:
Cloning: [email protected]:org/private-repo-name.git
Enter passphrase for key '/home/pavlos/.ssh/id_ed25519':
Steps to reproduce the problem
Create a deps.edn with the following contents
{:deps {foo/bar {:git/url "[email protected]:org/private-repo-name.git"
:sha "sha"}}}
where org/private-repo-name is a private repo
Run M-x cider-jack-in
Environment & Version information
CIDER version information
;; CIDER 1.12.0 (Split), nREPL 1.0.0
;; Clojure 1.11.1, Java 21.0.1
Lein / Clojure CLI version
Clojure CLI version 1.11.1.1149
Emacs version
GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)
Operating system
Fedora 39
JDK distribution
openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment (Red_Hat-21.0.1.0.12-4) (build 21.0.1+12)
OpenJDK 64-Bit Server VM (Red_Hat-21.0.1.0.12-4) (build 21.0.1+12, mixed mode, sharing)
In case anyone else is facing this, here are some workarounds:
- Spawn a standalone cider/nrepl server and cider-connect to it, as described in the docs
- Download the dependencies with
clojure -Pand then rerun cider-jack-in
(Many thanks to @vemv and @dpsutton from Clojurians slack for the suggestions)
Hi!
Thanks much for the report.
I'll try to repro it, anyway could you please provide the exact prompt text?
Good point, it's:
Cloning: [email protected]:org/private-repo-name.git
Enter passphrase for key '/home/pavlos/.ssh/id_ed25519':
Like I said it only appears in the ~REPL~ nrepl-server buffer (and it's not interactive) I've added it to the initial description too
Are you able to git-clone the same repo using e.g. Magit?
If not, it could indicate a generalized issue in your Emacs setup, such that ssh-add isn't being correctly invoked.
[...] You can confirm this by running eval
$(ssh-agent); ssh-add ~/.ssh/id_rsain a terminal, and then in the same terminalemacs &.
That solution isn't exactly ergonomic, but it would be a start.
Please try that specific approach for CIDER and/or Magit, allowing us to discard hypotheses.
Thanks - V
Are you able to git-clone the same repo using e.g. Magit?
Yes! If I delete the cache from .gitlibs and run magit-clone directly I get the correct prompt (same message but interactive)
Thanks!
To be clear, is your expected workflow entering the passphrase each time? It would make sense, although perhaps in your terminal emulator you don't have to?
is your expected workflow entering the passphrase each time
I believe that depends on how the ssh agent is set up. So it doesn't happen always (I think) but:
- when ssh-agent needs a passphrase I expect emacs/CIDER to ask for the user input correctly (magit-clone does so, so I assume it's caused by something that happens somewhere between the git and cider abstraction levels)
- when a passphrase isn't necessary, I expect CIDER to be able to clone the repo and then start the REPL (neither happens in my case, CIDER gets stuck "waiting" for user input that will never come).