Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows native-image build fails #2116

Closed
RexxLA opened this issue Jan 30, 2020 · 17 comments
Closed

Windows native-image build fails #2116

RexxLA opened this issue Jan 30, 2020 · 17 comments

Comments

@RexxLA
Copy link

RexxLA commented Jan 30, 2020

I can successfully build fallback images for the NetRexx compiler on MacOS and Linux X86-64. These fulfil a need, so while I am studying building completely native executables, I will put these out.
On 64-bit Windows 10 this fails in the following way: (I verified the working of the compiler with a c program and the working of NetRexx itself on the GraalVM installation)

C:\Users\rvjansen\netrexx-code>native-image -cp build/lib/NetRexxC.jar org.netrexx.process.NetRexxC -H:+ReportExceptionStackTraces
[org.netrexx.process.netrexxc:5676] classlist: 6,648.57 ms
[org.netrexx.process.netrexxc:5676] (cap): 1,482.91 ms
[org.netrexx.process.netrexxc:5676] setup: 2,303.88 ms
Error: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86, Copyright (C) Microsoft Corporation. All rights reserved., ]
com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-5060830253155072368\BuiltinDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27024.1 for x86, Copyright (C) Microsoft Corporation. All rights reserved., ]
at com.oracle.svm.core.util.UserError.abort(UserError.java:114)
at com.oracle.svm.hosted.c.NativeLibraries.reportErrors(NativeLibraries.java:218)
at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1518)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1006)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:835)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1

Can someone point me in the right direction?
Many thanks in advance.

@olpaw
Copy link
Member

olpaw commented Jan 30, 2020

Hi @RexxLA
The error reporting of query code compilation on Windows is only fixed on master, See:
See #1675 (comment)

@RexxLA
Copy link
Author

RexxLA commented Jan 30, 2020

Thanks! Are there nightly builds to be gotten somewhere?

@olpaw olpaw closed this as completed Jan 31, 2020
@olpaw olpaw reopened this Jan 31, 2020
@olpaw
Copy link
Member

olpaw commented Jan 31, 2020

Are there nightly builds to be gotten somewhere?

Yes ... https://github.com/graalvm/graalvm-ce-dev-builds/releases
Unfortunately currently, the native-image-installable-svm for Windows are missing. Likely some copy scripts need to be adjusted. I will let you know when this gets fixed.

@gilles-duboscq
Copy link
Member

The latest nightly builds now contain the native-image installables.

For example you can test the latest 20.0.0 nightly snapshot:
https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/20.0.0-dev-20200204_1306

@RexxLA
Copy link
Author

RexxLA commented Feb 5, 2020

ah thank you so much

@RexxLA RexxLA closed this as completed Feb 5, 2020
@RexxLA
Copy link
Author

RexxLA commented Feb 5, 2020

Oops ... same thing (well slightly different thing because it now reports an actual C++ compile error) with this nightly build:

C:\Users\rvjansen\netrexx-code>native-image -cp build\lib\NetRexxC.jar org.netrexx.process.NetRexxC -H:+ReportExceptionStackTraces
[org.netrexx.process.netrexxc:120] classlist: 6,554.51 ms, 1.13 GB
[org.netrexx.process.netrexxc:120] (cap): 2,217.32 ms, 1.13 GB
[org.netrexx.process.netrexxc:120] setup: 4,222.35 ms, 1.13 GB
Error: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.exe output included error: [WindowsDirectives.cpp, C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(180): error C2371: 'size_t': redefinition; different basic types, predefined C++ types (compiler internal)(16): note: see declaration of 'size_t']
com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp). Compiler command CL C:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.cpp /FeC:\Users\rvjansen\AppData\Local\Temp\SVM-4114664222709891486\WindowsDirectives.exe output included error: [WindowsDirectives.cpp, C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\vcruntime.h(180): error C2371: 'size_t': redefinition; different basic types, predefined C++ types (compiler internal)(16): note: see declaration of 'size_t']
at com.oracle.svm.core.util.UserError.abort(UserError.java:135)
at com.oracle.svm.hosted.c.NativeLibraries.reportErrors(NativeLibraries.java:228)
at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1515)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:1010)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:841)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1

@RexxLA RexxLA reopened this Feb 5, 2020
@olpaw
Copy link
Member

olpaw commented Feb 10, 2020

@pejovica are you familiar with this issue?

@pejovica
Copy link
Member

@olpaw No, I haven't seen it before. But the initial error indicates that a 32-bit toolchain was used, so perhaps that is still the case.

@RexxLA Could you try with the 64-bit toolchain because 32-bit is not supported.

@olpaw
Copy link
Member

olpaw commented Feb 10, 2020

@RexxLA if you use a 20.1 snapshot release should get better diagnostic output (see 7444772). Please try https://github.com/graalvm/graalvm-ce-dev-builds/releases/tag/20.1.0-dev-20200208_0320 and report back which error message you get. Thanks.

@cosminpolifronie
Copy link

@olpaw I had the same errors and after trying with 20.1.0 this is the error that I get:

[IWS_BCS_Clocking_Helper-1.0-dev:12168]    classlist:   1,979.06 ms,  0.96 GB
[IWS_BCS_Clocking_Helper-1.0-dev:12168]        setup:   1,070.16 ms,  0.96 GB
Error: Native-image building on Windows currently only supports target architecture: AMD64 (x86 unsupported)
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).

@cosminpolifronie
Copy link

@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.

@olpaw
Copy link
Member

olpaw commented Feb 24, 2020

@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.

For Java 8 we cannot move to a more recent native-toolchain because the static jdk libs that we are using there are built with that old toolchain. For GraalVM Java 11 version you can use Visual Studio 2015 version 14.0 or later (C/C++ Optimizing Compiler Version 19.* or later).

@cosminpolifronie
Copy link

@olpaw By the way, is there any chance you'll remove the dependency on Windows SDK 7.1 and move to something more recent with support for Windows 10? The install process is a pain.

For Java 8 we cannot move to a more recent native-toolchain because the static jdk libs that we are using there are built with that old toolchain. For GraalVM Java 11 version you can use Visual Studio 2015 version 14.0 or later (C/C++ Optimizing Compiler Version 19.* or later).

Oh, so Windows SDK 7.1 is not needed for the Java 11 version. That is good.

The error above is given by the Java 11 version, by the way.

@olpaw
Copy link
Member

olpaw commented Feb 24, 2020

I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).

Sounds like you are using the wrong developer prompt. You need to run from

x64 Native Tools Command Prompt for VS 2019

@olpaw
Copy link
Member

olpaw commented Feb 24, 2020

this one

@cosminpolifronie
Copy link

My bad, I was using the Developer Command Prompt. It's working now, but I'm having an unsupported feature error. I start another issue about it.

@olpaw olpaw closed this as completed Feb 25, 2020
@qianyiyong
Copy link

I don't know why it is targeting x86 or how I can force x64. I've tried both VS 2017 and VS 2019 (both Professional editions) and Windows SDK 7.1 is installed (and has support for both x86 and x64).

Sounds like you are using the wrong developer prompt. You need to run from

x64 Native Tools Command Prompt for VS 2019

thanks! nice answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants