Introducing a new way to review your PRs.

Read the announcement

capsoftware / cap

Open source Loom alternative. Beautiful, shareable screen recordings.

View on GitHub

31 documents · Updated Nov 23, 2026

docs / desktop-build-and-distribution

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 concernResult
Main applicationThe native GPUI application staged as Cap or Cap.exe
Native helperscap-muxer and cap-cli sidecars
Package identityCap with the so.cap.desktop application identity
Update supportPlatform artifacts and Tauri-compatible updater signatures
Platform metadataApp 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.

FormatDistribution roleRelease availability
.debDebian-family installation and updater artifactStable and prerelease
.rpmRPM-family installationStable only
.AppImagePortable Linux applicationStable and prerelease
.pkg.tar.zstArch packageStable 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 pointBuild inputPublication behavior
publish.ymlVersion from the desktop release manifest and the current commitStable draft; manual CrabNebula publication
publish-nightly.ymlCurrent commit and generated timestamped prerelease versionAutomatic nightly-channel publication
promote-nightly.ymlCommit resolved from a shipped nightly tag and a stable versionStable 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

TriggerConsequenceGuard
The bundle names the wrong GPUI main binary or omits a helperThe installer can be valid but the installed app or media path cannot startBundle 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 checkoutThe desktop UI can lose Cap-required behavior or fail to match the staged release binaryDependency preparation verifies the base revision and Cap patch set
A debug helper is left in a release staging pathA release bundle can contain a non-release native programSidecar freshness checks reject a release file that matches a debug binary
Linux links against host FFmpeg instead of the bundled versionThe loader cannot find the sonames shipped in the packageCI forbids system FFmpeg development packages and compares binary needs with bundled libraries
GPUI Linux packages retain unused WebKitGTK or GTK dependenciesInstallers describe or require a runtime that the native app does not useGPUI package finalization removes those dependencies and re-signs the package
The final AppImage signature does not match the rebuilt bytesThe updater rejects the package or users receive an artifact that cannot be verifiedFinalization signs the final image and replaces the adjacent signature only after success
A Windows installer is uploaded before external signing completesUsers receive an installer without a valid Windows trust signatureCI waits for SignPath, checks Authenticode, then creates the updater signature
A running legacy cap-gpui.exe keeps shared FFmpeg DLLs lockedThe Windows update can stop with a file-in-use error before it copies new filesThe NSIS pre-install hook checks for cap-gpui.exe and closes it before installation
An in-place Windows update leaves old Tauri binaries or assetsThe installed directory contains stale programs that can confuse cleanup or diagnosticsThe NSIS post-install hook deletes the obsolete files and assets\\rive directory
Windows shutdown, restart, or sign-off bypasses normal app-quit cleanupThe next launch can read a stale handoff marker and treat the GPUI process as crashedGPUI installs a native session-end handler and clears the marker for a confirmed session end
A stable release reuses a published version tagThe workflow can overwrite the meaning of an existing public releaseRelease preparation rejects an already published tag and requires a new app version
RPM is requested for a hyphenated prerelease versionLinux packaging fails because the RPM version format rejects the versionThe Linux wrapper skips RPM for prerelease versions and keeps DEB and AppImage enabled
A glass preset or renderer layout changes without updating its peerA window can show the wrong material or a visual check can report a false passPreset 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 patchDependency preparation can overwrite work or produce a source tree that does not match the releaseThe 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 deviceThe compositor or screen-share path cannot start, so reliability results do not describe a desktopArch 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 referenceThe captured image can retain the selection overlay or include the wrong regionThe 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 hiddenA relaunch can leave the main window missing or crash the appThe device-loss scenario checks loss detection, window restoration, process health, and panic count
The AppImage exports its bundled libraries to child desktop programsHost programs can load incompatible bundled libraries and fail under NixOSThe AppImage reliability check compares shipped and fixed child-process library inheritance

Key files

FileWhy to read it
.github/…/desktop-release.ymlThe complete cross-platform build, validation, signing, and upload flow
.github/…/ci.ymlThe change filters and cross-platform GPUI build, test, and patch validation flow
.github/…/linux-desktop-reliability.ymlThe Linux desktop, portal, graphics recovery, and AppImage reliability checks
.github/…/publish.ymlThe stable release entry point
.github/…/publish-nightly.ymlThe nightly version and channel rules
.github/…/promote-nightly.ymlThe exact-commit promotion flow
apps/…/README.mdThe GPUI shipping boundary, package handoff, updater identity, and artifact finalization model
apps/…/Cargo.tomlThe isolated GPUI workspace, pinned dependency boundary, kernel and glass members, and release profile
apps/…/Cargo.lockThe resolved GPUI dependency graph used for repeatable builds
apps/…/tauri.conf.jsonThe packaging identity, helper names, resources, updater settings, and Linux metadata
apps/desktop-gpui/Info.plistThe macOS file association and capture permission metadata
apps/…/build.rsThe Windows application resource and release stack setup
apps/…/Cargo.tomlThe separately optimized native media and pixel-work crate
apps/…/Cargo.tomlThe isolated glass material model workspace member
apps/…/model.rsThe shared material behavior used by the renderer and reference path
apps/…/presets.jsonThe light and dark regular and clear material values
apps/…/presets.rsThe material behavior checks against reference values
apps/…/glass.rsThe bridge from material presets to GPUI panes
apps/…/glass_probe.rsThe debug render and comparison path for visual validation
apps/desktop-gpui/patches/zed-glass.patchThe GPUI renderer support for glass and cross-renderer checks
scripts/build-desktop-binaries.mjsThe target-specific helper assembly and staging rules
scripts/build-gpui-binary.shGPUI release preparation, staging, and Linux library search path setup
scripts/prepare-gpui-dependency.shThe GPUI checkout, ordered patch application, stale-checkout update, and verification rules
scripts/prepare-gpui-dependency.test.mjsThe dependency preparation guarantees for patch order, line endings, safe updates, and local work
scripts/setup.jsPlatform native dependency preparation and Linux bundle input generation
scripts/build-linux-packages.mjsLinux package selection and AppImage handoff
scripts/linux-bundle-config.mjsThe shared Linux package contents and dependency model
scripts/finalize-linux-appimage.mjsAppImage cleanup, runtime preservation, and updater signing
scripts/…/README.mdThe supported Linux desktop sessions, user-like actions, and checks without a desktop
scripts/…/arch-up.shThe Arch compositor, virtual display, session, and tray setup
scripts/…/kde-up.shThe KDE compositor, graphical session, and tray setup
scripts/…/scenario-screenshot.shScreenshot permissions, portal capture, area checks, and result reporting
scripts/…/portal-shot.pyThe portal reference screenshot used for area comparisons
scripts/…/png-diff.pyThe pixel comparison that detects selection-overlay residue
scripts/…/scenario-device-loss.shThe hidden-window GPU loss and recovery scenario
apps/…/installer.rsCross-platform artifact verification, staging, and installation actions
apps/…/updates.rsUpdate channel checks, busy-work guards, install state, and relaunch flow
apps/desktop-gpui/packaging/windows/installer-hooks.nshWindows compression, pre-install process handling, and in-place cleanup rules
apps/…/url_scheme.rsThe installed Windows cap-desktop link registration contract
packaging/…/README.mdLinux package commands, signing inputs, package conversion, and runtime verification limits