Vertispan / j2clmavenplugin

Maven plugin to launch new J2CL compilation
https://vertispan.github.io/j2clmavenplugin/
Apache License 2.0
53 stars 26 forks source link

macOS / mvn j2cl:watch stalls when a file is saved while it is compiling #161

Closed schube closed 2 years ago

schube commented 2 years ago

As discussed with Colin Alworth on gitter, I am reporting a problem on macOS X 12.x (Intel and M1 CPU).

I am running mvn j2cl:watch and wait until [INFO] ----- Build Complete: ready for browser refresh ----- appears.

Then I do a change (modify a string string from "Hello world" to "Hello world 2"). When I wait for 9 seconds [INFO] ----- Build Complete: ready for browser refresh ----- appears again in the terminal and I can refresh the browser and see the modified string.

But if I do NOT wait until [INFO] ----- Build Complete: ready for browser refresh ----- and I modify the string to "Hello world 3" and save, [INFO] ----- Build Complete: ready for browser refresh ----- never appears again and the project is stalled, which means the changes are not reflected in the browser nor does any change trigger a new compile.

I have to do CTRL+C and mvn j2cl:watch so I can start over.

treblereel commented 2 years ago

@schube +1.

in my current project, each recompilation takes about 80sec and i use Idea, Idea by default saves files on window focus change, on idle and so on. So it breaks watch mode and i have to run it again, maybe we could use some kind of queue to handle recompilation tasks ?

niloc132 commented 2 years ago

Rather than a queue (we don't want to enqueue many builds when the user might still change more things...), the current code is supposed to cancel the running build if any, and then start a new one, that way upcoming changes all get coalesced into the same new build. Something clearly has stopped working there though.