fix(cli): spawn sibling fbuild-daemon binary, not bare PATH lookup (#830) - #889
Conversation
) When a venv-installed fbuild CLI does `daemon restart`, the previous code bare-spawned "fbuild-daemon" and let the OS PATH lookup pick the binary. On Windows that picked up the user's global `%USERPROFILE%\.local\bin\fbuild-daemon.exe` from a prior system-wide install, leaving a venv 2.3.13 CLI silently restarting a 2.2.27 daemon. The user thinks they're testing fresh code; they aren't. Fix: reuse the existing `daemon_executable_hint()`, which checks for a `fbuild-daemon` (or `.exe`) binary in the same directory as the running `fbuild` CLI before falling back to the bare name (and thus PATH). The hint is already used by the info / status surfaces — now spawn agrees with them, so all three views of "which daemon binary is in play" stay consistent. Improve the spawn-failure error message to include the resolved path so the next person hitting an install-layout issue sees what was actually attempted, not just a generic PATH suggestion. Closes #830
|
Warning Review limit reached
Next review available in: 38 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Problem
When a venv-installed fbuild CLI does
daemon restart, the previous code bare-spawned"fbuild-daemon"and let the OS PATH lookup pick the binary. On Windows that picked up the user's global%USERPROFILE%\.local\bin\fbuild-daemon.exefrom a prior system-wide install, leaving a venv 2.3.13 CLI silently restarting a 2.2.27 daemon. The user thinks they're testing fresh code; they aren't.Repro from #830:
Fix
Reuse the existing
daemon_executable_hint()inspawn_daemon_process, which already checks for afbuild-daemon(or.exe) binary in the same directory as the runningfbuildCLI before falling back to the bare name (and thus PATH). The hint was already used by the info / status surfaces — now spawn agrees with them, so all three views of "which daemon binary is in play" stay consistent.Also improve the spawn-failure error message to include the resolved path so the next person hitting an install-layout issue sees what was actually attempted, not just a generic PATH suggestion.
Verification
soldr cargo check -p fbuild-clicleansoldr cargo clippy -p fbuild-cli --all-targets -- -D warningsclean(
daemon_executable_hintdepends onstd::env::current_exe(), which is hard to unit-test without a refactor; the function itself is small and was already covered by being the info-path's primary lookup.)Closes #830