fix: ship Windows app code in asar to fit legacy Squirrel path limits - #55
Merged
Conversation
Squirrel 1.x expands every package file through 260-character .NET path APIs, during releasify and again on end-user machines under %LOCALAPPDATA%. Loose node_modules paths (deepest: nested OpenTelemetry copies under spectrum-ts at 166 characters) exceed that budget, so 0.0.36 Windows packaging failed with PathTooLongException. Windows packages now ship application code inside app.asar (a few hundred short paths instead of tens of thousands of loose files) and unpack only what must exist on real disk: scripts, container image, deploy config, public assets, the desktop directory, node-pty, and native modules. The desktop shell translates HELM_APP_ROOT, the working directory, and the Squirrel uninstall helper to the unpacked tree so Python, PowerShell, WSL, and plain-Node consumers keep reading real files, while the server itself is imported from inside the archive so dependency resolution stays there. The photon sidecar, a plain Node child process that cannot open asar archives, is bundled self-contained during npm run build and started from the unpacked tree in packaged builds. macOS, Linux, and development startup paths are unchanged. Verified by packaging the real app for Linux with the identical asar configuration: 581 unpacked files with a longest relative path of 118 characters, and the packaged app booted and served /api/setup/status. Release 0.0.37: version, changelog, and channel-machine pins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
📝 WalkthroughWalkthroughVersion 0.0.37 packages the Windows desktop application as ChangesWindows asar packaging and Photon sidecar
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Build as package.json
participant Packager as scripts/package-windows.cjs
participant Electron as Electron
participant Runtime as desktop/main.cjs
participant Photon as src/server/photon.ts
Build->>Packager: Build Photon sidecar bundle
Packager->>Electron: Create app.asar and app.asar.unpacked
Electron->>Runtime: Start packaged application
Runtime->>Runtime: Map external paths to app.asar.unpacked
Runtime->>Photon: Start Photon connector
Photon->>Photon: Select bundled sidecar path
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
0.0.36 Windows packaging fails during Squirrel releasify with
PathTooLongException. Legacy Squirrel expands every package file through 260-character .NET path APIs — during releasify, and again on every end-user machine during install/update under%LOCALAPPDATA%. The deepest loose dependency paths (nested OpenTelemetry copies under spectrum-ts, 166 characters relative) exceed the budget once Squirrel adds its staging prefixes. The drive-root scratch directory cannot fix this because Squirrel extracts into its own temp tree.Fix
app.asar: legacy Squirrel now handles ~600 short paths instead of ~30,000 deeply nested loose files, at build time and at end-user install/update time.scripts/,container/,deploy/,public/,desktop/,node_modules/node-pty, and all*.nodenatives.HELM_APP_ROOT, the working directory, and the Squirrel uninstall helper to the unpacked tree (Python, PowerShell, WSL, and plain-Node consumers keep reading real disk), while the server is imported from inside the archive so dependency resolution stays there.npm run buildnow produces a self-contained bundle (build:sidecar) which packaged builds start from the unpacked tree.Release 0.0.37: version, changelog, and
local/1helm-channel-machine:0.0.37pins.Verification
npm run ci(typecheck, build, full suite): 118 tests, 0 failures./api/setup/status.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation