When building a configuration with imported modules, the first
incremental build will often rebuild all the imported modules
module-info.java. This is caused by the recipe for copying the pre
compiled imported classes deleting the vardeps file for the compile target.
This patch makes the deletion more selective to solve the problem.
Bug: https://bugs.openjdk.java.net/browse/JDK-8154430
Patch:
diff -r 9f1ecdfae7fb make/CompileJavaModules.gmk
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -542,8 +542,9 @@
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE))
- $(RM) -r $(@D)
- $(MKDIR) -p $(@D)
+ $(call MakeDir, $(@D))
+ # Do not delete marker and build meta data files
+ $(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
$(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE)/* $(@D)/
$(TOUCH) $@
/Erik