compileClojure task hangs

33 views
Skip to first unread message

Dave Ray

unread,
Dec 16, 2012, 12:09:58 AM12/16/12
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

Meikel Brandmeyer

unread,
Dec 16, 2012, 3:16:42 PM12/16/12
to cloju...@googlegroups.com
Hi,

sorry. Only mobile connection at the moment.

Adding System/exit is the only solution I can spontaneously think off. Not requiring the namespaces won't help. Same problem when switching to AOT.

Meikel

Durch MOTOBLUR™ verbunden


-----Ursprüngliche Nachricht-----

Dave Ray

unread,
Dec 16, 2012, 4:15:46 PM12/16/12
to cloju...@googlegroups.com
Hi,

I'm working around it at the moment by just copying and modifying
compile.clj and test.clj and putting them earlier in the classpath.
I'll create an issue on bitbucket to track.

Cheers,

Dave
Reply all
Reply to author
Forward
0 new messages