Hey!
I'm using nrepl config to set system-wide default middleware for REPL metrics collection in our deps.edn projects. However, it gets wiped out whenever any tool passes --middleware on the CLI (which CIDER, Calva, etc. all do). This happens because of standard clojure merge semantics - CLI args completely replace the config's :middleware vector.
Is there a way for me to deploy company-wide middleware?
Hi @bozhidar! We would be super grateful if you could take a look at the PR ☝️. It would unblock some work here at Nubank. 🙇 Can you let us know what you think when you find the time?
@carloshernandez2.1b Here you go https://github.com/nrepl/nrepl/releases/tag/v1.6.0-alpha1
I might have missed some nrepl feature that solves this problem. But in case not, I published this https://github.com/nrepl/nrepl/pull/402 reviewplease
Hey @bozhidar, Thank you for your comments on the PR. I’ve addressed all the feedback provided. Could you please take another look when you have a moment? Let me know if there's anything else that needs attention. Thanks!
Will do!
Thanks @bozhidar, I saw now it is merged. How can we do the release? I saw the docs and it said I could tag a commit in master branch, but I didn't have permissions.
I’ll do a beta release later today.
I have a ns declarion like this:
(ns
inference-smollm2
(:require
[uncomplicate.diamond.internal.cudnn.factory :refer [cudnn-factory]]
))
and internaly this does some loading of native libraries.
If this fails for some reason, evaluating the ns expressions "hides" the real root cause, which is:
(so Calva cannot show it. The nrepl communication does not have it)
; Execution error (UnsatisfiedLinkError) at org.jocl.LibInitializer/initNativeLibrary (LibInitializer.java:74).
; Could not initialize native OpenCL library. Implementation library could not be loaded
It shows instead an error like:
; Execution error at (info.clj:9).
; No namespace: uncomplicate.clojurecl.internal.constants Loading the file via load-file or clj xxx shows the correct exception:
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
I assume that the exception (= UnsatisfiedLinkError) happens during compilation of he ns macro.see here: https://clojurians.slack.com/archives/CBE668G4R/p1764423611218879
is this a bug in nrepl ?
I have seen this before, working with native libraries and remember having been surprised by just seeing an exception of:
; No namespace: uncomplicate.clojurecl.internal.constantsI've tried it with another dependency that uses native libraries and could not reproduce (meaning that I receive UnsatisfiedLinkError from CIDER). Would you be able to make a small reproducer? I tried adding uncomplicate/deep-diamond {:mvn/version "0.42.0"} to dependencies but it fails to download some transitive ones.
I think it happens only when a macro tries to load the native dependency. So to reproduce it, you need a macro which tries this, and make sure the native library is not present
Gotta try it now
Wait, is the macro supposed to be in one of the internal namespaces?
Internal ? deep diamond loads as far as I know some native libs via macros. I get to these error usually when evaluating my 'ns' declaration which 'requires' some deep diamond ns
I've made a reproducer that triggers the loading of a native lib directly as the top-level form in the namespace. I'm not sure if doing it "via macros" would be any different.
OK, I think I did it via a macro now, if I understand correctly, and I still receive a clear (UnsatisfiedLinkError) from nREPL
Ok. So deep diamond does something special....which triggers it. I play quite a bit with the setup of my native libs, and get it from time again, when I mess up.
Make a 'reproducer' is tricky, as it requires (wrong) native setup. Maybe using Docker