Merge
authorjiangli
Thu, 19 Nov 2015 19:30:47 -0500
changeset 34114 43ac874b754c
parent 34113 210cb6523c6e (current diff)
parent 33721 aefdf48bab17 (diff)
child 34115 00b704eed6b5
Merge
modules.xml
--- a/.hgtags-top-repo	Wed Jul 22 20:14:16 2015 -0700
+++ b/.hgtags-top-repo	Thu Nov 19 19:30:47 2015 -0500
@@ -334,3 +334,4 @@
 895353113f382d24e623191fdab0e29a3ce34738 jdk9-b89
 cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
 122142a185381ce5cea959bf13b923d8cc333628 jdk9-b91
+106c06398f7ab330eef9e335fbd3a5a8ead23b77 jdk9-b92
--- a/make/Init.gmk	Wed Jul 22 20:14:16 2015 -0700
+++ b/make/Init.gmk	Thu Nov 19 19:30:47 2015 -0500
@@ -305,49 +305,20 @@
         endif
 
     on-failure:
-        ifneq ($(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*), )
-	  $(PRINTF) "=== Output from failing command(s) repeated here ===\n"
-	  $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*)), \
-	      $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" $(NEWLINE) \
-	      $(CAT) $(logfile) | $(GREP) -v -e "^Note: including file:" $(NEWLINE) \
-	  )
-	  $(PRINTF) "=== End of repeated output ===\n"
+	$(call PrintFailureReports)
+	$(call PrintBuildLogFailures)
+	$(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n"
+        ifneq ($(COMPARE_BUILD), )
+	  $(call CleanupCompareBuild)
         endif
-	if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then  \
-	  $(PRINTF) "=== Make failure sequence repeated here ===\n" ; \
-	  $(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
-	  $(PRINTF) "=== End of repeated output ===\n" ; \
-	  $(PRINTF) "Hint: Try searching the build log for the name of the first failed target.\n" ; \
-	else \
-	  $(PRINTF) "No indication of failed target found.\n" ; \
-	  $(PRINTF) "Hint: Try searching the build log for '] Error'.\n" ; \
-	fi
-	$(PRINTF) "Hint: If caused by a warning, try configure --disable-warnings-as-errors.\n\n"
 
     # Support targets for COMPARE_BUILD, used for makefile development
     pre-compare-build:
-	$(ECHO) "Preparing for comparison rebuild"
-        # Apply patch, if any
-        ifneq ($(COMPARE_BUILD_PATCH), )
-	  $(PATCH) -p1 < $(COMPARE_BUILD_PATCH)
-        endif
-        # Move the first build away and re-create the output directory
-	( cd $(TOPDIR) && \
-	    $(MV) $(OUTPUT_ROOT) $(OUTPUT_ROOT).OLD && \
-	    $(MKDIR) -p $(OUTPUT_ROOT) )
-        # Re-run configure with the same arguments (and possibly some additional),
-	# must be done after patching.
-	( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
-	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
+	$(call PrepareCompareBuild)
 
     post-compare-build:
-        # Compare first and second build. Ignore any error code from compare.sh.
-	$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
-        ifneq ($(COMPARE_BUILD_COMP_DIR), )
-	  +(cd $(OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) -2dirs $(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(OUTPUT_ROOT).OLD/$(COMPARE_BUILD_COMP_DIR) || true)
-        else
-	  +(cd $(OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) -o $(OUTPUT_ROOT).OLD || true)
-        endif
+	$(call CleanupCompareBuild)
+	$(call CompareBuildDoComparison)
 
   .PHONY: print-targets print-modules reconfigure main on-failure
 endif
--- a/make/InitSupport.gmk	Wed Jul 22 20:14:16 2015 -0700
+++ b/make/InitSupport.gmk	Thu Nov 19 19:30:47 2015 -0500
@@ -321,6 +321,8 @@
   # If any value contains "+", it will be replaced by space.
   define ParseCompareBuild
     ifneq ($$(COMPARE_BUILD), )
+      COMPARE_BUILD_OUTPUT_ROOT := $(TOPDIR)/build/compare-build/$(CONF_NAME)
+
       ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
         $$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
           $$(if $$(filter PATCH=%, $$(part)), \
@@ -364,6 +366,73 @@
     endif
   endef
 
+  # Prepare for a comparison rebuild
+  define PrepareCompareBuild
+	$(ECHO) "Preparing for comparison rebuild"
+        # Apply patch, if any
+	$(if $(COMPARE_BUILD_PATCH), $(PATCH) -p1 < $(COMPARE_BUILD_PATCH))
+        # Move the first build away temporarily
+	$(RM) -r $(TOPDIR)/build/.compare-build-temp
+	$(MKDIR) -p $(TOPDIR)/build/.compare-build-temp
+	$(MV) $(OUTPUT_ROOT) $(TOPDIR)/build/.compare-build-temp
+        # Restore an old compare-build, or create a new compare-build directory.
+	if test -d $(COMPARE_BUILD_OUTPUT_ROOT); then \
+	  $(MV) $(COMPARE_BUILD_OUTPUT_ROOT) $(OUTPUT_ROOT); \
+	else \
+	  $(MKDIR) -p $(OUTPUT_ROOT); \
+	fi
+        # Re-run configure with the same arguments (and possibly some additional),
+        # must be done after patching.
+	( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
+	    $(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
+  endef
+
+  # Cleanup after a compare build
+  define CleanupCompareBuild
+        # If running with a COMPARE_BUILD patch, reverse-apply it
+	$(if $(COMPARE_BUILD_PATCH), $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
+        # Move this build away and restore the original build
+	$(MKDIR) -p $(TOPDIR)/build/compare-build
+	$(MV) $(OUTPUT_ROOT) $(COMPARE_BUILD_OUTPUT_ROOT)
+	$(MV) $(TOPDIR)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUT_ROOT)
+	$(RM) -r $(TOPDIR)/build/.compare-build-temp
+  endef
+
+  # Do the actual comparison of two builds
+  define CompareBuildDoComparison
+        # Compare first and second build. Ignore any error code from compare.sh.
+	$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
+	$(if $(COMPARE_BUILD_COMP_DIR), \
+	  +(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
+	      -2dirs $(COMPARE_BUILD_OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) || true), \
+	  +(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
+	      -o $(OUTPUT_ROOT) || true) \
+	)
+  endef
+
+  define PrintFailureReports
+	$(if $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*), \
+	  $(PRINTF) "=== Output from failing command(s) repeated here ===\n" $(NEWLINE) \
+	  $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*)), \
+	      $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" $(NEWLINE) \
+	      $(CAT) $(logfile) | $(GREP) -v -e "^Note: including file:" $(NEWLINE) \
+	  ) \
+	  $(PRINTF) "=== End of repeated output ===\n" \
+	)
+  endef
+
+  define PrintBuildLogFailures
+	if $(GREP) -q "recipe for target .* failed" $(BUILD_LOG) 2> /dev/null; then  \
+	  $(PRINTF) "=== Make failure sequence repeated here ===\n" ; \
+	  $(GREP) "recipe for target .* failed" $(BUILD_LOG) ; \
+	  $(PRINTF) "=== End of repeated output ===\n" ; \
+	  $(PRINTF) "Hint: Try searching the build log for the name of the first failed target.\n" ; \
+	else \
+	  $(PRINTF) "No indication of failed target found.\n" ; \
+	  $(PRINTF) "Hint: Try searching the build log for '] Error'.\n" ; \
+	fi
+  endef
+
   define RotateLogFiles
 	$(RM) $(BUILD_LOG).old 2> /dev/null
 	$(MV) $(BUILD_LOG) $(BUILD_LOG).old 2> /dev/null || true
--- a/modules.xml	Wed Jul 22 20:14:16 2015 -0700
+++ b/modules.xml	Thu Nov 19 19:30:47 2015 -0500
@@ -229,8 +229,11 @@
       <to>java.logging</to>
       <to>java.management</to>
       <to>java.naming</to>
+      <to>java.security.jgss</to>
       <to>java.sql</to>
+      <to>java.xml</to>
       <to>jdk.management.resource</to>
+      <to>jdk.scripting.nashorn</to>
     </export>
     <export>
       <name>jdk.internal.org.objectweb.asm</name>