bash configure: result from running a microsoft compiler was empty string

Vitaly Provodin vitaly.provodin at jetbrains.com
Fri Apr 12 10:41:27 UTC 2019


Hello Erik,

I ran configure with this patch. Please note two ways launching WSL were exercised:

1. WSL (ubnutu in my case) was started from Command Prompt (%windir%\system32\cmd.exe)
in this way configure successfully completed

2. WSL was started directly (typed ubuntu in the search box and choose ubuntu on the top.)
in this way configure failed

I compared PATH in these two cases, they differ by the path /mnt/c/Users/vprovodin/.dnx/bin
The  first one contained this path while the second one did not


All,

Then I found the causes of all my issues:
1) I had the old source snapshot of OpenJDK
2) Initially I built specifying jdk-11.0.2 as with-boot-jdk

After fetching recent sources it works well with the following cmds:

$ ./configure --with-boot-jdk=/mnt/c/Tools/Java/jdk-12 --with-toolchain-version=2017
$ make CONF=windows-x86_64-server-release images

Thanks to all
Vitaly

> On 10 Apr 2019, at 20:57, Erik Joelsson <erik.joelsson at oracle.com> wrote:
> 
> Hello Vitaly,
> 
> When configure fails recognize the version of CL it usually means that either CL didn't launch correctly or that a non English locale is used so we don't recognize the output. In this case, since the recorded output is empty, I'm guessing the former. The failing wslpath line could be a lead. Perhaps we fail to put together a functioning PATH variable when extracting the Visual Studio environment from vsvars*.bat.
> 
> Could you try again with this patch so we can see what the PATH is set to?
> 
> diff -r a84fefde0543 make/autoconf/toolchain.m4
> --- a/make/autoconf/toolchain.m4
> +++ b/make/autoconf/toolchain.m4
> @@ -357,6 +357,7 @@
>        # for using basic Unix tools, so need to keep the original PATH.
>        BASIC_APPEND_TO_PATH(PATH, $VS_PATH)
>        BASIC_APPEND_TO_PATH(WSLENV, "PATH/l:LIB:INCLUDE")
> +      $ECHO "PATH=$PATH"
>        export WSLENV
>      else
>        # Reset path to VS_PATH. It will include everything that was on PATH at the time we
> 
> /Erik
> 
> On 2019-04-10 01:36, Vitaly Provodin wrote:
>> HI David, Andrew,
>> 
>> Thanks for the reply
>> 
>> I ran /mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe directly, it produced the following log:
>> 
>> $ /mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
>> Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27030.1 for x64
>> Copyright (C) Microsoft Corporation.  All rights reserved.
>> 
>> usage: cl [ option... ] filename... [ /link linkoption… ]
>> 
>> 
>> Andrew,
>> 
>> Thanks for providing me with the link to the actual doc. Now this command looks like:
>> 
>> bash ./configure --with-boot-jdk=/mnt/c/Tools/Java/jdk-11.0.2 --with-toolchain-version=2017
>> 
>> But the result the same :^(
>> Please note I ran it in the clean environment that means I did not set any env variables.
>> 
>> Suspicious lines in log:
>> checking for Boot JDK... /mnt/c/Tools/Java/jdk-11.0.2
>> checking Boot JDK version... java version "11.0.2" 2019-01-15 LTS  Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)  Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
>> checking for java.exe in Boot JDK... ok
>> checking for javac.exe in Boot JDK... ok
>> checking for javadoc.exe in Boot JDK... ok
>> checking for jar.exe in Boot JDK... ok
>> checking for jarsigner.exe in Boot JDK... ok
>> checking if Boot JDK is 32 or 64 bits... 64
>> checking for local Boot JDK Class Data Sharing (CDS)... no, creation failed
>> 
>> Not sure whether it can be ignored that CDS creation failed
>> more log
>> 
>> configure: Rewriting path to "/mnt/c/Windows/System32/OpenSSH"
>> configure: Rewriting path to "/mnt/c/cygwin64/bin"
>> /bin/wslpath: C:\WINDOWS\system32\config\systemprofile\.dnx\bin: Permission denied
>> configure: Rewriting path to "/mnt/c/PROGRA~1/MICROS~2/Dnvm"
>> 
>> and at the end
>> 
>> configure: Will use user supplied compiler CC=/mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
>> checking resolved symbolic links for CC... no symlink
>> configure: The C compiler (located as /mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe) does not seem to be the required microsoft compiler.
>> configure: The result from running it was: ""
>> configure: error: A microsoft compiler is required. Try setting --with-tools-dir.
>> configure exiting with result code 1
>> 
>> Thanks,
>> Vitaly
>> 
>>> On 10 Apr 2019, at 13:32, Andrew Luo <andrewluotechnologies at outlook.com> wrote:
>>> 
>>> Hi Vitaly,
>>> 
>>> Those instructions are out of date, just my original proposed patch.  What we eventually ended up committing is much simpler.
>>> 
>>> See http://hg.openjdk.java.net/jdk/jdk/file/72f05350b4b3/doc/building.md for the latest instructions.
>>> 
>>> Thanks,
>>> 
>>> -Andrew
>>> 
>>> -----Original Message-----
>>> From: build-dev <build-dev-bounces at openjdk.java.net> On Behalf Of David Holmes
>>> Sent: Tuesday, April 9, 2019 10:25 PM
>>> To: Vitaly Provodin <vitaly.provodin at jetbrains.com>; build-dev at openjdk.java.net
>>> Subject: Re: bash configure: result from running a microsoft compiler was empty string
>>> 
>>> Hi Vitaly,
>>> 
>>> What do you see if you run:
>>> 
>>> /mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe
>>> 
>>> directly?
>>> 
>>> Cheers,
>>> David
>>> 
>>> On 10/04/2019 1:35 pm, Vitaly Provodin wrote:
>>>> Hello,
>>>> 
>>>> I'm trying to compile OpenJDK 13 (using WSL and following this instructions http://mail.openjdk.java.net/pipermail/build-dev/2018-December/024316.html <http://mail.openjdk.java.net/pipermail/build-dev/2018-December/024316.html>), but when I use:
>>>> 
>>>> $ bash ./configure --with-boot-jdk=/mnt/c/Tools/Java/jdk-11.0.2 \
>>>>     --with-tools-dir="C:\Tools\VS\2017\Community\VC\Auxiliary" \
>>>>     --with-ucrt-dll-dir="C:\Tools\WindowsKits\10\bin\10.0.17763.0\x64\ucrt”
>>>> 
>>>> it fail, with the following message:
>>>> 
>>>> . . .
>>>> configure: Will use user supplied compiler
>>>> CC=/mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx6
>>>> 4/x64/cl.exe checking resolved symbolic links for CC... no symlink
>>>> configure: The C compiler (located as /mnt/c/Tools/VS/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe) does not seem to be the required microsoft compiler.
>>>> configure: The result from running it was: ""
>>>> configure: error: A microsoft compiler is required. Try setting --with-tools-dir.
>>>> configure exiting with result code 1
>>>> 
>>>> It looks like the cause of this failure is in the empty string
>>>> 
>>>> configure: The result from running it was: “"
>>>> 
>>>> Please note I tried the following
>>>> - to run vcvars64.bat then start WSL (ubuntu)
>>>> - just start WSL (ubuntu) wiothout vcvars64.bat anyway I got the above
>>>> message.
>>>> 
>>>> I'm using windows 10 64 bits
>>>> 
>>>> Could you please give me advice what I should do?
>>>> 
>>>> Thank you,
>>>> Vitaly
>>>> 



More information about the build-dev mailing list