Skip to content

fix(desktop): stage the dev sidecar and ripgrep like the packaged bin layout - #197

Merged
GoDiao merged 2 commits into
GoDiao:mainfrom
pcbeingused333:fix/dev-sidecar-binaries-layout
Oct 30, 2026
Merged

GoDiao merged 2 commits into
GoDiao:mainfrom
pcbeingused333:fix/dev-sidecar-binaries-layout

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

Closes #195

In dev mode the sidecar and ripgrep were staged as desktop/binaries/dreamcoder-sidecar-<triple> and desktop/binaries/rg-<triple>, while the CLI looks for a file named rg next to its own executable (src/utils/ripgrep.ts / ripgrepConfig.ts). So Glob and Grep only worked in bun run electron:dev when a system rg happened to be on PATH.

This follows the proposal in #195: the dev layout now matches the packaged one, with the triple as a directory instead of a file-name suffix.

  • prepare-ripgrep.ts copies ripgrep to desktop/binaries/<triple>/rg[.exe] (new devBinariesDir helper).
  • build-sidecars.ts writes the sidecar to desktop/binaries/<triple>/dreamcoder-sidecar.
  • electron/main.ts starts the dev sidecar from binaries/<hostTriple>/ through a new devSidecarPaths helper in sidecar.ts, and uses that directory as appRoot, so rg sits next to the executable.
  • electron-builder.json copies binaries/<triple> to bin for macOS and Windows instead of renaming the two files one by one.
  • CONTRIBUTING_en.md and CONTRIBUTING_zh.md show the new path; CHANGELOG.md has an entry (existing checkouts need one more bun run build:sidecars).

ripgrepConfig.ts is unchanged, and DREAMCODER_TARGET_TRIPLE cross builds still do not overwrite the host build.

Tests: scripts/prepare-ripgrep.test.ts covers the staging directory, and the new desktop/electron/devSidecarPaths.test.ts covers the dev sidecar and ripgrep paths (with and without .exe) and checks that electron-builder.json copies each target directory to bin. The new tests fail on main; bun test scripts/prepare-ripgrep.test.ts, the vitest files above and tsc -p electron/tsconfig.json --noEmit pass. Not run here: bun run build:sidecars, bun run electron:dev without a system rg, and electron:pack on macOS and Windows, so the packaging change still needs that check.

This change was prepared with Claude Code (AI-assisted).

🤖 Generated with Claude Code

pcbeingused333 and others added 2 commits October 28, 2026 07:39
… layout

In dev mode the sidecar and ripgrep sat in desktop/binaries as
dreamcoder-sidecar-<triple> and rg-<triple>, while the CLI looks for a file
named rg next to its executable, so Glob and Grep failed unless a system rg
was on PATH. Put them in desktop/binaries/<triple>/ under their packaged
names, start the dev sidecar from there, and have electron-builder copy the
target directory to bin/.

Fixes GoDiao#195

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>

@GoDiao GoDiao left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pcbeingused333, this is the fix proposed in #195, and it is clean: the dev layout now matches the packaged one, electron-builder.json copies the whole target directory instead of renaming files one by one, and the old names are gone from the code and docs.

We ran it in the dev app on macOS (with no rg on PATH): the sidecar starts from binaries/aarch64-apple-darwin/, the file search finds files outside a git repo, and Glob and Grep work in a chat. The macOS and Windows packaging jobs pass too.

We pushed a merge of main on top to resolve the CHANGELOG conflict. Approving and merging. Thanks again!

@GoDiao
GoDiao merged commit 4e430eb into GoDiao:main Oct 30, 2026
8 checks passed
GoDiao added a commit that referenced this pull request Oct 30, 2026
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.

Dev mode can't find the bundled ripgrep: align desktop/binaries with the packaged layout

2 participants