meson icon indicating copy to clipboard operation
meson copied to clipboard

java: use single javac invocation per jar

Open Mis012 opened this issue 1 year ago • 2 comments

as discussed in https://github.com/mesonbuild/meson/issues/12735:

Instead of invoking javac for every .java file, pass all of the sources for a jar target to a single javac invocation. This massively improves first compilation time and doesn't meaningfully affect incremental builds (it can even be faster in some cases).

The old approach also had issues where files would not always get recompiled even though they should, necessitating a clean rebuild in order to see changes reflected in the build output.

Multiple invocations seem to only make sense if:

  • issues with files not getting flagged for rebuild are investigated and fixed
  • something like the javaserver buildtool from openjdk sources is used instead of directly spawning javac processes
  • the amount of java files per jar is so large that it is faster to compile several files one by one than to compile all the files at once (batching may still make sense to get a reasonable balance)

Mis012 avatar Feb 16 '24 11:02 Mis012

Thanks for your contribution!

tristan957 avatar Feb 20 '24 16:02 tristan957

is there anything blocking this from getting merged?

Mis012 avatar Apr 08 '24 19:04 Mis012

it seems the patch doesn't apply properly anymore, is there a point in me fixing it seeing that this PR is getting ignored?

Mis012 avatar Jun 09 '24 21:06 Mis012

This is not intentionally ignored, we just have a ton of stuff to do and not that many people to do it so sometimes things are forgotten. Sorry about that. If you rebase this against current trunk, it should be good to merge.

jpakkane avatar Jun 09 '24 21:06 jpakkane

rebased :+1:

Mis012 avatar Jun 09 '24 21:06 Mis012