Skip to content

Conversation

@Karm
Copy link
Member

@Karm Karm commented Mar 11, 2025

Fixes #46235
Fixes #46988

Summary:

  • We don't have MacOS support for AWT extension yet. It might be trivial, but it's not coded in yet, so the extension needs to bail out just like on Windows. I am afraid that not having MacOS excluded via UnsupportedOSBuildItem is an artifact of moving DarwinFeature to AWT extension. The result is that the build might pass, but the Quarkus app won't start. If that is the desired design, we should allow the same on Windows and remove its UnsupportedOSBuildItem. I think the DarwinFeature previously was in core on purpose, to allow for building apps that effectively won't need to initialize AWT at runtime, i.e. don't need full AWT extension. @zakkak ? Ideas?

  • GraalVM has FFI/FFM implemented for amd64 arch only, so effectively starting Mandrel/GraalVM 24.2, i.e. Mandrel for JDK 24, we are losing AWT support on Linux aarch64 where it used to work

  • UBI9's microdnf requires -y, so container tests hanged on Is this ok [y/N]:

  • I tested all combinations that made sense to me and where I had access to HW, e.g. I skipped natively amd64 based MacOS. I used either our Mandrel 24.2 / JDK 24 ea builds or GraalVM CE 25 ea dev builds.

  • 🟢 - run went as expected; spoiler alert: All runs went as expected.

Tested

Windows amd64 hosted 🟢

Expected: 🟠 - SKIPPED, AWT Quarkus unsupported OS
Actual: 🟠

C:\tmp\quarkus(issue-46235 -> origin)
λ mvnw verify -f integration-tests/pom.xml -pl awt  -Pnative
    -Dquarkus.native.container-build=false -Dquarkus.container-image.build=false -DskipITs=false

[ERROR] Caused by: java.lang.UnsupportedOperationException:
Windows AWT integration is not ready in Quarkus native-image and would result in java.lang.UnsatisfiedLinkError: no awt in java.library.path.

Windows amd64 with Linux amd64 builder image 🟢

Expected: 🟢
Actual: 🟢

λ mvnw verify -f integration-tests/pom.xml -pl awt -Pnative 
    -Dquarkus.native.builder-image=quay.io/karmkarm/ubi9-quarkus-mandrel-builder-image:jdk-24-amd64
    -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true 
...

Finished generating 'quarkus-integration-test-awt-999-SNAPSHOT-runner' in 15m 51s.
...
[INFO] [io.quarkus.container.image.docker.common.deployment.CommonProcessor]
Executing the following command to build image: 
'podman build -f C:\tmp\quarkus\integration-tests\awt\src\main\docker\Dockerfile.native -t karm/quarkus-integration-test-awt:999-SNAPSHOT C:\tmp\quarkus\integration-tests\awt'
...
INFO  [io.qua.tes.com.DefaultDockerContainerLauncher] (main) 
Executing "podman run --name quarkus-integration-test-GQcdk -i --rm -p 8081:8081 -p 8444:8444 --net=quarkus-integration-test-UNOtv --env QUARKUS_LOG_CATEGORY__IO_QUARKUS__LEVEL=INFO --env QUARKUS_HTTP_PORT=8081 --env QUARKUS_HTTP_SSL_PORT=8444 --env TEST_URL=http://localhost:8081 --env QUARKUS_PROFILE=prod --env QUARKUS_CONTAINER_IMAGE_BUILD=true --env QUARKUS_NATIVE_CONTAINER_BUILD=true --env QUARKUS_NATIVE_BUILDER_IMAGE=quay.io/karmkarm/ubi9-quarkus-mandrel-builder-image:jdk-24-amd64 karm/quarkus-integration-test-awt:999-SNAPSHOT"
...
[INFO] Tests run: 41, Failures: 0, Errors: 0, Skipped: 0

MacOS aarch64 hosted 🟢

Expected: 🟠 - SKIPPED, AWT Quarkus unsupported OS
Actual: 🟠

[ERROR] Caused by: java.lang.UnsupportedOperationException:
    MacOS AWT integration is not ready in Quarkus native-image and would result in
    java.lang.UnsatisfiedLinkError: Can't load library: awt | java.library.path = [.].,
    AWT needs JDK's JEP 454 FFI/FFM support and that is not available for AArch64 with GraalVM's native-image,
    see: https://www.graalvm.org/latest/reference-manual/native-image/native-code-interoperability/foreign-interface/#foreign-functions

MacOS amd64 (via Rosetta) hosted 🟢

Expected: 🟠 - SKIPPED, AWT Quarkus unsupported OS
Actual: 🟠

[ERROR] Caused by: java.lang.UnsupportedOperationException:
    MacOS AWT integration is not ready in Quarkus native-image and would result in
    java.lang.UnsatisfiedLinkError: Can't load library: awt | java.library.path = [.].

MacOS amd64 with Linux amd64 builder

N/A - I don't have access to such HW and I don't want to try to
remove Podman machine from my MacOS aarch64 systems and try to run
podman there via Rosetta. It should work just like Windows above :-)

MacOS aarch64 with Linux aarch64 builder image 🟢

Expected: 🟠 - SKIPPED, ForeignAPISupport is amd64 only
Actual: 🟠

[ERROR] Caused by: java.lang.UnsupportedOperationException:
    AWT needs JDK's JEP 454 FFI/FFM support and that is not available for AArch64 with GraalVM's native-image,
    see: https://www.graalvm.org/latest/reference-manual/native-image/native-code-interoperability/foreign-interface/#foreign-functions

Linux amd64 hosted 🟢

Expected: 🟢
Actual: 🟢

$ ./mvnw verify -f integration-tests/pom.xml -pl awt  -Pnative
    -Dquarkus.native.container-build=false -Dquarkus.container-image.build=false -DskipITs=false 
OK

Linux amd64 with Linux amd64 builder image 🟢

Expected: 🟢
Actual: 🟢

$ ./mvnw verify -f integration-tests/pom.xml -pl awt -Pnative
    -Dquarkus.native.builder-image=quay.io/karmkarm/ubi9-quarkus-mandrel-builder-image:jdk-24-amd64
    -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true
OK

Linux aarch64 hosted 🟢

Expected: 🟠 - SKIPPED, ForeignAPISupport is amd64 only
Actual: 🟠

$ ./mvnw verify -f integration-tests/pom.xml -pl awt  -Pnative
    -Dquarkus.native.container-build=false -Dquarkus.container-image.build=false -DskipITs=false 

[ERROR] Caused by: java.lang.UnsupportedOperationException:
    AWT needs JDK's JEP 454 FFI/FFM support and that is not available for AArch64 with GraalVM's native-image,
    see: https://www.graalvm.org/latest/reference-manual/native-image/native-code-interoperability/foreign-interface/#foreign-functions

Linux aarch64 with Linux aarch64 builder image 🟢

Expected: 🟠 - SKIPPED, ForeignAPISupport is amd64 only
Actual: 🟠

$ ./mvnw verify -f integration-tests/pom.xml -pl awt -Pnative
    -Dquarkus.native.builder-image=quay.io/karmkarm/ubi9-quarkus-mandrel-builder-image:jdk-24-aarch64
    -Dquarkus.native.container-build=true -Dquarkus.container-image.build=true -DskipITs=false

[ERROR] Caused by: java.lang.UnsupportedOperationException:
    AWT needs JDK's JEP 454 FFI/FFM support and that is not available for AArch64 with GraalVM's native-image,
    see: https://www.graalvm.org/latest/reference-manual/native-image/native-code-interoperability/foreign-interface/#foreign-functions

Thanks for feedback

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 11, 2025

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 11, 2025

/cc @galderz (awt)

@Karm Karm marked this pull request as draft March 11, 2025 16:23
@Karm Karm requested a review from zakkak March 11, 2025 16:28
@Karm Karm self-assigned this Mar 11, 2025
@github-actions
Copy link

🎊 PR Preview 7843777 has been successfully built and deployed to https://quarkus-pr-main-46731-preview.surge.sh/version/main/guides/

  • Images of blog posts older than 3 months are not available.
  • Newsletters older than 3 months are not available.

@Karm Karm requested a review from galderz March 11, 2025 20:32
@Karm Karm marked this pull request as ready for review March 11, 2025 20:32
@quarkus-bot

This comment has been minimized.

@Karm
Copy link
Member Author

Karm commented Mar 12, 2025

No idea why would Micrometer get flaky on this PR. Do you understand the CI results @ebullient @brunobat?

Copy link
Contributor

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I think the DarwinFeature previously was in core on purpose, to allow for building apps that effectively won't need to initialize AWT at runtime, i.e. don't need full AWT extension.

By DarwinFeature are you referring to https://github.com/quarkusio/quarkus/blob/main/extensions/awt/runtime/src/main/java/io/quarkus/awt/runtime/graal/DarwinAwtFeature.java ?

AFAIS it was always under the awt extension #21566

The result is that the build might pass, but the Quarkus app won't start. If that is the desired design,

No, I don't think this is desired. Reporting it as unsupported seems the right thing to me.

GraalVM has FFI/FFM implemented for amd64 arch only, so effectively starting Mandrel/GraalVM 24.2, i.e. Mandrel for JDK 24, we are losing AWT support on Linux aarch64 where it used to work

We will need to list this as a known issue, in the migration guide I guess.

UBI9's microdnf requires -y, so container tests hanged on Is this ok [y/N]:

Good catch, I think we need this in ASAP. So if this PR ends up being delayed I would suggest openning a separate PR with just 1de05f2

Thank you @Karm

@gsmet
Copy link
Member

gsmet commented Mar 12, 2025

@Karm could you create a specific PR for the microdnf changes? This is something we want to backport right away. The rest of the PR requires more thoughts.

@Karm Karm mentioned this pull request Mar 12, 2025
@Karm
Copy link
Member Author

Karm commented Mar 12, 2025

@Karm could you create a specific PR for the microdnf changes? This is something we want to backport right away. The rest of the PR requires more thoughts.

@gsmet

#46763

@Karm
Copy link
Member Author

Karm commented Mar 12, 2025

@zakkak Thanks for the review

I think the DarwinFeature previously was in core on purpose, to allow for building apps that effectively won't need to initialize AWT at runtime, i.e. don't need full AWT extension.

By DarwinFeature are you referring to https://github.com/quarkusio/quarkus/blob/main/extensions/awt/runtime/src/main/java/io/quarkus/awt/runtime/graal/DarwinAwtFeature.java ?

AFAIS it was always under the awt extension #21566

Hmm, I confused it with AwtImageIO.java as I was trying to reason about why wasn't macOS excluded too. You are right.

The result is that the build might pass, but the Quarkus app won't start. If that is the desired design,

No, I don't think this is desired. Reporting it as unsupported seems the right thing to me.

Ack.

GraalVM has FFI/FFM implemented for amd64 arch only, so effectively starting Mandrel/GraalVM 24.2, i.e. Mandrel for JDK 24, we are losing AWT support on Linux aarch64 where it used to work

We will need to list this as a known issue, in the migration guide I guess.

Do I just edit this directly or is it generated?
https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.19

UBI9's microdnf requires -y, so container tests hanged on Is this ok [y/N]:

Good catch, I think we need this in ASAP. So if this PR ends up being delayed I would suggest openning a separate PR with just 1de05f2

Ack. Done.

@Karm
Copy link
Member Author

Karm commented Mar 12, 2025

The rest of the PR requires more thoughts.

@gsmet , any specific pointers?

@zakkak
Copy link
Contributor

zakkak commented Mar 12, 2025

Do I just edit this directly or is it generated?

Directly

@brunobat
Copy link
Contributor

No idea why would Micrometer get flaky on this PR. Do you understand the CI results @ebullient @brunobat?

Nope.

@gsmet
Copy link
Member

gsmet commented Mar 13, 2025

The rest of the PR requires more thoughts.

@Karm sorry, it was "more thoughts" as "if it was safe to be backported or not" :). Do you think we need a backport for this one?

I rebased to drop the additional commit and will merge when CI is green.

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 13, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit a04a213.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 17 Windows

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni - History

  • Stream has no elements - java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Stream has no elements
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lambda$lastReading$2(MetricDataFilter.java:213)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReading(MetricDataFilter.java:213)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:231)
	at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni(MicrometerTimedInterceptorTest.java:174)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:521)

@zakkak
Copy link
Contributor

zakkak commented Mar 13, 2025

@gsmet I would only consider the part that handles

We don't have MacOS support for AWT extension yet. It might be trivial, but it's not coded in yet, so the extension needs to bail out just like on Windows.

for backporting, but IMO it's not worth it.

@zakkak
Copy link
Contributor

zakkak commented Mar 13, 2025

@Karm it looks like AArch64 support will land in GraalVM for JDK 25, see oracle/graal#10856

@Karm
Copy link
Member Author

Karm commented Mar 14, 2025

@gsmet

@Karm sorry, it was "more thoughts" as "if it was safe to be backported or not" :). Do you think we need a backport for this one?

I don't think so.

@Karm
Copy link
Member Author

Karm commented Mar 14, 2025

@Karm it looks like AArch64 support will land in GraalVM for JDK 25, see oracle/graal#10856

@zakkak

Aww, great. Gonna give their branch a shot. I will make a note to see to removing these if-else version checks for 25 if it's sound.

@Karm
Copy link
Member Author

Karm commented Mar 14, 2025

@zakkak
Copy link
Contributor

zakkak commented Mar 14, 2025

@zakkak

Migration guide updated as https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.19/_compare/8ffa458b7951b8da1e26a86958243dd6edb4b55d...0d6004747c902b7e230e8e8a3209c765d6e8266c

@Karm there is a typo in your update. "To switch back to UBI 8" suggests using ubi9

Furthermore, we need to add a note about

GraalVM has FFI/FFM implemented for amd64 arch only, so effectively starting Mandrel/GraalVM 24.2, i.e. Mandrel for JDK 24, we are losing AWT support on Linux aarch64 where it used to work

@zakkak zakkak merged commit 52b28e2 into quarkusio:main Mar 14, 2025
58 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.22 - main milestone Mar 14, 2025
@Karm
Copy link
Member Author

Karm commented Mar 14, 2025

@zakkak
Migration guide updated as https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.19/_compare/8ffa458b7951b8da1e26a86958243dd6edb4b55d...0d6004747c902b7e230e8e8a3209c765d6e8266c

@Karm there is a typo in your update. "To switch back to UBI 8" suggests using ubi9

Furthermore, we need to add a note about

GraalVM has FFI/FFM implemented for amd64 arch only, so effectively starting Mandrel/GraalVM 24.2, i.e. Mandrel for JDK 24, we are losing AWT support on Linux aarch64 where it used to work

  1. gonna fix copy-paste typo
  2. I'm waiting for my build to test AWT with the recently merged FFM/FFI aarch64 JDK 25 support, gonna update text presently

@Karm
Copy link
Member Author

Karm commented Mar 14, 2025

@zakkak
Copy link
Contributor

zakkak commented Mar 14, 2025

Thank you @Karm

@Karm
Copy link
Member Author

Karm commented Apr 2, 2025

@zakkak @gsmet added backport label to help with adopting JDK 24.

@Karm
Copy link
Member Author

Karm commented Apr 2, 2025

JDK 25 won't have this limitation any more though...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native image build fails on Mac M2 with GraalVM 24 Native images fail to build on aarch64 mac with latest GraalVM master

4 participants