-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix: use native api to enable windows ansi support #4103
Conversation
Why: * cmd.exe and powershell does not enable ansi without native tweaking. This change addreses the need by: * use Graalvm native support to call out to native setConsoleMode() Fixes quarkusio#4095
@Platforms(Platform.WINDOWS.class) | ||
public class WindowsConsoleDirectives implements CContext.Directives { | ||
|
||
private static final String[] windowsLibs = new String[] { "<windows.h>" }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently I'm getting an error I highly assumes is missing header files but not sure.
Error is:
Error: Error compiling query code (in C:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.cpp). Compiler command CL C:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.cpp /FeC:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64, Copyright (C) Microsoft Corporation. All rights reserved., ]
com.oracle.svm.core.util.UserError$UserException: Error compiling query code (in C:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.cpp). Compiler command CL C:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.cpp /FeC:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.exe output included error: [Microsoft (R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64, 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:196)
at com.oracle.svm.hosted.NativeImageGenerator.processNativeLibraryImports(NativeImageGenerator.java:1512)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeLibraries(NativeImageGenerator.java:993)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:827)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:520)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:440)
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
waiting for oracle/graal#1675 to be fixed or someone magically figuring out what is wrong ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show the content of C:\Users\max\AppData\Local\Temp\SVM-3772467201033451472\NativeInfoDirectives.cpp
?
The error seems totally unrelated:
and looks similar to this issue. Since this is totally out of our control, I'm just going to restart the failing tests. |
For some reason Github won't let me restart the tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't yet build for Max so I won't approve it yet because there's a problem with it, we just don't know what the problem is yet.
I don't know if it works but at least it builds now :). Has the status of this PR changed or is it still a draft? |
still a draft - blocked by what seems like quarkus triggering need of <unistd.h> api which does not exist on Windows thus at the moment we can't compile natively on windows (note: this also happens in master without this patch :). |
Seems like we are running into the same problems trying to build Quarkus native-image on Windows :D The <unitstd.h> error is caused by a substitution in wildfly-common: However, solving that issue will only lead you to the next problem of missing JVM Signal functionality for Windows in Graal :) |
Yeah :) how did you locate your source of unitstd.h usage ? I tried to get GraalVM to dump more logs but the call tree analysis happens after this error making it tricky to pinpoint. Would be great to at least identify which missing pieces we are dependent on - and wether they are things we can fix or need fixing in Graal. |
I ended up just adding a System.out.println to the QueryCodeWriter visitor in Graal and printing out the Directives class and which header it includes :) I agree - having a set of issues to monitor the progress of Windows support would be great. |
@maxandersen what's the status of this PR? |
Waiting on graalvm's window support to improve enough so quarkus apps can be built on windows. |
Closing as out of date. |
Why:
This change addreses the need by:
Fixes #4095