Fork me on GitHub
#leiningen
<
2018-03-05
>
nakiya08:03:42

lein uberjarhangs in my project and from google I see that this is due to a top level form that gets evaluated. However, I can’t eyeball any such thing. Any way to get an idea what is causing lein uberjar to hang?

noisesmith17:03:51

nakiya: you can use jstack or even Control-\ to show all the stack traces in the vm

noisesmith18:03:08

one of those (likely the longest) will be the one that is stuck, and point to the top level side effect

noisesmith18:03:51

nakiya: and pedantically, all top level forms are evaluated when you do AOT, if something shouldn't happen when AOT compiling you shouldn't do it at the top level (or you shouldn't AOT compile)

kenrestivo21:03:13

doing anything in top-level forms besides defining vars and functions seems... dirty.

noisesmith21:03:29

@kenrestivo: it's trickier than that though, for example if you do something with a side effect inside the body of def - people don't intuitively expect that to run during AOT, but it will

kenrestivo21:03:55

ah, yes, i've been bitten by that before