Skip to content

Export SQLite auto-extension symbols for PHP.wasm side modules#3524

Merged
adamziel merged 1 commit into
trunkfrom
adamziel/cli-edit-markdown
May 14, 2026
Merged

Export SQLite auto-extension symbols for PHP.wasm side modules#3524
adamziel merged 1 commit into
trunkfrom
adamziel/cli-edit-markdown

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

@adamziel adamziel commented Apr 23, 2026

What it does

Exports SQLite's sqlite3_auto_extension() and
sqlite3_cancel_auto_extension() symbols from PHP.wasm main modules.

Rationale

External PHP.wasm side modules can register SQLite virtual table modules by
calling sqlite3_auto_extension() during PHP startup. The markdown editor now
lives in adamziel/wp-extensions and uses this path to register its
markdown_posts and markdown_postmeta virtual tables.

The current published @wp-playground/cli@3.1.30 cannot run that extension:
it does not expose the complete --php-extension workflow, and its PHP.wasm
builds do not export these SQLite symbols. This PR is the Playground-side
runtime change needed before the wp-extensions instructions can use a
published CLI release.

Related feature PR: adamziel/wp-extensions#1

Implementation

Adds sqlite3_auto_extension and sqlite3_cancel_auto_extension to the
Asyncify export lists in:

  • packages/php-wasm/compile/php/Dockerfile
  • packages/php-wasm/compile/php/Dockerfile-5-2

The markdown-editor command, mu-plugin, SQLite extension source, and
php-toolkit submodule are intentionally not in this Playground PR.

Testing instructions

git diff --check origin/trunk...HEAD

Full verification requires recompiling PHP.wasm and loading an external side
module that calls sqlite3_auto_extension(). The consumer lives in
adamziel/wp-extensions#1.

@adamziel adamziel changed the title [CLI] edit-markdown: edit a folder of Markdown files in the block editor [CLI] edit-markdown + sqlite-markdown extension (opt-in via --sqlite-markdown) Apr 28, 2026
@adamziel adamziel force-pushed the adamziel/cli-edit-markdown branch from af4b6db to a97e977 Compare May 12, 2026 22:57
@adamziel adamziel changed the title [CLI] edit-markdown + sqlite-markdown extension (opt-in via --sqlite-markdown) [CLI] edit-markdown via sqlite_markdown PHP.wasm extension May 12, 2026
@adamziel adamziel changed the base branch from trunk to adamziel/php-wasm-side-module-extension-loading May 12, 2026 22:58
@adamziel adamziel force-pushed the adamziel/php-wasm-side-module-extension-loading branch from 0316c21 to 94e808c Compare May 12, 2026 23:32
@adamziel adamziel force-pushed the adamziel/cli-edit-markdown branch from a97e977 to ff0a3a3 Compare May 12, 2026 23:33
@adamziel adamziel force-pushed the adamziel/php-wasm-side-module-extension-loading branch from 94e808c to e0d3db0 Compare May 12, 2026 23:51
@adamziel adamziel force-pushed the adamziel/cli-edit-markdown branch 4 times, most recently from 0cc451f to 74f61e1 Compare May 14, 2026 13:32
@adamziel adamziel changed the base branch from adamziel/php-wasm-side-module-extension-loading to trunk May 14, 2026 13:32
@adamziel adamziel force-pushed the adamziel/cli-edit-markdown branch 4 times, most recently from ec5eb5c to 90ef8b9 Compare May 14, 2026 14:38
@adamziel adamziel force-pushed the adamziel/cli-edit-markdown branch from 90ef8b9 to f56274e Compare May 14, 2026 14:58
@adamziel adamziel changed the title [CLI] edit-markdown via sqlite_markdown PHP.wasm extension Export SQLite auto-extension symbols for PHP.wasm side modules May 14, 2026
@adamziel adamziel marked this pull request as ready for review May 14, 2026 15:14
@adamziel adamziel requested review from a team and Copilot May 14, 2026 15:15
@adamziel adamziel requested a review from JanJakes May 14, 2026 15:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Exports SQLite auto-extension APIs from PHP.wasm builds so external side modules can register SQLite virtual table modules during PHP startup (needed by the markdown editor extension workflow).

Changes:

  • Add sqlite3_auto_extension to the Asyncify-related symbol list for the PHP.wasm build.
  • Add sqlite3_cancel_auto_extension to the Asyncify-related symbol list for the PHP.wasm build.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/php-wasm/compile/php/Dockerfile Adds SQLite auto-extension symbols to the Asyncify symbol list for the default PHP.wasm build.
packages/php-wasm/compile/php/Dockerfile-5-2 Adds SQLite auto-extension symbols to the Asyncify symbol list for the PHP 5.2 PHP.wasm build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1444 to 1452
"sqlite_handle_closer",\
"sqlite_handle_doer",\
"sqlite_handle_preparer",\
"sqlite3_auto_extension",\
"sqlite3_autovacuum_pages",\
"sqlite3_backup_step",\
"sqlite3_bind_pointer",\
"sqlite3_cancel_auto_extension",\
"sqlite3_exec",\
Comment on lines 1461 to 1469
"sqlite_handle_closer",\
"sqlite_handle_doer",\
"sqlite_handle_preparer",\
"sqlite3_auto_extension",\
"sqlite3_autovacuum_pages",\
"sqlite3_backup_step",\
"sqlite3_bind_pointer",\
"sqlite3_cancel_auto_extension",\
"sqlite3_exec",\
@adamziel adamziel merged commit bb4d8e1 into trunk May 14, 2026
104 of 105 checks passed
@adamziel adamziel deleted the adamziel/cli-edit-markdown branch May 14, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants