fix(paths): normalize the default Windows home as well - #110
ziyaad-mallick wants to merge 1 commit into
Conversation
resolve_home() folded separators for --home and RUNANYWHERE_HOME but returned the SDK's default base dir untouched. On Windows that value is LOCALAPPDATA with "/RunAnywhere" appended, so it still came back mixed. Pass it through normalize_dir() like the other two branches, and cover it with a backslashed LOCALAPPDATA case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe fallback path in ChangesHome path normalization
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change correctly normalizes the Windows fallback path and adds isolated coverage without a concrete merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Follow-up to #58, from CodeRabbit's outside-diff comment there.
#58 made
normalize_dir()fold backslashes, butresolve_home()only calls it for the--homeflag andRUNANYWHERE_HOME. The default branch returns the SDK's buffer as-is:On Windows that buffer is built by
windows_app_dir("LOCALAPPDATA")in runanywhere-sdkscore/src/desktop/desktop_adapter.cpp:98-113, which trims trailing separators and appends"/RunAnywhere"to the raw environment value. A realLOCALAPPDATAisC:\Users\<user>\AppData\Local, so the default home still comes back asC:\Users\<user>\AppData\Local/RunAnywhere. That's the default path for anyone who hasn't set--homeorRUNANYWHERE_HOME.This returns
normalize_dir(buffer), the same as the other two branches. On macOS and Linuxnormalize_dironly trims a trailing/, whichxdg_dirin the SDK already does, so nothing changes there.Why the existing test didn't catch it
The
_WIN32default case intest_resolve_home_precedencesetsLOCALAPPDATAto"C:/wally-local", with forward slashes, which is the one input that can't show the bug. Same blind spot #58 fixed forstate_dir(). This adds a second case with"C:\\wally-local"next to it and leaves the existing one alone.Tested: Windows 11 Pro x64, MinGW-w64 g++ 15.2.0. The full
ctestwasn't run, since building the test binary needs the pinned SDK kit, which isn't on this machine. Instead I compiledsrc/config/cli_paths.cppagainst a stub whoserac_desktop_default_base_diris copied verbatim fromdesktop_adapter.cpp, and ran both Windows default cases with the same_putenv_scallsEnvVarmakes:on
main:on this branch:
Not verified: the test under MSVC, or a real
wally inforun. Neither can be built here, so thewindows-2022job is the real check.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests