MinGW_MSYS_jdk (original) (raw)

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.shand 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 cygpathand 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 cpioso 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