fix(daemon): resolve a relative project dir against the caller's cwd - #1445
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CLI and daemon now convert project directories to absolute paths. Relative daemon requests use the caller’s working directory. Build, deploy, and dependency installation handlers use the shared resolver. Tests cover relative, absolute, missing-cwd, and ChangesProject Directory Resolution
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The caller-relative path handling is consistently applied across the affected operations, with no actionable current-head risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
`fbuild ci/kitchensink build` sent the daemon the relative string
"ci/kitchensink", and the build handler used it as-is. Every path
derived from it stayed relative -- the build dir, the downloaded
libraries, and their -I flags -- while the compiler runs from the
absolute project dir. So a registry library's headers were on the
include path under a name that pointed nowhere:
fatal error: ArduinoJson.h: No such file or directory
(symlink:// libraries were already canonicalised, which is why FastLED
itself was found). It also read the relative path against the daemon's
own cwd, which only matched the caller's by accident.
- CLI: resolve_project_dir() sends an absolute path (std::path::absolute,
lexical, no symlink resolution).
- Daemon: the build, deploy and install-deps handlers resolve a relative
project_dir against the request's caller_cwd
(resolve_request_project_dir), so other clients get the same result.
Fixes #1441
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…laced Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…thbuf) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
8850257 to
a789d36
Compare
Ships the fixes FastLED's CI is waiting on: - #1443 (closes #1440): .ino conversion no longer lifts an #include out of its #if. FastLED's root project (Sailboat) builds again. - #1445 (closes #1441): a relative project dir is resolved against the caller's cwd, so downloaded libraries get absolute include paths (fbuild ci/kitchensink build could not find ArduinoJson.h). - #1447 (closes #1442): ESP32 drops core-bundled lib_deps (FS, ArduinoOTA, ESPmDNS) before the registry lookup, as RP2040 already did. - #1446: a pre-unified-toolchain ESP32 platform pin (pioarduino 51.x) warns and builds against stable instead of failing on a 404 toolchain URL. Regression from #1434; per-MCU toolchain support is #1444. Also since 2.5.23: honored ESP32 platform pins and PlatformIO-parity ESP32-S3 size (#1434), fbuild install and split CI caches (#1438), declared-submodule handling for CH32V and SiLabs (#1439, unblocks FastLED's mgm240s), and Linux udev setup (#1424). Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Fixes #1441.
Root cause
It isn't about header-only libraries.
fbuild ci/kitchensink buildsent the daemon the relative stringci/kitchensink, and the build handler used it as-is (PathBuf::from(&req.project_dir)). Every path derived from it stayed relative: the build dir,libs/, and each downloaded library's-Iflag. Meanwhile the compiler runs from the absolute project dir. So the sketch gotwhich, resolved from
…/ci/kitchensink, points nowhere, and the build failed withfatal error: ArduinoJson.h: No such file or directory.symlink://libraries were already canonicalised (resolve_local_library_dir), which is why FastLED itself was found. The handler also read the relative path against the daemon's cwd, which only matched the caller's by accident.Fix
resolve_project_dir()sends an absolute path (std::path::absolute, lexical, no symlink resolution).project_diragainst the request'scaller_cwd(resolve_request_project_dir), so every client gets the same answer.Validation
resolve_request_project_dir: a relative path joined ontocaller_cwd, an absolute path kept, nocaller_cwdstill producing an absolute path, and..ci/kitchensink(fix(ci): port the kitchensink project to fbuild FastLED#4429) run asfbuild ci/kitchensink buildin dev mode: the build now compiles and links with#include <ArduinoJson.h>(309 KB). The sketch's ArduinoJson flag is now-I/home/…/ci/kitchensink/.fbuild/build/dev/release/libs/arduinojson/src/src. That run also needed fix(esp32): build a pre-unified-toolchain platform pin against stable #1446's platform fix, since the project pins pioarduino 51.03.04.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests