On Mon, 5 Sep 2022 16:33:08 GMT, Jan Lahoda <jlah...@openjdk.org> wrote:
>> make/common/JavaCompilation.gmk line 455: >> >>> 453: $$(call LogWarn, Compiling up to $$(words $$($1_SRCS)) >>> files for $1) >>> 454: $$(eval $$(call ListPathsSafely, $1_SRCS, >>> $$($1_FILELIST))) >>> 455: $$(eval $1_MODFILES := $$?) >> >> 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. > >> 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.) ------------- PR: https://git.openjdk.org/jdk/pull/10104