Closed miikka closed 7 years ago
Hmm, I'm not familiar with Virgil. I'll take a look, but at a first pass it seems like both plugins want to wrap the nrepl middleware and some sort of conflict is happening.
Actually, Virgil doesn't inherently touch anything in nrepl, so maybe the recompiling is somehow changing the nrepl function so it's not implementing the right interface anymore.
Okay, I think I know what's happening. Virgil reloads all the namespaces whenever it (re)compiles Java and it does it in an arbitrary order. First it reloads clojure.tools.nrepl.middleware.render-values
which uses the old definition of Transport and then it reloads clojure.tools.nrepl.transport
, which creates a new definition for Transport.
I assume a solution would be to make Virgil reload the namespaces in the dependency order – I'll open an issue there to discuss this further.
Ah, yeah the arbitrary ordering would be an issue for the reason you described. You can take a look at clojure.tools.namespace for the correct way to do dependency-ordered reloading.
I tried to use both Whidbey and Virgil in the same project. This is what happens:
I don't know if the problem is in Whidbey, in Virgil, or somewhere else. I'm opening the issue here, because the stacktrace points towards the direction of Whidbey.
Here's a repo for reproducing the problem: https://github.com/miikka/whidbey-virgil-problem. If you remove either Virgil or Whidbey from the plugin list, the REPL opens just fine. I'm using Whidbey 1.3.1, Virgil 0.1.5, Clojure 1.8.0, Leiningen 2.7.1 on Java 1.8.0_66.