Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Lamina breaks reloading in REPL #82

Closed
coltnz opened this Issue · 9 comments

3 participants

@coltnz

Don't quite see through the magic to know whats going on, but basically my app can't reload at the REPL because Alia can't reload because Lamina can't reload..

user=>  (require '[lamina.core] :reload)
nil
user=>  (require '[lamina.core] :reload-all)

CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)
user=> (pst)
CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3514)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:417)
    clojure.lang.Compiler.eval (Compiler.java:6647)
...
Caused by:
ClassCastException lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel
    lamina.trace.probe/probe-channel- (probe.clj:79)
    lamina.trace.probe/fn--21299 (probe.clj:126)
    lamina.trace.probe/probe-channel-generator/fn--21293 (probe.clj:113)
    lamina.executor.core/executor (core.clj:69)
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3509)


@mpenet

That's unfortunate.
Let me know if that's a blocker for you, I'd consider moving the lamina based async function to a separate namespace (at least if you don't use it you wouldnt encounter this issue).

@ztellman the code in question is here https://github.com/mpenet/alia/blob/master/src/qbits/alia.clj#L253

@mpenet

@coltnz I looked into this, apparently it was caused by a typo and was fixed in #77 . I updated the dependency on alia, from my quick tests it seems to work now.

@mpenet

You can get the latest version with the update using cc.qbits/alia "2.0.0-beta7"

@coltnz

Yeah I thought that too but no...

➜  datastore-search git:(feature/alia-async) ✗ lein repl
Retrieving cc/qbits/alia/2.0.0-beta7/alia-2.0.0-beta7.pom from clojars
Retrieving cc/qbits/alia/2.0.0-beta7/alia-2.0.0-beta7.jar from clojars
.....
user=> (require '[qbits.alia :as alia] :reload)
nil
user=> (require '[qbits.alia :as alia] :reload-all)

CompilerException java.lang.ClassCastException: lamina.core.channel.Channel cannot be cast to lamina.core.channel.IChannel, compiling:(core.clj:181:20)
@ztellman
Owner

Sorry, coming to this late. Is there any AOT compilation going on?

@mpenet

Works for me.

; CIDER 0.5.0alpha (package: 20140114.202) (Clojure 1.5.1, nREPL 0.2.3)
user> (require '[qbits.alia :as alia] :reload)
nil
user> (require '[qbits.alia :as alia] :reload-all)
nil
user> 

As @ztellman said, maybe it's related to aot, or conflicting dependencies. try lein clean and also lein deps :tree looking for an older lamina version maybe.

@coltnz

Ok after a bunch of red herrings, I can confirm we did in fact have an AOT internal library and once AOT-ed problem went away. Seems to be potemkin and clojure AOT bugs related (this one? http://dev.clojure.org/jira/browse/CLJ-1330).

@ztellman
Owner
@coltnz

Yep. Got my dependency list down to:

:dependencies [[org.clojure/clojure "1.6.0-alpha3"]
[com.smxemail/smx-netty-clout "1.0.10"]
[lamina "0.5.2"]])

Removed the AOT-ing of the main namespace in our SMX library and it's all good. So given that AOT and Clojure is busted, happy to close this ticket as resolved.

@coltnz coltnz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.