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 container build with debug symbols fails during copying of jar sources #13848

Closed
aluckenbaugh opened this issue Dec 11, 2020 · 7 comments · Fixed by #13908
Closed

Native container build with debug symbols fails during copying of jar sources #13848

aluckenbaugh opened this issue Dec 11, 2020 · 7 comments · Fixed by #13908
Assignees
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@aluckenbaugh
Copy link

Describe the bug
When trying to build a native image with debug symbols in the quarkus quickstart project the build fails. I originally spotted this in my custom project and was able to replicate the same problem in the hibernate-orm-quickstart. Maybe I'm doing something wrong, or maybe this is actually a bug?

Expected behavior
The build should succeed.

Actual behavior
The following error message is logged as the build fails:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.10.3.Final:native-image (default) on project hibernate-orm-quickstart: Failed to generate native image: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Unable to copy from C:\path\to\mvn\repo\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5-sources.jar to C:\path\to\quarkus-quickstarts\hibernate-orm-quickstart\target\hibernate-orm-quickstart-1.0-SNAPSHOT-native-image-source-jar\lib\jakarta.annotation.jakarta.annotation-api-1.3.5-sources.jar
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.copyJarSourcesToLib(NativeImageBuildStep.java:423)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:93)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.nio.file.NoSuchFileException: C:\path\to\mvn\repo\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5-sources.jar -> C:\path\to\quarkus-quickstarts\hibernate-orm-quickstart\target\hibernate-orm-quickstart-1.0-SNAPSHOT-native-image-source-jar\lib\jakarta.annotation.jakarta.annotation-api-1.3.5-sources.jar
[ERROR] at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85)
[ERROR] at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
[ERROR] at java.base/sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:202)
[ERROR] at java.base/sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:283)
[ERROR] at java.base/java.nio.file.Files.copy(Files.java:1294)
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.copyJarSourcesToLib(NativeImageBuildStep.java:421)
[ERROR] ... 13 more
[ERROR] -> [Help 1]

To Reproduce

Run this as recommended on https://quarkus.io/guides/building-native-image#debugging-native-executable to download the sources jars (this doesn't seem to make any difference): mvn dependency:sources

Run: mvn clean install -DskipTests -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.debug.enabled=true

In project: https://github.com/quarkusio/quarkus-quickstarts/tree/master/hibernate-orm-quickstart

Environment:

  • Output of uname -a or ver:
    ver
    Microsoft Windows [Version 10.0.19041.388]
  • Output of java -version:
    java -version
    openjdk version "11.0.7" 2020-04-14 LTS
    OpenJDK Runtime Environment Corretto-11.0.7.10.1 (build 11.0.7+10-LTS)
    OpenJDK 64-Bit Server VM Corretto-11.0.7.10.1 (build 11.0.7+10-LTS, mixed mode)
  • Quarkus version or git rev: quarkusio/quarkus-quickstarts@6fc48e9
  • Build tool (ie. output of mvnw --version or gradlew --version):
    mvn -version
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.3\bin..
    Java version: 11.0.7, vendor: Amazon.com Inc., runtime: C:\Program Files\Amazon Corretto\jdk11.0.7_10
    Default locale: en_US, platform encoding: Cp1252
    OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
@aluckenbaugh aluckenbaugh added the kind/bug Something isn't working label Dec 11, 2020
@ghost ghost added the env/windows Impacts Windows machines label Dec 11, 2020
@machi1990
Copy link
Member

@zakkak is this related to #13754?

@zakkak
Copy link
Contributor

zakkak commented Dec 11, 2020

@machi1990 no, this is a different issue.

According to https://github.com/quarkusio/quarkus/blob/master/docs/src/main/asciidoc/building-native-image.adoc#debugging-native-executable

Starting with Oracle GraalVM 20.2 or Mandrel 20.1, debug symbols for native executables can be generated for Linux environments (Windows support is still under development).

@aluckenbaugh
Copy link
Author

@zakkak, given the Maven build is spinning up a docker image of quay.io/quarkus/ubi-quarkus-native-image:20.2.0-java11 would that mean the debug symbol generation would be happening in the Linux environment of the container and not the Windows host? Or is this the Windows support that's still under development?

@zakkak
Copy link
Contributor

zakkak commented Dec 11, 2020

@zakkak, given the Maven build is spinning up a docker image of quay.io/quarkus/ubi-quarkus-native-image:20.2.0-java11 would that mean the debug symbol generation would be happening in the Linux environment of the container and not the Windows host?

Correct.

Or is this the Windows support that's still under development?

No the windows support that is still under development is having debug symbols for windows builds.
Building linux binaries on windows should work AFAIK, so I think you are right, this looks like a bug.

Can you please verify that C:\path\to\mvn\repo\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5-sources.jar and C:\path\to\quarkus-quickstarts\hibernate-orm-quickstart\target\hibernate-orm-quickstart-1.0-SNAPSHOT-native-image-source-jar\lib exist?

Could mvn dependency:sources be failing to fetch the sources?

@aluckenbaugh
Copy link
Author

C:\path\to\mvn\repo\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5-sources.jar does exist, however the lib folder in C:\path\to\quarkus-quickstarts\hibernate-orm-quickstart\target\hibernate-orm-quickstart-1.0-SNAPSHOT-native-image-source-jar\lib does not, so that could be the problem causing the NoSuchFileException.

@zakkak
Copy link
Contributor

zakkak commented Dec 15, 2020

@aluckenbaugh I was able to reproduce the issue and I have opened #13908 with a fix.
It would be great if you could give it a try and verify it solves the issue for you as well.

This will require building Quarkus from my branch, and editing the xml file of the quickstart example to use 999-SNAPSHOT instead of 1.10.3.Final as the version of Quarkus.

@zakkak zakkak self-assigned this Dec 15, 2020
@ghost ghost added this to the 1.11 - master milestone Dec 16, 2020
@gsmet gsmet modified the milestones: 1.11 - master, 1.10.5.Final Dec 16, 2020
@aluckenbaugh
Copy link
Author

Yes, this looks like it fixes the issue. Thanks!

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

Successfully merging a pull request may close this issue.

4 participants