From a2e3f11e70f5f7e61a96baa2694bf90c35173db9 Mon Sep 17 00:00:00 2001 From: Gronod Date: Sat, 12 Sep 2026 09:29:40 +0100 Subject: [PATCH] fix(m9): ad-hoc sign embedded ICCeryCore framework so test host launches (#119) --- .gitea/workflows/macos.yml | 13 +++++++++++++ Packages/ICCeryCore/Package.swift | 5 +---- project.yml | 7 +++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/macos.yml b/.gitea/workflows/macos.yml index b75e74e..b4d9b43 100644 --- a/.gitea/workflows/macos.yml +++ b/.gitea/workflows/macos.yml @@ -45,6 +45,19 @@ jobs: CODE_SIGNING_ALLOWED=YES \ CODE_SIGN_IDENTITY='-' + # Xcode embeds the shared ICCeryCore package framework into the app + # and the test bundle without signing it. Ad-hoc hosts still require + # every loaded dylib to carry a cdhash — dyld killed the test host at + # launch (run 31992) — so sign every embedded copy once the build is + # done (embed steps run after any build script phase) (#119). + - name: Sign package product frameworks + run: | + find "$DERIVED/Build/Products/Debug" -depth -name '*_PackageProduct.framework' -print0 \ + | while IFS= read -r -d '' fw; do + echo "signing $fw" + codesign --force --sign - --timestamp=none "$fw" + done + - name: Test unit (ICCeryCoreTests) run: | XCTESTRUN="$(find "$DERIVED" -name 'ICCery*.xctestrun' | head -n 1)" diff --git a/Packages/ICCeryCore/Package.swift b/Packages/ICCeryCore/Package.swift index 6bb5b81..5fde803 100644 --- a/Packages/ICCeryCore/Package.swift +++ b/Packages/ICCeryCore/Package.swift @@ -5,10 +5,7 @@ let package = Package( name: "ICCeryCore", platforms: [.macOS(.v12)], products: [ - // Static so app + test bundles each link ICCeryCore directly — - // a dynamic package product framework is not embedded in the - // .app and dyld kills the app at launch on macOS 12 (#117). - .library(name: "ICCeryCore", type: .static, targets: ["ICCeryCore"]), + .library(name: "ICCeryCore", targets: ["ICCeryCore"]), ], targets: [ .target(name: "ICCeryCore"), diff --git a/project.yml b/project.yml index 46bc694..bdd9fc8 100644 --- a/project.yml +++ b/project.yml @@ -62,6 +62,13 @@ targets: OTHER_SWIFT_FLAGS: ["$(inherited)", "-strict-concurrency=minimal"] MACOSX_DEPLOYMENT_TARGET: "12.0" ARCHS: "$(ARCHS_STANDARD)" + # Debug builds sign ad-hoc; hardened-runtime library validation would + # reject the unsigned embedded ICCeryCore package framework when the + # test host launches (run 31992, #119). Release keeps validation and + # links the package statically anyway. + configs: + Debug: + DISABLE_LIBRARY_VALIDATION: YES ICCeryCoreTests: type: bundle.unit-test -- 2.39.5