Skip to content

feat(dev-install): build and install PATH shims alongside the main binary - #301

Merged
getappz merged 3 commits into
masterfrom
dev-install-shim-bundling
Jul 22, 2026
Merged

feat(dev-install): build and install PATH shims alongside the main binary#301
getappz merged 3 commits into
masterfrom
dev-install-shim-bundling

Conversation

@getappz

@getappz getappz commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Found while investigating why agentflare init --agent claude-code wasn't hardlinking ~/.agentflare/shims/'s 56 stale duplicate-byte shim files into hardlinks (item #133/#227's fix) on a dev machine: agentflare init's "shims" component only links pre-built agentflare-shim/flare-git-shim binaries it finds next to the currently-running agentflare executable — but no install path (cargo install, and especially dev-install, the primary local dev-loop command) ever built and placed those sibling binaries there. Only a packaged release archive would.

  • dev_install::cargo::build_shims builds agentflare-shim and flare-git-shim's git-named bin in one cargo invocation, generalizing the existing single-target JSON-artifact parser to look up by name.
  • After the main binary swap succeeds, dev_install::install_shims copies both next to the freshly installed agentflare, then runs shim_install::install() (the same hardlink logic init's "shims" component uses).
  • Best-effort by design: a shim build failure only prints an info line and returns — it can never fail dev-install overall, since the main binary is already installed by that point (matches shim_install's existing "nice-to-have" philosophy).

Verified manually: ran the exact cargo build -p agentflare-shim --bin agentflare-shim -p flare-git-shim --bin git invocation directly — produces agentflare-shim.exe and git.exe with the exact target names build_shims/parse_named_executable_path expect.

Test plan

  • cargo build --workspace --all-features clean
  • cargo test --workspace — 727 passed, 0 failed
  • cargo fmt --all -- --check clean
  • Manually verified the build_shims cargo invocation produces the expected agentflare-shim.exe/git.exe artifacts

…nary

dev-install only ever built and swapped the main `agentflare` binary,
so the hardlink-based PATH shim installer (`agentflare init`'s "shims"
component) had nothing to link -- it only looks for `agentflare-shim`/
the git shim next to the currently running executable, and no install
path (cargo install, dev-install) ever placed them there.

dev-install now also builds `agentflare-shim` and flare-git-shim's
`git` binary, copies them next to the freshly installed `agentflare`,
and runs the same hardlink install `init` does -- best-effort only, so
a shim build failure never blocks the main binary install.

Agentflare-Agent: claude-code_2-1-216_agent
Agentflare-Branch: dev-install-shim-bundling
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@getappz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3a955ef0-40f6-4bd7-be87-68c2afe018df

📥 Commits

Reviewing files that changed from the base of the PR and between baff301 and 8b5992b.

📒 Files selected for processing (3)
  • src/dev_install/cargo.rs
  • src/dev_install/mod.rs
  • src/shim_install.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-install-shim-bundling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz enabled auto-merge (squash) July 21, 2026 19:05
getappz added 2 commits July 22, 2026 10:40
…stall() consumes it

install_shims stages a copy named 'git'/'git.exe' next to the main
agentflare binary so shim_install::install() can find and hardlink it
into the real, dedicated shims dir. bin_dir (target.parent()) is often
a general-purpose PATH dir shared with unrelated tools -- for a
cargo-install setup that's ~/.cargo/bin -- so a leftover file literally
named 'git' left sitting there would silently shadow the real git for
anything else resolving it via that PATH entry. Clean it up once
install() has consumed it; dev-install rebuilds it fresh every run so
there's nothing lost.

Agentflare-Agent: claude-code_2-1-216_agent
Agentflare-Branch: dev-install-shim-bundling
…ndling

Agentflare-Agent: claude-code_2-1-216_agent
Agentflare-Branch: dev-install-shim-bundling
@getappz
getappz merged commit ea471f5 into master Jul 22, 2026
16 checks passed
@getappz
getappz deleted the dev-install-shim-bundling branch July 22, 2026 05:22
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.

1 participant