Re: RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v7]

2020-12-07 Thread Erik Joelsson
On Sat, 5 Dec 2020 01:13:34 GMT, Magnus Ihse Bursie  wrote:

>> For the build to work on Windows, we need a unix compatibility layer (known 
>> as the "winenv" in the build system). This can be e.g. Cygwin or Msys. The 
>> build system then needs to adapt various aspect to get the build to work in 
>> this winenv. Over time, our current solutions (which were never that 
>> well-designed) has collapsed into an unmaintainable mess.
>> 
>> This rewrite takes on a fresh approach, by giving up on the native 
>> "fixpath.exe" converter, and instead relying on a platform-independent shell 
>> script "fixpath.sh", which can dynamically adapt to the current winenv. It 
>> also provides a proper framework on how to categorize, and support, 
>> different winenvs. As a result, we now easily support Cygwin, Msys2, WSL1 
>> and WSL2 (the latter is unfortunately not mature enough to be able to 
>> compile the JDK).
>> 
>> Furthermore, this rewrite removes all the kludges and hacks that were put in 
>> place all over the code base, and consolidates all tricky part of handling 
>> the winenv to basically two places: setting up in configure, and run-time 
>> handling by fixpath.sh.
>> 
>> This patch also cleans up our handling of how we detect tools in configure, 
>> and makes a proper framework for cross-compilation on Windows.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Extract only the actual contents added to the PATH by VS SetEnv.cmd.

Marked as reviewed by erikj (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/1597


Re: RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v7]

2020-12-07 Thread Bernhard Urban-Forster
On Sat, 5 Dec 2020 01:13:34 GMT, Magnus Ihse Bursie  wrote:

>> For the build to work on Windows, we need a unix compatibility layer (known 
>> as the "winenv" in the build system). This can be e.g. Cygwin or Msys. The 
>> build system then needs to adapt various aspect to get the build to work in 
>> this winenv. Over time, our current solutions (which were never that 
>> well-designed) has collapsed into an unmaintainable mess.
>> 
>> This rewrite takes on a fresh approach, by giving up on the native 
>> "fixpath.exe" converter, and instead relying on a platform-independent shell 
>> script "fixpath.sh", which can dynamically adapt to the current winenv. It 
>> also provides a proper framework on how to categorize, and support, 
>> different winenvs. As a result, we now easily support Cygwin, Msys2, WSL1 
>> and WSL2 (the latter is unfortunately not mature enough to be able to 
>> compile the JDK).
>> 
>> Furthermore, this rewrite removes all the kludges and hacks that were put in 
>> place all over the code base, and consolidates all tricky part of handling 
>> the winenv to basically two places: setting up in configure, and run-time 
>> handling by fixpath.sh.
>> 
>> This patch also cleans up our handling of how we detect tools in configure, 
>> and makes a proper framework for cross-compilation on Windows.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Extract only the actual contents added to the PATH by VS SetEnv.cmd.

Tested the cross compilation bits with a win-aarch64 build from win-x86_64:
- Cygwin: `--openjdk-target=aarch64-unknown-cygwin 
--with-boot-jdk=/cygdrive/c/work/jdk-16+22`
- WSL1: `--openjdk-target=aarch64-unknown-cygwin 
--with-boot-jdk=/mnt/c/work/jdk-16+22`

And smoke tested each one on win-aarch64 with `jtreg:tier1_compiler_1`.


Cosmetic: I get a bunch of warnings for non-existing paths in `$PATH` during 
configure on the wsl1 build, e.g.:
configure: Setting extracted environment variables for x86_64



I'll give the "native compilation" on win-aarch64 a try again when this change 
has landed. Some bits (e.g. config.guess) required for it have made it into 
this PR, but some things are still missing (e.g. choose x86 binaries for MSVC, 
since no native bits are available for MSVC).

Thank you for the hard work on this!

make/autoconf/toolchain_microsoft.m4 line 632:

> 630:   [path to Microsoft Windows Kit UCRT DLL dir (Windows only) 
> @<:@probed@:>@])])
> 631: 
> 632:   if test "x$USE_UCRT" = "xtrue" && test "x$OPENJDK_TARGET_CPU" != 
> xaarch64; then

👍

-

Marked as reviewed by burban (Author).

PR: https://git.openjdk.java.net/jdk/pull/1597


Re: RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v7]

2020-12-07 Thread Bernhard Urban-Forster
On Sat, 5 Dec 2020 01:13:34 GMT, Magnus Ihse Bursie  wrote:

>> For the build to work on Windows, we need a unix compatibility layer (known 
>> as the "winenv" in the build system). This can be e.g. Cygwin or Msys. The 
>> build system then needs to adapt various aspect to get the build to work in 
>> this winenv. Over time, our current solutions (which were never that 
>> well-designed) has collapsed into an unmaintainable mess.
>> 
>> This rewrite takes on a fresh approach, by giving up on the native 
>> "fixpath.exe" converter, and instead relying on a platform-independent shell 
>> script "fixpath.sh", which can dynamically adapt to the current winenv. It 
>> also provides a proper framework on how to categorize, and support, 
>> different winenvs. As a result, we now easily support Cygwin, Msys2, WSL1 
>> and WSL2 (the latter is unfortunately not mature enough to be able to 
>> compile the JDK).
>> 
>> Furthermore, this rewrite removes all the kludges and hacks that were put in 
>> place all over the code base, and consolidates all tricky part of handling 
>> the winenv to basically two places: setting up in configure, and run-time 
>> handling by fixpath.sh.
>> 
>> This patch also cleans up our handling of how we detect tools in configure, 
>> and makes a proper framework for cross-compilation on Windows.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Extract only the actual contents added to the PATH by VS SetEnv.cmd.

make/autoconf/boot-jdk.m4 line 66:

> 64: if test "x$BOOT_JDK_FOUND" = xmaybe; then
> 65:   # Do we have a bin/java?
> 66:   if test ! -x "$BOOT_JDK/bin/java" && test ! -x 
> "$BOOT_JDK/bin/java.exe"; then

`BOOTJDK_CHECK_BUILD_JDK` also needs those updates I believe

-

PR: https://git.openjdk.java.net/jdk/pull/1597


Re: RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v7]

2020-12-04 Thread Magnus Ihse Bursie
> For the build to work on Windows, we need a unix compatibility layer (known 
> as the "winenv" in the build system). This can be e.g. Cygwin or Msys. The 
> build system then needs to adapt various aspect to get the build to work in 
> this winenv. Over time, our current solutions (which were never that 
> well-designed) has collapsed into an unmaintainable mess.
> 
> This rewrite takes on a fresh approach, by giving up on the native 
> "fixpath.exe" converter, and instead relying on a platform-independent shell 
> script "fixpath.sh", which can dynamically adapt to the current winenv. It 
> also provides a proper framework on how to categorize, and support, different 
> winenvs. As a result, we now easily support Cygwin, Msys2, WSL1 and WSL2 (the 
> latter is unfortunately not mature enough to be able to compile the JDK).
> 
> Furthermore, this rewrite removes all the kludges and hacks that were put in 
> place all over the code base, and consolidates all tricky part of handling 
> the winenv to basically two places: setting up in configure, and run-time 
> handling by fixpath.sh.
> 
> This patch also cleans up our handling of how we detect tools in configure, 
> and makes a proper framework for cross-compilation on Windows.

Magnus Ihse Bursie has updated the pull request incrementally with one 
additional commit since the last revision:

  Extract only the actual contents added to the PATH by VS SetEnv.cmd.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1597/files
  - new: https://git.openjdk.java.net/jdk/pull/1597/files/41cee7d1..ef81e1f9

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1597&range=06
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1597&range=05-06

  Stats: 8 lines in 2 files changed: 7 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1597.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1597/head:pull/1597

PR: https://git.openjdk.java.net/jdk/pull/1597