RFR: JDK-8154430: Imported modules rebuilt on second run when nothing has changed

Erik Joelsson erik.joelsson at oracle.com
Mon Apr 18 09:08:26 UTC 2016

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
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)/*))
      $(TOUCH) $@


More information about the build-dev mailing list