镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

build(desktop): share the bundled buzz CLI build across worktrees - #2894

Merged
baxen merged 1 commit into
mainfrom
nexus/investigate-concurrent-worktree-compilation-effi-f7bd37cd
Nov 7, 2026
Merged

baxen merged 1 commit into
mainfrom
nexus/investigate-concurrent-worktree-compilation-effi-f7bd37cd

Conversation

@comp615

@comp615 comp615 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

just desktop builds the bundled buzz CLI with cargo install --git … --rev <pin> --locked into each checkout's own target/. That build depends only on the pinned block/buzz revision and its lockfile, never on worktree sources, so every new worktree compiled the same 242 crates again.

scripts/build-buzz-cli.mjs now resolves its target with git rev-parse --git-common-dir, the same check scripts/bootstrap-worktree.sh uses. Linked worktrees install into the main checkout's target/, still keyed by revision, target and profile. A single checkout, CI included, resolves to its own target/, so CI paths and rust-cache coverage don't change. CARGO_TARGET_DIR still overrides. The app and buzz-agent-command still build per worktree, for the reasons in .cargo/config.toml. Worktree bootstrap is unaffected: it copies .env.local, installs the toolchain and runs pnpm install, and never touches target/.

Measurements (debug build of the current pin, 16-core Mac, crate sources already in ~/.cargo):

Before After
First worktree 27 s, 1.2 GB 32 s, 1.2 GB (in the main checkout's target/)
Each additional worktree 27 s, 1.2 GB 1 s, no target/ created
Rerun in the same worktree 0 s 0 s

The first-worktree difference is run-to-run noise; both builds are cold. When two worktrees installed at the same time, Cargo's package-cache and build-directory locks made them take turns, and both staged binaries ran.

Side effects:

  • cargo clean or deleting target/ in the main checkout also removes the shared CLI build, so the next just desktop in any worktree rebuilds it once.
  • Worktrees on different rust-toolchain.toml pins share the install folder. Cargo reinstalls when rustc changes, so alternating between them relinks the CLI each time.
  • A worktree that can't write to the main checkout, such as an agent sandbox limited to its own directory, can't stage the CLI. just desktop warns and starts without it, while just desktop-bundle fails. Setting CARGO_TARGET_DIR sends the build back inside the worktree.

Not yet done: the native-app run and human testing from the readiness checklist.

🤖 Generated with Claude Code

The bundled buzz CLI builds from a pinned block/buzz revision with its own
lockfile, so its output never depends on worktree sources. Linked worktrees
now install it under the main checkout's target/ instead of compiling the same
revision again in each one. A single checkout, as in CI, keeps its own target/
and the Rust cache that covers it; CARGO_TARGET_DIR still overrides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Charlie Croom <ccroom@squareup.com>
@comp615
comp615 marked this pull request as ready for review November 7, 2026 01:45
@comp615
comp615 requested a review from a team as a code owner November 7, 2026 01:45
@baxen
baxen merged commit c045f14 into main Nov 7, 2026
42 checks passed
@baxen
baxen deleted the nexus/investigate-concurrent-worktree-compilation-effi-f7bd37cd branch November 7, 2026 03:57
tlongwell-block added a commit that referenced this pull request Nov 7, 2026
Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz>

* origin/main:
  Build sidebar headings as one fluid design-system row (#2686)
  fix(messages): swap bubble fills for reactions you've made, drop the ring (#2949)
  fix(messages): align line-start mention capsules with each other (#2899)
  fix(relay): probe the live socket on wake, focus and network (#2958)
  fix(messages): size thread avatars like the timeline's (#2890)
  build(desktop): share the bundled buzz CLI build across worktrees (#2894)
  fix(messages): render review comment mentions as chips and open at the reader's place (#2965)
  feat(agents): read owner messages and canvases over MCP (#2881)

Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants