Dave Ray
unread,Dec 16, 2012, 12:09:58 AM12/16/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cloju...@googlegroups.com
Hi Clojuresque,
One problem I've had with Clojuresque is that the compileClojure task
hangs for our codebase. Luckily, I think I have a solution.
Here's what I believe the compile task does:
* spawns off a JVM (maybe gradle does this) and runs the compile.clj
task (through the Driver.java shim)
* compile.clj just runs through all the clj source files and requires them
That's it. The issue is that some of our code refers to Java classes
whose static initializers do non-trivial stuff like, say, starting up
non-daemon background threads. So all the code is required, the task
returns, and then the JVM never exits because there are these stupid
non-daemon threads hanging around. I might be able to track down
whoever's creating these threads and get them to change, but it will
always be a risk since stuff like this won't happen with pure Java
code bases.
My current solution is just to put an explicit (System/exit 0) at the
end of the compile task. This seems to work fine and seems like it
shouldn't have any impact on the semantics of the task. Putting
System.exit(0) at the end of main() in Driver.java would fix the same
issue for all tasks. I see the same behavior with clojureTest.
Thoughts?
Thanks,
Dave