Skip to content

Commit b49d63b

Browse files
committed
docs: refresh sidecar references after externalBin → resource move
Commit 025fa19 moved the claude-agent sidecar from Tauri's externalBin to its resources mechanism, but several docs still described the old externalBin layout and bundle path. Refresh: - src-tauri/src/agent_provider/claude/sidecar_path.rs module doc: point at `resources` and note why the move happened. - scripts/build-claude-sidecar.sh header comment: same. - docs/features/agent-chat.md "How it's shipped": describe the actual resource glob, the resource_dir pinning in setup(), and the on-disk install paths (`usr/lib/codemux/binaries/` on Linux, `binaries/` next to codemux.exe on Windows). Add a packagers note so downstream repackagers (AUR, custom distros) know to copy the sidecar from the resource layout, not just `usr/bin/codemux`. No functional change.
1 parent 025fa19 commit b49d63b

3 files changed

Lines changed: 31 additions & 11 deletions

File tree

docs/features/agent-chat.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,34 @@ bun run build:all
138138

139139
The per-target binary is staged at
140140
`src-tauri/binaries/codemux-claude-sidecar-<target-triple>`, which is
141-
where Tauri's `externalBin` bundling picks it up. The Rust integration
141+
where Tauri's `resources` glob picks it up. The Rust integration
142142
tests (`src-tauri/tests/sidecar_ping.rs`) look for the same path and
143143
skip cleanly (with a build hint) if the binary is missing.
144144

145-
**How it's shipped.** `tauri.conf.json`'s `bundle.externalBin` array
146-
includes `binaries/codemux-claude-sidecar`. Tauri's packager picks up
147-
`binaries/codemux-claude-sidecar-<triple>` per target and embeds it
148-
into the AppImage / deb / rpm / NSIS installer. The release workflow
149-
(`.github/workflows/release.yml`) installs Bun and pre-stages the
150-
binary so tauri-action finds it before bundling. CI
145+
**How it's shipped.** `tauri.conf.json`'s `bundle.resources` array
146+
includes `binaries/codemux-claude-sidecar-*`. Tauri's packager picks
147+
up the per-triple variant and embeds it into the AppImage / deb / rpm
148+
/ NSIS installer under `usr/lib/codemux/binaries/` on Linux and next
149+
to `codemux.exe` under `binaries/` on Windows. (It originally shipped
150+
as an `externalBin` under `usr/bin/`; moved to a resource because
151+
linuxdeploy's patchelf step corrupts the ~100 MB bun-compiled binary
152+
during AppImage bundling — see commit 025fa19.) At runtime, the
153+
`setup()` hook in `src-tauri/src/lib.rs` resolves the resource via
154+
`AppHandle::path().resource_dir()` and pins the resolved path into
155+
the `CODEMUX_CLAUDE_SIDECAR_PATH` env var so the adapter (which has
156+
no `AppHandle` access at construction time) can find it. The release
157+
workflow (`.github/workflows/release.yml`) installs Bun and
158+
pre-stages the binary so tauri-action finds it before bundling. CI
151159
(`.github/workflows/ci.yml`) does the same, with a zero-byte
152160
placeholder fallback for constrained runners.
153161

162+
**Packagers note.** Downstream packagers (AUR, custom distros) MUST
163+
copy the sidecar from the Tauri resource layout (`usr/lib/codemux/
164+
binaries/codemux-claude-sidecar-<triple>` on Linux) into their own
165+
package — repackaging only `usr/bin/codemux` will leave the agent-
166+
chat Claude provider unable to find its sidecar and the first send
167+
fails with `provider_not_configured: Claude`.
168+
154169
**Protocol.** Newline-delimited JSON-RPC 2.0 over stdin/stdout. The
155170
Rust side spawns the sidecar through
156171
[`JsonRpcChild`](../../src-tauri/src/json_rpc_child/mod.rs) — the same

scripts/build-claude-sidecar.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
22
# Build the claude-agent sidecar for the current target and stage the
33
# compiled binary at src-tauri/binaries/codemux-claude-sidecar-<triple>
4-
# so Tauri's `externalBin` can bundle it into the installer / AppImage.
4+
# so Tauri's `resources` glob can bundle it into the installer / AppImage.
5+
# (The sidecar used to ship as an externalBin; it moved to resources
6+
# because linuxdeploy's patchelf corrupts the bun-compiled binary —
7+
# see commit 025fa19.)
58
#
69
# Called by scripts/copy-sidecars.sh (which wraps every sidecar we
710
# bundle), by the release workflow, and optionally during `cargo test`

src-tauri/src/agent_provider/claude/sidecar_path.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
//!
33
//! The sidecar is a Bun-compiled TypeScript binary staged under
44
//! `src-tauri/binaries/codemux-claude-sidecar-<triple>[.exe]` in dev
5-
//! builds and bundled into the installer via Tauri's `externalBin`
6-
//! mechanism in release builds. This module finds whichever copy is
7-
//! reachable from the current process.
5+
//! builds and bundled into the installer via Tauri's `resources`
6+
//! mechanism in release builds. (Originally shipped via `externalBin`,
7+
//! moved to `resources` because linuxdeploy's patchelf step corrupts
8+
//! the ~100 MB bun-compiled binary — see commit 025fa19.) This module
9+
//! finds whichever copy is reachable from the current process.
810
//!
911
//! Search order:
1012
//! 1. `CODEMUX_CLAUDE_SIDECAR_PATH` env var (tests and manual

0 commit comments

Comments
 (0)