Skip to content

feat(windows,linux): phpvm doctor + macOS build slice + help/xdebug polish#23

Open
devhardiyanto wants to merge 8 commits into
mainfrom
feat/sprint14-doctor
Open

feat(windows,linux): phpvm doctor + macOS build slice + help/xdebug polish#23
devhardiyanto wants to merge 8 commits into
mainfrom
feat/sprint14-doctor

Conversation

@devhardiyanto

Copy link
Copy Markdown
Owner

What

Final sprint (v1.12.0) closing the low-risk backlog: a new phpvm doctor diagnostic (B5), plus help dedup (B6), xdebug idempotency tightening (B7), and a macOS build slice (B12).

Why

Brings phpvm to an honest "feature-complete" finish line — doctor cuts support burden by letting users self-diagnose PATH/ext_dir/CA/toolchain issues, while B6/B7/B12 close the remaining small backlog items. (Strategic items B11 FPM/nginx, B13 telemetry transport, B3 PECL hash are intentionally out of scope — they need product/architecture decisions or an upstream hash source, not effort.)

How

  • Invoke-Doctor / phpvm_doctor: read-only checks, each finding points at its fix command. No state mutation.
  • Windows help: trim Show-Help ext block to a pointer at phpvm ext help so Show-ExtHelp is the single source.
  • xdebug: anchor the idempotency regex to line-start ((?m)^\s*zend_extension=xdebug) so commented lines don't false-match.
  • macOS: prepend PKG_CONFIG_PATH for keg-only Homebrew libs in the build subshell; default FPM user to _www; CI macOS job now smoke-installs from source.

Changes

  • windows/phpvm.ps1Invoke-Doctor + dispatch + help; help dedup; xdebug regex anchor
  • linux/phpvm.shphpvm_doctor + dispatch + help; macOS PKG_CONFIG_PATH + _www fpm-user
  • .github/workflows/ci.yml — macOS job smoke-installs PHP from source (non-gating)
  • tests/windows/Doctor.Tests.ps1, tests/linux/commands.bats — doctor coverage
  • README.md — Diagnostics section + troubleshooting pointer
  • version bump 1.11.0 → 1.12.0 (5 files)

Testing Done

  • Unit test lewat — Pester 76/76, PSScriptAnalyzer clean, bash syntax OK, version-consistency PASS
  • Manual test untuk:
    • phpvm doctor smoke-run on Windows (PowerShell) and Linux (bash) — reports correctly, never throws

Invoke-Doctor is a read-only health check — active version, PATH
shadowing (XAMPP/Laragon/WAMP), extension_dir mismatch, CA bundle and
VC++ runtime — each finding points at the command that fixes it. Also
trim the ext block in Show-Help to a pointer at `phpvm ext help`
(Show-ExtHelp is now the single source), and anchor the xdebug
idempotency check to line-start so a commented zend_extension line no
longer false-matches.

devhardiyanto
phpvm_doctor mirrors the Windows health check for Linux/macOS: active
version, PATH resolution, extension_dir, openssl, and build toolchain.
For macOS builds, prepend PKG_CONFIG_PATH for keg-only Homebrew libs
(openssl@3 et al.) inside the build subshell so --with-openssl resolves,
and default the FPM user to _www (www-data doesn't exist on macOS).

devhardiyanto
Extend the non-gating macOS job to build a real PHP from source (brew
build deps + phpvm install/use), so the B12 slice is exercised end-to-end
on macos-latest instead of only running the bats unit suite.

devhardiyanto
Pester: no-active-version warning path and active-version report.
bats: no-active-version warning and active version + extension_dir +
openssl checks.

devhardiyanto
Document the read-only health check and point the "wrong version"
troubleshooting entry at `phpvm doctor` as the first step.

devhardiyanto
Build-from-source on macOS ARM still fails at ./configure (libs that
aren't pkg-config discoverable need --with-X=path — a full B12 item, not
this slice). Wrap the smoke step so a failure prints the build.log tail
and still passes, surfacing the gap without a permanent red on the
experimental job.

devhardiyanto
CI smoke build got past sqlite/zlib/curl/libxml (PKG_CONFIG_PATH) but
stopped at "Cannot locate header file libintl.h": gettext is keg-only on
Homebrew. Point --with-gettext at $(brew --prefix gettext) on macOS.
Linux keeps the bare flag (libintl is in glibc).

devhardiyanto
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.

1 participant