Skip to content

Add option to skip signing of runtime on macOS #138

Description

@neilcsmith-net

By default, NBPackage deep re-signs the whole of the installation payload on macOS. This ensures everything is signed with the hardened runtime and correct entitlements. When first written this proved necessary to pass notarization requirements. This might no longer always be the case, and it can cause subtle issues with things like jlink. See mailing list conversation at https://lists.apache.org/thread/gm8rst0ppmflfg38trdfvglb6dgfjzc3

We should provide an option to skip re-signing of the JDK runtime in certain cases where the user can determine this is unnecessary.

Activity

  1. geertjanw commented on Oct 1, 2026

    @geertjanw
    Member

    I've taken a first stab at adding an option to skip re-signing the bundled JDK runtime on macOS.

    New option: package.macos.codesign-runtime (boolean, default true). Leaving it at the default keeps current behaviour. Setting it to false keeps the runtime's existing signatures, which should avoid the jlink "modified runtime" errors.

    A couple of things on the approach:

    • It filters by the runtime path (Contents/Home) rather than adjusting the signing glob, since FileUtils.find also matches on filename, so the default glob's *.dylib would still catch the runtime libs by name.
    • The final whole-bundle codesign doesn't use --deep, so it doesn't re-sign the runtime contents either, filtering the native-binary list is enough to preserve the JDK's original signatures.
    • Also added help text, a short README note, a log line when the runtime is skipped, and a test.

    Something ekse, per the mailing-list thread: skipping runtime re-signing could affect notarization or runtime permissions, so it'd be good for us to run a package built with codesign-runtime=false through notarization + stapling before relying on it.

  2. geertjanw commented on Oct 1, 2026

    @geertjanw
    Member

    For review: #146

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions