On 2017-09-27 10:55, David Holmes wrote:
On 27/09/2017 6:30 PM, Magnus Ihse Bursie wrote:

The nashorn java code requires a somewhat convoluted compilation. As a result, we use a special java compiler setup, GENERATE_NEWBYTECODE_DEBUG. This explicitly lists -source 9 -target 9, which generates this warning:

warning: [options] bootstrap class path not set in conjunction with -source 1.9

when building in jdk10. I assume this is just a mistake, and that it should really target 10. (Or, to always be in sync, perhaps even $(VERSION_MAJOR)).

Seems like a reasonable assumption. Though one has to wonder why we even set the source/target? That would only be necessary if we needed to force building to an older level. I think these could just be removed.

Historically, we have told javac explicitly which source/target version to use, instead of relying on the default. (This is not the only place we have this hard-coded in.)

We should change this behavior. I've created https://bugs.openjdk.java.net/browse/JDK-8188015 to track this.

/Magnus




Cheers,
David


Bug: https://bugs.openjdk.java.net/browse/JDK-8188012
Patch inline:
diff --git a/make/BuildNashorn.gmk b/make/BuildNashorn.gmk
--- a/make/BuildNashorn.gmk
+++ b/make/BuildNashorn.gmk
@@ -41,7 +41,7 @@
  $(eval $(call SetupJavaCompiler, GENERATE_NEWBYTECODE_DEBUG, \
      JVM := $(JAVA_JAVAC), \
      JAVAC := $(NEW_JAVAC), \
-    FLAGS := -g -source 9 -target 9 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \ +    FLAGS := -g -source 10 -target 10 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \            --system none --module-source-path $(call GetModuleSrcPath), \
      SERVER_DIR := $(SJAVAC_SERVER_DIR), \
      SERVER_JVM := $(SJAVAC_SERVER_JAVA)))

/Magnus

Reply via email to