Repository navigation
Package the desktop app for Windows - #4662
Merged
Merged
Conversation
SawyerHood
marked this pull request as ready for review
October 2, 2026 01:41
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Base automatically changed from
bb/windows-boot-and-cli-thr_jensq3v9th
to
main
October 2, 2026 03:21
The desktop build scripts only knew macOS and Linux: electron-builder was spawned through a shim Windows cannot execute, there was no Windows target, the packaged app lacked the Windows file-watcher binary, and the app reported itself as the Linux build. - Run electron-builder through Node and add an x64 NSIS target, a per-user install directory named after the product, and `package:win` and `desktop:build:win` tasks. - Copy and load-check `@parcel/watcher-win32-x64` in afterPack. - Add a `windows` desktop platform with its own feed and updater metadata names; Windows builds do not check for or install updates yet. - Run the packaged-app smoke on Windows and package the app in the Windows CI job. Co-Authored-By: Claude Code <[email protected]>
SawyerHood
force-pushed
the
bb/windows-desktop-build-thr_jensq3v9th
branch
from
October 2, 2026 03:21
1103cab to
f8f98ce
Compare
SawyerHood
added a commit
that referenced
this pull request
Oct 2, 2026
## Human comments ## What was wrong The Windows desktop app could be packaged (#4662) but nothing built or published it, and `resolveDesktopUpdateSupport` returned no version check and no auto-update for Windows, so an installed Windows app would never learn about a newer release. Part of #1206. ## What changed - `.github/workflows/build-desktop.yml`: new `windows` job (Blacksmith Windows 2025) that packages the NSIS x64 installer with `desktop:build:win`, smoke tests the packaged app, and writes `desktop-version-windows.json`. The single `publish` job now needs it and uploads the installer, block map, `latest.yml`, and the Windows feed with the other platforms. A Windows build failure therefore stops the release, as a Linux one does. - `.github/workflows/publish-bb-app.yml`: new `nightly-desktop-windows` job with the same shape; the nightly publish requires its version to match the others and uploads `nightly.yml` and the Windows feed. - Signing: both Windows jobs pass `WINDOWS_CERTIFICATE_PFX` and `WINDOWS_CERTIFICATE_PASSWORD` to electron-builder as `WIN_CSC_LINK` and `WIN_CSC_KEY_PASSWORD`. With neither secret the installer is unsigned and still published (Windows SmartScreen warns before running it); with only one the stable job fails. - `apps/desktop/src/desktop-update-provider.ts`: Windows checks its version feed and installs updates through electron-updater, like macOS. - `apps/desktop/README.md` and `docs/bb-release-process.md` describe the Windows artifacts, feeds, and secrets. The Windows jobs do not run the desktop and launcher unit tests that the macOS and Linux jobs run; those suites pass on Windows only with #4738 and #4739. ## How you verified - Windows 11 Enterprise VM (build 26300): built installers for 0.44.0 and 0.44.1 from this change with the update URL pointed at a local HTTP server holding the 0.44.1 installer, block map, `latest.yml`, and `desktop-version-windows.json` (generated by `desktop:version-feed`). The installed 0.44.0 fetched the version feed and `latest.yml`, downloaded the 0.44.1 installer in the background, and after the window was closed the installer ran silently; `bb.exe` then reported 0.44.1 and the app started. The silent install took about a minute and a half, during which `bb.exe` was absent. - Linux: `desktop-update-provider.test.ts` passes; both workflow files parse as YAML. On this branch before the last rebase, `turbo run lint typecheck test --filter='...[origin/main]'`: 14 of 14 tasks passed. After the rebase onto current main, lint and typecheck pass for the same filter. Not verified: the workflow jobs have never run (they only run from `workflow_dispatch` and the nightly schedule); signing with a real certificate; the Relaunch button path (the install-on-quit path is what the test above exercised). 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED Co-authored-by: Claude Code <[email protected]>
tomdale
added a commit
to tomdale/bb
that referenced
this pull request
Oct 20, 2026
The Personal and Lab build profiles were written against a base that predated upstream's Windows packaging (get-bb#4662), and resolving them onto main replaced upstream files wholesale. That dropped win32 from the desktop package, the desktop:build:win and package:win scripts, the win32 build platform, Windows update metadata and install names, and Windows auto-update support. Restore those files to upstream and move the profile helpers (resolveDesktopBuildProfile, createDesktopApplicationIdentity) into the fork-owned desktop-build-profiles module, so desktop-release-channel matches upstream exactly. A profile test now fails if release builds lose Windows packaging again.
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
The desktop app could not be built for Windows, and a Windows build would have misbehaved:
run-electron-builder.mjsspawnednode_modules/.bin/electron-builder, which on Windows is a.cmd/.ps1shim thatspawncannot execute; the script exited 1 with no output.electron-builder.config.jsonhad no Windows target,afterPackcomputed a Linux-style binary path, and the release-channel helpers threw forwin32.@parcel/watcher-win32-x64out of the package, so the daemon's file-watcher child crashed in a loop ("No prebuild or local build of @parcel/watcher found").resolveBbDesktopPlatformmapped every non-macOS platform tolinux, so a Windows build would read the Linux version feed and announce Linux releases.%LOCALAPPDATA%\Programs\@bbdesktop.Part of #1206. Stacked on #4657, which is what lets bb build and start on Windows at all.
What changed
run-electron-builder.mjsruns electron-builder'scli.jswithprocess.execPathon every platform. For--winit sets the per-channel icon andextraMetadata.name(bb/bb-nightly) so the install directory is%LOCALAPPDATA%\Programs\bb.electron-builder.config.jsongains an x64 NSIS target (oneClick, per-user).apps/desktopdeclareswin32inos, and addspackage:winanddesktop:build:winwith matching Turbo tasks.pnpm desktopresolvespackage:winon Windows.prepare-native-modules.cjs(afterPack): uses<productName>.exeon Windows, copies the platform@parcel/watcher-<platform>-<arch>package from the workspace when the packaged app lacks it (macOS and Windows; Linux names carry a libc suffix and are left to electron-builder), and loads that binary with the packaged Electron version. A package without@parcel/watchernow fails the build.windowsvalue inbbDesktopVersionFeedPlatformSchemawithdesktop-version-windows.json;latest.yml/nightly.ymlare the updater metadata names.resolveDesktopUpdateSupportturns both the version check and auto-update off on Windows, because no Windows feed is published.smoke-packaged-app.mjsandpackaged-app-paths.mjshandlewin-unpacked\bb.exe.Windows app smokeCI job now also runspackage:winandsmoke:packaged; its timeout goes from 25 to 40 minutes.apps/desktop/README.mddocuments Windows packaging.Not included: a published Windows release (no change to
build-desktop.ymlor the nightly workflow), code signing, auto-update, andbb-app's npmosfield.How you verified
On a Windows 11 Enterprise VM (build 26300), with this branch (which contains #4657):
turbo run smoke:boot --filter=bb-apppassed (49 s);turbo run package:win --filter=@bb/desktoppassed (102 s), includingafterPack's packaged-npm check with Electron 44.3.0;turbo run smoke:packaged --filter=@bb/desktop --forceprintedPackaged desktop smoke passed: …\release\win-unpacked\bb.exe.desktop:build:winproducedbb-0.44.0-x64.exe(175 MB) andlatest.yml. A silent install (/S) created%LOCALAPPDATA%\Programs\bb\bb.exe, a Start Menu shortcut, and an uninstall entry. The installed app started its server and daemon, showed the main window, and two watcher child processes were running; the earlier build without the watcher package logged the "No prebuild" error on every respawn.bb.exeprocesses after 15 s. Force-killing only the main process also left zero after 12 s, and the next launch started normally.%LOCALAPPDATA%\Programs\@bbdesktop.On Linux:
turbo run lint typecheck test --filter=@bb/desktop --filter=@bb/desktop-contract --filter=@bb/scriptspasses (11 of 11 tasks). New tests cover the Windows platform mapping, update support, the printed builder config for--winon both channels, the Windows launch arguments, and the packaging task name.Not verified: the macOS path through the new watcher copy and load check (it runs only when the package lacks the platform package, and I have no macOS host here); the Windows build on the CI runner, which this PR's run will show.
🤖 Generated with Claude Code