Code Review for MinGW_MSYS_jdk

Prepared by:Volker H. Simonis on Thu Mar 8 18:20:34 CET 2012
Contributed by:volker.simonis@gmail.com
Workspace:/share/software/Java/OpenJDK/jdk8_build/jdk
Compare against: http://hg.openjdk.java.net/jdk8/build/jdk
Compare against version:5068
Summary of changes: 226 lines changed: 115 ins; 25 del; 86 mod; 6210 unchg
Patch of changes: MinGW_MSYS_jdk.patch
Author comments:

This is the jdk repository part of the "Enable OpenJDK builds on Windows with MinGW/MSYS" change.

I tested full OpenJDK 8 product and debug builds on Windows with MKS, Cygwin and MinGW/MSYS. To avoid regressions I also did product and debug builds on Solaris10/amd64 without any problems.

The patch mainly replaces forward slash style options (e.g. /NOLOG) for calls to Windows programs with their corresponding dash form (e.g -NOLOG) and backslash path separators with forward path separators (or prevents the replacement of forward path separators with backslash path separators if this was not necessary).

The build now automatically detects if it runs inside a MinGW/MSYS shell (by parsing the output of the uname command) and sets the new variable USING_MINGW to true. I also introduced a new variable USING_MKS to simplify the conditional make file logic (until now, !USING_CYGWIN implicitly meant that we're inside an MKS environment, but that's now not the case anymore).

MinGW/MSYS has no utility which converts a path name into the corresponding short "8.3" version like the Cygwin (cygpath) or MKS (dosname) tools. I therefore added the two scripts make/tools/mingw_build_scripts/dospath.sh and make/tools/mingw_build_scripts/dospath.vbs which do the job. The first one is just a shell script wrapper for the second one which is a three line Visual Basic Script. The Visual Basic Script is executed through the Windows Script Host (by calling cscript.exe) which is installed by default on Windows since Windows 98.

I noticed that dospath (or cygpath and dosname for the Cygwin and MKS build) are called more than 4000 times during a full product build. Improving the speed of these utilities can therefore improve the overall build speed considerably. I also think it is not really necessary to convert path names that often during a build. However I haven't investigated this topic in full detail and hopefully the new build infrastructure will significantly decrease the amount of path conversions with these utilities.

The only change which affects other build platforms is the complete replacement of cpio with tar. cpio was only used in three places to copy directory tries with preserved file attributes. The problem with cpio was that there is no native MinGW/MSYS version available and the current MKS version of cpio has a bug which prevents it from copying read-only files (this is tracked under the bug id "CFS# 32408--- cpio can not handle files which are ReadOnly" by MKS, although there is no public bug tracker available). Moreover there are already several places in the JDK build which already use tar instead of cpio so I thought removing one more build dependency isn't that bad anyway.

Below you can find some timing results for the different build environments (MKS ver. 9.4, Cygwin ver. 1.7.9, MinGW/MSYS 1.0.17) for a full JDK 8 product build on a freshly booted, dual core i7 notebook with 8GB RAM and 64-bit Windows 7:

MKS
-- Build times ----------
Target all_product_build
Start 2012-02-29 19:19:26
End   2012-02-29 20:07:44
00:03:10 corba
00:03:44 hotspot
00:00:30 jaxp
00:00:37 jaxws
00:39:39 jdk
00:00:36 langtools
00:48:18 TOTAL
-------------------------
MinGW/MSYS
-- Build times ----------
Target all_product_build
Start 2012-02-29 18:16:31
End   2012-02-29 19:10:59
00:02:57 corba
00:03:04 hotspot
00:00:32 jaxp
00:00:40 jaxws
00:46:36 jdk
00:00:36 langtools
00:54:28 TOTAL
-------------------------
Cygwin
-- Build times ----------
Target all_product_build
Start 2012-02-29 14:36:50
End   2012-02-29 16:05:50
00:05:47 corba
00:03:24 hotspot
00:00:33 jaxp
00:00:43 jaxws
01:17:45 jdk
00:00:39 langtools
01:29:00 TOTAL
-------------------------
Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/com/sun/java/pack/Makefile

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
4 lines changed: 0 ins; 0 del; 4 mod; 178 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/Defs-windows.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
9 lines changed: 0 ins; 0 del; 9 mod; 410 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/Demo.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
3 lines changed: 0 ins; 0 del; 3 mod; 407 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/Library.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
3 lines changed: 0 ins; 0 del; 3 mod; 307 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/Program.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
5 lines changed: 0 ins; 0 del; 5 mod; 274 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/Release.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
27 lines changed: 0 ins; 23 del; 4 mod; 1335 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/shared/Defs-utils.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
11 lines changed: 7 ins; 1 del; 3 mod; 218 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/shared/Defs-windows.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
67 lines changed: 19 ins; 1 del; 47 mod; 671 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/shared/Platform.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
9 lines changed: 9 ins; 0 del; 0 mod; 463 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/shared/Sanity-Settings.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
7 lines changed: 5 ins; 0 del; 2 mod; 264 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/common/shared/Sanity.gmk

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
2 lines changed: 0 ins; 0 del; 2 mod; 1595 unchg

Cdiffs Udiffs Sdiffs Frames Old New Patch Raw make/tools/freetypecheck/Makefile

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
4 lines changed: 0 ins; 0 del; 4 mod; 88 unchg

------ ------ ------ ------ --- New Patch Raw make/tools/mingw_build_scripts/dospath.sh

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
42 lines changed: 42 ins; 0 del; 0 mod; 0 unchg

------ ------ ------ ------ --- New Patch Raw make/tools/mingw_build_scripts/dospath.vbs

rev 5069 : Enable OpenJDK builds on Windows with MinGW/MSYS
33 lines changed: 33 ins; 0 del; 0 mod; 0 unchg

This code review page was prepared using /sapmnt/home1/d046063/webrev.ksh (vers 23.18-hg).