This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-04
Channels
- # admin-announcements (1)
- # adventofcode (98)
- # announcements (5)
- # asami (3)
- # babashka (24)
- # beginners (51)
- # bitcoin (3)
- # calva (24)
- # clj-kondo (73)
- # cljdoc (5)
- # cljs-dev (2)
- # clojure (15)
- # clojure-czech (3)
- # clojure-dev (27)
- # clojure-europe (7)
- # clojure-gamedev (1)
- # clojure-italy (2)
- # clojure-uk (1)
- # conjure (4)
- # cursive (18)
- # datahike (4)
- # datomic (3)
- # deps-new (7)
- # emacs (1)
- # events (10)
- # fulcro (5)
- # honeysql (4)
- # jackdaw (2)
- # java (13)
- # lsp (85)
- # meander (9)
- # membrane (1)
- # minecraft (1)
- # off-topic (45)
- # re-frame (16)
- # sql (17)
- # tools-deps (10)
- # vscode (9)
- # xtdb (8)
A bit confused as to what's happening.
I'm using an older version of Cursive, 1.10.2-2020.2
, and I have the "Clojure Deps" settings section using the CLI tools, version 1.10.3.967
.
I just added this alias to my deps.edn
:
:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "48c3c67"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}
When I run clj -X:test
, it works just fine. clj -A:test -Spath
works just fine as well and has the correct dependency on the classpath.
However, when I mark the :test
alias in the "Clojure Deps" panel in IDEA, I get:
12:12 Errors during project resolution
The following errors were found during project resolve:
/home/p-himik/.../deps.edn:
Library io.github.cognitect-labs/test-runner has missing :sha in coordinate.
If Cursive is using clj
CLI tool, how can the above error be explained? How can I fix it?@U2FRKM4TW I think you might be being hit by https://github.com/cursive-ide/cursive/issues/2105, which is fixed in 1.10.3. Could you check /usr/local/lib/clojure/libexec
and see if you have multiple versions there? If so, please delete all but the one you want and try again.
Seems like it's something else. The symptoms are different, and even after removing everything but clojure-tools-1.10.3.967.jar
and exec.jar
and restarting IDEA, the behavior is still the same.
Love me some bizarre behavior.
After attaching strace, Cursive started erroring out with Could not create shim: Could not create shim
.
The stacktrace in the logs:
2021-12-05 11:59:35,974 [ 361182] ERROR - #cursive.build.BuildSystemUtil - Could not create shim
java.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:141)
at cursive.shim.ShimProvider.withShim(Shim.kt:108)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:167)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:85)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:42)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1.run(BuildSystemManager.kt:150)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:93)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:935)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
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: java.lang.NullPointerException
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.postInvoke(ClojureRuntimeShimImpl.java:49)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.init(ClojureRuntimeShimImpl.java:31)
at org.projectodd.shimdandy.ClojureRuntimeShim.newRuntime(ClojureRuntimeShim.java:26)
at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:26)
at cursive.shim.Shim$createShimProvider$1.apply(Shim.kt:73)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:148)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:90)
at cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:268)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 7 more
At the same time, strace shows that one of the IDEA's processes is trying to find libjawt.so
but in wrong places for some reason, and fails with SIGSEGV.
Funny thing is, now dependency resolution doesn't work at all - in other projects, after killing strace and restarting IDEA along with purging all indexes. I have no clue how attaching strace could've seemingly prevented IDEA from looking for libjawt.so
at the right place.Ah, I think I know what's going on.
libjawt.so
was just a random coincidence.
I see this line in the strace output: stat("/usr/local/lib/clojure/libexec/clojure-tools-1.10.2.796.jar", 0x7f133adf3f40) = -1 ENOENT (No such file or directory)
So for some reason, Cursive is still trying to access an older version of the jar, one that I removed.
@U0567Q30W Just FYI, got it fixed by removing ~/.clojure/.cpcache
.
That is super weird. I’m pretty sure that removing .cpcache
wouldn’t be the thing that fixed it, since Cursive only calls the CLI script for -Sdescribe
, which I don’t think uses it. I’m honestly not sure what might have actually fixed it though. I’m pretty sure that that bug is the underlying cause.
Well, FWIW that's the only thing I did after which the behavior actually changed - tried multiple IDEA restarts with cache clearing (while using strace at different stages), and all the time strace was showing the old clojure-tools jar being used. Didn't do any other changes myself apart from removing the old jars in the first place.
And BTW if you run clojure -Sdescribe
within ~/home/.clojure
, that .cpcache
directory is definitely used. But only for the stat
syscall, so maybe that's not important.
Ohh… actually, I think what you probably had to do was go to the Deps settings, change something, hit apply and then change it back and hit apply again. The path to the jar file that actually gets used is updated during that process.
(or some similar combination which would provoke IntelliJ to update that value in the Settings dialog).
Oh, you're absolutely right! Not sure how it flew out of my head, sorry for the confusion.
No worries, it’s confusing that the process of configuring deps can later provoke this sort of error, for sure…
For the sake of my own education - where is this setting stored? I didn't find the old version with grep
so I must've missed some place.
So in IntelliJ there are project-specific settings and global app-wide ones. This is app-wide, so it’s not stored in the project itself. You can find those directories here: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory. On my Mac, the relevant file is at: /Users/colin/Library/Application Support/JetBrains/IntelliJIdea2021.3/settingsRepository/repository/clojure-deps.settings.xml