On Wed, 7 Sep 2022 16:30:33 GMT, Erik Joelsson <er...@openjdk.org> wrote:
>>> ... and also that we _must_ include the vardeps file, since any change >>> there should trigger a complete rebuild. >>> >>> The logic here seems correct, but apparently somewhat hard to fully >>> understand correctly. Maybe a few lines of comments summarizing the >>> important points raised here would be a good thing? >> >> How about: >> https://github.com/openjdk/jdk/pull/10104/commits/6c1a83b28ee72a99bf24e7f66c96d1294ad485dd >> >> Thanks, >> Jan > > To clarify my last post. The Main compile rule has this prereq declaration: > > > $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_FILELIST) $$($1_DEPENDS) \ > $$($1_VARDEPS_FILE) $$($1_EXTRA_DEPS) $$($1_JAVAC_SERVER_CONFIG) > > The `$$($1_DEPENDS)` and `$$($1_EXTRA_DEPS)` may contain prereqs/dependencies > that we probably should always recompile everything for. The EXTRA_DEPS is > where we get the API changes from other modules. The DEPENDS variable is set > by the caller and can be anything. Both of these are (deliberately) missing > from the FILELIST generation rule, but I think MODFILES generation needs > them. Because of this, I think the new MODFILES logic needs to move to the > main compilation rule (like in your original patch) but the FILELIST rule > should still be left alone. > > We need to verify that this still gives us the expected speedup in the common > case though. I'm not sure in what situations other dependencies may be > included in `$?` here. Actually, this is not an entirely correct description. EXTRA_DEPS points to the `depend` javac plugin itself in buildtools. Once built, this is unlikely to change. Dependency on the API changes themselves happen on a higher level, in `CompileJavaModules.gmk`, where we add a dependency of the outputted `pubapi` file for modules we depend on. (I did have to look this up, though) ------------- PR: https://git.openjdk.org/jdk/pull/10104