Skip to content

[BUILD] macOS package: sign the Qt frameworks as bundles, retry codesign - #5

Merged
timosachsenberg merged 1 commit into
developfrom
claude/macos-codesign-frameworks
Nov 30, 2026
Merged

timosachsenberg merged 1 commit into
developfrom
claude/macos-codesign-frameworks

Conversation

@timosachsenberg

@timosachsenberg timosachsenberg commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

The macOS nightly installer of 2026-11-22 failed in the Package step:

codesign failed for .../lib/QtGui.framework/Versions/A/Headers/qbrush.h (1)
CPack Error: Error when generating package: OpenMS-GUI

The Dependencies component signed every file under lib/ with its own codesign --timestamp call. That includes the Headers/ of the eight bundled Qt frameworks, which install(RUNTIME_DEPENDENCY_SET) copies as whole folders. So every nightly made thousands of requests to Apple's timestamp service, and one of them failed. The code was the same on the nights before and after, and those succeeded. The failure was in the middle of the file list. This is the only packaging failure in this repository's CI history. A dropped timestamp request is the likely cause, but not a proven one: codesign's own message was printed as a STATUS message, which CPack hides, so only the exit code made it into the log.

Changes

New cmake/MacOSX/codesign.cmake, included by the install rules when CPack runs them:

  • openms_gui_codesign(<path> IDENTITY … [IDENTIFIER …] [TIMESTAMP] [OPTIONS …]): if codesign fails, it tries again (3 attempts, 10 s apart). The last failure stops the installation with codesign's output in the error message.
  • openms_gui_codesign_dir(<dir> …): signs each *.framework as a bundle, through its Versions/<v> folder. That signs the binary and seals everything else (Info.plist, Headers/) as resources, which is how macOS expects frameworks to be signed. Every other file (dylibs, plugins) is still signed on its own. Symlinks and linked folders (Versions/Current) are skipped. CMP0009 is set inside the function because the generated install script sets no policies.

package_mac_productbuild.cmake (libraries, Qt, plugins, CLI tools) and add_mac_bundle.cmake (app bundles) now use these functions. The identifiers stay the same: de.openms.TOPP.libs.<name> (a framework keeps the name of its binary, e.g. …QtGui), de.openms.TOPP.<tool> and de.openms.<app>. Ad hoc signing (-) still requests no timestamp.

With these changes the Qt part needs 8 framework signatures plus about 30 dylibs and 3 plugins, instead of one call per header.

Testing

  • On Linux, with a fake codesign on PATH and a copy of the real lib/ layout (frameworks with Versions/A, Versions/Current and top-level symlinks, versioned dylib symlinks, lib/plugins/):
    • frameworks are signed once, through Versions/A; dylibs and plugins one by one; symlinks are skipped;
    • a failure followed by a success logs a warning with codesign's message, and the build continues;
    • a permanent failure stops after 3 attempts with codesign failed for <path> (exit code 1): <codesign output>;
    • the exact install(CODE) snippets from both files, run with cmake --install, give the expected argument lists; the identity with spaces and parentheses stays one argument.
  • On macOS, with the real certificates, in a dry run of release.yml on this branch (deploy: false, core_ref: develop): https://github.com/OpenMS/OpenMS-TOPP-GUI/actions/runs/46403593479
    • Package succeeded in 39 s. The nightly of 2026-11-29 took about 6 min for the same step, before this change.
    • Notarize macOS Package: Apple's notary service returned status: Accepted and the ticket was stapled. pkgutil reports "signed by a developer certificate issued by Apple for distribution" and spctl reports "accepted".
    • No codesign call needed a retry.

AI disclosure

  • This PR was prepared with AI assistance (Claude Code). The human contributor reviews and is accountable for it.

https://claude.ai/code/session_0149aXmZodXGhChZB7AQzpkp


Generated by Claude Code

The Dependencies component signed every file under lib/ on its own, the
Headers/ of the bundled Qt frameworks included: thousands of codesign
calls, each asking Apple's timestamp service for a secure timestamp. One
failed in the nightly of 2026-11-22 (on QtGui.framework/.../qbrush.h)
and stopped the macOS package; CPack hid codesign's message, so only the
exit code was logged.

cmake/MacOSX/codesign.cmake, included by the install rules:
- openms_gui_codesign tries a failed codesign again (3 attempts, 10 s
  apart) and fails with codesign's output;
- openms_gui_codesign_dir signs each framework as a bundle (its
  Versions/<v>, which seals the headers as resources) and every other
  file on its own, without following linked folders.
package_mac_productbuild.cmake and add_mac_bundle.cmake use them. The
identifiers stay de.openms.TOPP.libs.<name> and de.openms.<app>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149aXmZodXGhChZB7AQzpkp
@timosachsenberg
timosachsenberg marked this pull request as ready for review November 30, 2026 11:36
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6888ad97-86cb-4485-9d15-fe6f3782dc5f
Commits

Reviewing files that changed from the base of the PR and between 1c7ee16 and 5e27e6c.

Files selected for processing: 3

  • cmake/MacOSX/codesign.cmake
  • cmake/package_mac_productbuild.cmake
  • src/openms_gui/add_mac_bundle.cmake
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@timosachsenberg
timosachsenberg merged commit 6f8cd8f into develop Nov 30, 2026
10 of 15 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.

2 participants