clojureRepl hangs other Gradle tasks when build.gradle is changed

45 views
Skip to first unread message

Phil Groce

unread,
Feb 14, 2014, 10:48:13 PM2/14/14
to cloju...@googlegroups.com
Thanks for implementing the clojureRepl task, it's good to know I can keep on using CIDER when I move from Leiningen to Gradle.

When I have the repl running in one process, I can run other Gradle tasks on the same project in other processes with no problems, unless I make a change to the build file. At that point, the repl continues to work, but trying to execute other Gradle tasks hangs while the second process waits for a lock that (presumably) the clojureRepl process has and won't give up.

To reproduce, start a clojureRepl in a Gradle project, make a change to the build.gradle file (a change seems to be required; just touching the file works fine) and run a task in a separate shell while the repl is running. I've attached the build.gradle file I was using, and a transcript of the debug output.

I don't know enough about Gradle to speculate on what might fix this behavior. I find it tedious to have to restart the repl process when I change the build, but it is possible, and I imagine I'll be touching the build scripts much less once I quit experimenting with Gradle itself and work primarily on my actual project. If you choose not to change it, though, I suggest you document this behavior somewhere, as it might not be obvious for new users.

phil

Meikel Brandmeyer

unread,
Feb 15, 2014, 3:26:41 AM2/15/14
to cloju...@googlegroups.com
Hi,

On Fri, Feb 14, 2014 at 07:48:13PM -0800, Phil Groce wrote:
> When I have the repl running in one process, I can run other Gradle tasks
> on the same project in other processes with no problems, unless I make a
> change to the build file. At that point, the repl continues to work, but
> trying to execute other Gradle tasks hangs while the second process waits
> for a lock that (presumably) the clojureRepl process has and won't give up.

I know of this behaviour and I'm afraid I cannot do anything about it.
This is somewhere deep in the gradle machinery. The same is true for
the task watcher btw. I'm currently writing an ebooklet documenting
everything. I added it there already as a warning.

Meikel

signature.asc

Phil Groce

unread,
Feb 16, 2014, 1:24:23 PM2/16/14
to cloju...@googlegroups.com
On Saturday, February 15, 2014 3:26:41 AM UTC-5, Meikel Brandmeyer wrote:

I know of this behaviour and I'm afraid I cannot do anything about it.
This is somewhere deep in the gradle machinery. The same is true for
the task watcher btw.

Alright. I was rather afraid of this, but I thought it was worth asking.

I suppose that a task that started a repl in the background and returned immediately wouldn't have this issue, but I understand that that's problematic in other ways. 
 
I'm currently writing an ebooklet documenting
everything. I added it there already as a warning.

Thanks! That will be very useful. 
 
Meikel

phil 
Reply all
Reply to author
Forward
0 new messages