Skip to content

fix(packaging): ship serve-sim only in macOS builds - #25128

Merged
Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/package-serve-sim-mac-only
Oct 4, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
Jinwoo-H/package-serve-sim-mac-only

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​17
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

ELI5

serve-sim is the tool Orca uses to show the iOS Simulator, which only exists on macOS. Windows and Linux builds were shipping it anyway. Since the latest serve-sim version added a macOS-only binary, the Windows release signing step rejects it, and that blocked v1.4.220. This change ships serve-sim only in macOS builds.

What Changed

  • Before: serve-sim is in the runtime package list that every desktop build copies into resources/node_modules. Since fix(emulator): take serve-sim 0.1.47 so the iOS simulator works on Xcode 27 #24228 (serve-sim 0.1.47, for Xcode 27), the package includes dist/native/serve-sim-native.node, a macOS universal (Mach-O) binary.
    • The Windows release stages every .exe, .dll and .node for SignPath.
    • SignPath's inner-binaries config signs **/*.node as Windows PE files, so it failed the v1.4.220 signing request: "The file does not correspond to the specified file type … serve-sim-native.node".
  • After:
    • serve-sim moves to a macOS-only root list, beside the existing Windows-only list, so Windows and Linux packages no longer contain it.
    • macOS packaging is unchanged.
  • Runtime impact on Windows and Linux: none.
    • The iOS backend reports itself unsupported off macOS (isSupportedOnHost() returns platform() === 'darwin'), and the emulator bridge picks the Android backend there.
    • resolveServeSimExecutable is reached only through the iOS backend.
    • The app finds serve-sim by file path, not by a bare import, so the packaged-import check doesn't depend on it.

Why

  • I checked all 42 Windows binaries in the failed signing bundle. Only serve-sim-native.node is not a Windows binary: it starts with cafebabe, not MZ.
  • Two other fixes were considered and rejected:
    • Having the release workflow skip non-PE files when staging: that would unblock signing but keep shipping a dead macOS package on Windows and Linux.
    • Excluding the file in SignPath's server-side config: that's a manual change, and the next macOS-only addon would break signing again.
  • Not shipping what can't run fixes the problem at its source.

Linked Issue

N/A (maintainer; release blocker for v1.4.220)

Visual Proof

N/A: packaging change only, with no UI change.

Testing

  • Added a test: serve-sim is not in the shared runtime roots, the Linux closure, or the Windows and Linux extraResources. It fails without the change, and the existing macOS serve-sim test still passes.
  • electron-builder-config and the packaged-runtime suites pass (5 files, 75 tests).
  • The real check is the Windows release signing step in the next 1.4.220 cut, which runs after an ad hoc build.

Review

Agent skill upstream boundary

  • Not applicable

Notes

  • Cross-platform: macOS is unchanged; Windows and Linux lose an unusable package.
  • SSH: serve-sim is not used by relays or remote hosts.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • N/A for visuals, with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Tests pass locally for the touched contracts; CI covers the rest

serve-sim drives the iOS Simulator, which exists only on macOS. Since 0.1.47
(#24228) it carries a Mach-O addon, and Windows signing rejects every *.node
that is not a PE file, so the v1.4.220 Windows build failed at SignPath.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — gate serve-sim to macOS packaging so Windows/Linux stop shipping its Mach-O addon.

  • Route serve-sim through a macOS-only root list — 'serve-sim' leaves the shared PACKAGED_RUNTIME_PACKAGE_ROOTS; a new DARWIN_PACKAGED_RUNTIME_PACKAGE_ROOTS is merged into collectPackagedRuntimePackages only when electronPlatformName === 'darwin', mirroring the existing Windows-only list. macOS extraResources is unchanged.
  • Regression test added — asserts serve-sim is absent from the shared roots, the Linux closure, and linux/win extraResources, while the existing macOS test still pins its presence.

I verified the off-macOS claim independently: IosEmulatorBackend.isSupportedOnHost() returns platform() === 'darwin' (src/main/emulator/backends/ios-emulator-backend.ts:66), the router selects the Android backend elsewhere, no main-bundle code bare-imports serve-sim, and app.asar carries no node_modules (config/electron-builder.config.cjs:112), so removing it from extraResources removes it from the package entirely. The electron-builder-config, package-electron-runtime-contract, and electron-builder-runtime-resources suites pass locally (60 tests).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 67a5ae8d-074c-4a74-9831-1958098dd081
📥 Commits

Reviewing files that changed from the base of the PR and between 2b1acd0 and 329013e.

📒 Files selected for processing (2)
  • config/packaged-runtime-node-modules.cjs
  • config/scripts/electron-builder-config.test.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The shared packaged runtime roots no longer include serve-sim. The collector adds the Darwin-only package roots when the target platform is Darwin. A regression test checks that serve-sim is absent from the shared roots and from Linux and Windows packaging resources. The existing macOS runtime-closure test continues to cover its inclusion.

Priority: ⬆️ High

Merge Risk: ⚪ Minimal · up to 32901

The change keeps serve-sim in macOS packages while excluding it from Windows and Linux outputs, with regression coverage for those paths. No concrete merge blocker remains; the Windows release-signing run is still a follow-up validation.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 32901

The change narrowly removes an unsupported simulator dependency from Windows and Linux while preserving macOS packaging. No introduced security weakness was identified. The resulting release artifacts and signing outcome remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated exposure change is limited to dependency content in Windows and Linux desktop artifacts. The hardcoded target-specific root selection narrows distribution of serve-sim rather than granting additional runtime authority.

Trust Boundaries and Controls

  • observed — Host-support checks protect normal iOS device selection and availability. Active-session lookup itself does not recheck host support, and registration can default to iOS, but those existing behaviors are not newly introduced controls or vulnerabilities in this PR. Production attachment records the session returned by host-aware backend selection.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: serve-sim is packaged only in macOS builds.
Description check ✅ Passed The description explains the problem, the change, the platform impact, and the testing. It also addresses visual proof and the linked-issue exception for maintainers. The blank Review section and omit…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

@Jinwoo-H
Jinwoo-H merged commit 94f5669 into main Oct 4, 2026
32 checks passed
Jinwoo-H added a commit that referenced this pull request Oct 4, 2026
serve-sim drives the iOS Simulator, which exists only on macOS. Since 0.1.47
(#24228) it carries a Mach-O addon, and Windows signing rejects every *.node
that is not a PE file, so the v1.4.220 Windows build failed at SignPath.

(cherry picked from commit 94f5669)
machamy added a commit to machamy/orca that referenced this pull request Oct 4, 2026
Upstream cut v1.4.220 the day machamy.18 shipped. This merges main to
ea6a6d6, which contains everything in that tag including its tag-only
packaging fix (stablyai#25128).

The fork's statusline model/effort endpoint now sits behind upstream's new
status-hooks gate. The window-services tests are upstream's file again: the
fork's split-out harness and TCC test became duplicates, and upstream's 31
tests pass unchanged on fork code. The sidebar reveal path feeds worktree
folder expansion from upstream's host-scoped lineage inputs.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

1 participant