RFR: JDK-8241463 Move build tools to respective modules

Mandy Chung mandy.chung at oracle.com
Mon Mar 23 20:19:13 UTC 2020


Hi Magnus,

Modularizing the build tools is a good move.    This patch suggests to 
place the build tools under
     src/$MODULE/share/tools/$PACKAGE/*.java

I think the modular source location of the build tools needs more 
discussion, including jigsaw-dev for this discussion.

The JDK source as specified in JEP 201 is under:
     src/$MODULE/{share,$OS}/classes/$PACKAGE/*.java

Compiling the source files from the `src` directory are the intermediate 
input to build the resulting image.    Build tools are used to generate 
additional intermediate input (that is not part of the `src` directory) 
to build the image.   So I wonder if make/$MODULE/share/tools or 
make/tools/$MODULE  may be better location for the build tools.

Mandy

On 3/23/20 12:03 PM, Magnus Ihse Bursie wrote:
> The build tools (small java tools that are run during the build to 
> generate source code, or data, needed in the JDK) have historically 
> been placed in the "make" directory. This maybe made sense long time 
> ago, but does not do so anymore.
>
> Instead, the build tools source code should move the the module that 
> needs them. For instance, compilefontconfig should move to 
> java.desktop, etc.
>
> There are multiple reasons for this:
>
> * Currently we build *all* build tools at once, which mean that we 
> cannot compile java.base until e.g. the compilefontconfig tool is 
> compiled, even though it is not needed.
>
> * If a build tool, e.g. compilefontconfig is modified, all build tools 
> are recompiled, which triggers a rebuild of more or less the entire 
> JDK. This makes development of the build tools unnecessary tedious.
>
> * When the build tools are modified, the group owning the 
> corresponding module is the proper review instance, not the build 
> team. But since they reside under "make", the review mails often 
> include build-dev, but this is mostly noise for us. With this move, 
> the ownership is made clear.
>
> In this patch, I have not modified how and when the build tools are 
> compiled, but this shuffle is the prerequisite for continuing with 
> that in a follow-up patch.
>
> I have also moved the build tools to the org.openjdk.buildtools.* 
> package name space (inspired by Skara), instead of the strangely named 
> build.tools.* name space.
>
> A few build tools are not moved in this patch. Two of them, 
> charsetmapping and cldrconverter, are shared between two modules. (I 
> think they should move to modules nevertheless, but they need some 
> more thought to make sure I do this right.) The rest are tools that 
> are needed for the build in general, like linking or javadoc support. 
> I'll move this to a better location too, but in a separate patch.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8241463
> WebRev: 
> http://cr.openjdk.java.net/~ihse/JDK-8241463-move-build-tools-to-modules/webrev.01
>
> /Magnus
>



More information about the jigsaw-dev mailing list