Fork me on GitHub
#cider
<
2015-10-22
>
wagjo07:10:49

@piotrek I'm using it

blueberry09:10:11

In case anyone is interested in GPU and other high-performance computing, new version of ClojureCL has just been released. ClojureCL 0.3.0 is available in Clojars. http://clojurecl.uncomplicate.org

cfleming10:10:20

Does this error look familiar to anyone?

java.lang.IllegalArgumentException: 
No implementation of method: :urls of protocol:
#'mranderson045.javaclasspath.v0v2v2.clojure.java.classpath/URLClasspath
found for class: com.intellij.util.lang.UrlClassLoader, compiling:(track_state.clj:57:8) 
No implementation of method: :urls of protocol:
#'mranderson045.javaclasspath.v0v2v2.clojure.java.classpath/URLClasspath
found for class: com.intellij.util.lang.UrlClassLoader

cfleming10:10:12

It’s an error in Cursive, but it seems to be provoked by having the CIDER nREPL plugin in the user’s profile.

wagjo10:10:13

If you also have refactor-nrepl middleware enabled, it may be the https://github.com/clojure-emacs/refactor-nrepl/issues/126

cfleming10:10:36

No, profiles.clj is:

{:user
 {:plugins [;; add plugins for all projects below
            [cider/cider-nrepl "0.10.0-SNAPSHOT"]
            [lein-localrepo "0.5.3"]
            [lein-pprint "1.1.1"]
            ]
  :dependencies [;; add deps for all projects below
                 ;; [org.clojure/tools.nrepl "0.2.7"]
                 [org.clojure/tools.nrepl "0.2.10"]
                 [spyscope "0.1.5"]]
  :injections [(require 'spyscope.core)]
  }
}

cfleming10:10:22

Interesting that @benedek says there that classloader isolation didn’t work out for them, since that is what Cursive is now using.

cfleming10:10:36

I’d be interested to know what the problems were and if they might be related.

cfleming10:10:12

Actually, what is happening there is that it’s picking the wrong classloader for some reason: com.intellij.util.lang.UrlClassLoader is the root of the classloader hierarchy.

bozhidar10:10:16

track-state is a CIDER middleware

bozhidar10:10:42

but I don’t understand what’s the issue with the intellij classes

cfleming10:10:04

I don’t understand why it would do that - when calling this, both Compiler/LOADER and the thread context classloader are set to a DynamicClassLoader.

bozhidar10:10:06

seems that the ns obfuscation step done by mranderson is causing some issues

bozhidar10:10:04

but @benedek is definitely the expert on mranderson-related stuff

cfleming10:10:15

When that exception is thrown, the correct classloader is still set to both Compiler/LOADER and the TCCL

cfleming10:10:04

Ok, the problem is in clojure.java.classpath

cfleming10:10:58

It assumes that every classloader in the hierarchy is a URLClassLoader

cfleming10:10:08

Which seems… ambitious

bozhidar10:10:33

there’s a reason we opted to use ns rewriting instead of classloader isolation

bozhidar10:10:53

it seems that nobody could get the classloader isolation to work properly on a non-trivial project simple_smile

cfleming10:10:57

I’m keen to hear it

cfleming10:10:13

I dunno, Cursive runs Leiningen in a shim now

cfleming10:10:25

Although it was several weeks of pain to get it to do so

bozhidar10:10:04

if you write some blog post about this I’d be very happy to read it

cfleming10:10:45

That’s unlikely to happen any time soon unfortunately, at a minimum until after the conj.

cfleming10:10:53

I’m not sure what to do about this.

cfleming10:10:00

The class of that classloader is not available inside the shim, so I can’t extend the clojure.java.classpath protocol to it.

bozhidar10:10:15

btw, if you’re in the reading mood yourself you can take a look at this ticket and the once that reference it

bozhidar10:10:25

to see how we ended up where we did

cfleming10:10:35

Ok, I’ll take a look when I get a chance.

cfleming10:10:16

In the meantime, I’d like to politely suggest that the classpath code is wrong.

cfleming10:10:46

You can’t make that sort of assumption about the classloaders you’re running in.

benedek10:10:47

by the time I arrive mranderson is cleared. cool

cfleming10:10:35

@benedek: Yeah, you’re off the hook

cfleming11:10:44

I reported this as http://dev.clojure.org/jira/browse/CLASSPATH-7, in case anyone is interested.

bozhidar17:10:38

@cfleming: 10x