GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing github.com — feat: static build support (--enable-php-debugger) by pronskiy · Pull Request #47 · php-debugger/php-debugger Conversation
|
| Config | Time | Overhead |
|---|---|---|
| Vanilla PHP (no ext) | 0.573s | baseline |
| Static php_debugger (loaded, no client) | 0.605s | ~5.6% |
Same observer API floor as the shared build.
extension_loaded("php_debugger") ✅extension_loaded("xdebug") ✅ (compat alias)php_debugger.* and xdebug.* INI settings workzend_extension=php_debugger.so) unaffected
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I want to add some automated test, but don't want to slow down the whole CI for that. Any suggestions? Upd: added test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9ab4c01 to
6cb250d
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is brilliant @pronskiy
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add support for compiling php_debugger as a static extension into php-src using ./configure --enable-php-debugger (without --enable-shared). Changes: - MINIT self-registration: in static builds, the Zend extension is registered from PHP_MINIT_FUNCTION since zend_startup_extensions() has already run by the time MINIT fires. Manually calls xdebug_library_zend_startup() and xdebug_debugger_zend_startup() to replicate xdebug_zend_startup() logic. - xdebug_zend_startup() early return: prevents double module registration when zend_startup_extensions() calls it after MINIT already initialized. - php_php_debugger.h: bridge header providing phpext_php_debugger_ptr for PHP's static extension table (main/internal_functions.c). - config.m4: add PHP_ADD_INCLUDE($ext_srcdir) for header discovery. - Fix COMPILE_DL_XDEBUG -> COMPILE_DL_PHP_DEBUGGER in RINIT ZTS guard. Benchmark (PHP 8.6.0-dev, bench.php): Vanilla PHP: 0.573s (baseline) Static php_debugger: 0.605s (~5.6% overhead, observer API floor)
Dedicated CI job that builds PHP from source with --enable-php-debugger and verifies the extension loads correctly as a static build. Only triggers on changes to config.m4, php_php_debugger.h, xdebug.c, or the workflow itself — does not slow down the main test suite. Smoke tests: - Module list (php_debugger + xdebug compat) - Zend extension registration - extension_loaded() for both names - INI settings (both prefixes) - Function existence (both aliases)
config.m4 includes m4/pkg.m4 and m4/clocks.m4 which resolve relative to the php-src root, not the extension directory.
Remove cache step (not worth complexity for a rarely-triggered workflow). Always clone fresh — simpler and more reliable.
dd6d678 to
14bc967
Compare
Registers php_debugger_info as a ZEND_FALIAS of xdebug_info so the php_debugger_* function namespace has at least one user-visible entry point alongside the php_debugger.* INI namespace. Updates the static-build smoke test to assert php_debugger_info() exists, replacing a stale assertion for php_debugger_break() (an alias that was removed when arginfo got regenerated in #48).
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Allow compiling this debugger statically into the php core
There was an error while loading. Please reload this page.