taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 196 forks source link

Uberjar failure with direct-linking=true #449

Open tafenton opened 4 months ago

tafenton commented 4 months ago

Hi,

I get the following message while trying to compile a sente project using the aleph community adapter:

Execution error (ExceptionInfo) at taoensso.truss.impl/default-error-fn (impl.cljc:81).
Invariant failed at taoensso.sente|496: ((fn* [p1__11175#] (satisfies? interfaces/IServerChanAdapter p1__11175#)) #object[taoensso.sente.server_adapters.community.aleph.AlephAsyncNetworkChannelAdapter 0x7634fcb8 "taoensso.sente.server_adapters.community.aleph.AlephAsyncNetworkChannelAdapter@7634fcb8"])

This behaviour occurs consistently with:

However, the behaviour stops if I disable "-Dclojure.compiler.direct-linking=true" (set by default in the current lein new template) - and also if I move it into a non-aot namespace.

I've also cloned sente and played with direct-linking in the raw project; it appears the relevant have? statement is checked twice, passing the first time and failing the second. I've uploaded a (very) minimal reproduction here.

Unfortunately I don't know enough about direct linking to go any further, but hopefully this is a helpful pointer!

ptaoussanis commented 4 months ago

@tafenton Thanks for the info and reproducible Tom!

I'm not too familiar with direct linking myself, so can't say off-hand - but happy to look into this next time I'm on batched Sente work. Appreciate you bringing this to my attention.

Cheers! :-)