Repository navigation
Conversation
Contributor
|
Thanks @aulneau for the PR. This repo needs approval before a PR. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ) and explain what you want to open a PR for and why. A maintainer then adds you to the allow list. This PR now closes on its own. Reopen it or open a new one after approval. |
SawyerHood
added a commit
that referenced
this pull request
Sep 12, 2026
## Human comments ## What was wrong Desktop 0.43.0 ships npm 11.16.0 without its bundled dependencies. Electron-builder's pnpm collector treats npm as a leaf, and its dependency copier excludes nested `node_modules`. Source builds and the separate bb-app tarball smoke pass, while packaged npm exits 7 with missing `proc-log` and cannot install or update plugin dependencies. ## What changed Preserve npm's complete nested dependency tree through an explicit shared electron-builder file set, before signing. The same file-set approach was proposed in closed, unmerged #3587. Gate native-host packaging in `afterPack` on an artifact smoke test, and repeat it in packaged desktop smoke. The test runs the shipped npm through bundled Electron with an empty PATH and isolated HOME/cache/config. It audits required CJS/ESM dependency resolution and version ranges, imports ESM dependencies, and performs an offline disposable plugin dependency install and update from 1.0.0 to 2.0.0. Lockfile contents and actual ESM imports verify both operations; resource hashes reject bundle mutations. Document standalone npm smoke and add Turbo prerequisites for local packaging. No server/daemon wire or public SDK changes. ## How you verified - On a MacBook Air, both a freshly downloaded signed macOS 0.43.0 release and current-main packaged output lacked 60/65 direct npm dependencies and exited 7 through their own Electron runtime with no executables on PATH. - Fixed real macOS arm64 packaging passes: all 65 direct dependencies, 144 packages including npm, and 348 required CJS/ESM dependency edges. Offline install/update succeeds and resources remain unchanged. An ad hoc signed disposable copy still passes strict codesign verification afterward. - Negative controls reject removal of the new file set during real packaging, a missing Chalk ESM implementation file, and a nested dependency omission that resolves an incompatible minipass version. - `pnpm exec turbo run package --filter=@bb/desktop`: passed, including the pre-signing npm gate. - `pnpm exec turbo run typecheck test --filter=@bb/desktop`: passed; 322 tests passed, 1 existing skip. The sandbox initially aborted the existing Electron preload test; the macOS-process-enabled rerun passed. - Formatting, `git diff --check`, and the public-content scan passed. - The reported self-repair was not reproduced on the shipped dependency-install path: two attempts failed, all 9,225 release bundle files remained unchanged, and strict codesign verification still passed. Independent Linux verification on x86_64/glibc 2.44 at commit `1d1ec370a90d53d97dc76d5b3998368ecf8aba88`: - A freshly downloaded official 0.43.0 AppImage reproduces 60/65 missing dependencies and exit 7 for both version and real offline dependency-install commands through bundled Electron with an empty PATH. A repeated install also fails without changing resource hashes; no self-repair was observed. - Real Turbo Linux packaging and the final **extracted AppImage executable** pass all 65 direct dependency, 144 package, and 348 CJS/ESM dependency-edge checks, including version ranges, offline install/update, and unchanged resources. Final AppImage SHA256: `f17e6bf79d3a26b92b6ce26ad2825b81fb5541a1a3d361cc60188d2a3c31024d`. - Extracted AppImage GUI preload smoke passes under disposable Xvfb; the official-release baseline passes too. - Both artifact negative controls fail as intended: missing Chalk ESM implementation and missing nested minipass dependencies with an incompatible fallback version. - Turbo typecheck passes; 322 desktop tests and 81 bb-app tests pass, with one existing desktop skip. No PR-caused defects or source changes were needed. Limitations: Linux AppImage FUSE lifecycle testing is blocked identically before and after (exit 127; host lacks `/dev/fuse` and `fusermount`); extracted-artifact checks above pass. macOS packaged GUI readiness timed out on both before and after artifacts. Developer ID signing/notarization and full Extensions UI activation were not tested. The new runtime gate requires a native target host. All verification used disposable artifacts and fixtures; no installed production app or store was modified. Fixes #3566 Fixes #3581 Fixes #3584 > AGENT GENERATED
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.
Human comments
What was wrong
Desktop 0.43.0 switched plugin installs to bundled npm 11.16.0 in #3529, but the Electron artifact omitted npm's nested dependency tree. pnpm reports npm without child dependencies, while electron-builder's dependency copier excludes nested
node_modules. The installed macOS app fails even onnpm --versionwith exit 7 andCannot find module 'proc-log'; 60 of npm's 65 direct dependencies cannot resolve. The existing npm check only covered the bb-app tarball, and desktop smoke only exercised the preload/window path.What changed
Copy npm's nested dependency tree through an explicit desktop file set, preserving it in ASAR/unpacked resources before signing. Run an offline install check through the packaged Electron executable with an empty PATH, a fresh npm cache/config, and lifecycle scripts disabled. Invoke the check in
afterPackso packaging fails before signing or uploading artifacts, and repeat it in packaged desktop smoke. Document how to run the npm check without opening a window.No server/daemon wire, SDK, CLI, or user configuration changes.
How you verified
proc-logerror using the installed 0.43.0 app's Electron executable and bundled npm.afterPackcheck printedPackaged npm 11.16.0 installed a dependency with an empty PATH.Packaging completed successfully; the standalone check also passed.afterPackcheck failed withCannot find module 'proc-log', stopping packaging before signing. Production source configuration was unchanged by this negative control.pnpm exec turbo run build typecheck test --filter=@bb/desktop: 52 tasks succeeded; 320 desktop tests passed, 1 skipped. The first sandboxed attempt aborted Electron startup; the desktop-enabled rerun passed.pnpm exec turbo run test --filter=@bb/desktop -- --run test/electron-builder-config.test.ts: 22 tests passed.git diff --checkpassed.