Fork me on GitHub
#cursive
<
2022-02-20
>
Mario Angst20:02:28

Hi all! I am new to Clojurescript, coming from an R/ Python background. As a long-time PyCharm user I was delighted to find Cursive 🙂 ! Currently working through http://learn-clojurescript.com. I quite like Clojure up until now 🙂! Clojurescript seems to be set up correctly, I can run basically everything up until now from the command line and editing files within IntelliJ. However, I cannot get Cursive to work in a deps.edn project setting. I constantly keep getting the error

Could not create shim: Could not create shim
(stacktrace attached below). I'm IntelliJ IDEA Ultimate 2021.3.2. Cursive is the latest non EA-version. I've tried • downgrading both IntelliJ and the plugin • re-installing IntelliJ while clearing the Cache • running from both Windows and WSL2 (how cool is that by the way) • different SDKs (SDK 11, Temurin, • after finding an earlier thread in here changing something in the Deps setting and hitting apply, does not do anything neither I'd be super grateful for a pointer! Tried other IDEs, but VS Code/ Calva confuses me (though seems to work). Really want to get Cursive to work.

cfleming00:02:36

I was just looking at this yesterday. Does upgrading tools.deps on the command line help? To prompt Cursive to pick that up, you might need to go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps, let it report the version and then hit apply.

Mario Angst08:02:29

@U0567Q30W thanks for looking into this! I upgraded tools.deps.alpha to 0.12.1148 (still new to this but added it to my user.depn and hit clj on the command line and it upgraded) and as you said, when I went to the ... | Clojure Deps menu, the version appeared. Error sadly persists, stacktrace has also not changed 😞

cfleming08:02:56

@U0349822389 Can you try this, please? 1. Open Help-&gt;Diagnostic Tools-&gt;Debug Log Settings. 2. In the box that’s opened, enter #cursive.deps.DepsShimProvider and press Ok. 3. Reproduce the problem. 4. Check your log file from Help-&gt;Show log in Finder/Explorer for lines mentioning DepsShimProvider, and let me know what they say.

cfleming08:02:55

You should either see a path to an uberjar, or a list of files making up a classpath, probably in your Maven repo.

cfleming08:02:31

@U064X3EF3 Assuming the log entries show Mario using the correct version, any other ideas why this might be happening? This is problem we discussed the other day, but the assumption that the user’s version of deps CLI is out of date looks like it might not be the case.

Mario Angst09:02:31

@U0567Q30W Ok, I've done this. As you said, the line shows a (long) list of files making up the classpath. Start of the latest entry:

2022-02-21 10:51:21,482 [  23976]  DEBUG - #cursive.deps.DepsShimProvider - Executing deps 0.12.1148 directly, classpath C:\Users\Mario\.m2\repository\org\clojure\tools.deps.alpha\0.12.1148\tools.deps.alpha-0.12.1148.jar:C:\Users\Mario\.m2\repository\org\apache\maven\resolver\maven-resolver-api\1.6.3\maven-resolver-api-1.6.3.jar:C:\Users\Mario\.m2\repository\org\ap (...)
As far as I can tell, it's using the correct version?

Alex Miller (Clojure team)13:02:47

The error is about missing stuff from Clojure 1.10 - can you see what version of Clojure is on that classpath?

Mario Angst15:02:25

It looks like the version on the classpath is clojure-1.9.0.jar - I am a bit confused because my user deps.edn and my project deps.edn include 1.10.3 (that's also what calling clj in the terminal yields)

Alex Miller (Clojure team)15:02:16

really a question for @U0567Q30W - I don't know how all that shim stuff works. tools.deps.alpha 0.12.1148 depends on Clojure 1.10.3, so not sure how that classpath is being made

Mario Angst15:02:41

Thanks - it's a hint. As a hail mary, I've also tried manually deleting the 1.9.0 folder from the maven repository, but then setting the latest clojure deps version in ... | Clojure Deps downloads it again

Mario Angst15:02:53

what is interesting is that if I delete 1.9.0 and then launch a fresh project with deps.edn set to the default

{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}}}
I get an error
Cannot execute - downloaded deps classpath not found:
			C:\Users\Mario\.m2\repository\org\clojure\clojure\1.9.0\clojure-1.9.0.jar

Mario Angst16:02:16

@U0567Q30W I found a solution! I tried creating a Leiningen project. Upon creating it, the IDE reminded me that there were two Maven repositories Build tools | Maven | Repositories that were not updated (the two remote ones: http://repo.clojars.org and http://repo1.maven.org/maven2). I updated those. Leiningen started working. Then I went back and created a brand new deps project and now everything works.

cfleming20:02:05

I’ll try to figure out where the 1.9.0 could be coming from.

cfleming20:02:55

@U0349822389 Could you DM me or email me the full classpath list from your log? Email is <mailto:[email protected]|[email protected]>.

cfleming23:02:03

Actually, never mind, I’ve reproduced the problem.

cfleming00:02:13

This is a problem in deps, https://clojure.atlassian.net/browse/TDEPS-222. I’ll get a workaround into the next build.

cfleming09:02:48

@U0349822389 1.12.2-eap5 is out now, and has a fix for this problem as described here: https://groups.google.com/g/cursive/c/O_oettEjv40/m/agRLYvdBCAAJ. I’m not sure how your previous fix could have worked, but this should do it. You’ll need to switch to using EAPs, see https://cursive-ide.com/userguide/#choosing-to-receive-eap-beta-builds. If you’d rather not use EAPs, then I think just using Deps 0.11.x versions should work. If you want to do that, just go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps and configure the version there.

Mario Angst15:02:09

@U0567Q30W sorry for being late, glad you were able to reproduce the problem. looking forward to the EAP. Cursive is amazing!

Mario Angst15:02:19

yeah and for my "fix", that was not really a solution as you suspected, while it led to Cursive being able to proceed a bit further (no shim error anymore and run REPL option appeared on deps.edn), IntelliJ then started to crash building the classpath.

Mario Angst16:02:20

@U0567Q30W happy to report back that after a fresh re-install of IntelliJ + Cursive latest EAP + updating Clojure Deps, everything seems to work fine now.