Skip to content

Build macOS installers with Apple's native packaging tools - #1524

Merged
gdams merged 5 commits into
adoptium:masterfrom
gdams:macos-native-packaging-upstream
Nov 12, 2026
Merged

gdams merged 5 commits into
adoptium:masterfrom
gdams:macos-native-packaging-upstream

Conversation

@gdams

@gdams gdams commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace the third-party Packages build dependency with Apple's built-in pkgbuild and productbuild, preserving the existing installer identity, payload, presentation, root-volume policy, and preinstall script.
  • Resolve the latest available LTS JDK/JRE archives for each supported macOS architecture through the Adoptium API, verify their SHA-256 checksums, and build them in a GitHub Actions matrix.
  • Use the API's version.openjdk_version for package metadata, rather than deriving a different version from the archive filename. For example, Java 25's package version remains 25.0.5+8-LTS, not 25.0.5_8.
  • Produce unsigned installers for the existing Eclipse signing and notarization service; do not unlock a keychain, alter the embedded JDK signature, or sign locally.

Packages is a long-lived third-party dependency rather than an Apple-maintained packaging tool. Moving to the native Apple tools removes that extra builder dependency. This is not a claim that Packages is abandoned: its release notes describe recent macOS compatibility updates.

Release-script compatibility

The current Jenkins release invocation of bash pkgbuild/create-installer-mac.sh and its WORKSPACE, MAJOR_VERSION, FULL_VERSION, and optional SEARCH_PATTERN inputs remain supported. Output filenames and locations are unchanged, and each input archive is removed only after a successful build, as before. No change is required for the existing unsigned build and separate Eclipse signing flow; the upstream Jenkinsfile and public release-pipeline caller were inspected.

Intentional exception: local --sign/notarization is removed. Direct callers relying on that option must use the separate signing service. The old CERTIFICATE environment variable no longer triggers signing and emits a warning when set.

Testing

On macOS 27.2 / Apple silicon with the system Bash 3.2:

  • bash test/functional/pkgbuild/runInstallerTests.sh — passed: package identity/version, root-volume policy, ownership/permissions, symlinks, payload filtering, preinstall and UI resources; HotSpot/OpenJ9, JDK/JRE and x86_64/arm64 variants; multi-archive entry point, SEARCH_PATTERN, successful archive removal, failed-build archive preservation, and legacy-signing warning.
  • bash test/functional/pkgbuild/testUpgradeDowngrade.sh — passed: 40 legacy/native transition comparisons (80 fixture installations) for Java 8 JDK, Java 11 JRE, Java 25 JDK and same-version Java 25 build-number changes, in both upgrade and downgrade directions.
  • PYTHONPATH=. python3 -m unittest discover -s test/functional/pkgbuild -p 'test_*.py' — six resolver tests passed, including Java 8/11/25 version formats and invalid metadata.
  • Shell syntax, Python syntax/diagnostics and workflow YAML parsing passed.
  • The live API resolved 18 available combinations across LTS versions 8, 11, 17, 21 and 25. This validates matrix resolution, not all 18 package builds locally; the PR workflow builds the full matrix.

Compared newly built installers against checksum-verified published packages:

Published package Package version Matching BOM entries
Java 8 JDK, x64 1.8.0_504-b01 523
Java 11 JRE, arm64 11.0.33+10 379
Java 25 JDK, arm64 25.0.5+8-LTS 497

For all three, package identifier/version, payload bytes, BOM paths/modes/ownership/sizes/checksums, preinstall script, license, welcome/conclusion pages, and Installer-reported targets matched. The Java 25 logo also matched and its embedded JDK signature passed codesign --verify --deep --strict. The new preview package itself is intentionally unsigned. Native-generated XML is structurally different and estimated install sizes vary slightly (Java 25: 300729 vs 300606 KiB); this is not a byte-identical package container.

The upgrade tests use production-built packages rebased to a unique disposable current-user directory and legacy-style package metadata; they do not install the published packages over a real JDK. All fixtures and unique per-user receipts are cleaned up. On this macOS version, legacy and native behavior matched: Java 25 and Java 11 JRE downgrades left the newer bundle in place, while Java 8-style downgrades were allowed by both. For the blocked Java 25/11 downgrades, both styles still recorded the attempted older receipt version. These are existing Installer behaviors, not new downgrade guarantees.

No privileged system installation, real-JDK upgrade/downgrade, or Eclipse signing/notarization run was performed. The user's installed JDKs were not changed.

Hosted CI: The macOS workflow passed all 20 jobs: the resolver, compatibility tests, and all 18 JDK/JRE matrix builds. The differential Semgrep check also passed.

gdams and others added 3 commits November 11, 2026 16:08
Preserve package identity and release entry-point behavior while replacing the third-party builder. Add API-version, package metadata and isolated upgrade/downgrade coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match the legacy root-volume policy, warn when a legacy certificate is supplied, and test upgrades with realistic package and bundle identifiers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve JDK and JRE artifacts and exact package versions from the Adoptium API, verify downloads, and run metadata and upgrade compatibility checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
steelhead31
steelhead31 previously approved these changes Nov 11, 2026

@steelhead31 steelhead31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, one minor nitpick, feel free to ignore :)

Comment thread pkgbuild/create-installer-mac.sh Resolved
Co-authored-by: Scott Fryer <60462088+steelhead31@users.noreply.github.com>
Quoting SEARCH_PATTERN made the default OpenJDK*-j*.tar.gz glob literal,
so the archive entry point found no inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gdams
gdams enabled auto-merge (squash) November 12, 2026 16:44

@andrew-m-leonard andrew-m-leonard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, thanks George

@gdams
gdams merged commit da28d50 into adoptium:master Nov 12, 2026
26 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.

3 participants