I am in a situation of an Clojure error, which the Calva repl does not show, but I see it in a normal repl started by "lein repl":
(require '[uncomplicate.clojurecuda.internal.constants])
Execution error (UnsatisfiedLinkError) at jdk.internal.loader.NativeLibraries/load (NativeLibraries.java:-2).
/home/vscode/.javacpp/cache/cuda-13.0-9.14-1.5.13-SNAPSHOT-linux-x86_64.jar/org/bytedeco/cuda/linux-x86_64/libjnicudart.so: libcudart.so.13: cannot open shared object file: No such file or directory
Evaluation of the same in a Calva repl, shows "only":
; Execution error at (info.clj:9).
; No namespace: uncomplicate.clojurecuda.internal.constants Is this a bug in Calva ?
@pez Any ideas about this?
Not really. I take it you can still repro. @carsten.behring? If so, what do you see in the nrepl log?
I would call it a "bug", as there is no way in calva to see the exception root cause. reproducing is not that easy, as it needs a system where native libs are "missing" So pure "clojure code" cannot reproduce it, as it depends on the "system" below. (= native libraries installed/not-installed)
I’m ready to call it a something-to-fix if nrepl has info about it that Calva is not surfacing.
I think you are right.
It's a problem of nrepl.
The nrepl buffer does not have it neither, when evaluating the ns expressions.
If I run the same clojure file via clojure xxx.clj
I see the correct excption:
Could not load libOpenCL.so, error libOpenCL.so: cannot open shared object file: No such file or directory
Execution error (UnsatisfiedLinkError) at org.jocl.LibInitializer/initNativeLibrary (LibInitializer.java:74).
Could not initialize native OpenCL library. Implementation library could not be loadedAnd if you load-file from the REPL in Calva?
Using "load-file" the root cause is shown. In both, Calva REPL and clojure cli The "UnsatisfiedLinkError" happens while compiling the ns macro, I suppose. And somehow in this situation nrepl does not reveal the real root cause.
So you see nothing in the nrepl log?
not the "root cause": "Could not initialize native OpenCL library."
Maybe people in #nrepl know more about what options we have here.
Yes, I think there is no way to see the root cause Exception in Calva
The first one is clearly far more informative and the second is hiding the root cause, and is in this situation very confusing and it took me indeed a wile to fihure this out. I think I have seen this more often before, in case of "issues" with native libraries. (not sure if only with "leiningen" or as well with clojure tools) Is this maybe related to the "exception" being an "UnsatisfiedLinkError", so an "Error"
If you eval *e in Calva, after getting that error, do you see the full stacktrace?
No.
I susppect as well that the "error" happens at macro expansion time.
Ah, because the error happens when the code is loaded, not run...
Hi. "Resolve macro as..." has options for -> and ->> - is it possible to add as-> to the macro list?
I think these options are maintained by the #lsp project. I could be wrong, but I don’t remember seeing the list in the Calva code. (afk so can’t check)
Thank you, will raise there.
https://www.reddit.com/r/Clojure/comments/1p9x9ll/calva_flare_window_in_vscode/ -- FYI @pez (or anyone else who can answer)
Thanks! The question highlights a Ux problem that we can address.