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

Error on Building GraalVM Native Image with Recent Update to v1.18.1 #1979

Closed
cpoyatos1 opened this issue May 15, 2024 · 1 comment · Fixed by #1991 or #2017
Closed

Error on Building GraalVM Native Image with Recent Update to v1.18.1 #1979

cpoyatos1 opened this issue May 15, 2024 · 1 comment · Fixed by #1991 or #2017
Assignees
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@cpoyatos1
Copy link

cpoyatos1 commented May 15, 2024

Bug Description

In the last update, the -H:+BuildReport option was added to the native-image.properties file.

This presents an issue when trying to build a GraalVM native image using a GraalVM community edition. This option is not available in the CE. build-reports docs

Attempts to override the -H:+BuildReport option in the application's properties file (i.e., using quarkus.native.additional-build-args=-H:-BuildReport) have not addressed the problem.

Example code (or command)

./gradlew build -Dquarkus.package.type=native

Stacktrace

Error: Could not find option 'BuildReport' from 'jar:file:///[build-folder]/lib/com.google.cloud.sql.jdbc-socket-factory-core-1.18.1.jar!/META-INF/native-image/com.google.cloud.sql/cloud-sql-jdbc-socket-factory-parent/native-image.properties'. Use -H:PrintFlags= to list all available options.
> Task :quarkusAppPartsBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusAppPartsBuild'.
> There was a failure while executing work items
   > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
      > io.quarkus.builder.BuildException: Build failure: Build failed due to errors
                [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: io.quarkus.deployment.pkg.steps.NativeImageBuildStep$ImageGenerationFailureException: Image generation failed. Exit code: 1
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:468)
                at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:258)
                at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
                at java.base/java.lang.reflect.Method.invoke(Method.java:580)
                at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
                at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
                at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
                at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
                at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
                at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
                at java.base/java.lang.Thread.run(Thread.java:1583)
                at org.jboss.threads.JBossThread.run(JBossThread.java:483)

Steps to reproduce?

  1. Update com.google.cloud.sql.jdbc-socket-factory-core to v1.18.1
  2. Use 21.0.2-graalce or 22.0.1-graalce
  3. Run ./gradlew build -Dquarkus.package.type=native

Environment

  1. OS type and version: macOS 14.4.1 (23E224)
  2. Java SDK version: 21.0.2-graalce
  3. Cloud SQL Java Socket Factory version: v1.18.1

Additional Details

No response

@cpoyatos1 cpoyatos1 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label May 15, 2024
@hessjcg
Copy link
Collaborator

hessjcg commented May 20, 2024

Hi @cpoyatos1, Thanks for finding this. I've opened a PR to remove the flag.

hessjcg added a commit that referenced this issue May 21, 2024
hessjcg added a commit that referenced this issue May 21, 2024
. (#1991)

Removes the -H:+BuildReport flag from the native image module configuration. This will allow builds
on GraalVM CE to run successfully.

Fixes #1979
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
2 participants