Skip to content

fix(packaging): unpack the orcad serve-selection entry so orca serve can run it - #27404

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/post-relay-asar-orcad
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/post-relay-asar-orcad

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

ELI5

On an installed Orca, orca serve asks the app a quick question first: "should this server run on orcad?" The file that answers was left inside the app's sealed archive, where the command-line tool cannot open it. So every orca serve printed a "Cannot find module" error and quietly fell back to the older Electron server.

What Changed

  • Before: on packaged builds (reported on the Linux .deb, same on macOS/Windows), every orca serve start logged Cannot find module '.../app.asar.unpacked/out/main/orcad/orcad-local-serve-selection-entry.js' and ran on Electron serve, which binds all interfaces.
  • After: the file is copied out next to the other command-line entry points, so the check runs and orca serve uses orcad when this machine can.

Mechanism: the CLI runs out/main/orcad/orcad-local-serve-selection-entry.js from app.asar.unpacked with ELECTRON_RUN_AS_NODE=1, and that mode cannot read inside app.asar. The electron-builder asarUnpack list now includes that file. Its imports already resolve: the shared chunks are under the unpacked out/main/chunks/**, and @orca/process-host ships in resources/node_modules.

Why

This is the same fix already applied to the other entries the CLI or scanner runs under ELECTRON_RUN_AS_NODE (daemon, parcel watcher, the foreign SQLite reader). I unpacked only this one file rather than all of out/main/orcad/**, because the other files in that folder are loaded only by the Electron main process, and asar handles those paths.

Linked Issue

Fixes #27307

Visual Proof

N/A. Packaging-only change with no UI.

Testing

  • Automated tests added/updated, or explained why not below

New test in config/scripts/electron-builder-config.test.mjs: it reads the entry name from src/shared/orcad-local-serve-selection.ts, the same constant the CLI uses, and runs electron-builder's own FileMatcher over asarUnpack. It failed before the config change and passes after it. pnpm tc, oxlint, pnpm run check:code-quality:changed and pnpm lint pass.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Applies the same way on all platforms (one config list). SSH hosts are unaffected because they deploy orcad from the template, not from this entry.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: 5fb049b2-9a8b-4865-9c6a-8364d936b5e4

📥 Commits

Reviewing files that changed from the base of the PR and between b197bc6 and b1ec449.


📒 Files selected for processing (2)
  • config/electron-builder.config.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; 7 remain after this review.



📝 Walkthrough

Walkthrough

The electron-builder configuration now includes the orcad serve-selection entry in asarUnpack. A packaging test derives the entry name from its shared source declaration and checks that the matching compiled main-process path is included.


Priority: ➖ Normal

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to b1ec4

The change unpacks the orcad serve-selection entry at the path used by the packaged launcher. The matcher test and runtime dependency packaging checks address the identified launch requirements, leaving no concrete merge blocker.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main packaging fix: unpacking the orcad serve-selection entry so orca serve can run it.
Description check Passed The description follows the required template, explains the user impact and mechanism, links issue #27307, documents testing, marks visual proof as not applicable, and addresses platform and SSH impac…
Linked Issues check Passed Issue #27307 requires the orcad serve-selection entry to run from app.asar.unpacked so orca serve can select orcad. The PR adds out/main/orcad/orcad-local-serve-selection-entry.js to `asarUnpack…
Out of Scope Changes check Passed The PR changes only the electron-builder packaging list, an explanatory comment, and a focused packaging test. These changes support issue #27307. No unrelated product behavior or files are included.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

  • 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

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

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.

Linux .deb 1.4.224: orcad-local-serve-selection-entry.js is not in app.asar.unpacked, so orca-ide serve always falls back to Electron serve

1 participant