-
Notifications
You must be signed in to change notification settings - Fork 305
[ php-wasm ] Add xdebug
shared extension to @php-wasm/node JSPI
#2248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adamziel
merged 46 commits into
WordPress:trunk
from
mho22:add-xdebug-support-to-php-wasm-node-jspi
Jul 2, 2025
+448,858
−46,085
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
0136d51
Added -fPIC to libintl
mho22 f6f6a97
Set php-wasm as a main module and enable dynamic linking
mho22 990f945
Implement XDebug as zend extension, compile and build
mho22 aa63703
Remove artifacts
mho22 8e87691
Correct merge conflicts
mho22 6f82103
Build xdebug with nx command and PHP_VERSION arg
mho22 fcfebd3
Add a withXdebug option in loadNodeRuntime
mho22 6c14976
Create separate file for supported php versions
mho22 f0e2d7c
Add proper ini entries and mount current working directory in with-xd…
mho22 77ddbda
Compile all php-wasm and xdebug extensions
mho22 460c878
Prevent Xdebug to be loaded in Asyncify
mho22 29520ea
Add tests
mho22 549f04f
Remove socket connection error and recompile php
mho22 c6411e4
Correct conflicts
mho22 491d0bb
Correct lint errors and add tests to CI
mho22 b3cc02c
Added temporary new job test-unit-jspi
mho22 fefc94c
Add last test on DBGP communication
mho22 ffcf2c4
Correct conflicts
mho22 c382bef
Correct errors and clean unused code
mho22 e19f292
Correct Errors and make improvements
mho22 bd0729c
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 522a7ea
Add previous emscriptenOptions in new ones
mho22 ffe001f
Correct errors and implement modifications
mho22 2fe9bbe
Apply new filepath for built and unbuilt version
mho22 143c23c
Unbundle sqlite3 in PHP 7.3 and 7.2
mho22 a1eee4f
Document multiple processes like sqlite <7.4 and esbuild path replace…
mho22 63733cf
Implement an 'import-url' Vite plugin and an ESBuild plugin to handle…
mho22 f3fb08a
wrap zend_list_free Zend function to avoid function signature mismatc…
mho22 eccb56f
minor modifications
mho22 037a25b
Add comment and test for function signature mismatch
mho22 8e7b5c9
correct merge conflicts from trunk
mho22 dc7afb4
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 1e66704
remove only from the unknown function signature mismatch test
mho22 654df4a
Recompile Asyncify PHP versions with aditional asyncify imports
mho22 02b80ed
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 454e740
Try to solve failing checks
mho22 eec8621
add env variable in ci
mho22 afcfae0
experiment use of max_old_space_size with runner
mho22 82b6e58
add aftereach in tests which disposes PHP wasm runtime
mho22 3ffdd92
improve aftereach which disposes PHP wasm runtime
mho22 aa53bc3
improve aftereach which disposes PHP wasm runtime
mho22 e5e453b
add php-networking in ci jobs list
mho22 f4c2388
Tweak some timeouts to make the checks pass
mho22 7418095
Tweak some timeouts to make the checks pass
mho22 3763dbc
Tweak some timeouts to make the checks pass
mho22 57d15a6
Merge branch 'trunk' into add-xdebug-support-to-php-wasm-node-jspi
mho22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Passing extra flags breaks the version check | ||
if [[ "$@" == "-v" ]]; then | ||
export EMCC_FLAGS="" | ||
fi | ||
|
||
# Convert args to an array for filtering | ||
args=("${@}") | ||
|
||
# Remove flags that we do not want to pass to emcc | ||
if [[ -n "${EMCC_SKIP:-}" ]]; then | ||
for ((i=0; i < ${#args[@]}; i++)); do | ||
if [[ " ${EMCC_SKIP[*]} " =~ " ${args[$i]} " ]]; then | ||
unset 'args[i]' | ||
fi | ||
done | ||
fi | ||
|
||
# Remove duplicate library references to avoid linking errors. | ||
# Begin at end because we generally want dependencies to come last, | ||
# and if two things depend on a lib, we want the lib to come after both. | ||
declare -A seen_libs | ||
for ((i=${#args[@]} - 1; i >= 0; i--)); do | ||
# Skip empty args because array may be sparse | ||
[[ -z "${args[$i]:-}" ]] && continue | ||
|
||
arg=${args[i]} | ||
if ( | ||
[[ "$arg" =~ ^-l([a-z]|[A-Z]|[0-9]|[\-_])+$ ]] || | ||
[[ "$arg" =~ (^|/)lib([a-z]|[A-Z]|[0-9]|[\-_])+\.a$ ]] | ||
); then | ||
if [[ -v seen_libs["$arg"] ]]; then | ||
unset 'args[i]' | ||
else | ||
seen_libs["$arg"]=1 | ||
fi | ||
fi | ||
done | ||
|
||
/root/emsdk/upstream/emscripten/emcc2 "${args[@]}" ${EMCC_FLAGS:-} |
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
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
Binary file modified
BIN
+5.05 MB
(220%)
packages/php-wasm/compile/libintl/asyncify/dist/root/lib/lib/libicui18n.a
Binary file not shown.
Binary file modified
BIN
+96.8 KB
(290%)
packages/php-wasm/compile/libintl/asyncify/dist/root/lib/lib/libicuio.a
Binary file not shown.
Binary file modified
BIN
+52.2 KB
(110%)
packages/php-wasm/compile/libintl/asyncify/dist/root/lib/lib/libicutest.a
Binary file not shown.
Binary file modified
BIN
+516 KB
(220%)
packages/php-wasm/compile/libintl/asyncify/dist/root/lib/lib/libicutu.a
Binary file not shown.
Binary file modified
BIN
+3.03 MB
(220%)
packages/php-wasm/compile/libintl/asyncify/dist/root/lib/lib/libicuuc.a
Binary file not shown.
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
Binary file modified
BIN
+5.05 MB
(220%)
packages/php-wasm/compile/libintl/jspi/dist/root/lib/lib/libicui18n.a
Binary file not shown.
Binary file modified
BIN
+96.8 KB
(290%)
packages/php-wasm/compile/libintl/jspi/dist/root/lib/lib/libicuio.a
Binary file not shown.
Binary file modified
BIN
+52.2 KB
(110%)
packages/php-wasm/compile/libintl/jspi/dist/root/lib/lib/libicutest.a
Binary file not shown.
Binary file modified
BIN
+516 KB
(220%)
packages/php-wasm/compile/libintl/jspi/dist/root/lib/lib/libicutu.a
Binary file not shown.
Binary file modified
BIN
+3.03 MB
(220%)
packages/php-wasm/compile/libintl/jspi/dist/root/lib/lib/libicuuc.a
Binary file not shown.
86 changes: 86 additions & 0 deletions
86
packages/php-wasm/compile/libsqlite3/<7.4/pdo_sqlite_config.m4
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
dnl config.m4 for extension pdo_sqlite | ||
dnl vim:et:sw=2:ts=2: | ||
|
||
PHP_ARG_WITH(pdo-sqlite, for sqlite 3 support for PDO, | ||
[ --without-pdo-sqlite[=DIR] | ||
PDO: sqlite 3 support. DIR is the sqlite base | ||
install directory [BUNDLED]], $PHP_PDO) | ||
|
||
if test "$PHP_PDO_SQLITE" != "no"; then | ||
|
||
if test "$PHP_PDO" = "no" && test "$ext_shared" = "no"; then | ||
AC_MSG_ERROR([PDO is not enabled! Add --enable-pdo to your configure line.]) | ||
fi | ||
|
||
ifdef([PHP_CHECK_PDO_INCLUDES], | ||
[ | ||
PHP_CHECK_PDO_INCLUDES | ||
],[ | ||
AC_MSG_CHECKING([for PDO includes]) | ||
if test -f $abs_srcdir/include/php/ext/pdo/php_pdo_driver.h; then | ||
pdo_cv_inc_path=$abs_srcdir/ext | ||
elif test -f $abs_srcdir/ext/pdo/php_pdo_driver.h; then | ||
pdo_cv_inc_path=$abs_srcdir/ext | ||
elif test -f $phpincludedir/ext/pdo/php_pdo_driver.h; then | ||
pdo_cv_inc_path=$phpincludedir/ext | ||
else | ||
AC_MSG_ERROR([Cannot find php_pdo_driver.h.]) | ||
fi | ||
AC_MSG_RESULT($pdo_cv_inc_path) | ||
]) | ||
|
||
php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" | ||
|
||
SEARCH_PATH="$PHP_PDO_SQLITE /root/lib" # you might want to change this | ||
SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this | ||
if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter | ||
PDO_SQLITE_DIR=$PHP_PDO_SQLITE | ||
else # search default path list | ||
AC_MSG_CHECKING([for sqlite3 files in default path]) | ||
for i in $SEARCH_PATH ; do | ||
if test -r $i/$SEARCH_FOR; then | ||
PDO_SQLITE_DIR=$i | ||
AC_MSG_RESULT(found in $i) | ||
fi | ||
done | ||
fi | ||
if test -z "$PDO_SQLITE_DIR"; then | ||
AC_MSG_RESULT([not found]) | ||
AC_MSG_ERROR([Please reinstall the sqlite3 distribution]) | ||
fi | ||
|
||
PHP_ADD_INCLUDE($PDO_SQLITE_DIR/include) | ||
|
||
LIBNAME=sqlite3 | ||
LIBSYMBOL=sqlite3_open | ||
|
||
PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL, | ||
[ | ||
PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $PDO_SQLITE_DIR/$PHP_LIBDIR, PDO_SQLITE_SHARED_LIBADD) | ||
AC_DEFINE(HAVE_PDO_SQLITELIB,1,[ ]) | ||
],[ | ||
AC_MSG_ERROR([wrong sqlite lib version or lib not found]) | ||
],[ | ||
-L$PDO_SQLITE_DIR/$PHP_LIBDIR -lm | ||
]) | ||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[ | ||
AC_DEFINE(HAVE_SQLITE3_KEY,1, [have commercial sqlite3 with crypto support]) | ||
]) | ||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_close_v2,[ | ||
AC_DEFINE(HAVE_SQLITE3_CLOSE_V2, 1, [have sqlite3_close_v2]) | ||
]) | ||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[ | ||
AC_DEFINE(HAVE_SQLITE3_COLUMN_TABLE_NAME, 1, [have sqlite3_column_table_name]) | ||
]) | ||
|
||
PHP_SUBST(PDO_SQLITE_SHARED_LIBADD) | ||
PHP_NEW_EXTENSION(pdo_sqlite, $php_pdo_sqlite_sources_core, $ext_shared,,-I$pdo_cv_inc_path) | ||
|
||
dnl Solaris fix | ||
PHP_CHECK_LIBRARY(rt, fdatasync, [PHP_ADD_LIBRARY(rt,, PDO_SQLITE_SHARED_LIBADD)]) | ||
|
||
ifdef([PHP_ADD_EXTENSION_DEP], | ||
[ | ||
PHP_ADD_EXTENSION_DEP(pdo_sqlite, pdo) | ||
]) | ||
fi |
70 changes: 70 additions & 0 deletions
70
packages/php-wasm/compile/libsqlite3/<7.4/sqlite_config0.m4
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
dnl config.m4 for extension sqlite3 | ||
dnl vim:et:ts=2:sw=2 | ||
|
||
PHP_ARG_WITH(sqlite3, whether to enable the SQLite3 extension, | ||
[ --without-sqlite3[=DIR] Do not include SQLite3 support. DIR is the prefix to | ||
SQLite3 installation directory.], yes) | ||
|
||
if test $PHP_SQLITE3 != "no"; then | ||
sqlite3_extra_sources="" | ||
PHP_SQLITE3_CFLAGS=" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 " | ||
|
||
dnl when running phpize enable_maintainer_zts is not available | ||
if test -z "$enable_maintainer_zts"; then | ||
if test -f "$phpincludedir/main/php_config.h"; then | ||
ZTS=`grep '#define ZTS' $phpincludedir/main/php_config.h|$SED 's/#define ZTS//'` | ||
if test "$ZTS" -eq "1"; then | ||
enable_maintainer_zts="yes" | ||
fi | ||
fi | ||
fi | ||
|
||
AC_MSG_CHECKING([for sqlite3 files in default path]) | ||
for i in $PHP_SQLITE3 /root/lib; do | ||
if test -r $i/include/sqlite3.h; then | ||
SQLITE3_DIR=$i | ||
AC_MSG_RESULT(found in $i) | ||
break | ||
fi | ||
done | ||
|
||
if test -z "$SQLITE3_DIR"; then | ||
AC_MSG_RESULT([not found]) | ||
AC_MSG_ERROR([Please reinstall the sqlite distribution from http://www.sqlite.org]) | ||
fi | ||
|
||
AC_MSG_CHECKING([for SQLite 3.3.9+]) | ||
PHP_CHECK_LIBRARY(sqlite3, sqlite3_prepare_v2, [ | ||
AC_MSG_RESULT(found) | ||
PHP_ADD_LIBRARY_WITH_PATH(sqlite3, $SQLITE3_DIR/$PHP_LIBDIR, SQLITE3_SHARED_LIBADD) | ||
PHP_ADD_INCLUDE($SQLITE3_DIR/include) | ||
],[ | ||
AC_MSG_RESULT([not found]) | ||
AC_MSG_ERROR([Please install SQLite 3.3.9 first or check libsqlite3 is present]) | ||
],[ | ||
-L$SQLITE3_DIR/$PHP_LIBDIR -lm | ||
]) | ||
|
||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_key,[ | ||
AC_DEFINE(HAVE_SQLITE3_KEY, 1, [have commercial sqlite3 with crypto support]) | ||
]) | ||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_column_table_name,[ | ||
AC_DEFINE(SQLITE_ENABLE_COLUMN_METADATA, 1, [have sqlite3 with column metadata enabled]) | ||
]) | ||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_errstr,[ | ||
AC_DEFINE(HAVE_SQLITE3_ERRSTR, 1, [have sqlite3_errstr function]) | ||
]) | ||
|
||
PHP_CHECK_LIBRARY(sqlite3,sqlite3_load_extension, | ||
[], | ||
[AC_DEFINE(SQLITE_OMIT_LOAD_EXTENSION, 1, [have sqlite3 with extension support]) | ||
]) | ||
|
||
AC_DEFINE(HAVE_SQLITE3,1,[ ]) | ||
|
||
sqlite3_sources="sqlite3.c $sqlite3_extra_sources" | ||
|
||
PHP_NEW_EXTENSION(sqlite3, $sqlite3_sources, $ext_shared,,$PHP_SQLITE3_CFLAGS) | ||
PHP_ADD_BUILD_DIR([$ext_builddir/libsqlite]) | ||
PHP_SUBST(SQLITE3_SHARED_LIBADD) | ||
fi |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.