calva

2025-11-29T13:40:11.218879Z

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

2025-12-16T19:43:25.489349Z

Is this a bug in Calva ?

seancorfield 2025-12-16T19:45:09.986269Z

@pez Any ideas about this?

pez 2025-12-16T19:53:49.832299Z

Not really. I take it you can still repro. @carsten.behring? If so, what do you see in the nrepl log?

2025-12-16T19:57:13.999139Z

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)

pez 2025-12-16T20:01:10.858179Z

I’m ready to call it a something-to-fix if nrepl has info about it that Calva is not surfacing.

2025-12-16T20:07:11.193569Z

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 loaded

pez 2025-12-16T20:11:02.630429Z

And if you load-file from the REPL in Calva?

2025-12-16T20:22:21.360699Z

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.

pez 2025-12-16T20:29:48.288739Z

So you see nothing in the nrepl log?

2025-12-16T20:30:40.739979Z

not the "root cause": "Could not initialize native OpenCL library."

pez 2025-12-16T20:33:33.580309Z

Maybe people in #nrepl know more about what options we have here.

2025-11-30T08:39:17.646949Z

Yes, I think there is no way to see the root cause Exception in Calva

2025-11-29T13:45:45.126879Z

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"

seancorfield 2025-11-29T16:48:15.596419Z

If you eval *e in Calva, after getting that error, do you see the full stacktrace?

2025-11-29T21:01:58.222759Z

No.

2025-11-29T21:02:49.978889Z

I susppect as well that the "error" happens at macro expansion time.

seancorfield 2025-11-29T21:13:35.456089Z

Ah, because the error happens when the code is loaded, not run...

Shantanu Kumar 2025-11-29T15:12:50.004289Z

Hi. "Resolve macro as..." has options for -> and ->> - is it possible to add as-> to the macro list?

pez 2025-11-29T15:54:43.688489Z

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)

Shantanu Kumar 2025-11-29T15:56:07.883009Z

Thank you, will raise there.

seancorfield 2025-11-29T20:35:42.586319Z

https://www.reddit.com/r/Clojure/comments/1p9x9ll/calva_flare_window_in_vscode/ -- FYI @pez (or anyone else who can answer)

🙏 1
pez 2025-11-29T22:35:18.591539Z

Thanks! The question highlights a Ux problem that we can address.