Repository navigation
improve: build macOS release architectures concurrently - #135753
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 9:46 PM ET / September 2, 2026, 01:46 UTC. ClawSweeper reviewWhat this changesThis PR runs arm64 and x86_64 macOS Swift build graphs concurrently in isolated workers before assembling the universal application. Merge readinessKeep open for normal maintainer gating: the introduced scheduler correctly waits for architecture-local builds and verified cleanup before assembly, but the supplied exact-head CI rollup is still incomplete/truncated. Priority: P2 Review scores
Verification
How this fits togetherThe macOS packager builds Swift application and helper binaries for each CPU architecture, then combines their outputs into one signed app. This change replaces its serial build stage with a scheduler that collects verified per-architecture results before assembly. flowchart LR
A[Mac release packager] --> B[Architecture scheduler]
B --> C[arm64 worker]
B --> D[x86_64 worker]
C --> E[Verified build results]
D --> E
E --> F[Universal app assembly]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +132, Other +197. Total +329 across 5 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the isolated scheduler design and land only after the exact head has completed the required CI gates; the owner has already accepted the intentionally bounded signed-package validation scope. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal release-packaging performance change, not a reported user-facing defect. The changed behavior has focused scheduler-harness coverage and reported real SwiftPM runs. Is this the best way to solve the issue? Yes. Isolated architecture workers preserve per-build package, snapshot, resource-patch, and cleanup ownership, whereas backgrounding the former loop would retain shared lifecycle state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fc277615d8e4. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer disposition of the completed review on The detected “serialized state” is invocation-owned build output under the existing temporary app staging directory: verified source/output facts and a cleanup-complete receipt. Normal success removes it with staging; uncertain cleanup retains it with the owned lock for diagnosis. It is not Gateway/runtime persisted state, a database schema, or an upgrade migration. CI follow-up: the first exact-head run hit a CLI help-process deadlock guard after printing help and startup traces. The same unaffected shard passed on the preceding head. Its failed job was retried once, together with the two Swift jobs that had no runner and no executed steps, after all active work completed. The remaining completed checks were retained. |
|
Exact-head CI run 33579008526, attempt 3 is green on Both unrelated timing failures passed their single failed-job retry. Named follow-up: replace the fixed 100 ms settlement in The full signed universal-package proof gap remains as documented and accepted in the maintainer disposition above. |
|
Merged via squash.
|
What Problem This Solves
Universal macOS packaging builds its arm64 and x86_64 native dependency graphs serially, leaving release time on the table even when the host can build both architectures. This runs the two graphs concurrently while keeping the total Swift compiler job budget bounded by available CPUs.
Why This Change Was Made
The packaging owner now delegates each architecture to an isolated app and MLX package root, with separate SwiftPM scratch paths, a verified read-only Peekaboo source snapshot, invocation-owned resource backups, and an exclusive architecture lock. The existing managed-child process owner joins workers and descendants before restoring patched sources or detaching snapshots. A failed build cancels its sibling; cleanup failure retains work and ownership locks for diagnosis. Assembly begins only after both builds verify the expected source revision.
The old serial graph loop and shared temporary-package/snapshot cleanup path are removed. The existing shell build logic is extracted into one worker owner, rather than duplicated. Production delta is +197 lines after accounting for the move; the additional code owns concurrent scheduling, cancellation, and verified cleanup. Tests add 132 net lines. No new operator configuration is introduced.
User Impact
Maintainers can produce universal macOS releases sooner without changing the packaged application's behavior. This is an internal release-tooling change, so no product changelog entry is needed.
Evidence
node scripts/run-vitest.mjs test/scripts/package-mac-app.test.ts: 81 tests passed. Executable fixtures cover concurrent success, worker failure, source-revision mismatch, parent cancellation, cleanup failure and retained locks, resource restoration, snapshot verification, and existing packaging behavior.Alternative considered: simply backgrounding the original loop would share shell state, package lockfiles and cleanup ownership; architecture-local workers keep those responsibilities explicit. Remaining limitation: no end-to-end signed universal application was rebuilt for this change.