RFR: JDK-8189094: Change required boot jdk to JDK 9

Erik Joelsson erik.joelsson at oracle.com
Wed Oct 18 09:29:08 UTC 2017


New webrev again: http://cr.openjdk.java.net/~erikj/8189094/webrev.03/

Removed the ToolProvider patching.

Changed build/tools/symbolgenerator/TransitiveDependencies.java to use 
JavacTool directly.

Changed Gendata-jdk.compiler.gmk to just use INTERIM_LANGTOOLS_ARGS 
instead of listing a separate set of arguments for compilation.

/Erik


On 2017-10-18 10:18, Erik Joelsson wrote:
> Hello,
>
>
> On 2017-10-17 19:54, mandy chung wrote:
>> On 10/17/17 10:44 AM, Jan Lahoda wrote:
>>> The problematic part is TransitiveDependencies, right?
>>>
>>> Might be easier to replace:
>>> JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
>>> with:
>>> JavaCompiler compiler = JavacTool.create();
>>>
>>> (import com.sun.tools.javac.api.JavacTool;)
>>>
>>> That should avoid the ServiceLoader lookup.
>>>
>>
> I can try this instead of patching ToolProvider.
>> Worth trying this and  I think this needs --limit-modules to hide 
>> jdk.compiler and other interim modules.
> Yes, --limit-modules is definitely needed and already used.
>>
>> Does this build tool just depend on javac?  Does it need all system 
>> modules to be observable?
>>
> I'm currently running it with the same arguments as when I run interim 
> javac and it works:
>
> --limit-modules 
> java.base,jdk.zipfs,java.compiler.interim,jdk.compiler.interim,jdk.jdeps.interim,jdk.javadoc.interim 
>
> --add-modules 
> java.compiler.interim,jdk.compiler.interim,jdk.jdeps.interim,jdk.javadoc.interim 
>
> --module-path 
> /localhome/hg/jdk10-boot9/build/linux-x64/buildtools/interim_modules
> --add-exports java.base/sun.reflect.annotation=jdk.compiler.interim
> --add-exports java.base/jdk.internal.util.jar=jdk.jdeps.interim
> --add-exports java.base/jdk.internal.misc=jdk.jdeps.interim
>
> Some of these may be unnecessary for this specific tool, but it is 
> certainly simpler from my point of view to just use the same set of 
> arguments instead of maintaining another set.
>
> /Erik
>> Mandy
>>
>>> Jan
>>>
>>> On 17.10.2017 19:04, mandy chung wrote:
>>>> It'd be simpler if we could avoid patching ToolProvider.   The ctsym
>>>> generator is a build tool.  Jan and Jon may have suggestion if the 
>>>> build
>>>> tool can find the compiler from the interim module instead and use
>>>> --limit-modules to java.base?
>>>>
>>>> Mandy
>>>>
>>>> On 10/17/17 8:55 AM, Erik Joelsson wrote:
>>>>>
>>>>> The ctsym generator in Gendata-jdk.compiler.gmk looks up the tool
>>>>> using the ToolProvider. That part of the change was just a 
>>>>> reaction to
>>>>> ctsym generation failing.
>>>>>
>>>>> /Erik
>>>>>
>>>>>
>>>>> On 2017-10-17 17:47, mandy chung wrote:
>>>>>> Hi Erik,
>>>>>>
>>>>>> On 10/16/17 6:12 AM, Erik Joelsson wrote:
>>>>>>>
>>>>>>> To generate the new modules, I copy the module-info.java files to a
>>>>>>> new gensrc dir and sed replace the module names. I also generate a
>>>>>>> new ToolProvider.java so that the default tools are taken from the
>>>>>>> interim modules.
>>>>>>>
>>>>>>> :
>>>>>>>
>>>>>>> Webrev: http://cr.openjdk.java.net/~erikj/8189094/webrev.01
>>>>>>
>>>>>> 65 java.compiler_EXTRA_FILES :=
>>>>>> $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java 
>>>>>>
>>>>>>
>>>>>> 66 TARGETS += $(java.compiler_EXTRA_FILES)
>>>>>>
>>>>>>
>>>>>> What issue did you run into without patching ToolProvider? I have
>>>>>> assumed
>>>>>> the build always launches javac/javadoc main class and not using
>>>>>> ToolProvider.
>>>>>>
>>>>>> 580 JAVAC_MAIN_CLASS = -m 
>>>>>> jdk.compiler.interim/com.sun.tools.javac.Main
>>>>>> 581 JAVADOC_MAIN_CLASS = -m
>>>>>> jdk.javadoc.interim/jdk.javadoc.internal.tool.Main Mandy
>>>>>
>>>>
>>
>




More information about the build-dev mailing list