Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

Mandy Chung
Moving this to jigsaw-dev....

On 12/6/17 8:38 AM, Adam Farley8 wrote:
> Hi All,
>
> Currently, GenModuleInfoSource.java does not allow you to merge extra
> module-info files into the primary module-info file (for a given module)
> at build time.

This tool intends to augment platform-specific
exports/opens/uses/provides but not requires.  It was a design choice we
made that JDK modules are expected to have the same dependences for all
platforms.
> Put simply; I think it should have this functionality. Can committers
> please review and opine?

Can you explain why you want the module dependences be different on
different platform?  Is it an option to add the requires
src/<module>/share/classes/module-info.java ?

The build generates the target dependences based on the requires from
module-info.java.   At the moment it does not take
module-info.java.extra into account AFAIU.

Mandy
Reply | Threaded
Open this post in threaded view
|

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

Mandy Chung
Can you send some example module-info.java & .extra files and source
location that shows what functionality you depend on?

Mandy

On 12/7/17 4:20 AM, Adam Farley8 wrote:

> Update: OpenJ9 appears to need this functionality.
>
> Best Regards
>
> Adam Farley
>
>
>
> From: Adam Farley8/UK/IBM
> To: mandy chung <[hidden email]>
> Cc: [hidden email]
> Date: 07/12/2017 12:14
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
> Hi Mandy,
>
> I don't believe anyone should need the "requires" to be different on
> different platforms, however the logic in there can be used for
> merging additional requires supplied by new components (like OpenJ9).
>
> I'm exploring whether or not OpenJ9 can live without the extra
> "requires" right now.
>
> If it does, or if this feature is needed by someone else, I can't
> think of a better place to keep this logic. Any thoughts?
>
> Best Regards
>
> Adam Farley
>
>
>
>
> From: mandy chung <[hidden email]>
> To: Adam Farley8 <[hidden email]>
> Cc: [hidden email]
> Date: 06/12/2017 18:51
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
>
> Moving this to jigsaw-dev....
>
> On 12/6/17 8:38 AM, Adam Farley8 wrote:
> Hi All,
>
> Currently, GenModuleInfoSource.java does not allow you to merge extra
> module-info files into the primary module-info file (for a given module)
> at build time.
>
>
> This tool intends to augment platform-specific
> exports/opens/uses/provides but not requires.  It was a design choice
> we made that JDK modules are expected to have the same dependences for
> all platforms.
>
> Put simply; I think it should have this functionality. Can committers
> please review and opine?
>
> Can you explain why you want the module dependences be different on
> different platform?  Is it an option to add the requires
> src/<module>/share/classes/module-info.java ?
>
> The build generates the target dependences based on the requires from
> module-info.java. At the moment it does not take
> module-info.java.extra into account AFAIU.
>
> Mandy
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

Mandy Chung
In reply to this post by Mandy Chung
Hi Adam,

java.management should not require java.logging. PlatformLoggingMXBean
is registered to the platform MBeanServer only if java.logging is
present in the runtime.  This is detected dynamically [1].  I would
recommend to replace the static dependencies to java.util.logging using
similar approach as
DefaultPlatformMBeanProvider.

Hope this helps.
Mandy
[1]
http://hg.openjdk.java.net/jdk/jdk/file/tip/src/java.management/share/classes/java/lang/management/DefaultPlatformMBeanProvider.java#l358

On 12/7/17 8:35 AM, Adam Farley8 wrote:

> P.S. I did some digging, and it seems that though OpenJ9 has several
> .extra files, only one appears to have a "requires" entry. It's the
> one I mentioned below.
>
> A search for "java.util.logging" (the "requires" module's package)
> reveals three classes inside that directory that use it:
>
> - com/ibm/java/lang/management/internal/ManagementUtils.java
> - com/ibm/java/lang/management/internal/LoggingMXBeanImpl.java
> - java/lang/management/PlatformLoggingMXBean.java
>
> Ideally it'd be good to keep this functionality in these classes.
>
> Best Regards
>
> Adam Farley
>
>
>
> From: Adam Farley8/UK/IBM
> To: mandy chung <[hidden email]>
> Cc: [hidden email]
> Date: 07/12/2017 16:25
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
> Hi Mandy,
>
> Sure. Here's an example of a module-info file, and the .extra file
> that gets merged with it:
>
> https://github.com/ibmruntimes/openj9-openjdk-jdk9/blob/openj9/jdk/src/java.management/share/classes/module-info.java 
>
> https://github.com/eclipse/openj9/blob/master/jcl/src/java.management/share/classes/module-info.java.extra 
>
>
> Note that the former is simple a clone of most of JDK9 (sans hotspot),
> with the addition of a handful of changes to make it fit with OpenJ9.
> That module-info.java file was not changed.
>
> If you'd like to see the build in action (complete with module-info
> merging), go here:
>
> https://www.eclipse.org/openj9/oj9_build.html
>
> That contains instructions to build with OpenJ9 for JDK8 and JDK9 (the
> toggle is on the top-left of the screen).
>
> Prebuilt binaries can be found at the AdoptOpenJDK website.
>
> Best Regards
>
> Adam Farley
>
>
>
>
> From: mandy chung <[hidden email]>
> To: Adam Farley8 <[hidden email]>
> Cc: [hidden email]
> Date: 07/12/2017 16:12
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
>
> Can you send some example module-info.java & .extra files and source
> location that shows what functionality you depend on?
>
> Mandy
>
> On 12/7/17 4:20 AM, Adam Farley8 wrote:
> Update: OpenJ9 appears to need this functionality.
>
> Best Regards
>
> Adam Farley
>
>
>
> From: Adam Farley8/UK/IBM
> To: mandy chung _<[hidden email]>_ <mailto:[hidden email]>
> Cc: [hidden email].net_ <mailto:[hidden email]>
> Date: 07/12/2017 12:14
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
> Hi Mandy,
>
> I don't believe anyone should need the "requires" to be different on
> different platforms, however the logic in there can be used for
> merging additional requires supplied by new components (like OpenJ9).
>
> I'm exploring whether or not OpenJ9 can live without the extra
> "requires" right now.
>
> If it does, or if this feature is needed by someone else, I can't
> think of a better place to keep this logic. Any thoughts?
>
> Best Regards
>
> Adam Farley
>
>
>
>
> From: mandy chung _<[hidden email]>_
> <mailto:[hidden email]>
> To: Adam Farley8 _<[hidden email]>_
> <mailto:[hidden email]>
> Cc: [hidden email].net_ <mailto:[hidden email]>
> Date: 06/12/2017 18:51
> Subject: Re: Proposal for New Functionality: Allow module-info merging
> in GenModuleInfoSource.java
> ------------------------------------------------------------------------
>
>
>
> Moving this to jigsaw-dev....
>
> On 12/6/17 8:38 AM, Adam Farley8 wrote:
> Hi All,
>
> Currently, GenModuleInfoSource.java does not allow you to merge extra
> module-info files into the primary module-info file (for a given module)
> at build time.
>
>
> This tool intends to augment platform-specific
> exports/opens/uses/provides but not requires.  It was a design choice
> we made that JDK modules are expected to have the same dependences for
> all platforms.
>
> Put simply; I think it should have this functionality. Can committers
> please review and opine?
>
> Can you explain why you want the module dependences be different on
> different platform?  Is it an option to add the requires
> src/<module>/share/classes/module-info.java ?
>
> The build generates the target dependences based on the requires from
> module-info.java. At the moment it does not take
> module-info.java.extra into account AFAIU.
>
> Mandy
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
> 3AU
>
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
>
>
>
> Unless stated otherwise above:
> IBM United Kingdom Limited - Registered in England and Wales with
> number 741598.
> Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

Alan Bateman
In reply to this post by Mandy Chung


On 06/12/2017 18:51, mandy chung wrote:

> Moving this to jigsaw-dev....
>
> On 12/6/17 8:38 AM, Adam Farley8 wrote:
>> Hi All,
>>
>> Currently, GenModuleInfoSource.java does not allow you to merge extra
>> module-info files into the primary module-info file (for a given module)
>> at build time.
>
> This tool intends to augment platform-specific
> exports/opens/uses/provides but not requires.  It was a design choice
> we made that JDK modules are expected to have the same dependences for
> all platforms.
Right, more specifically the `requires transitive` should never be
different.

If there is use-case where the implementation is so different that it
needs `requires` in the .extra file then it can be done but the
augmenting would need to be done before the build computes the ordering
that the modules are compiled (the modules are compiled in reserve
topological order as Mandy knows).

-Alan
Reply | Threaded
Open this post in threaded view
|

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

Adam Farley8
In reply to this post by Mandy Chung
Hi Alan,

After discussing the matter with Mandy, we agreed that the next step to
resolve this issue should be to remove the need for this functionality in
OpenJ9.

My reply didn't reach the list because it was rejected (posting blocked
for
nonsubscribers). This has since been resolved.

Thanks for your time. :)

Best Regards

Adam Farley



From:   Alan Bateman <[hidden email]>
To:     Adam Farley8 <[hidden email]>
Cc:     mandy chung <[hidden email]>, [hidden email]
Date:   11/12/2017 15:27
Subject:        Re: Proposal for New Functionality: Allow module-info
merging in GenModuleInfoSource.java





On 06/12/2017 18:51, mandy chung wrote:
> Moving this to jigsaw-dev....
>
> On 12/6/17 8:38 AM, Adam Farley8 wrote:
>> Hi All,
>>
>> Currently, GenModuleInfoSource.java does not allow you to merge extra
>> module-info files into the primary module-info file (for a given
module)
>> at build time.
>
> This tool intends to augment platform-specific
> exports/opens/uses/provides but not requires.  It was a design choice
> we made that JDK modules are expected to have the same dependences for
> all platforms.
Right, more specifically the `requires transitive` should never be
different.

If there is use-case where the implementation is so different that it
needs `requires` in the .extra file then it can be done but the
augmenting would need to be done before the build computes the ordering
that the modules are compiled (the modules are compiled in reserve
topological order as Mandy knows).

-Alan





Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU