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

Unable to compile C-ABI query code #1258

Closed
tsatatwer opened this issue May 10, 2019 · 29 comments
Closed

Unable to compile C-ABI query code #1258

tsatatwer opened this issue May 10, 2019 · 29 comments
Assignees

Comments

@tsatatwer
Copy link

tsatatwer commented May 10, 2019

Hi ,
I am testing windows GraalVM Community Edition 19.0.0 native-image , I got this error:
Error: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system. com.oracle.svm.core.util.UserError$UserException: Unable to compile C-ABI query code. Make sure GCC toolchain is installed on your system. at com.oracle.svm.core.util.UserError.abort(UserError.java:65) at com.oracle.svm.hosted.c.codegen.CCompilerInvoker.compileAndParseError(CCompilerInvoker.java:87) at com.oracle.svm.hosted.c.CAnnotationProcessor.compileQueryCode(CAnnotationProcessor.java:131) at com.oracle.svm.hosted.c.CAnnotationProcessor.process(CAnnotationProcessor.java:84) at com.oracle.svm.hosted.c.NativeLibraries.finish(NativeLibraries.java:311) at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1523) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:997) at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:829) at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:521) at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441) 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

@olpaw olpaw self-assigned this May 10, 2019
@olpaw
Copy link
Member

olpaw commented May 10, 2019

Hi @tsatatwer

The error message is misleading in this case. Our Windows support is still early days and the message claims that you have to install GCC. This is not the case for Windows. Instead you need to have Windows SDK for Windows 7 installed and you need to run from the Windows SDK 7.1 Command Prompt (so that native-image is able to see the Windows toolchain).

@tsatatwer
Copy link
Author

tsatatwer commented May 10, 2019

Thanks for the fast replay .
OK it is clear that GCC has nothing to do with windows , any way happy that GraalVM support windows .
I will install Windows SDK and let you know.

@tsatatwer
Copy link
Author

@olpaw ,
after the Windows SDK installed the error mentioned disappeared . Thanks can be closed.

@philwalk
Copy link

Hi, thanks for the information. After installing Windows SDK for Windows 7 (the x64 version), I got further along, but below is the problem I'm still having. I suspect the wrong C++ compiler may be in my path, but I'm not quite sure. Any suggestions are welcome!

c:\opt\ue>native-image.cmd --initialize-at-run-time=org.simpleflatmapper.util.ParallelReader --initialize-at-run-time=scalikejdbc.CommonsConnectionPool --initialize-at-run-time=org.postgresql.sspi.SSPIClient --initialize-at-run-time=scala.tools.reflect.FormatInterpolator --initialize-at-run-time=scala.tools.nsc.typechecker.ContextErrors --initialize-at-run-time=scala.tools.nsc.ast.parser.ParsersCommon "--initialize-at-run-time=scala.tools.nsc.ast.parser.Parsers$Parser" --initialize-at-build-time=org.postgresql.Driver --initialize-at-build-time=org.postgresql.util.SharedTimer --enable-url-protocols=https -H:ReflectionConfigurationFiles=reflectconfig.json -H:-UseServiceLoaderFeature --allow-incomplete-classpath -cp "jsrc\bp.sc.jar;C:\opt\uejlib\*;\opt\ueolib\*" -H:+ReportExceptionStackTraces Main
[main:108740]    classlist:  59,431.80 ms
[main:108740]        (cap):   2,508.88 ms
[main:108740]        setup:   4,708.57 ms
[main:108740]   (typeflow):  14,379.47 ms
[main:108740]    (objects):  25,030.10 ms
[main:108740]   (features):   1,098.89 ms
[main:108740]     analysis:  41,500.42 ms
[main:108740]     (clinit):   2,452.40 ms
[main:108740]     universe:   3,226.77 ms
[main:108740]      (parse):   1,976.95 ms
[main:108740]     (inline):   3,659.08 ms
[main:108740]    (compile):  19,373.55 ms
[main:108740]      compile:  26,910.13 ms
[main:108740]        image:   2,932.64 ms
[main:108740]        write:     896.35 ms
Fatal error: java.lang.RuntimeException: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /Fec:\opt\ue\main.exe C:\Users\philwalk\AppData\Local\Temp\SVM-5744542995274268338\main.obj /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\opt\graalvm-ee-19.0.0\jre\lib /LIBPATH:C:\opt\graalvm\jre\lib\svm\clibraries\windows-amd64 jitdebug.lib ffi.lib zip.lib net.lib nio.lib java.lib strictmath.lib jvm.lib libchelper.lib advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/debug
/out:c:\opt\ue\main.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\opt\graalvm-ee-19.0.0\jre\lib
/LIBPATH:C:\opt\graalvm\jre\lib\svm\clibraries\windows-amd64
jitdebug.lib
ffi.lib
zip.lib
net.lib
nio.lib
java.lib
strictmath.lib
jvm.lib
libchelper.lib
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\philwalk\AppData\Local\Temp\SVM-5744542995274268338\main.obj
   Creating library c:\opt\ue\main.lib and object c:\opt\ue\main.exp
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDHKeyAgreement_deriveKey
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_signDigest
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_verifySignedDigest
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair
main.obj : error LNK2001: unresolved external symbol Java_sun_security_krb5_Config_getWindowsDirectory
main.obj : error LNK2001: unresolved external symbol Java_sun_security_krb5_SCDynamicStoreConfig_getKerberosConfig
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateChains
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_storeCertificate
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_PRNG_generateSeed
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSAKeyPairGenerator_generateRSAKeyPair
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_generatePublicKeyBlob
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_importPublicKey
main.obj : error LNK2001: unresolved external symbol Java_sun_security_smartcardio_PCSC_SCardEstablishContext
c:\opt\ue\main.exe : fatal error LNK1120: 13 unresolved externals

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
        at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:458)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:289)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:427)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:109)
Caused by: java.lang.RuntimeException: host C compiler or linker does not seem to work: java.lang.RuntimeException: returned 2

Running command: CL /MD /Zi /Fec:\opt\ue\main.exe C:\Users\philwalk\AppData\Local\Temp\SVM-5744542995274268338\main.obj /link /INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES /LIBPATH:C:\opt\graalvm-ee-19.0.0\jre\lib /LIBPATH:C:\opt\graalvm\jre\lib\svm\clibraries\windows-amd64 jitdebug.lib ffi.lib zip.lib net.lib nio.lib java.lib strictmath.lib jvm.lib libchelper.lib advapi32.lib ws2_32.lib secur32.lib iphlpapi.lib

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/debug
/out:c:\opt\ue\main.exe
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\opt\graalvm-ee-19.0.0\jre\lib
/LIBPATH:C:\opt\graalvm\jre\lib\svm\clibraries\windows-amd64
jitdebug.lib
ffi.lib
zip.lib
net.lib
nio.lib
java.lib
strictmath.lib
jvm.lib
libchelper.lib
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\philwalk\AppData\Local\Temp\SVM-5744542995274268338\main.obj
   Creating library c:\opt\ue\main.lib and object c:\opt\ue\main.exp
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDHKeyAgreement_deriveKey
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_signDigest
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_verifySignedDigest
main.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair
main.obj : error LNK2001: unresolved external symbol Java_sun_security_krb5_Config_getWindowsDirectory
main.obj : error LNK2001: unresolved external symbol Java_sun_security_krb5_SCDynamicStoreConfig_getKerberosConfig
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateChains
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_storeCertificate
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_PRNG_generateSeed
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSAKeyPairGenerator_generateRSAKeyPair
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_generatePublicKeyBlob
main.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_importPublicKey
main.obj : error LNK2001: unresolved external symbol Java_sun_security_smartcardio_PCSC_SCardEstablishContext
c:\opt\ue\main.exe : fatal error LNK1120: 13 unresolved externals

        at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:308)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:654)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441)
        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

@tsatatwer
Copy link
Author

Hi @philwalk,
before installing the Windows SDK try to deinstall MS C++ compiler version 10 and then install Windows SDK after that run Windows SDK command prompt and from this run mative-image.

@lizhanhui
Copy link

Hi @olpaw I tried to build our client jar to a shared library on Windows 7 with the SDK you mentioned above, some symbols are missing in the last step.

/dll
/implib:C:\build\build\rocketmq-client-cpp-full.lib
/debug
/out:C:\build\build\rocketmq-client-cpp-full.dll
/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:OLDNAMES
/LIBPATH:C:\graalvm-ce-19.0.0\jre\lib
/LIBPATH:C:\graalvm-ce-19.0.0\jre\lib\svm\clibraries\windows-amd64
/LIBPATH:C:
ffi.lib
zip.lib
nio.lib
net.lib
java.lib
strictmath.lib
jvm.lib
libchelper.lib
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib
C:\Users\LIZHAN~1\AppData\Local\Temp\SVM-7660183915656644986\rocketmq-client-cpp-full.obj
Creating library C:\build\build\rocketmq-client-cpp-full.lib and object C:\build\build\rocketmq-client-cpp-full.exp
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDHKeyAgreement_deriveKey
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_signDigest
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECDSASignature_verifySignedDigest
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_generatePrivateKeyBlob
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateChains
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_storeCertificate
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_KeyStore_storePrivateKey
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_PRNG_generateSeed
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSAKeyPairGenerator_generateRSAKeyPair
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_generatePublicKeyBlob
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_mscapi_RSASignature_importPublicKey
rocketmq-client-cpp-full.obj : error LNK2001: unresolved external symbol Java_sun_security_smartcardio_PCSC_SCardEstablishContext
java.lib(SecurityManager.obj) : error LNK2019: unresolved external symbol JVM_GetClassContext referenced in function Java_java_lang_SecurityManager_getClassContext
java.lib(SecurityManager.obj) : error LNK2019: unresolved external symbol JVM_CurrentLoadedClass referenced in function
Java_java_lang_SecurityManager_currentLoadedClass0
java.lib(SecurityManager.obj) : error LNK2019: unresolved external symbol JVM_CurrentClassLoader referenced in function
Java_java_lang_SecurityManager_currentClassLoader0
java.lib(SecurityManager.obj) : error LNK2019: unresolved external symbol JVM_ClassDepth referenced in function Java_jav
a_lang_SecurityManager_classDepth
java.lib(SecurityManager.obj) : error LNK2019: unresolved external symbol JVM_ClassLoaderDepth referenced in function Ja
va_java_lang_SecurityManager_classLoaderDepth0
C:\build\build\rocketmq-client-cpp-full.dll : fatal error LNK1120: 18 unresolved externals

    at com.oracle.svm.hosted.image.NativeBootImageViaCC.write(NativeBootImageViaCC.java:308)
    at com.oracle.svm.hosted.image.SharedLibraryViaCCBootImage.write(SharedLibraryViaCCBootImage.java:63)
    at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:654)
    at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441)
    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

I checked the graalvm SDK, the symbols can be found in${graalvm_sdk_dir}/jre/bin/sunec.dll and sunmscapi.dll. These two files do not have .lib file and are not linked.

@lizhanhui
Copy link

Hi @philwalk,
before installing the Windows SDK try to deinstall MS C++ compiler version 10 and then install Windows SDK after that run Windows SDK command prompt and from this run mative-image.

@tsatatwer The issue @philwalk and I have is caused by missing of sunec.lib and sunmscapi.lib from graalvm SDK. They should included as "ffi.lib
zip.lib
nio.lib
net.lib
java.lib
strictmath.lib
jvm.lib
libchelper.lib
advapi32.lib
ws2_32.lib
secur32.lib
iphlpapi.lib" are

@olpaw
Copy link
Member

olpaw commented May 13, 2019

We do not provide static libs for sunec or sunmscapi on any supported platform. Regarding Security Services the same rules apply as on other platforms. See https://github.com/oracle/graal/blob/master/substratevm/JCA-SECURITY-SERVICES.md#native-implementations
CC @cstancu

@olpaw olpaw closed this as completed May 13, 2019
@santhoshTpixler
Copy link

Hi @tsatatwer

The error message is misleading in this case. Our Windows support is still early days and the message claims that you have to install GCC. This is not the case for Windows. Instead you need to have Windows SDK for Windows 7 installed and you need to run from the Windows SDK 7.1 Command Prompt (so that native-image is able to see the Windows toolchain).

I ran into lot of errors while installing Windows SDK 7.1 and found a useful link given below. It worked flawlessely for me.
For installing Windows SDK https://stackoverflow.com/a/32534158/8279604

@borkdude
Copy link

In a Windows 10 VM I keep running into this problem:

Screenshot 2019-05-14 10 33 13

Screenshot 2019-05-14 10 36 19

Is there a way to get around these .NET messages?

@rsvoboda
Copy link

@borkdude, was fighting the same war last night, had to change registry entries ( + grant full control to myself for those entries ... ). A bit of nightmare before I managed to install SDK, plus I uninstalled some newer .net/c++ stuff.

See

@borkdude
Copy link

@rsvoboda confirmed that worked

@lizhanhui
Copy link

We do not provide static libs for sunec or sunmscapi on any supported platform. Regarding Security Services the same rules apply as on other platforms. See https://github.com/oracle/graal/blob/master/substratevm/JCA-SECURITY-SERVICES.md#native-implementations
CC @cstancu

As the mentioned document requires,
The following command instruction fails on Windows although its equivalent is proven working properly on Linux and Mac:

native-image --shared  -H:Path=.\build ^
                       -H:ReflectionConfigurationFiles=.\reflection_config.json ^
                       -H:Name=rocketmq_graalvm ^
                       -jar .\rocketmq-client-cpp-full.jar ^
                       -Dio.netty.noUnsafe=true ^
                       -Djava.library.path=C:\soft\graalvm-ce-19.0.0\jre\bin ^
                       --report-unsupported-elements-at-runtime ^
                       --allow-incomplete-classpath ^
                       -H:+ReportExceptionStackTraces ^
                       --enable-all-security-services ^
                       --enable-url-protocols=https ^
                       -H:+PrintClassInitialization ^
                       --initialize-at-build-time ^
                       --initialize-at-run-time=RUN_TIME_CLASS_LIST

Native-image command fails on the "generate image step".
I doubt the windows version is buggy when handling linking symbols of JNI.

@olpaw
Copy link
Member

olpaw commented May 14, 2019

I doubt the windows version is buggy when handling linking symbols of JNI

Hi @lizhanhui,
That sounds plausible. Please create a separate ticket for this finding with an appropriate title.

@koppor
Copy link

koppor commented Aug 19, 2019

This is still within the first hits at Google. A quick fix is following chocolatey command:

choco install windows-sdk-7.1 kb2519277

Afterwards (in cmd.exe)

call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"

Then, one can execute native-image.cmd

@lilili87222
Copy link

It may caused by not load .lib file
I add

public void beforeAnalysis(BeforeAnalysisAccess access) {
BeforeAnalysisAccessImpl impl=(BeforeAnalysisAccessImpl) access;
impl.getNativeLibraries().addLibrary("sunec", true);
}

it stop ec problem ,but mscapi.lib file not found .

tested windows 7 amd64, graalvm 19.2.1

can you add those .lib files

@nightscape
Copy link
Contributor

@olpaw probably stupid question, but could native-image be made to work with newer versions of the Windows SDK? The 7.1 version is a major pain to install on newer systems...

@olpaw
Copy link
Member

olpaw commented Nov 6, 2019

@nightscape yes of course. There is nothing from Windows API that prevents us to build with later versions of Windows SDK. @pejovica please fill in the details. Also how the situation will be with the upcoming 19.3 release for 8 & 11.

@remkop
Copy link

remkop commented Nov 6, 2019

Great! Hopefully that will allow building Windows native images in GitHub Actions. (Currently cannot install windows-sdk-7.1)

@mcred
Copy link

mcred commented Nov 6, 2019

@remkop We were able to get windows native images to build in Github Actions using docker. It's definitely slow, but it works. We based our docker image on a cached version of servercore that is installed on Github-hosted runners. Here's how we did it:

Dockerfile
Github Action Workflow
Build Output

@borkdude
Copy link

borkdude commented Nov 6, 2019

@remkop FWIW I have an appveyor running that also builds Windows natives, although the main problem with that is that I cannot redistribute this binary because it depends on external dlls:

https://ci.appveyor.com/project/borkdude/clj-kondo
https://github.com/borkdude/clj-kondo/blob/master/appveyor.yml

@remkop
Copy link

remkop commented Nov 6, 2019

@mcred Thanks for the Docker links! I will give that a try.

@borkdude Yes, I have been able to build Windows native images in AppVeyor and in TravisCI, but not yet in GitHub Actions. About the DLL dependency: the latest news on getting rid of the dependency on msvcr100.dll is not good, unfortunately... :-(

@pejovica
Copy link
Member

pejovica commented Nov 7, 2019

@nightscape GraalVM builds are based on the supported build platforms used by the corresponding JDKs, see https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms. So the plan for the upcoming 19.3 release is to have a JDK 8 based build with MSVC 2010 SP1, and a JDK 11 based build with MSVC 2017 15.5.5.

This means that on JDK 11 you should be able to use any newer compatible MSVC compiler, see https://docs.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017?view=vs-2019.

@sogaiu
Copy link

sogaiu commented Jan 6, 2020

I had the "opportunity" to go through a setup process for building with the Java 8 based native-image on a Windows 10 VM recently. It came about that it wasn't necessary to use the registry key tweaking method described above.

The gist is that for the Java 8 based GraalVM, it appears that after attempting an installation of Windows SDK 7.1, installing Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 is suffcient.

(I am uncertain if the "uninstall Visual C++ 2010 Redistributables before attempting installation" tip in the useful StackOverflow post is necessary. For the record, I did not perform that step, but that was because I didn't notice any such thing already installed.)

@IgorNesterov
Copy link

IgorNesterov commented Feb 12, 2020

Hi!
I encountered a similar problem, but when using the native-image-maven-plugin:19.3.1 in IDEA.

Windows SDK installed
Windows SDK 7.1 Command Prompt running as administrator

This happens when the maven-command 'package' is run.

part of the logs with an error from the IDEA terminal.:

[example:6396] classlist: 4,331.29 ms
[example:6396] (cap): 464.36 ms
Error: Unable to compile C-ABI query code. Make sure native software development toolchain is installed on your system.
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
[example:6396] setup: 908.36 ms

@stuartstein777
Copy link

I can't install the older SDKs / older C++ stuff.

I'm on WIndows 10 and need all the newest .NET / VC++ / SDKS for work.

Does this mean I won't be able to use native-image without firing up an old W7 VM?

@olpaw
Copy link
Member

olpaw commented Mar 5, 2020

Does this mean I won't be able to use native-image without firing up an old W7 VM?

@stuartstein777 why don't you use GraalVM for Java 11? There you can use Visual Studio 2015 version 14.0 or later. The requirement to use Windows SDK 7.1 only exists for GraalVM for Java 8. See:

@IvanLuchkin
Copy link

@olpaw in my circumstances, JDK 11 based GraalVM versions fails does to some weird errors like
java.lang.IllegalArgumentException: Can't load standard profile: GRAY.pf

@olpaw
Copy link
Member

olpaw commented Nov 9, 2020

@olpaw in my circumstances, JDK 11 based GraalVM versions fails does to some weird errors like
java.lang.IllegalArgumentException: Can't load standard profile: GRAY.pf

@IvanLuchkin That does not sound like it's related to native tool chain detection / use.
Please provide a full bug report with detailed steps (also exact infos about the version of each component involved) so that we can reproduce your finding.

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