Desktop build and distribution tooling
The desktop build and distribution tooling turns the Cap GPUI application into installable releases for macOS, Windows, and Linux. It combines the native GPUI binary with the media helpers, platform resources, and validated visual-material path, creates updater artifacts, and gives release CI checks for the files that users install. This page is a focused companion to Build and release automation and GPUI desktop client.
Desktop release boundary
The shipped desktop product is the GPUI application. The Tauri application last shipped in 0.6.0 and is no longer the active desktop app, but its packaging identity and updater formats remain compatibility contracts for existing installations.
| Release concern | Result |
|---|---|
| Main application | The native GPUI application staged as Cap or Cap.exe |
| Native helpers | cap-muxer and cap-cli sidecars |
| Package identity | Cap with the so.cap.desktop application identity |
| Update support | Platform artifacts and Tauri-compatible updater signatures |
| Platform metadata | App permissions, file association, icons, and installer cleanup rules |
Binary assembly
The assembly flow builds the native helpers and GPUI application for the selected target, stages the files under the identity used by existing Cap installs, and then uses the Tauri bundler to create familiar installers. The bundler is a packaging tool here; the shipped application does not depend on a webview.
GPUI bundle assembly
The GPUI packaging configuration defines the product name, updater endpoint, helper set, resources, file association, and platform bundle targets. Its bundle step creates macOS archives and disk images, a Windows NSIS installer, and Linux packages with updater artifacts. Platform finalization then reduces package size and removes runtime inputs that the native app does not use. Windows skips webview installation because the application is fully native. apps/…/README.md describes this handoff from the GPUI binary to the shared package identity, while apps/…/tauri.conf.json defines the bundle contract.
References: apps/…/README.md• L84-125 apps/…/tauri.conf.json• L1-35 apps/…/tauri.conf.json• L36-99
Native helper assembly
The helper build covers the media work that the desktop app calls outside its main process. build-desktop-binaries.mjs stages target-specific helper names and avoids replacing current staged files when its watched inputs are unchanged, while the shell entry point provides the direct build path used by release CI. The GPUI package consumes the resulting cap-muxer and cap-cli files as external binaries.
References: scripts/build-desktop-binaries.mjs• L11-19 scripts/build-desktop-binaries.mjs• L40-77 scripts/build-desktop-binaries.mjs• L80-143 scripts/build-desktop-binaries.sh• L19-43 apps/…/tauri.conf.json• L25-28
Bundle identity and migration
The bundle keeps the product name, application identifier, main binary name, package names, and updater target names stable. This lets a 0.6.2 GPUI release replace the older Tauri app without changing the installed application’s permissions, data location, or update feed. The macOS metadata accepts .cap recording bundles and declares the capture permission messages. Before a Windows update copies files, the installer closes the older cap-gpui.exe process because it can keep shared FFmpeg files locked. After installation, it removes obsolete GPUI and exporter files and the old Rive assets that an in-place update could otherwise leave behind. An installed Cap.exe claims the cap-desktop link scheme.
References: apps/…/README.md• L88-125 apps/…/tauri.conf.json• L3-17 apps/…/Info.plist• L5-31 apps/…/installer-hooks.nsh• L1-17 apps/…/url_scheme.rs• L3-17
The high-level assembly flow connects source builds to platform installers and update artifacts.
flowchart LR
A[GPUI source and shared Cap crates] --> B[Build native helpers]
A --> C[Build Cap GPUI]
B --> D[Stage target-specific binaries]
C --> D
D --> E[Run shared Tauri bundler]
E --> F[Platform installers and updater files]
F --> G[Validate contents and signatures]
G --> H[Upload release assets]
GPUI release preparation
GPUI is the native desktop UI path built for every supported desktop release. Its dependency tree stays in a separate Cargo workspace so its graphics stack and compiler needs do not alter the root workspace or the older Tauri build.
GPUI dependency boundary
The app workspace contains the desktop app plus the kernel, localization-build, and glass workspaces that support release builds. It uses a pinned Cap-compatible fork of the Zed source and applies the local Cap patches before it builds. prepare-gpui-dependency.sh checks the sibling checkout or creates it at the required revision, then verifies the complete ordered patch stack. If the checkout carries an earlier committed version of that stack, it updates only the patched paths through a scratch copy; unrelated work and local edits stay protected. This keeps the source and the binary inputs repeatable across release machines.
References: apps/…/Cargo.toml• L1-8 apps/…/Cargo.toml• L26-41 apps/…/Cargo.toml• L304-313 apps/…/Cargo.toml• L1-11 apps/…/Cargo.toml• L1-13 scripts/prepare-gpui-dependency.sh• L4-24 scripts/prepare-gpui-dependency.sh• L33-50 scripts/prepare-gpui-dependency.sh• L52-117 scripts/prepare-gpui-dependency.test.mjs• L172-231 scripts/prepare-gpui-dependency.test.mjs• L253-320
GPUI material validation
The desktop surface uses a shared glass material model so the native renderer and its CPU reference path describe the same visual behavior. Four light and dark presets cover regular and clear glass. A debug probe can render the same scenes in GPUI, compare them with the reference model or Apple capture data, and write a pass report before a visual change is treated as ready.
References: apps/…/lib.rs• L1-13 apps/…/model.rs• L37-89 apps/…/scenes.rs• L3-13 apps/…/presets.rs• L25-65 apps/…/glass_probe.rs• L20-30 apps/…/glass.rs• L23-77
GPUI build profiles
Release preparation builds the GPUI application for supported desktop targets. Development builds keep the app crate quick to rebuild while compiling the dependency tree and the pixel-heavy kernel crate with stronger optimization. This separates edit speed from the frame and media work that must remain fast in the running application. Release builds use a small, optimized output suitable for packaging.
Windows release startup also gives media work a larger thread stack and clears the handoff marker when the operating system shuts down, restarts, or signs out. Those session events do not follow the normal app-quit path, so the cleanup prevents the next launch from treating a normal session end as a crash.
References: apps/…/Cargo.toml• L312-347 apps/…/README.md• L23-38 apps/…/main.rs• L223-239 apps/…/main.rs• L533-547 apps/…/windows.rs• L69-77
Version alignment
The GPUI package version is part of the shipped application version. The packaging identity remains the same as the older Tauri release, so release tooling must keep the GPUI version, bundle names, updater metadata, and channel tags aligned. Promotion also needs the exact source revision that produced the nightly binary because the version is embedded in the application.
References: apps/…/Cargo.toml• L10-20 apps/…/README.md• L3-8 apps/…/tauri.conf.json• L3-11 .github/…/desktop-release.yml• L221-241
Platform runtime inputs
Release preparation supplies native libraries that are not safe to leave to the build host. macOS receives the trimmed and signed media framework. Windows receives FFmpeg, ONNX Runtime, and DirectX shader compiler files. Linux receives the native dependency set and records the library names that must be bundled. The goal is for the binary's recorded runtime needs to match the files shipped with its installer.
References: scripts/setup.js• L51-126 scripts/setup.js• L133-205 scripts/setup.js• L250-337
Native updater
The GPUI app uses the same CrabNebula update service and platform names as existing Cap installs. It checks the selected stable or nightly channel, downloads the matching archive or package, verifies the minisign signature while it streams to disk, and installs it only when recording and other active work is idle. The install action matches the package to the platform: it swaps the macOS app bundle, starts the Windows installer, installs a Debian package, or replaces the running AppImage. The app then relaunches the installed executable.
References: apps/…/updates.rs• L80-147 apps/…/updates.rs• L398-482 apps/…/updates.rs• L495-677 apps/…/installer.rs• L15-85 apps/…/installer.rs• L273-359
Linux package formats
Linux distribution produces packages for different installation models from the same GPUI release build. Debian packages and AppImages are available for prerelease and stable versions. RPM is added for stable versions, and an Arch package is derived in an isolated Arch build environment.
Linux format selection
The Linux build wrapper chooses the supported bundle list from the version and passes it to the bundler. It then finalizes the AppImage and signs the updater files. CI uploads the Debian package and AppImage for every Linux release, uploads RPM only for a plain stable version, and uploads the Arch package after its container build.
| Format | Distribution role | Release availability |
|---|---|---|
.deb | Debian-family installation and updater artifact | Stable and prerelease |
.rpm | RPM-family installation | Stable only |
.AppImage | Portable Linux application | Stable and prerelease |
.pkg.tar.zst | Arch package | Stable and prerelease |
References: packaging/…/README.md• L3-11 scripts/linux-bundle-config.mjs• L1-5 scripts/build-linux-packages.mjs• L10-24 scripts/build-linux-packages.mjs• L26-68 .github/…/desktop-release.yml• L714-744
Linux runtime closure
The Linux bundle carries the FFmpeg and ONNX Runtime libraries that the binaries need under the Cap library directory. The package declares desktop and audio libraries that it expects from the host. GPUI packaging removes the WebKitGTK and GTK dependencies that the shared bundler would add for the old Tauri runtime, so the installed package describes the native application rather than an unused webview.
References: scripts/setup.js• L281-331 scripts/linux-bundle-config.mjs• L7-62 apps/…/tauri.conf.json• L81-98 apps/…/README.md• L106-117
The Linux preparation path makes the relationship between build inputs, package contents, and runtime checks explicit.
flowchart TD
A[Linux native dependencies] --> B[Stage shared libraries]
B --> C[Generate GPUI bundle rules]
C --> D[Build deb rpm and AppImage]
D --> E[Remove unused webview runtime inputs]
E --> F[Sign final packages]
D --> G[Build Arch package from deb]
F --> H[Validate package contents]
G --> H
AppImage finalization
The finalization step keeps the AppImage runtime intact while removing host-conflicting Wayland and PipeWire libraries. The GPUI bundle does not ship a webview, so its final image is pruned to the libraries the native application actually loads. The finished image and its signature replace the intermediate pair only after packaging and signing succeed.
References: apps/…/README.md• L109-117 packaging/…/README.md• L13-29 scripts/finalize-linux-appimage.mjs• L40-53 scripts/finalize-linux-appimage.mjs• L168-183 scripts/finalize-linux-appimage.mjs• L185-263
Arch package assembly
The Arch package is a format conversion for the existing Debian payload rather than a second application build. An isolated Arch environment changes the package marker and declares Arch dependencies without stripping or rebuilding the executables. This keeps the Arch package aligned with the binaries already checked in the Linux release flow.
References: packaging/…/README.md• L31-42
Release CI workflow
The reusable workflow in .github/…/desktop-release.yml is the release engine for stable, nightly, and promoted builds. It prepares a release record, builds a target matrix, checks the resulting installers, uploads assets, and then publishes or leaves the release ready for publication according to the selected channel.
Release channels
Stable and nightly releases use different visibility rules. Stable releases create the normal version tag and draft GitHub and CrabNebula records. Nightly releases use a prerelease version and the hidden CrabNebula nightly channel. Promotion rebuilds the exact commit from a shipped nightly with a plain stable version, because the version is part of the binary.
| Entry point | Build input | Publication behavior |
|---|---|---|
| publish.yml | Version from the desktop release manifest and the current commit | Stable draft; manual CrabNebula publication |
| publish-nightly.yml | Current commit and generated timestamped prerelease version | Automatic nightly-channel publication |
| promote-nightly.yml | Commit resolved from a shipped nightly tag and a stable version | Stable draft with the normal manual publication step |
References: .github/…/publish.yml• L1-43 .github/…/publish-nightly.yml• L1-15 .github/…/publish-nightly.yml• L32-109 .github/…/promote-nightly.yml• L1-11 .github/…/promote-nightly.yml• L25-73
Target build matrix
The release job builds Intel and Apple Silicon macOS targets, Windows x64, and Linux x64 on matching hosted runners. It prepares signing material before the build and raises Linux swap or Windows pagefile capacity because the optimized link can exceed the default memory limit.
References: .github/…/desktop-release.yml• L191-214 .github/…/desktop-release.yml• L243-300 .github/…/desktop-release.yml• L302-339
Desktop build validation
Pull-request CI validates the GPUI build path before release packaging runs. It selects the desktop job when shared Rust or GPUI inputs change, prepares the pinned dependency, builds and tests the app and its kernel, glass, and localization workspaces on macOS, Windows, and Linux, and runs the GPUI patch tests on real or software graphics devices when the patch set changes. This catches source, patch, and graphics regressions without waiting for a distributable release.
References: .github/…/ci.yml• L19-68 .github/…/ci.yml• L360-446 .github/…/ci.yml• L448-524
Linux desktop reliability
The Linux desktop reliability workflow validates the built GPUI binary in desktop sessions that resemble user systems. It runs the app in systemd containers with real portal and tray hosts for GNOME, Hyprland, KDE, and niri-related paths, then checks recording, screen sharing, screenshots, camera input, export, relaunch, and graphics recovery behavior. The GNOME job passes its build and native libraries to later desktop jobs, while a separate AppImage check confirms that the shipped library layout works under NixOS-style appimage-run.
The harness drives the same user-facing actions through launchers, portals, shortcut approval, and tray controls. It compares area screenshots with a portal reference so selection overlays cannot remain in the captured image, and it injects a GPU device loss while the window is hidden to verify that the app restores the window without a panic. The workflow stores logs and result files as artifacts for failed runs.
flowchart LR
A[Build GPUI and native libraries] --> B[GNOME desktop checks]
B --> C[Package binary and libraries]
C --> D[Hyprland and niri checks]
E[Known AppImage] --> F[NixOS library-layout check]
B --> G[Logs and result artifacts]
D --> G
F --> G
References: .github/…/linux-desktop-reliability.yml• L1-39 .github/…/linux-desktop-reliability.yml• L72-180 .github/…/linux-desktop-reliability.yml• L338-428 .github/…/linux-desktop-reliability.yml• L510-555 .github/…/linux-desktop-reliability.yml• L557-625 scripts/…/README.md• L1-29 scripts/…/README.md• L55-86 scripts/…/README.md• L97-130 scripts/…/arch-up.sh• L1-15 scripts/…/arch-up.sh• L55-108 scripts/…/kde-up.sh• L1-66 scripts/…/png-diff.py• L1-9 scripts/…/portal-shot.py• L1-6 scripts/…/scenario-device-loss.sh• L1-8 scripts/…/scenario-screenshot.sh• L14-17 scripts/…/scenario-screenshot.sh• L39-63 scripts/…/scenario-screenshot.sh• L147-163
Artifact validation
CI checks the artifact after it is built, not only the build command's exit status. Linux checks the embedded resources, required executables, GPUI library search path, FFmpeg sonames, declared runtime dependencies, and package markers. macOS checks app contents, code signing, notarization, updater files, and the disk image. Windows checks the installer contents, Authenticode signature, and Tauri updater signature.
References: .github/…/desktop-release.yml• L362-397 .github/…/desktop-release.yml• L399-559 .github/…/desktop-release.yml• L582-607 .github/…/desktop-release.yml• L668-702 packaging/…/README.md• L52-54
Artifact publication
The workflow uploads platform assets to the matching CrabNebula release after validation. Windows installers pass through external signing before their updater signatures are recreated. Stable and nightly channel flags then control which update feed can see each asset. DEB and AppImage use updater targets, while RPM and Arch users update through their package manager or by installing a new package.
References: .github/…/desktop-release.yml• L609-744 .github/…/desktop-release.yml• L764-807 packaging/…/README.md• L50-54
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the GPUI main binary name, package identity, helper staging names, updater target names, and installer checks aligned.
- Keep the GPUI source revision, patch set, separate kernel and glass workspaces, version, staged target name, and effective bundle configuration aligned.
- When a Linux library or host dependency changes, update the generated bundle rules and the soname and package-dependency checks as one contract.
- Keep the release version rules aligned across stable tags, nightly tags, promotion input, bundle names, and updater channel names.
- Treat signing changes as a chain: platform signing, updater signatures, artifact validation, and release upload must still refer to the same output file.
- When replacing the old Tauri release path, check Windows pre-install process cleanup, post-install file cleanup, macOS metadata, file associations, URL registration, and update-in-place behavior together.
- Keep Linux package format rules aligned across prerelease version checks, updater targets, package-manager instructions, and the Arch payload conversion.
- When changing glass presets or the GPUI glass patch, keep the CPU model, renderer material layout, debug probe report, and preset checks aligned.
- When changing the Linux desktop harness, keep the desktop image setup, portal and tray host assumptions, result keys, and workflow assertions aligned.
- When changing screenshot capture or device recovery behavior, keep the scenario inputs, reference-image checks, injected failure markers, and log assertions aligned.
- When changing the GPUI patch stack, preserve ordered application, line-ending stability, stale-checkout migration, and protection for unrelated local work.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The bundle names the wrong GPUI main binary or omits a helper | The installer can be valid but the installed app or media path cannot start | Bundle configuration and CI artifact checks require Cap, cap-muxer, and cap-cli under their target names |
| GPUI is built from an unpatched or wrong-revision checkout | The desktop UI can lose Cap-required behavior or fail to match the staged release binary | Dependency preparation verifies the base revision and Cap patch set |
| A debug helper is left in a release staging path | A release bundle can contain a non-release native program | Sidecar freshness checks reject a release file that matches a debug binary |
| Linux links against host FFmpeg instead of the bundled version | The loader cannot find the sonames shipped in the package | CI forbids system FFmpeg development packages and compares binary needs with bundled libraries |
| GPUI Linux packages retain unused WebKitGTK or GTK dependencies | Installers describe or require a runtime that the native app does not use | GPUI package finalization removes those dependencies and re-signs the package |
| The final AppImage signature does not match the rebuilt bytes | The updater rejects the package or users receive an artifact that cannot be verified | Finalization signs the final image and replaces the adjacent signature only after success |
| A Windows installer is uploaded before external signing completes | Users receive an installer without a valid Windows trust signature | CI waits for SignPath, checks Authenticode, then creates the updater signature |
A running legacy cap-gpui.exe keeps shared FFmpeg DLLs locked | The Windows update can stop with a file-in-use error before it copies new files | The NSIS pre-install hook checks for cap-gpui.exe and closes it before installation |
| An in-place Windows update leaves old Tauri binaries or assets | The installed directory contains stale programs that can confuse cleanup or diagnostics | The NSIS post-install hook deletes the obsolete files and assets\\rive directory |
| Windows shutdown, restart, or sign-off bypasses normal app-quit cleanup | The next launch can read a stale handoff marker and treat the GPUI process as crashed | GPUI installs a native session-end handler and clears the marker for a confirmed session end |
| A stable release reuses a published version tag | The workflow can overwrite the meaning of an existing public release | Release preparation rejects an already published tag and requires a new app version |
| RPM is requested for a hyphenated prerelease version | Linux packaging fails because the RPM version format rejects the version | The Linux wrapper skips RPM for prerelease versions and keeps DEB and AppImage enabled |
| A glass preset or renderer layout changes without updating its peer | A window can show the wrong material or a visual check can report a false pass | Preset tests compare the model with expected material behavior, and the probe compares rendered output with the model or reference capture |
| A GPUI patch checkout has local edits or a missing patch | Dependency preparation can overwrite work or produce a source tree that does not match the release | The update uses a scratch copy and verification fails without changing unrelated or locally edited files |
| A Linux desktop session lacks the required virtual display or render device | The compositor or screen-share path cannot start, so reliability results do not describe a desktop | Arch and KDE setup fail with a clear host-device requirement and the workflow loads vkms or requires a DRM render node |
| A screenshot area differs from the settled portal reference | The captured image can retain the selection overlay or include the wrong region | The scenario checks the PNG size and uses png-diff.py to reject changed pixels in the selected area |
| The renderer loses its GPU device while the window is hidden | A relaunch can leave the main window missing or crash the app | The device-loss scenario checks loss detection, window restoration, process health, and panic count |
| The AppImage exports its bundled libraries to child desktop programs | Host programs can load incompatible bundled libraries and fail under NixOS | The AppImage reliability check compares shipped and fixed child-process library inheritance |
Key files
| File | Why to read it |
|---|---|
| .github/…/desktop-release.yml | The complete cross-platform build, validation, signing, and upload flow |
| .github/…/ci.yml | The change filters and cross-platform GPUI build, test, and patch validation flow |
| .github/…/linux-desktop-reliability.yml | The Linux desktop, portal, graphics recovery, and AppImage reliability checks |
| .github/…/publish.yml | The stable release entry point |
| .github/…/publish-nightly.yml | The nightly version and channel rules |
| .github/…/promote-nightly.yml | The exact-commit promotion flow |
| apps/…/README.md | The GPUI shipping boundary, package handoff, updater identity, and artifact finalization model |
| apps/…/Cargo.toml | The isolated GPUI workspace, pinned dependency boundary, kernel and glass members, and release profile |
| apps/…/Cargo.lock | The resolved GPUI dependency graph used for repeatable builds |
| apps/…/tauri.conf.json | The packaging identity, helper names, resources, updater settings, and Linux metadata |
apps/desktop-gpui/Info.plist | The macOS file association and capture permission metadata |
| apps/…/build.rs | The Windows application resource and release stack setup |
| apps/…/Cargo.toml | The separately optimized native media and pixel-work crate |
| apps/…/Cargo.toml | The isolated glass material model workspace member |
| apps/…/model.rs | The shared material behavior used by the renderer and reference path |
| apps/…/presets.json | The light and dark regular and clear material values |
| apps/…/presets.rs | The material behavior checks against reference values |
| apps/…/glass.rs | The bridge from material presets to GPUI panes |
| apps/…/glass_probe.rs | The debug render and comparison path for visual validation |
apps/desktop-gpui/patches/zed-glass.patch | The GPUI renderer support for glass and cross-renderer checks |
| scripts/build-desktop-binaries.mjs | The target-specific helper assembly and staging rules |
| scripts/build-gpui-binary.sh | GPUI release preparation, staging, and Linux library search path setup |
| scripts/prepare-gpui-dependency.sh | The GPUI checkout, ordered patch application, stale-checkout update, and verification rules |
| scripts/prepare-gpui-dependency.test.mjs | The dependency preparation guarantees for patch order, line endings, safe updates, and local work |
| scripts/setup.js | Platform native dependency preparation and Linux bundle input generation |
| scripts/build-linux-packages.mjs | Linux package selection and AppImage handoff |
| scripts/linux-bundle-config.mjs | The shared Linux package contents and dependency model |
| scripts/finalize-linux-appimage.mjs | AppImage cleanup, runtime preservation, and updater signing |
| scripts/…/README.md | The supported Linux desktop sessions, user-like actions, and checks without a desktop |
| scripts/…/arch-up.sh | The Arch compositor, virtual display, session, and tray setup |
| scripts/…/kde-up.sh | The KDE compositor, graphical session, and tray setup |
| scripts/…/scenario-screenshot.sh | Screenshot permissions, portal capture, area checks, and result reporting |
| scripts/…/portal-shot.py | The portal reference screenshot used for area comparisons |
| scripts/…/png-diff.py | The pixel comparison that detects selection-overlay residue |
| scripts/…/scenario-device-loss.sh | The hidden-window GPU loss and recovery scenario |
| apps/…/installer.rs | Cross-platform artifact verification, staging, and installation actions |
| apps/…/updates.rs | Update channel checks, busy-work guards, install state, and relaunch flow |
apps/desktop-gpui/packaging/windows/installer-hooks.nsh | Windows compression, pre-install process handling, and in-place cleanup rules |
| apps/…/url_scheme.rs | The installed Windows cap-desktop link registration contract |
| packaging/…/README.md | Linux package commands, signing inputs, package conversion, and runtime verification limits |