RFR: 8293116: Incremental JDK build could be sped up [v3]

Erik Joelsson erikj at openjdk.org
Tue Sep 6 13:21:58 UTC 2022


On Mon, 5 Sep 2022 19:00:56 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>>> I think you really mean `$$($1_SRCS)` here, since the vardeps file is a build internal file that javac do not and should not care about. While I'm sure it will ignore it, the code here will be clearer if we don't pass it around when we shouldn't.
>> 
>> Hm, but `$$($1_SRCS)` contains all the source files of the given module, modified and unmodified, correct? The point of this patch is that we send the list of modified files to the `Depend` plugin (all sources are still passed to the javac invocation), and the plugin decides whether or not all files should be compiled, or only the modified files should be compiled.
>> 
>> The plugin could theoretically do the timestamp check from the sources, but it is more difficult to do, and the make has (presumably) already done that in a predictable way.
>> 
>> The `Depend` plugin will do a full build if a non-Java file is present in the list, which I hope should lead to a more reliable recompilation for some complex changes among the sources.
>> 
>> Note that the modfiles are not sent to javac as such - all sources are still sent to javac. The modfiles are sent to the `Depend` plugin using a side channel.
>
> Right, I confused `$?` and `$+`. You are of course correct, this is the way to get the changed targets. I had a bit of bad luck when I though about this. 😄  (Theoretically, we could filter out anything that is not in `$1_SRCS` from `$?` but that seems to more work than is reasonable.)

> The `Depend` plugin will do a full build if a non-Java file is present in the list, which I hope should lead to a more reliable recompilation for some complex changes among the sources.

Ah, I had missed that and that's clever! That also means there is a reason to generate MODFILES in the actual compile recipe instead of the separate rule as I suggested earlier. For this to be "safe" we need `$$?` to really contain all the updated prereqs, otherwise we may miss compiling everything when something external actually should make us do just that.

-------------

PR: https://git.openjdk.org/jdk/pull/10104


More information about the compiler-dev mailing list