Fork me on GitHub
#cider
<
2022-12-21
>
bozhidar13:12:10

FYI - CIDER 1.6 ("Buenos Aires") is out https://github.com/clojure-emacs/cider/releases/tag/v1.6.0 Cheers! cider

🙌 5
cider 5
Ben Lieberman17:12:29

hey folks, I previously have used Emacs w/ CIDER on WSL2 without issues. I have since switched to a Linux box and am trying to configure Emacs. I have Clojure and the Temurin JDK installed and all that (I can use Calva perfectly fine), but when I try to start a REPL in Emacs it gives me the error "the clojure executable isn't on your exec-path". I modified that variable in my config (pointing it to my Clojure install) but no dice.

pez17:12:10

Calva bundles a ”backup” way of starting Clojure with the help of deps.clj. You can check in the VS Code development console for messages about this and see if it falls back in this or not.

pez17:12:21

Depending on how you start Emacs it might or might not have the correct PATH. If you start it from terminal where you know you can run the clojure command, CIDER should find it too.

Ben Lieberman17:12:12

Thanks @U0ETXRFEW. I'll investigate. I'm not that committed to getting this fixed (because Calva is great :face_with_cowboy_hat: ) but I do like Emacs, too.

dpsutton18:12:46

> I modified that variable what does this mean?

Ben Lieberman18:12:27

in my .emacs file I put "/usr/local/bin/clojure" in the exec-path` list

Ben Lieberman18:12:44

my ELisp skills are very poor though, so I'm guessing I screwed something up

dpsutton18:12:58

i don’t think it wants executables on exec-path but paths on the exec path. just like your PATH variable i na shell

dpsutton18:12:04

what are the other values in that list?

dpsutton18:12:02

for example, a few of mine are

"/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/"
note these are not individual executables but directories where executables are found. Compare to "/usr/local/bin/clojure" (and this would not find clj even if it worked like this

dpsutton18:12:40

> List of directories to search programs to run in subprocesses. > Each element is a string (directory name) or nil (try default directory).

Ben Lieberman18:12:01

yeah I'm noticing that the other executables (eg. Cargo and Node) have the form of /cargo/bin and /node/bin and not the other way around

dpsutton18:12:22

those aren’t executables

dpsutton18:12:29

those are directories containing lots of executables

Ben Lieberman18:12:32

should Emacs be looking for clj or for clojure because they are both co-located on my machine

dpsutton18:12:49

emacs will look for whatever program it needs to. All it needs are places to look for programs

dpsutton18:12:05

so give it "/usr/local/bin/"

dpsutton18:12:28

but by default CIDER will look for clojure (as clj is the same thing essentially but with rlwrap included for niceties like backspacing and pressing up for history)

Ben Lieberman18:12:53

I had that in there already, restarted Emacs but no change

dpsutton18:12:36

open up an eshell window with m-x eshell and type which clojure

dpsutton18:12:35

if that can’t find it you won’t be able to start. Emacs is still unable to find clojure. Can you post the value of exec-path?

Ben Lieberman18:12:41

'(exec-path
   '("/app/bin" "/usr/bin" "/usr/local/bin/"  "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.1/x86_64-pc-linux-gnu"))

dpsutton18:12:53

what is that?

Ben Lieberman18:12:01

yeah which clojure in eshell is looking in the app/bin directories

dpsutton18:12:03

why is it quoted and prefixed with exec-path?

Ben Lieberman18:12:36

when I was looking up how to do this it showed this form on EmacsWiki

Ben Lieberman18:12:50

yeah nvm I'm conflating things, this is not on EmacsWiki

Ben Lieberman18:12:05

should I be using the setq exec-path form instead?

dpsutton18:12:14

i’m completely lost. can you tell me what the value of exec-path is currently?

dpsutton18:12:25

m-x describe-variable [ret] exec-path

dpsutton18:12:32

let’s find out what the value currently is first

Ben Lieberman18:12:15

same as the quoted list above

dpsutton18:12:15

for me it is

exec-path is a variable defined in 'C source code'.

Its value is
("/Users/dan/.nvm/versions/node/v17.9.1/bin/" "/Users/dan/.sdkman/candidates/java/current/bin/" "/Users/dan/bin/" "/opt/homebrew/bin/" "/opt/homebrew/sbin/" "/usr/local/bin/" "/usr/bin/" "/bin/" "/usr/sbin/" "/sbin/" "/opt/homebrew/Cellar/emacs-mac/emacs-28.1-mac-9.0/libexec/emacs/28.1/aarch64-apple-darwin21.5.0/")
Original value was 
("/Users/dan/.nvm/versions/node/v17.9.1/bin" "/Users/dan/.sdkman/candidates/java/current/bin" "/Users/dan/bin" "/opt/homebrew/bin" "/opt/homebrew/sbin" "/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/opt/homebrew/Cellar/emacs-mac/emacs-28.1-mac-9.0/libexec/emacs/28.1/aarch64-apple-darwin21.5.0")
can you post your output like this?

Ben Lieberman18:12:16

exec-path is a variable defined in 'C source code'.

Its value is
("/app/bin" "/usr/bin" "/usr/local/bin/" "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.1/x86_64-pc-linux-gnu")
Original value was 
("/app/bin" "/usr/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/node/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin" "/home/slothrop/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/28.2/x86_64-pc-linux-gnu")

dpsutton18:12:03

ok. that looks great. now we know that value is being set correctly. and in an eshell buffer what is the output of which clojure?

Ben Lieberman18:12:37

~/Documents/clojure/scratch $ which clojure
which: no clojure in (/app/bin:/usr/bin:/home/slothrop/.var/app/org.gnu.emacs/data/node/bin:/home/slothrop/.var/app/org.gnu.emacs/data/cargo/bin:/home/slothrop/.var/app/org.gnu.emacs/data/python/bin)

dpsutton18:12:39

ok i have a theory: emacs doesn’t have permissions to look at /usr/local/bin ? Open up a dired buffer and navigate to that folder. See if emacs can see it

Ben Lieberman18:12:04

you are correct

dpsutton18:12:04

i’m guessing perhaps that’s why it is not looking in there?

Ben Lieberman18:12:09

/usr/local/bin is inaccessible or nonexistent

dpsutton18:12:29

ok. what do you get from a terminal ls /usr/local/bin?

Ben Lieberman18:12:15

slothrop@pop-os:/usr/local/bin$ ls
aws  aws_completer  bb  clj  clojure  corepack  ng  node  npm  npx

dpsutton18:12:14

ok. so there’s some permissions thing. i’m not sure

dpsutton18:12:26

everything is configured correctly at the emacs level. just can’t see that directory

Ben Lieberman18:12:37

so this really has nothing to do with Emacs in particular then?

dpsutton18:12:05

doesn’t sound like it. the executable is there. But emacs cannot see the directory /usr/local/bin.

Ben Lieberman18:12:10

this is my personal machine so I can change whatever I want

dpsutton18:12:13

“is inaccessible or nonexistent”

Ben Lieberman19:12:29

I'll have to explore this. I suspect this was not an issue on WSL bc I was launching Emacs from the terminal, as opposed to now launching it from the desktop. Thanks for your help @U11BV7MTK

đź‘Ť 1