[orchestrator-v2] fix(desktop): Bundle staged runtime dependencies#3815
[orchestrator-v2] fix(desktop): Bundle staged runtime dependencies#3815mwolson wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. This PR introduces new dependency resolution logic for desktop packaging that determines which packages are bundled for end users. The transitive dependency closure walking and ffi-rs native package handling are non-trivial changes to build infrastructure that warrant human verification. You can customize Macroscope's approvability policy. Learn more. |
a6b05bf to
1c46b1a
Compare
|
Closing in favor of #3816 (merged to Local verification: rebuilt the orchestrator-v2 integration stack from current
#3816 covers the ffi-rs optional-native packaging gap that blocked nightlies; the rest of the staged-closure work is no longer needed for local packaging once main is in the integration base. Thanks Julius for the pointer. |
|
Superseded for packaging by #3816 on main; verified local AppImage without this branch. |
What Changed
cross-spawnv7 runtime dependencies used by the packaged backend.ffi-rsandfffnative packages, including glibc-only Linux packages for the Windows WSL backend.cross-spawn, native package promotion, pnpm symlink fallback, stage workspace config, and ASAR unpack config.Why
fast-checkandfind-my-way-tsbecause pnpm keeps them under the virtual store rather than top-level appnode_modules.cross-spawnruntime deps and native optional packages.cross-spawnv7 deps and platform native packages needed byffi-rsandfff.realpathSync(packageJsonPath)in the closure walk and cover the fallback symlink layout in a unit test.Validation
effectas a direct dependency, realpnpminstallsfast-checkandfind-my-way-tsunder the virtual store, not as top-level app dependencies. This is not aubeshim-only.vp test scripts/build-desktop-artifact.test.tsvp checkvp run typecheckChecklist
Note
Bundle staged runtime dependencies for ffi-rs and cross-spawn v7 in desktop artifact build
resolveStagedDependencyClosureto walk the installed dependency graph from a set of direct dependencies, using issuer-aware resolution to correctly handle pnpm symlink layouts.resolveDesktopStageDependenciesto compute the final desktop stage dependency set, including ffi-rs platform/arch native packages, cross-spawn v7 runtime dependencies (isexe,which, etc.), and a re-walk after promotions.DESKTOP_ASAR_UNPACKto includenode_modules/@yuuang/ffi-rs-*/**/*alongside existing@ff-labs/fff-bin-*globs.Macroscope summarized 1c46b1a.
Note
Medium Risk
Changes core desktop packaging dependency resolution and native binary staging; mistakes could omit runtime deps or ship wrong platform natives, but scope is limited to the build script with strong unit test coverage.
Overview
Fixes packaged desktop builds missing runtime modules that pnpm keeps in the virtual store by walking installed package manifests and promoting the full transitive closure into the production stage
package.jsonbeforepnpm install --prod.Adds
resolveDesktopStageDependencies, which layers on top of that closure: knowncross-spawnv7 runtime packages (which,isexe, etc.) when they would not appear in the manifest, and platform@yuuang/ffi-rs-*natives (plus glibc-only Linux ffi-rs on Windows for the bundled WSL backend). Manifest resolutionrealpathSyncspackage.jsonpaths so nested pnpm symlink layouts resolve correctly.DESKTOP_ASAR_UNPACKnow includesnode_modules/@yuuang/ffi-rs-*/**/*. Linux fff native selection is refactored to share helpers with ffi-rs; Windows WSL fff staging uses glibc-only Linux bins instead of full gnu+musl.Unit tests cover closure walking, duplicate package names, symlink layouts, cross-spawn promotion, and ffi-rs staging per platform.
Reviewed by Cursor Bugbot for commit 1c46b1a. Bugbot is set up for automated code reviews on this repo. Configure here.