cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code
590 stars 7 forks source link

Could not create shim #2647

Closed balaudt closed 2 years ago

balaudt commented 2 years ago

Since upgrading IntelliJ Ultimate to 2021.3, Cursive has been throwing an error Could not create shim on refresh of any deps project and hence blocking loading of any class in REPL making the plugin itself virtually unusable. This continues to exist even after another release of IntelliJ and Cursive. Please find below the environment details and the stack trace:

Stack trace:

java.lang.RuntimeException: Could not create shim
    at cursive.shim.ShimProvider.getShim(Shim.kt:148)
    at cursive.shim.ShimProvider.withShim(Shim.kt:115)
    at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:176)
    at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:87)
    at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:45)
    at cursive.build.BuildSystemProjectsManager.reimportAllProjects$lambda-3$lambda-2(BuildSystemManager.kt:149)
    at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:83)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:496)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: Syntax error compiling at (cursive/deps/command.clj:28:40).
    at clojure.lang.Compiler.analyze(Compiler.java:6808)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3820)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7109)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7109)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7105)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6384)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$TryExpr$Parser.parse(Compiler.java:2314)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$TryExpr$Parser.parse(Compiler.java:2314)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6436)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6436)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6120)
    at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5467)
    at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4029)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7105)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7095)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.access$300(Compiler.java:38)
    at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:596)
    at clojure.lang.Compiler.analyzeSeq(Compiler.java:7107)
    at clojure.lang.Compiler.analyze(Compiler.java:6789)
    at clojure.lang.Compiler.analyze(Compiler.java:6745)
    at clojure.lang.Compiler.eval(Compiler.java:7181)
    at clojure.lang.Compiler.load(Compiler.java:7636)
    at clojure.lang.RT.loadResourceScript(RT.java:381)
    at clojure.lang.RT.loadResourceScript(RT.java:372)
    at clojure.lang.RT.load(RT.java:459)
    at clojure.lang.RT.load(RT.java:424)
    at clojure.core$load$fn__6839.invoke(core.clj:6126)
    at clojure.core$load.invokeStatic(core.clj:6125)
    at clojure.core$load.doInvoke(core.clj:6109)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invokeStatic(core.clj:5908)
    at clojure.core$load_one.invoke(core.clj:5903)
    at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
    at clojure.core$load_lib.invokeStatic(core.clj:5947)
    at clojure.core$load_lib.doInvoke(core.clj:5928)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invokeStatic(core.clj:667)
    at clojure.core$load_libs.invokeStatic(core.clj:5985)
    at clojure.core$load_libs.doInvoke(core.clj:5969)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invokeStatic(core.clj:667)
    at clojure.core$require.invokeStatic(core.clj:6007)
    at clojure.core$require.doInvoke(core.clj:6007)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.lang.Var.invoke(Var.java:384)
    at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.require(ClojureRuntimeShimImpl.java:73)
    at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:29)
    at cursive.shim.Shim.createShimProvider$lambda-1(Shim.kt:80)
    at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:155)
    at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:153)
    at cursive.application.ApplicationKt.onPooledThread$lambda-2(Application.kt:16)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:263)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    ... 7 more
Caused by: java.lang.RuntimeException: No such var: deps/make-classpath-map
    at clojure.lang.Util.runtimeException(Util.java:221)
    at clojure.lang.Compiler.resolveIn(Compiler.java:7388)
    at clojure.lang.Compiler.resolve(Compiler.java:7358)
    at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7319)
    at clojure.lang.Compiler.analyze(Compiler.java:6768)
    ... 110 more

Environment:

IntelliJ IDEA 2021.3.2 (Ultimate Edition)
Build #IU-213.6777.52, built on January 27, 2022
Licensed to Balamurugan Chandrasekaran
Subscription is active until October 12, 2022.
Runtime version: 11.0.13+7-b1751.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.1
GC: G1 Young Generation, G1 Old Generation
Memory: 9000M
Cores: 16
Registry:
    scala.erase.compiler.process.jdk.once=false

Non-Bundled Plugins:
    socrates.tabshifter (0.30)
    org.toml.lang (213.5744.224)
    org.jetbrains.plugins.go-template (213.6777.8)
    org.jetbrains.plugins.go (213.6777.52)
    org.antlr.intellij.plugin (1.17)
    google-java-format (1.13.0.0)
    com.intellij.plugins.watcher (213.6461.19)
    org.jetbrains.kotlin (213-1.6.10-release-944-IJ6461.79)
    com.4lex4.intellij.solarized (2.4.0)
    nl.rubensten.texifyidea (0.7.13)
    com.firsttimeinforever.intellij.pdf.viewer.intellij-pdf-viewer (0.11.1)
    PlantUML integration (5.10.0)
    IDEA Restart (1.0)
    com.intellij.play (213.5744.125)
    Pythonid (213.6777.52)
    org.jetbrains.compose.desktop.ide (1.0.0)
    org.intellij.scala (2021.3.18)
    com.intellij.bigdatatools (213.5449.281)
    com.cursiveclojure.cursive (1.12.2-eap3-2021.3)
    izhangzhihao.rainbow.brackets (6.21)
    AceJump (3.8.5)
    IdeaVIM (1.9.3)
    org.jetbrains.IdeaVim-EasyMotion (1.6)
    eu.theblob42.idea.whichkey (0.6.2)

Kotlin: 213-1.6.10-release-944-IJ6461.79
marioangst commented 2 years ago

I have the same problem, same setting as @balaudt, so I will not reproduce the error codes again - I also tried using Temurin and older versions of IntelliJ Idea Ultimate (2020.3.4 and 2020.1.4).

cursive-ide commented 2 years ago

This is actually two unrelated problems, I believe.

@balaudt I believe your problem will be fixed by upgrading your Clojure Deps install. Please let me know if this doesn't fix it.

I've been talking to @marioangst on Slack, his issue is a problem in Deps (TDEPS-222), and also a problem in Cursive. That's fixed in a new release of tools.deps.alpha, and there will be a fix for the Cursive part in the next build of Cursive.

balaudt commented 2 years ago

Updating Clojure Deps from 1.10 to 1.10.3 did resolve the issue but it would be nice if this hard requirement is captured in the documentation.