8213348: jdk.internal.vm.compiler.management service providers missing in module descriptor
authordlong
Thu, 08 Nov 2018 15:19:14 -0800
changeset 52464 c139884bd80e
parent 52463 52155b28cdb7
child 52465 3e0ebf913679
child 57024 8bb1fcdd611f
8213348: jdk.internal.vm.compiler.management service providers missing in module descriptor 8211781: re-building fails after changing Graal sources Reviewed-by: erikj, mchung
make/Main.gmk
make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk
make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk
--- a/make/Main.gmk	Thu Nov 08 18:23:52 2018 -0500
+++ b/make/Main.gmk	Thu Nov 08 15:19:14 2018 -0800
@@ -690,16 +690,17 @@
   # copied and processed.
   java.desktop-gensrc-src: java.base-gensrc java.base-copy
 
-  # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
-  # needs classes from the current JDK.
-  jdk.internal.vm.ci-gensrc-src: $(addsuffix -java, \
-      $(call FindTransitiveDepsForModule, jdk.internal.vm.ci))
+  # The annotation processing for jdk.internal.vm.compiler
+  # and jdk.internal.vm.compiler.management needs classes from the current JDK.
   jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \
       $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
+  jdk.internal.vm.compiler.management-gensrc-src: $(addsuffix -java, \
+      $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler.management))
 
-  # For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra
+  # For these modules, the gensrc step is generating a module-info.java.extra
   # file to be processed by the gensrc-moduleinfo target.
   jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src
+  jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src
 
   jdk.jdeps-gendata: java rmic
 
--- a/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Thu Nov 08 18:23:52 2018 -0500
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk	Thu Nov 08 15:19:14 2018 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -67,7 +67,7 @@
 
 PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
 
-ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src)
+ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
 SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
 
 PROCESSOR_JARS := \
@@ -81,23 +81,23 @@
 
 ADD_EXPORTS := \
     --add-modules jdk.internal.vm.ci \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
-    --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=jdk.internal.vm.compiler \
+    --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=jdk.internal.vm.compiler \
     #
 
 $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
@@ -121,6 +121,7 @@
 ################################################################################
 
 $(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
+	$(ECHO) "" > $@;
 	($(CD) $(GENSRC_DIR)/META-INF/providers && \
 	    p=""; \
 	    impl=""; \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/gensrc/Gensrc-jdk.internal.vm.compiler.management.gmk	Thu Nov 08 15:19:14 2018 -0800
@@ -0,0 +1,101 @@
+#
+# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+default: all
+
+include $(SPEC)
+include MakeBase.gmk
+
+GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)
+SRC_DIR := $(TOPDIR)/src/$(MODULE)/share/classes
+
+################################################################################
+
+PROC_SRC_SUBDIRS := \
+    org.graalvm.compiler.hotspot.management \
+    #
+
+PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
+
+PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
+
+ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
+SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))
+
+PROCESSOR_JARS := \
+    $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.serviceprovider.processor.jar \
+    #
+PROCESSOR_PATH := $(call PathList, $(PROCESSOR_JARS))
+
+$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS)
+	$(call MakeDir, $(@D))
+	$(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files))
+	$(JAVA) $(NEW_JAVAC) \
+	    -XDignore.symbol.file \
+	    --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
+	    -sourcepath $(SOURCEPATH) \
+	    -implicit:none \
+	    -proc:only \
+	    -processorpath $(PROCESSOR_PATH) \
+	    -d $(GENSRC_DIR) \
+	    -s $(GENSRC_DIR) \
+	    @$(@D)/_gensrc_proc_files
+	$(TOUCH) $@
+
+TARGETS += $(GENSRC_DIR)/_gensrc_proc_done
+
+################################################################################
+
+$(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done
+	$(ECHO) "" > $@;
+	($(CD) $(GENSRC_DIR)/META-INF/providers && \
+	    p=""; \
+	    impl=""; \
+	    for i in $$($(GREP) '^' * | $(SORT) -t ':' -k 2 | $(SED) 's/:.*//'); do \
+	      c=$$($(CAT) $$i | $(TR) -d '\n\r'); \
+	      if test x$$p != x$$c; then \
+                if test x$$p != x; then \
+	          $(ECHO) "    ;" >> $@; \
+	        fi; \
+	        $(ECHO) "provides $$c with" >> $@; \
+                p=$$c; \
+	        impl=""; \
+	      fi; \
+              if test x$$impl != x; then \
+	        $(ECHO) "  , $$i" >> $@; \
+              else \
+	        $(ECHO) "    $$i" >> $@; \
+              fi; \
+              impl=$$i; \
+	    done); \
+	$(ECHO) "    ;" >> $@;
+
+TARGETS += $(GENSRC_DIR)/module-info.java.extra
+
+################################################################################
+
+all: $(TARGETS)
+
+.PHONY: default all