fix(cli): use correct PATH delimiter and skip S_IXUSR on Windows in cbm_find_cli#161
Open
slvnlrt wants to merge 1 commit intoDeusData:mainfrom
Open
fix(cli): use correct PATH delimiter and skip S_IXUSR on Windows in cbm_find_cli#161slvnlrt wants to merge 1 commit intoDeusData:mainfrom
slvnlrt wants to merge 1 commit intoDeusData:mainfrom
Conversation
f27c74d to
4eeec46
Compare
…bm_find_cli
Two issues prevent cbm_find_cli() from finding OpenCode/Aider on Windows:
1. PATH delimiter: uses ':' on all platforms, but Windows uses ';'.
This splits 'C:\Users\...' at the drive letter colon, producing
garbage paths.
2. S_IXUSR check: stat() on Windows does not set Unix permission bits,
so the executable check always fails even when the file exists.
npm installs CLI shims as extensionless files (e.g. 'opencode',
not 'opencode.exe'), which stat() finds but S_IXUSR rejects.
Fix: use ';' delimiter on Windows, and check only file existence
(stat() == 0) instead of S_IXUSR.
Tests: replaced SKIP("PATH search differs on Windows") with
cross-platform test cases that run on both Unix and Windows.
Fixes DeusData#159
4eeec46 to
4cc7890
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cbm_find_cli()never finds OpenCode or Aider on Windows due to two issues::on all platforms, but Windows uses;. This splitsC:\Users\...at the drive letter colon, producing garbage paths.S_IXUSRcheck:stat()on Windows does not set Unix permission bits. npm installs CLI shims as extensionless files (e.g.opencode, notopencode.exe), whichstat()finds but theS_IXUSRcheck always rejects.Fixes #159
Changes
src/cli/cli.c—cbm_find_cli():;as PATH delimiter on Windows (#ifdef _WIN32)S_IXUSRcheck on Windows — just verify file exists withstat() == 0tests/test_cli.c—cli_find_cli_on_path,cli_find_cli_fallback_paths:SKIP("PATH search differs on Windows")with cross-platform test cases that run on both Unix and WindowsTest plan
scripts/test.shpasses (previously skipped tests now run)codebase-memory-mcp install -ydetects OpenCode when installed via npm:delimiter andS_IXUSRbehavior unchanged