Skip to content

fix(fbuild-python): prefer venv-adjacent fbuild-daemon over PATH (#275)#311

Merged
zackees merged 1 commit into
mainfrom
fix-275-venv-daemon-path
May 30, 2026
Merged

fix(fbuild-python): prefer venv-adjacent fbuild-daemon over PATH (#275)#311
zackees merged 1 commit into
mainfrom
fix-275-venv-daemon-path

Conversation

@zackees
Copy link
Copy Markdown
Member

@zackees zackees commented May 30, 2026

Summary

  • Resolve fbuild-daemon via sys.executable.parent() / DAEMON_BIN_NAME before falling back to PATH, so venv installs always run the daemon that ships with the active Python.
  • Single platform-gated constant: fbuild-daemon.exe on Windows, fbuild-daemon elsewhere; reused by both venv-adjacent lookup and PATH fallback.
  • Sync Daemon::ensure_running resolves under the GIL it already holds. Async path resolves before entering the future so the GIL is never held across .await.

Closes #275.

Test plan

  • 5 new unit tests in daemon::tests::* (file present, file absent, dir-with-matching-name rejected, missing parent dir, platform filename guard)
  • soldr cargo check --workspace --all-targets clean
  • soldr cargo clippy --workspace --all-targets -- -D warnings clean
  • uv run ci/test.py full workspace — no regressions

🤖 Generated with Claude Code

When the PyO3 binding spawned the daemon, it relied on the OS PATH search
to resolve `fbuild-daemon`. On Windows venvs whose `.venv/Scripts` is not
at the front of PATH, that picked up a stale user-level binary at
`~/.local/bin/fbuild-daemon.exe` instead of the venv-shipped daemon. The
stale daemon could miss features the in-process `_native` extension
depends on (notably `.S` source support in FastLED `library.json`
srcFilter), producing wrong builds.

Resolve `sys.executable` via PyO3, look for `fbuild-daemon[.exe]` in its
parent directory, and prefer that absolute path when present. Fall back
to the bare PATH-relative name when no venv-adjacent binary is found so
`pip install --user` / system installs keep working unchanged.

The async `AsyncDaemon::ensure_running` resolves the path before
entering the future to avoid holding the GIL across `.await`.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Warning

Review limit reached

@zackees, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 19 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 77bc168d-ac61-44b6-8d08-5e86ff68fbb8

📥 Commits

Reviewing files that changed from the base of the PR and between 1a4d661 and 0ca1bc5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • crates/fbuild-python/Cargo.toml
  • crates/fbuild-python/src/daemon.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-275-venv-daemon-path

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 and usage tips.

@zackees zackees merged commit 651b0d7 into main May 30, 2026
80 of 83 checks passed
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.

fbuild-python can spawn stale PATH daemon instead of venv daemon

1 participant