Fork me on GitHub
#cider
<
2020-08-12
>
ben.sless08:08:15

What's the best way of configuring the java version per project? I have not found a way of setting environment variables with dir-locals and cider has no variable which would translate to LEIN_JAVA_CMD This was probably asked in the past but I was unable to find an answer online

bozhidar09:08:39

@ben.sless I never thought of this actually, as I typically work on projects that target the same JDKs. Probably it'd be easiest to change the Emacs exec-path in dir-locals.

ben.sless10:08:36

huh, didn't occur to me to manipulate exec-path. I'll try and report results. Thanks 🙂

ben.sless10:08:43

Do dir-locals support something like

(cons "/usr/lib/jvm/java-14-openjdk-amd64/bin/" exec-path)
Its read literally 😞

jumar10:08:47

I fought with various different setups using jenv on Mac OS in the past but eventually gave up - now I'm using the most recent version (14) for all the projects

ben.sless10:08:00

Well, I can just put this in a script and set it as a dir-local ((nil . ((cider-lein-command . "lein14"))))

cat lein14
#!/usr/bin/env sh
LEIN_JAVA_CMD=/usr/lib/jvm/java-14-openjdk-amd64/bin/java lein "[email protected]"

bozhidar10:08:24

Yeah, that would work.

plexus10:08:09

Would someone with commit bit on piggieback have time to review this PR? https://github.com/nrepl/piggieback/pull/117 🙏

bozhidar12:08:39

It's on my todo list.

plexus13:08:32

thank you ❤️

plexus10:08:16

Currently when using a browser repl-env the logic to pprint evaluation results will error. This fixes that.

j0ni11:08:22

hello cider people, I have a strange error which shows up when I try to cljr jump to references to a function at point - it gives me the “this will take a long time” warning, then computes for a bit, then fails with an exception complaining about a bad keyword in a dev namsepace. The “cause” exception has the following message and first few lines:

Caused by: clojure.lang.ExceptionInfo: [line 149, col 32] Invalid keyword: ::streams/topology. {:type :reader-exception, :ex-kind :reader-error, :file "/Users/joni/Scratch/xapix/clojud/dev/src/dev.clj", :line 149, :col 32}
	at refactor_nrepl.util$ex_info_assoc.invokeStatic(util.clj:27)
	at refactor_nrepl.util$ex_info_assoc.doInvoke(util.clj:24)
	at clojure.lang.RestFn.applyTo(RestFn.java:139)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:660)
	at refactor_nrepl.find.find_macros$find_macro_definitions_in_file.invokeStatic(find_macros.clj:51)

jr0cket14:08:27

Sounds like you have a keyword in the dev.clj file that is invalid. Some clj-refactor commands require all the code to compile, so if there are bugs in the code they will fail.

j0ni15:08:49

well sure, but the keyword is valid - streams is an alias for a required namespace. A few minutes later I was actually able to run the same command on a different symbol and it worked. That keyword is defined as an integrant key, if that’s relevant

j0ni15:08:30

the fact that it worked after a while, suggests to me that some code was not loaded prior to the first invocation, but was loaded before I ran it again.

j0ni15:08:17

hmm, I had some luck in the past disabling the pre-assembly of the AST, because of weird code loading issues and exceptions, as well as dynamic rebinds which caused errors - perhaps I’ll give that a shot next time I see this

j0ni11:08:45

I can make a bug later if that’s required, but I figured I’d ask around first