RFR: 8257679: Improved unix compatibility layer in Windows build (winenv) [v2]
Jorn Vernee
jvernee at openjdk.java.net
Thu Dec 3 23:01:55 UTC 2020
On Thu, 3 Dec 2020 22:52:57 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Hey,
>>
>> Since I often work on Windows I'm taking this for a spin, but the current patch fails during `configure` for me with:
>>
>> configure: Using default toolchain microsoft (Microsoft Visual Studio)
>> configure: Found Visual Studio installation at /cygdrive/j/progra~2/micros~1/2019/community/ using --with-tools-dir
>> configure: Found Microsoft Visual Studio 2019
>> configure: Trying to extract Visual Studio environment variables for x86_64
>> configure: using /cygdrive/j/progra~2/micros~1/2019/community//vc/auxiliary/build/vcvarsx86_amd64.bat
>> configure: Setting extracted environment variables for x86_64
>> fixpath: failure: Directory containing path 'usr\local\bin' does not exist
>> checking that Visual Studio variables have been correctly extracted... ok
>> checking for cl... [not found]
>> configure: error: Could not find a C compiler.
>> configure exiting with result code 1
>>
>> I think this is because I have my VS installation in a non-default directory passed to `--with-tools-dir`. This is the configure command:
>>
>> bash configure \
>> --with-conf-name=windows-release \
>> --with-boot-jdk='/cygdrive/c/Program Files/Java/jdk-15' \
>> --with-jtreg=/cygdrive/h/libs/jtreg-5.1-b01/ \
>> --with-tools-dir='J:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools' \
>> --with-toolchain-version=2019 \
>> --with-jmh=/cygdrive/h/libs/jmh
>>
>> (Note that `--with-tools-dir` requires a Windows path for some reason, otherwise configure complains that the VS installation is not valid).
>>
>> ---
>>
>> Cross-compiling to Linux with WSL works with:
>>
>> bash configure \
>> --build=x86_64-unknown-linux-gnu \
>> --host=x86_64-unknown-linux-gnu \
>> --with-jtreg=/mnt/h/libs/jtreg-5.1-b01 \
>> --with-conf-name=linux-release \
>> --with-boot-jdk=/usr/lib/jvm/jdk-15 \
>> --with-jmh=/mnt/h/libs/jmh
>>
>> But trying to configure for Windows on WSL with:
>>
>> bash configure \
>> --with-conf-name=windows-release-wsl \
>> --with-boot-jdk='/mnt/c/Program Files/Java/jdk-15' \
>> --with-jtreg=/mnt/h/libs/jtreg-5.1-b01/ \
>> --with-tools-dir='J:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools' \
>> --with-toolchain-version=2019 \
>> --with-jmh=/mnt/h/libs/jmh
>>
>> Fails with:
>>
>> configure: Found potential Boot JDK using configure arguments
>> configure: Potential Boot JDK found at /mnt/c/Program Files/Java/jdk-15 is not a working JDK; ignoring
>> configure: Output from java -version was: /mnt/h/cygwin64/home/Jorn/cygwin-projects-new/git-jdk2/build/.configure-support/generated-configure.sh: line 56895: -version: command not found
>> configure: error: The path given by --with-boot-jdk does not contain a valid Boot JDK
>> configure exiting with result code 1
>>
>> This is not a configuration I normally use though. Since I've had problems with WSL I usually use Cygwin, so the configure command might not be right (am I missing a target platform flag here? According to the build docs Windows is the default).
>>
>> (I'll continue investigating as well)
>
> @JornVernee Thanks for your feedback! I'll have a closer look at your examples, and see if I can reproduce them in my own environment. One question, your first example, was this from a Cygwin environment?
>
> As a general comment, the idea is that paths to configure options should be in "unix" style. If that is not accepted, it is a bug. (Otoh, I try hard to be tolerant and accept Windows style or mixed-style ("c:/windows") paths as well, but this is not guaranteed to work.)
@magicus Ah dang, I tested passing `--with-tools-dir` a unix path before but messed up the drive letter. So, passing unix path to `--with-tools-dir` works after all (though IIRC this wasn't the case in the past).
-------------
PR: https://git.openjdk.java.net/jdk/pull/1597
More information about the hotspot-compiler-dev
mailing list