Repository navigation
fix: build the clib on macOS without nproc - #239
Conversation
macOS does not ship nproc, so the clib build command failed before make started. sysctl and getconf are already on this system. Co-authored-by: Cursor <cursoragent@cursor.com>
The Darwin job-count check was failing on its own explanation. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for the fix and the test, and sorry for the long wait.
|
…ix/mac-make-jobs-without-nproc
|
Merged current main and added an Unreleased changelog note for the macOS make job count. The local job-count test still passes. CI should be able to run ci-ok on this head. |
|
shellcheck SC2016 was the remaining lint failure. The search stays in single quotes so it matches the literal |
|
Merged current main again ( |
|
Thank you @stantheman0128 for the contribution and for keeping this PR up to date! All CI checks are now passing, and the fix has been merged. Thanks for improving the macOS build experience and adding the regression test. |
## 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](https://cursor.com) --------- Co-authored-by: stantheman0128 <stantheman0128@users.noreply.github.com> Co-authored-by: Piotr Hałas <halaspiotr@gmail.com>
Summary
Fixes the
nprochalf of #95.Builder::build()ranmake -j$(nproc). This Mac has nonproc, so the command substitution exits 127. The job count is nowsysctl -n hw.ncpu, thengetconf _NPROCESSORS_ONLN, then1. Theg++/clang++null-coalescing check in the same issue was not changed.phpis not installed here, so that branch was not executed.prepared with Cursor
Verification
Red, this Mac:
Green:
sysctl -n hw.ncpureturned a positive integer.phptests were not run. The Dockernprocindocker/Dockerfilewas left alone. That image is Linux.Made with Cursor