Fork me on GitHub

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?


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


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


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)


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


@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


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