-
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
Native image build fails with unknown arguments on Windows #5675
Comments
Hello @gdoenlen, Any chance you can quickly try this against the previous This looks odd, since I don't see any obvious issue here other than Graal VM 19.3 and Java 11 that you are using. |
So I tried a few things: With CR2 and 19.2.1 and Java 8 I get different message, about failing to augment application classes:
For reference my project can be found here, and I can push a branch without any Java 11 features if needed: https://github.com/gdoenlen/rovert |
A Java 8 branch would be good, if possible. Thank you. |
I am seeing:
I see the same error both in |
If I instead change your
then |
Just to be clear: we don't support 19.3 yet. The work is in progress.
…On Fri, Nov 22, 2019 at 11:39 AM Georgios Andrianakis < ***@***.***> wrote:
If I instead change your application.properties to:
rovert.authorization.enabled = false
rovert.messages.user = trevor
slack.api.token = token
slack.api.url = localhost:9000
slack.signing-secret = rovert
then mvn clean package -Pnative works.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5675?email_source=notifications&email_token=AAJYOBN7C22YPFUVTISBZPDQU6ZHDA5CNFSM4JQKU5B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE5IFHA#issuecomment-557482652>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJYOBMCFFF4SCU3ZXAXU7TQU6ZHDANCNFSM4JQKU5BQ>
.
|
@geoand The docs says that stuff can be defined at runtime via environment variables for native or jar packages. (https://quarkus.io/guides/config). I removed that file entirely (the application doesn't have any config it needs anymore) and the packaging is still failing. Running that generated ~\Desktop\rovert\rovert\target [graal8 ≡ +0 ~1 -1 !]> C:\Users\george\desktop\graalvm-ce-windows-amd64-19.2.1\graalvm-ce-19.2.1\jre\bin\native-image.cmd -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar rovert-1.0.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-JNI -H:-UseServiceLoaderFeature -H:+StackTrace rovert-1.0.0-SNAPSHOT-runner
~\Desktop\rovert\rovert\target [graal8 ≡ +0 ~1 -1 !]> $lastexitcode
-1073741819 @gsmet I understand that, but the 19.2.1 build for me is still failing. |
@gdoenlen I might have missed the command you used to build the image. Can you paste it again? |
@geoand it's just the command generated from the build step.
I haven't had time to look look into why it's returning non-zero yet though. |
I had access to an Windows setup yesterday and I did see it silently fail with |
@jaikiran Just an update, I've successfully packaged natively under WSL with 19.2.1 (19.3 still fails with other errors) so I think this is definitely a graalvm windows problem. @geoand I did run into the null pointers you pointed out, so I guess I misread the documentation there about having config properties be available at runtime as environment variables. |
@gdoenlen thanks for the info. From what I understood the problem was the way your application is setup, but I don't have a Windows machine so I can't tell for sure |
Thank you for verifying that. So if it succeeds against |
There is still the issue that windows compilation just doesn't work/fails silently (with both 19.3 and 19.2.1). But that should probably be tracked under the graal repo I guess. |
For reference, packaging the default app from https://code.quarkus.io on Windows with 19.2.1 fails with the same error from native-image.cmd returning non-zero: [INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: C:\Users\george\desktop\co de-with-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner. jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from C:\Users\george\desktop\code-wi th-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner.jar [INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit Graa lVM CE 19.2.1
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] C:\Users\george\desktop\graalvm-ce-windows-amd64-19.2.1\gr aalvm-ce-19.2.1\jre\bin\native-image.cmd -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.ma xUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 --initiali ze-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar code-w ith-quarkus-1.0.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-JNI -H:-UseServiceLoaderFeature -H:+Sta ckTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.672 s
[INFO] Finished at: 2019-11-24T09:31:17-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.0.CR2:build (default) on project code-with-quarkus: F ailed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:289)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
[ERROR] at java.lang.Thread.run(Thread.java:748)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:278)
[ERROR] ... 12 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException |
It would be good to have it reported here https://github.com/oracle/graal/issues and see if they have any inputs. |
Same here (with
Git Bash (for Windows) |
When I take the printed command
and wrap every parameter that contains a It seems Quarkus should do this wrapping automatically, at least on Windows. |
Hello @famod, |
Hi @jaikiran,
Well, yes and no. When I simply took the printed command and ran it directly on the Windows command line I received the very same error message as via I suppose |
GraalVM 20.0.0 is out and this entry in the release notes caught my attention:
Wonder when Quarkus moves to GraalVM 20? |
@famod you can already use GraalVM 20.0 with Quarkus. I propose you give it a go :) |
This solved building it on Mac with gradle. |
@fmhwong if you have access to a Windows machine, it would be nice to test a couple of examples on Windows with GraalVM 20 and see how it goes. |
I have access to Windows machines and I can take a look. |
GraalVM 20.0.0 seems to have fixed this issue! I am now getting past that point, but running into oracle/graal#1160:
|
I can confirm that it still does not work on windows with Graal 20.0 and Quarkus 1.2.1.Final with the default project generated from quarkus.io.
|
I ran into the same problem reported in #7269 |
Just retried this with 1.3.0.CR2 and it is now working. Environment:
|
Great to hear! Thanks for letting us know! |
@gdoenlen would you be able to test as well? |
More than likely I will be able to tonight. |
Excellent, thank you |
@geoand I managed to get around to testing this this morning and it does work, but it's not really in an ideal form atm. Some things to note:
I know the first two issues are probably upstream problems with either Graal or Microsoft themselves, but if you want to drive adoption it's probably something that should be worked on. I think for now there needs to be some sort of documentation somewhere on how to do the above process for windows users (maybe in here somewhere https://quarkus.io/guides/maven-tooling). Thanks for keeping this a priority guys! Environment:
|
This is by design.
cc @maxandersen |
What is it you can't do in / out of powershell ? |
I'm not sure what you mean by this, but without running the bat file CL won't be found to be executed. After manually adding CL onto my path both shells complain about not having the include path set properly for the compiler. I'm assuming vcvars does something that sets an environment variable for this and only in cmd does it actually stay around after the bat file is done. AFTER putting CL on path:
The only way I've gotten a clean compile in powershell is to:
Like I said, it works, it's just not ideal and requires some documentation. |
Yes, so what I have in my windows install is a windows 7 sdk command line prompt - that does the magical setup; that might be just calling out Would you be up for taking a stab on such documentation to get it bootstrapped and we can iterate on over time ? |
Yes it does my
I could do this, but ideally I would like to see NativeBuildStep.java in quarkus take care of this. Either by passing the path to vcvars64.bat in |
Windows env setup doesn't work as transparent as linux though thus I don't think we can do this in a reliable fashion - docs are the best way forward at the moment. in other conversations we are working on trying to auto setup native-image so you don't need to download it separately but in all cases I think the assumption must be that the surrounding environment need to be setup for native compilation. I would say improve the documentation and then on windows detect failure during complation and have the exception refer to that documentation would be a good bet. |
Now that compiling to native on windows is working properly add documentation on the steps required as discussed in quarkusio#5675
Now that compiling to native on windows is working properly add documentation on the steps required as discussed in quarkusio#5675
Now that compiling to native on windows is working properly add documentation on the steps required as discussed in quarkusio#5675
Now that compiling to native on windows is working properly add documentation on the steps required as discussed in quarkusio#5675
Now that compiling to native on windows is working properly add documentation on the steps required as discussed in quarkusio#5675
Describe the bug
mvn package -Pnative fails with an unknown arguments error
It seems to have to do with the args being passed with -J
Environment (please complete the following information):
Output of
uname -a
orver
: windows 10Output of
java -version
:openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-jvmci-19.3-b05-LTS)
OpenJDK 64-Bit GraalVM CE 19.3.0 (build 11.0.5+10-jvmci-19.3-b05-LTS, mixed mode, sharing)
Quarkus version or git rev: 1.0.0.RC1
The text was updated successfully, but these errors were encountered: