-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CL.exe compilation errors not returned #1675
Comments
@dougxc added some improvements in error handling of native-compilation issues. Can you still reproduce this problem? |
Seeing the same not very helpful error message with
Invocation:
|
Hi @olpaw, thanks for letting me know. |
It should also be possible by using |
Thanks @olpaw! This revealed that I am having the same problem as @osmanrafiqss ( |
I'm now running into this issue as well:
This is in a GitHub Action: Any ideas? |
Just leaving this here in case it helps someone:
Edit: I also manually located vcvars.bat file and run it but i'm not sure whether it helped. Part 3 of the article tells you where vcvars is located |
When native-image compilation fails on Windows the error included is not very informative.
Consider the following example:
[getting-started-1.0-SNAPSHOT-runner:12224] classlist: 8,740.59 ms [getting-started-1.0-SNAPSHOT-runner:12224] (cap): 1,634.56 ms [getting-started-1.0-SNAPSHOT-runner:12224] setup: 2,111.65 ms Error: Error compiling query code (in C:\tmp\SVM-2783671696419126403\NativeInfoDirectives.cpp). Compiler command CL C:\tmp\SVM-2783671696419126403\NativeInfoDirectives.cpp /FeC:\tmp\SVM-2783671696419126403\NativeInfoDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64, Copyright (C) Microsoft Corporation. All rights reserved., ] com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\tmp\SVM-2783671696419126403\NativeInfoDirectives.cpp). Compiler command CL C:\tmp\SVM-2783671696419126403\NativeInfoDirectives.cpp /FeC:\tmp\SVM-2783671696419126403\NativeInfoDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64, Copyright (C) Microsoft Corporation. All rights reserved., ] at com.oracle.svm.core.util.UserError.abort(UserError.java:114)
I am by no means a Microsoft Compiler expert - but it seems that CL.exe writes compilation errors to stdout and compiler errors to stderr.
If I update substratevm to capture stdout when CL.exe exits with a non-zero error code - I get the following more informative error:
[getting-started-1.0-SNAPSHOT-runner:8848] classlist: 9,326.16 ms [getting-started-1.0-SNAPSHOT-runner:8848] (cap): 2,198.22 ms [getting-started-1.0-SNAPSHOT-runner:8848] setup: 2,802.02 ms Error: Error compiling query code (in C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp). Compiler command CL C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp /FeC:\tmp\SVM-1270989077554696147\NativeInfoDirectives.exe output included error: [NativeInfoDirectives.cpp, C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp(32) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory] com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp). Compiler command CL C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp /FeC:\tmp\SVM-1270989077554696147\NativeInfoDirectives.exe output included error: [NativeInfoDirectives.cpp, C:\tmp\SVM-1270989077554696147\NativeInfoDirectives.cpp(32) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory]
I have spent a few days figuring out why native-image compilation when using Quarkus was failing on my setup - having a more informative error message would really be helpful.
The text was updated successfully, but these errors were encountered: