Skip to content

Feat: Refuse Liberica NIK for AWT-free macOS images, and keep main on the first thread there - #60

Merged
b-re-w merged 2 commits into
extendedfrom
feat/nik-macos-main-thread
Oct 18, 2026
Merged

b-re-w merged 2 commits into
extendedfrom
feat/nik-macos-main-thread

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 18, 2026

Copy link
Copy Markdown
Member

An AWT-free macOS image needs main on the process's first thread, because the AppKit window takes its calls there. Liberica NIK 25.0.4.1 runs main on a new thread on macOS whatever -H:-RunMainInNewThread says (run 39084384117), so any image it builds hangs at its first window call.

  • packageNativeImage reads the GraalVM's release file before building. When IMPLEMENTOR is BellSoft and the build is AWT-free on macOS, it stops and gives the reason and the fix (upstream GraalVM 25, as graalvmHome or GRAALVM_HOME). AWT images and Linux are unaffected.
  • It now passes -H:-RunMainInNewThread itself, inside the unlocked experimental options, for every AWT-free macOS image. The samples drop their own copy.
  • Tests: NativeImageMainThreadTest, plus a macOS gate step that runs packageNativeImage with Liberica NIK and requires the refusal and its reason.
  • Docs: extended/README.md, README_ko.md and extended/native-image/README.md.

… the first thread there

An AWT-free macOS image needs main on the process's first thread, because the AppKit window takes
its calls there. Liberica NIK 25.0.4.1 runs main on a new thread on macOS whatever
-H:-RunMainInNewThread says (run 39084384117), and the image hangs at its first window call.
packageNativeImage now reads the GraalVM's release file before building and stops with the reason
and the fix (upstream GraalVM 25) when its IMPLEMENTOR is BellSoft. It also gives
-H:-RunMainInNewThread itself, unlocked, for every AWT-free macOS image, so the samples no
longer have to.

Documented in extended/README.md, README_ko.md and extended/native-image/README.md.
NativeImageMainThreadTest covers the detection.
@b-re-w
b-re-w merged commit 7539495 into extended Oct 18, 2026
15 checks passed
@b-re-w
b-re-w deleted the feat/nik-macos-main-thread branch October 18, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant