Skip to content

ci: fix JNI builds on Linux ARM64 + Windows ARM64, add GraalVM release#1

Merged
kdroidFilter merged 6 commits into
masterfrom
fix/ci-and-rename
Apr 24, 2026
Merged

ci: fix JNI builds on Linux ARM64 + Windows ARM64, add GraalVM release#1
kdroidFilter merged 6 commits into
masterfrom
fix/ci-and-rename

Conversation

@kdroidFilter
Copy link
Copy Markdown
Collaborator

Summary

Three independent fixes + one new workflow, kept in a single PR so CI validates them together before touching master.

Fixes

  • Linux ARM64 JNI build (build-natives.yaml) — install Android SDK via android-actions/setup-android@v3 on ubuntu-24.04-arm. The x64 runner ships with an SDK but the ARM image does not, and com.android.library requires one at configuration time.
  • Windows ARM64 JNI build (build-windows.bat) — always reinvoke vcvarsall.bat with the target arch, using amd64_arm64 for cross-compiles. Previously the script skipped env setup when cl.exe was already on PATH (set by ilammy/msvc-dev-cmd for x64), so linking pdfium.dll.lib ARM64 produced 23 LNK2019 unresolved externals.
  • Maven coordinatedev.nucleusframework.pdf:pdfiumdev.nucleusframework:pdfium. Flatter namespace, matches the user's published groupId. README snippet updated.

New

  • release-graalvm.yaml — on every v* tag (and on manual dispatch), builds the :example desktop app as a GraalVM native image for Linux x64/arm64, macOS arm64/intel, Windows x64. Packages .deb/.dmg/.exe and uploads them to a GitHub Release. Inspired by Nucleus's release-graalvm.yaml but trimmed to this project's actual native-artifact surface (just PDFium JNI).

Test plan

  • Pre Merge Checks passes on this PR — validates build-natives.yaml across Linux x64/aarch64, macOS, Windows x64+arm64, then :pdfium:check
  • Trigger release-graalvm.yaml manually via workflow_dispatch on this branch to validate the desktop builds end-to-end before merging
  • After merge, re-tag v149.0.7802.0 on the fixed master to retry Maven Central publication

- Install Android SDK on ubuntu-24.04-arm so com.android.library configures
  cleanly (SDK is preinstalled on ubuntu-latest but not on ARM images).
- build-windows.bat always calls vcvarsall.bat with the requested arch,
  using amd64_arm64 when cross-compiling ARM64 from an x64 host. Previously
  a preexisting x64 cl.exe on PATH prevented the arm64 env from being set
  and caused LNK2019 unresolved external errors on the ARM64 DLL.
- Simplify Maven coordinate from dev.nucleusframework.pdf:pdfium to
  dev.nucleusframework:pdfium, update README snippet accordingly.
- Add release-graalvm.yaml: on every v* tag, build GraalVM native-image
  packages for Linux x64/arm64, macOS arm64/intel, Windows x64 and upload
  .deb/.dmg/.exe to a GitHub Release.
Validates :example:packageGraalvmNative on Linux x64, macOS ARM64 and Windows x64 for every pull request, catching regressions in the desktop build before merge. Mirrors Nucleus's test-graalvm.yaml.
android-actions/setup-android@v3 defaults to installing 'tools platform-tools', but the legacy 'tools' package has no ARM64 Linux build and fails with sdkmanager exit code 1. Install only 'platforms;android-36' which is what AGP needs at configuration time for :pdfium.
Previously the task linked against the x86_64 libpdfium.so regardless of host arch, so on ubuntu-24.04-arm the linker rejected the incompatible .so and failed with 'cannot find -lpdfium'. Pick the PDFium lib dir from System.getProperty('os.arch').
Two fixes to unbreak :pdfium:check on Linux.

- Drop the Os.isFamily(FAMILY_MAC) guard around iOS cinterop. Kotlin/Native
  cross-compiles iOS klibs on any host and cinterop only needs the staged
  PDFium headers; libraryPaths/linkerOpts are only consumed at final link
  time (macOS). Previously all dev.nucleusframework.pdfium.native.* imports
  were unresolved on Linux, so compileKotlinIosSimulatorArm64 failed.

- Wire installPdfiumWasm + generatePdfiumWasmRuntime as explicit deps of
  jsProcessResources too, not just wasmJsProcessResources. Both read from
  src/webMain/resources/pdfium, and Gradle 9 enforces this implicit-dep
  check strictly.
@kdroidFilter kdroidFilter merged commit 8852018 into master Apr 24, 2026
4 checks passed
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