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

Native awt build fails on Windows also when running with native-build-container #28335

Closed
joggeli34 opened this issue Oct 1, 2022 · 3 comments · Fixed by #28412
Closed

Native awt build fails on Windows also when running with native-build-container #28335

joggeli34 opened this issue Oct 1, 2022 · 3 comments · Fixed by #28412
Assignees
Labels
area/native-image env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@joggeli34
Copy link
Contributor

Describe the bug

Running the native build with -Dquarkus.native.container-build=true also fails on windows even though the native-build would be executed inside a linux docker container.

Expected behavior

The build should work inside a linux docker container

Actual behavior

Following error is thrown:

* What went wrong:
Execution failed for task ':devtools:machine-learning:labeling-server:quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
  	[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:281)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
  	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
  	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
  	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
  	at java.base/java.lang.Thread.run(Thread.java:833)
  	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
  Caused by: java.lang.UnsupportedOperationException: Windows AWT integration is not ready in native-image and would result in java.lang.UnsatisfiedLinkError: no awt in java.library.path.
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep$NativeImageInvokerInfo$Builder.build(NativeImageBuildStep.java:883)
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:249)
  	... 11 more

How to Reproduce?

  • add io.quarkus:quarkus-awt
  • run
gradlew quarkusBuild -Dquarkus.native.container-build=true -Dquarkus.package.type=native -Dquarkus.container-image.build=true

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

17

Quarkus version or git rev

2.13.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

gradlew 7.5.1

Additional information

No response

@joggeli34 joggeli34 added the kind/bug Something isn't working label Oct 1, 2022
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Oct 1, 2022
@geoand
Copy link
Contributor

geoand commented Oct 5, 2022

@Karm any idea what's going on here?

@gsmet
Copy link
Member

gsmet commented Oct 5, 2022

The OS test is based on the local OS and doesn't take into account the fact that the actual OS could be a container. It needs to be adjusted.

@Karm Karm self-assigned this Oct 5, 2022
@Karm
Copy link
Member

Karm commented Oct 5, 2022

I will change io.quarkus.dev.console.QuarkusConsole.IS_WINDOWS usage to something else so as it takes into account nativeConfig.isContainerBuild() and test on Windows Podman and Windows Docker Desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants