Repository navigation
fix: bundle macOS native dependencies before signing - #197383
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR embeds the locked Sparkle artifact, repairs the MLX helper’s library reference, and checks native dependencies before signing. Example: Packaging an arm64 app when Sparkle exists in SwiftPM’s artifacts directory but not its release products directory.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs concrete macOS packaging failures still present on main, with no verified introduced defect. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe macOS packager assembles Swift products, frameworks, helpers, and the private Bun runtime into a staged app, verifies its dependencies, signs it, and publishes the verified bundle. flowchart LR
A[Locked SwiftPM artifacts] --> C[Staged app assembly]
B[Swift executables and private runtime] --> C
C --> D[Executable local dependency audit]
D --> E[Signing and runtime verification]
E --> F[Verified app replacement]
Technical reviewBest possible solution: Keep dependency assembly and validation in the existing packaging and portability owners, preserving signing policy and verified output replacement. Do we have a high-confidence way to reproduce the issue? Source shows the silent missing-framework path and absent MLX reference repair; the author reports native red/green regressions, but this read-only review executed no target code. Is this the best way to solve the issue? The patch fixes dependency production and routing before validating the assembled artifact, and each added test covers a distinct failure without introducing a competing owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 17140700d7b5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +141, Docs +2, Other +121. Total +264 across 8 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 11, 2026, 4:39 PM ET / 21:39 UTC. |
|
Merged via squash.
|
(cherry picked from commit f817a8b) Source-x: f817a8b Backport scope: scripts/lib/mac-swift-build.sh sparkle_framework_for_arch selects locked XCFramework artifact; scripts/package-mac-app.sh mandatory Sparkle embedding/MLX install-name repair; scripts/lib/mac-runtime-portability.mjs app-mode per-executable closure before signing/replacement. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f91f5e9709a84f61806b428ca86b1e2bb502c54b)
What Problem This Solves
Fixes macOS builds that crash at launch because Sparkle is missing, or whose MLX voice helper can find a required Swift library only on the build machine.
User Impact
Packaged apps include the locked Sparkle framework and point the MLX helper at the bundled compatibility library. Packaging fails before signing or replacing an existing output if a native dependency cannot resolve within the app or the system libraries.
Why This Change Was Made
Swift Build's products directory does not contain the resolved Sparkle binary artifact. The packager silently skipped that missing path. Separately, MLX is its own executable and cannot inherit the main app's Frameworks runpath.
Use SwiftPM's locked artifact directly, fix the helper's install name before signing, and extend the existing native inventory/portability owner to check each executable and its dependency chain. The existing stricter private-runtime audit remains unchanged. No dependency versions, signing identities, entitlements, or installed application state change.
Evidence
node scripts/run-vitest.mjs test/scripts/mac-runtime.test.ts test/scripts/package-mac-app.test.ts --maxWorkers=1: 196 passed, 90.58 seconds in Vitest / 99.39 seconds including the wrapper. The new compiled native regression took 973 ms. CI seconds are not yet available.4576d88153188f35067baff75f60586e311ea9a6: no verified findings. A subsequent one-line test-boundary adjustment made the native regression fail on the original behavior rather than a missing marker; its red/green run passed. This is a narrative review, not a helper-validated result.Fresh exact-head
pnpm mac:packagerelease/arm64 packaging passed from an independent checkout with private state and an ad-hoc debug bundle identity. Final-output verification passed dependency closure (54 native images), deep/strict codesign, exact source metadata, embedded Sparkle, and the MLX bundled compatibility-library route. The package also passed its signed private-runtime proof. This is arm64 packaging proof, not a Developer ID/notarized release, universal build, installation, GUI, or personal Keychain acceptance. Exact-head CI and PR tooling Darwin passed, including the required CI gate. Scope-skipped lanes are not additional passing proof. Hosted ClawSweeper review completed on this exact head with no actionable findings and no before-merge items; it recommends maintainer review. Its evidence limitation is that the public PR contains narrative packaging results rather than raw terminal output.