8172241: Cleanup mistakes in jib publish support change
authorerikj
Tue, 10 Jan 2017 11:23:59 +0100
changeset 43043 bf14e07c9075
parent 43040 ab2c8b03c328
child 43044 6ff517127736
8172241: Cleanup mistakes in jib publish support change Reviewed-by: tbell
common/autoconf/spec.gmk.in
common/conf/jib-profiles.js
make/Bundles.gmk
make/Images.gmk
make/Main.gmk
--- a/common/autoconf/spec.gmk.in	Wed Jul 05 22:40:29 2017 +0200
+++ b/common/autoconf/spec.gmk.in	Tue Jan 10 11:23:59 2017 +0100
@@ -778,11 +778,18 @@
 # Images directory definitions
 JDK_IMAGE_SUBDIR:=jdk
 JRE_IMAGE_SUBDIR:=jre
+JRE_COMPACT1_IMAGE_SUBDIR := jre-compact1
+JRE_COMPACT2_IMAGE_SUBDIR := jre-compact2
+JRE_COMPACT3_IMAGE_SUBDIR := jre-compact3
 
 # Colon left out to be able to override output dir for bootcycle-images
 JDK_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JDK_IMAGE_SUBDIR)
 JRE_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_IMAGE_SUBDIR)
 
+JRE_COMPACT1_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(JRE_COMPACT1_IMAGE_SUBDIR)
+JRE_COMPACT2_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(JRE_COMPACT2_IMAGE_SUBDIR)
+JRE_COMPACT3_IMAGE_DIR := $(IMAGES_OUTPUTDIR)/$(JRE_COMPACT3_IMAGE_SUBDIR)
+
 # Test image, as above
 TEST_IMAGE_SUBDIR:=test
 TEST_IMAGE_DIR=$(IMAGES_OUTPUTDIR)/$(TEST_IMAGE_SUBDIR)
@@ -818,6 +825,12 @@
 endif
 JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
 JRE_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART).tar.gz
+JRE_COMPACT1_BUNDLE_NAME := \
+    jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact1_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz
+JRE_COMPACT2_BUNDLE_NAME := \
+    jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact2_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz
+JRE_COMPACT3_BUNDLE_NAME := \
+    jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact3_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz
 JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
 JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz
 ifeq ($(OPENJDK_TARGET_OS), windows)
--- a/common/conf/jib-profiles.js	Wed Jul 05 22:40:29 2017 +0200
+++ b/common/conf/jib-profiles.js	Tue Jan 10 11:23:59 2017 +0100
@@ -501,7 +501,7 @@
     // extra default target.
     var openOnlyProfilesExtra = {
         "linux-x86-open": {
-            default_make_targets: "profiles",
+            default_make_targets: "profiles-bundles",
             configure_args: "--with-jvm-variants=client,server"
         }
     };
@@ -587,6 +587,7 @@
             ],
             work_dir: input.get("src.full", "install_path") + "/test",
             environment: {
+                "JT_JAVA": common.boot_jdk_home,
                 "PRODUCT_HOME": input.get(testedProfile + ".jdk", "home_path"),
                 "TEST_IMAGE_DIR": input.get(testedProfile + ".test", "home_path"),
                 "TEST_OUTPUT_DIR": input.src_top_dir
@@ -710,10 +711,15 @@
                     local: "bundles/\\(jdk.*bin.tar.gz\\)",
                     remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
                 },
+                jdk_symbols: {
+                    local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
+                    remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
+                },
                 jre: {
-                    local: "bundles/\\(jre.*[0-9]_linux-x86_bin.tar.gz\\)",
+                    // This regexp needs to not match the compact* files below
+                    local: "bundles/\\(jre.*[+][0-9]\\{1,\\}_linux-x86_bin.tar.gz\\)",
                     remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },/* The build does not create these
+                },
                 jre_compact1: {
                     local: "bundles/\\(jre.*-compact1_linux-x86_bin.tar.gz\\)",
                     remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
@@ -725,7 +731,7 @@
                 jre_compact3: {
                     local: "bundles/\\(jre.*-compact3_linux-x86_bin.tar.gz\\)",
                     remote: "bundles/openjdk/GPL/profile/linux-x86/\\1",
-                },*/
+                },
             }
         },
 
--- a/make/Bundles.gmk	Wed Jul 05 22:40:29 2017 +0200
+++ b/make/Bundles.gmk	Tue Jan 10 11:23:59 2017 +0100
@@ -152,6 +152,9 @@
   JRE_IMAGE_HOMEDIR := $(JRE_IMAGE_DIR)
   JDK_BUNDLE_SUBDIR := jdk-$(VERSION_NUMBER)
   JRE_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)
+  JRE_COMPACT1_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)-compact1
+  JRE_COMPACT2_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)-compact2
+  JRE_COMPACT3_BUNDLE_SUBDIR := jre-$(VERSION_NUMBER)-compact3
   ifneq ($(DEBUG_LEVEL), release)
     JDK_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
     JRE_BUNDLE_SUBDIR := $(JRE_BUNDLE_SUBDIR)/$(DEBUG_LEVEL)
@@ -281,6 +284,35 @@
 
 ################################################################################
 
+ifneq ($(filter profiles-bundles, $(MAKECMDGOALS)), )
+  ifeq ($(OPENJDK_TARGET_OS), macosx)
+    $(error Creating compact profiles bundles on macosx is unsupported)
+  endif
+
+  define GenerateCompactProfilesBundles
+    ALL_JRE_COMPACT$1_FILES := $$(call CacheFind, $$(JRE_COMPACT$1_IMAGE_DIR))
+
+    JRE_COMPACT$1_BUNDLE_FILES := $$(filter-out \
+        $$(SYMBOLS_EXCLUDE_PATTERN), \
+        $$(ALL_JRE_COMPACT$1_FILES))
+
+    $$(eval $$(call SetupBundleFile, BUILD_JRE_COMPACT$1_BUNDLE, \
+        BUNDLE_NAME := $$(JRE_COMPACT$1_BUNDLE_NAME), \
+        FILES := $$(JRE_COMPACT$1_BUNDLE_FILES), \
+        BASE_DIRS := $$(JRE_COMPACT$1_IMAGE_DIR), \
+        SUBDIR := $$(JRE_COMPACT$1_BUNDLE_SUBDIR), \
+    ))
+
+    PROFILES_TARGETS += $$(BUILD_JRE_COMPACT$1_BUNDLE)
+  endef
+
+  $(eval $(call GenerateCompactProfilesBundles,1))
+  $(eval $(call GenerateCompactProfilesBundles,2))
+  $(eval $(call GenerateCompactProfilesBundles,3))
+endif
+
+################################################################################
+
 ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
   TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
 
@@ -316,7 +348,8 @@
 ################################################################################
 
 product-bundles: $(PRODUCT_TARGETS)
+profiles-bundles: $(PROFILES_TARGETS)
 test-bundles: $(TEST_TARGETS)
 docs-bundles: $(DOCS_TARGETS)
 
-.PHONY: all default product-bundles test-bundles docs-bundles
+.PHONY: all default product-bundles profiles-bundles test-bundles docs-bundles
--- a/make/Images.gmk	Wed Jul 05 22:40:29 2017 +0200
+++ b/make/Images.gmk	Tue Jan 10 11:23:59 2017 +0100
@@ -147,10 +147,6 @@
 	    --output $(JRE_IMAGE_DIR)
 	$(TOUCH) $@
 
-JRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1
-JRE_COMPACT2_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact2
-JRE_COMPACT3_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact3
-
 
 $(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
     $(call DependOnVariable, JRE_COMPACT1_MODULES_LIST) $(BASE_RELEASE_FILE)
--- a/make/Main.gmk	Wed Jul 05 22:40:29 2017 +0200
+++ b/make/Main.gmk	Tue Jan 10 11:23:59 2017 +0100
@@ -342,7 +342,7 @@
 symbols-image:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk symbols)
 
-profiles:
+profiles-image:
 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
 
 mac-bundles-jdk:
@@ -356,7 +356,7 @@
 
 ALL_TARGETS += store-source-revision create-source-revision-tracker bootcycle-images zip-security \
     zip-source jrtfs-jar jdk-image jre-image \
-    symbols-image profiles mac-bundles-jdk \
+    symbols-image profiles-image mac-bundles-jdk \
     release-file exploded-image-optimize
 
 ################################################################################
@@ -510,13 +510,16 @@
 product-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk product-bundles)
 
+profiles-bundles:
+	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk profiles-bundles)
+
 test-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk test-bundles)
 
 docs-bundles:
 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f Bundles.gmk docs-bundles)
 
-ALL_TARGETS += product-bundles test-bundles docs-bundles
+ALL_TARGETS += product-bundles profiles-bundles test-bundles docs-bundles
 
 ################################################################################
 # Install targets
@@ -734,7 +737,7 @@
   jre-image: jmods release-file
   symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS)
 
-  profiles: jmods release-file
+  profiles-image: jmods release-file
 
   mac-bundles-jdk: jdk-image jre-image
 
@@ -793,6 +796,8 @@
 
   product-bundles: product-images
 
+  profiles-bundles: profiles-images
+
   test-bundles: test-image
 
   docs-bundles: docs-image
@@ -878,6 +883,9 @@
 # an image until this can be cleaned up properly.
 product-images: zip-security
 
+# Declare these for backwards compatiblity and convenience.
+profiles profiles-images: profiles-image
+
 # The module summary cannot be run when:
 # * Cross compiling and building a partial BUILDJDK for the build host
 # * An external buildjdk has been supplied since it may not match the
@@ -909,7 +917,9 @@
     copy java rmic libs launchers jmods \
     jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples \
     exploded-image-base exploded-image \
-    create-buildjdk mac-bundles product-images docs-image test-image all-images \
+    create-buildjdk mac-bundles product-images \
+    profiles profiles-images \
+    docs-image test-image all-images \
     all-bundles
 
 ################################################################################