Skip to content

fix: detect build tools with where on Windows - #240

Merged
s2x merged 4 commits into
crazy-goat:mainfrom
stantheman0128:fix/windows-which-build-tools
Oct 3, 2026
Merged

s2x merged 4 commits into
crazy-goat:mainfrom
stantheman0128:fix/windows-which-build-tools

Conversation

@stantheman0128

Copy link
Copy Markdown
Contributor

Summary

Fixes #188.

Builder::isBuildAvailable() probed PATH with Unix-only which, so on Windows it always returned false even when cmake and a C++ compiler were installed. It now uses where when PHP_OS_FAMILY === 'Windows', and keeps which elsewhere. Independent of #239 (macOS nproc).

prepared with Cursor

Verification

Evidence type: PATH fixture on macOS (not a live Win11 run). This Mac has no Windows and no php binary.

Red class (cmake on PATH, which absent):

env -i PATH=<fixture-bin> /bin/bash --noprofile --norc -c 'which cmake 2>/dev/null'
exit 127

Green:

bash tests/windows-which-lookup.test.sh
windows which-lookup fixture ok (which missing exit 127, where found cmake)

Source checks in that script: Windows PHP_OS_FAMILY branch, where, 2>NUL, and no unconditional shell_exec('which ...'). PHPUnit was not run (php not installed here).

Made with Cursor

@s2x
s2x merged commit 9c93e75 into crazy-goat:main Oct 3, 2026
10 checks passed
@s2x

s2x commented Oct 3, 2026

Copy link
Copy Markdown
Member

Thank you @stantheman0128 for this contribution! The fix has now been merged, and the build-tool detection was also verified on real Windows runners with PHP 8.2, 8.3, and 8.4. Thanks for improving Windows support and fixing the clang++ fallback.

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.

bug: Builder.isBuildAvailable() uses Unix-only 'which', always returns false on Windows

2 participants