[PHP.wasm] Fix sqlite_markdown extension loading - #3650
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes a PHP 8.4 web runtime crash when loading the published sqlite_markdown extension manifest by exporting the missing _strtoll and _php_info_print_table_header symbols and rebuilding the JSPI artifact. Also adds an e2e regression test.
Changes:
- Add
_strtolland_php_info_print_table_headerto the PHP exported functions list. - Rebuild PHP 8.4 JSPI web artifact (8.4.20 → 8.4.21) picking up newly exported symbols.
- Add a Playwright e2e test that loads the real published
sqlite_markdownmanifest and queries its virtual tables.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/php-wasm/compile/php/exported-functions.list | Adds _strtoll and _php_info_print_table_header to exported symbols. |
| packages/php-wasm/web-builds/8-4/jspi/php_8_4.js | Regenerated runtime exposing new exports and bumping to 8.4.21. |
| packages/php-wasm/web/src/test/php-dynamic-loading.spec.ts | New e2e test verifying the published sqlite_markdown extension loads and works. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What it does
Fixes the web runtime crash when loading the published
sqlite_markdownextension manifest in JSPI PHP builds.
Click here to test on Playground
Rationale
The deployed web PHP 8.4 JSPI build does not export every symbol imported by
the
sqlite_markdownside module. Emscripten wires those missing imports as JSstubs, and the browser later crashes with
TypeError: n is not a functionduring extension startup. The same export list is shared by the other PHP
versions, so this rebuild carries the fix across the JSPI matrix.
Implementation
Adds
_strtolland_php_info_print_table_headerto the PHP export list andrebuilds the web JSPI artifacts for PHP 7.4 through 8.5. The rebuilt modules
also pick up the existing SQLite/filesystem exports already listed for side
modules, including
_sqlite3_auto_extension,_sqlite3_cancel_auto_extension,_opendir,_readdir,_mkdir,_rename,and
_unlink.This does not try to make Asyncify side-module loading work. PHP 8.5
Asyncify is rebuilt only as a generated-runtime canary so CI keeps exercising
one Asyncify artifact after the export-list change.
Adds a browser e2e regression that loads the real published manifest URL
pinned to
4656cd898cf8430c44e985d0515c2182ffcc5575,creates a markdown file in the PHP filesystem, and queries the extension's
markdown_postsandmarkdown_postmetaSQLite virtual tables.Testing instructions
Verified that all rebuilt JSPI artifacts, plus the PHP 8.5 Asyncify canary,
export
strtollandphp_info_print_table_header.Also manually verified the original URL locally through
npm run dev. Itbooted to
/wp-admin/edit.php?post_type=page, showed the markdown editor adminnotice, and listed the markdown-backed pages.