Files
cmux/scripts/setup.sh
T
Lawrence Chen b129a8669f Move diff viewer backend boundary to a Rust sidecar (#7804)
* Add Rust diff viewer sidecar

* Harden diff sidecar request handling

* Close sidecar review gaps

* Finish sidecar build and retry integration

* Gate sidecar transport and webview checks

* Remove sidecar setup and localization gaps

* Extract diff sidecar process boundary

* Use stdio for native diff sidecar transport

* Satisfy Swift file length guard

* Make custom scheme test deterministic

* Address sidecar review findings

* Test incremental diff tree source reuse

* Make diff tree streaming linear

* Verify diff correctness and streaming performance

* Fix diff sidecar review regressions

* Harden diff sidecar stdio RPC

* Test bounded large diff rendering

* Bound large diff UI updates

* Harden large diff navigation

* Fix diff sidecar isolation warning

* Test mobile diff drawer close control

* Make mobile diff drawer opaque

* Harden mobile diff drawer dismissal

* Refactor diff viewer bridge ownership

* Preserve diff sidecar pipe ownership

* Load diff sessions lazily through Rust

* Keep Rust diff sessions alive while rendering

* Split diff sidecar helpers from legacy files

* Close diff sessions before page navigation

* Close diff sessions before navigating

* Track active diff sessions through navigation

* Refresh generated diff viewer bundle

* Keep diff source switching responsive

* Open typed diff sessions in place

* Update diff CLI file budget

* Extract typed diff viewer writer

* Build typed diff writer in CLI target

* Expose shared diff shortcut payload

* Share typed diff writer model types

* Allow typed diff fallback input replacement

* Open diff loading shell before asset setup

* Bound typed branch base resolution

* Avoid duplicate diff theme registration

* Test custom-scheme asset fetch decoding

* Decode deflated assets for diff scheme

* Test cancellation of stale diff streams

* Cancel stale diff sessions and cap patch writes

* test: cover diff sidecar review regressions

* fix: bound diff sidecar lifecycle

* test: cover sidecar cancellation cleanup

* fix: clean up cancelled sidecar process groups

* test: require race-free sidecar process groups

* fix: handshake sidecar process group startup

* test: cover cancellation after patch rename

* fix: retain cleanup ownership through registration

* fix: bound sidecar startup and shutdown

* test: cover branch picker repository switches

* fix: close final sidecar lifecycle gaps

* test: cover same-repo branch base changes

* fix: preserve process group identity through shutdown

* Make stale branch picker test state-driven

* Test Last Turn switching and abandoned sidecar sessions

* Keep typed diff sources and manifests recoverable

* Test typed diff selector composition

* Compose typed diff selector state

* Rebuild diff webview assets

* Test orphan cleanup and Last Turn repo switching

* Close typed diff lifecycle gaps

* Test pending cancellation and rotating orphan cleanup

* Bound pending and remote diff resources

* Cap sidecar queue and index temp cleanup

* Bound server sessions and retain patch ownership

* Make patch ownership and HTTP encoding durable

* Test empty branch base selection

* Keep empty branch and pending patch recovery available

* Test branch base survives source switching

* Preserve selected branch base across source switches

* Retain generated patch ownership until lifecycle cleanup

* Serialize token session publication

* Keep concurrent diff sessions independently owned

* Reconcile session cleanup with manifest lifecycle

* Make session publication cancellation safe

* Scope cancellation and close transactions correctly

* Authorize session close by manifest ownership

* Close discarded diff sessions safely

* Cancel superseded diff sessions safely

* Reserve diff session resources atomically

* Protect active diff session patches

* Preserve active typed diff sessions

* Lease active diff sidecar sessions

* Journal diff session resource ownership

* Bound diff session recovery artifacts

* Harden diff sidecar production artifact

* Fix POSIX lock calls on Xcode 26.5

* Fix app-side lease locking on Xcode 26.5

* test: cover typed diff direct page lifecycle

* fix: open typed diff session page directly

* Fix sidecar verification for spaced paths
2026-07-15 22:00:34 -07:00

42 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_DIR"
echo "==> Initializing submodules..."
git submodule update --init --recursive
echo "==> Checking for zig..."
if ! command -v zig &> /dev/null; then
echo "Error: zig is not installed."
echo "Install via: brew install zig"
exit 1
fi
echo "==> Checking for Rust..."
# Xcode uses a non-login shell, so verify the same PATH used by the sidecar
# build phase rather than relying on the caller's interactive shell setup.
export PATH="${CARGO_HOME:-${HOME}/.cargo}/bin:/opt/homebrew/bin:/usr/local/bin:${PATH}"
if ! command -v rustup &> /dev/null; then
echo "Error: Rust is not installed."
echo "Install via: https://rustup.rs"
exit 1
fi
DIFF_RUST_TOOLCHAIN="$(awk -F '"' '/^[[:space:]]*channel[[:space:]]*=/{print $2; exit}' Native/DiffSidecar/rust-toolchain.toml)"
rustup toolchain install "$DIFF_RUST_TOOLCHAIN" --profile minimal --component clippy,rustfmt
rustup target add --toolchain "$DIFF_RUST_TOOLCHAIN" aarch64-apple-darwin x86_64-apple-darwin
rustup run "$DIFF_RUST_TOOLCHAIN" cargo --version
rustup run "$DIFF_RUST_TOOLCHAIN" rustc --version
"$SCRIPT_DIR/ensure-ghosttykit.sh"
"$SCRIPT_DIR/install-git-hooks.sh"
echo "==> Setup complete!"
echo ""
echo "You can now build and run the app:"
echo " ./scripts/reload.sh --tag first-run"