Fork me on GitHub
#cursive
<
2021-07-07
>
lgessler20:07:48

hi, I'm getting an error when trying to open a project by opening the deps.edn file: the message is Unknown alias key: :exec-fn and the only place :exec-fn occurs is in my :test alias (see reply). anybody got pointers?

lgessler20:07:51

:test
{:extra-paths ["src/test"]
 :main-opts   ["-m" "cognitect.test-runner"]
 :exec-fn     cognitect.test-runner.api/test
 :extra-deps  {com.cognitect/test-runner {:git/url ""
                                          :sha     "705ad25bbf0228b1c38d0244a36001c2987d7337"}
               thheller/shadow-cljs      {:mvn/version "2.12.5"}}}

cfleming21:07:50

Do you see that same error in deps on the command line, e.g. using clojure -Spath or something similar?

lgessler21:07:47

clj -M:test -d src/test seems to work fine, clojure -Spath also works fine

cfleming21:07:28

Weird, since that error doesn’t seem to be a Cursive one. I’ll try to reproduce this in a bit.

cfleming21:07:07

Is the rest of the deps.edn available somewhere or is this a work project?

Alex Miller (Clojure team)21:07:57

that's an error from an old version of tools.deps (circa 0.8.x, about a year ago or older)

Alex Miller (Clojure team)21:07:31

the exec stuff was added in the Clojure CLI in version 1.10.1.697, last September, so older than that. not sure if this is tools.deps in Cursive or an old Clojure CLI

lgessler21:07:42

fwiw, my CLI version:

$ clj --version
Clojure CLI version 1.10.3.855

Alex Miller (Clojure team)21:07:45

that should be fine (and explains why it works on command line), so I'd guess it's Cursive's use of older tools.deps?

cfleming22:07:17

I suspect this might be https://github.com/cursive-ide/cursive/issues/2105, which is fixed in the latest EAP. @U49U72C4V if you’re not using the EAP already, could you try that to see if it helps? Instructions for how to do so are here: https://cursive-ide.com/userguide/index.html#eap. After doing that, go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps and make sure the correct CLI version is show there, and then hopefully it’ll work.

lgessler22:07:13

I did the following: • Uninstall Cursive • Restart IntelliJ • Install Cursive 1.10.3-eap2-2021.1 • Restart IntelliJ, invalidating all caches • Open directory, right click deps.edn, click "Add as Clojure Deps Project" I'm still getting the same error though

lgessler22:07:41

I should mention: a fine workaround for now is to just comment out the exec-fn line, if only while i'm launching my intellij repl

cfleming23:07:23

That’s very strange. Could you try the following? Go to Help | Debug log settings… and enter #cursive.shim.Shim in the box that appears there. Then reproduce the problem and email me your log file to <mailto:[email protected]|[email protected]>? Log file is at Help | Show log in Finder/Explorer.

lgessler00:07:41

emailed--hope I did the log right

cfleming00:07:25

Yep, that’s great, thanks. The cause is definitely that bug:

Version 1.10.3.855
Files /usr/local/lib/clojure/libexec/clojure-tools-1.10.1.536.jar <etc etc>

cfleming00:07:50

So I think that upgrading Cursive has just not triggered the update to the classpath. Could you try the following - go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps, click on “Use tools.deps directly” then Refresh and Download if required, then click apply and close the prefs screen. Then reopen it again, check “Use CLI tools” then apply, close and try again.

lgessler00:07:22

yup, that fixed it!

lgessler00:07:29

thanks for the help 🙂