Skip to content

[Compilation][#3512] PHP.wasm Web#3526

Merged
mho22 merged 1 commit intotrunkfrom
compile-php-wasm-web
Apr 24, 2026
Merged

[Compilation][#3512] PHP.wasm Web#3526
mho22 merged 1 commit intotrunkfrom
compile-php-wasm-web

Conversation

@mho22
Copy link
Copy Markdown
Collaborator

@mho22 mho22 commented Apr 24, 2026

This pull request is part of #3512 and #3518

Compiling PHP.wasm Web.

This is the second attempt since #3513 was merged directly inside #3512 which hit the same issue as when you recompile PHP.wasm directly inside a PR.

@mho22 mho22 requested review from a team, ashfame and Copilot April 24, 2026 17:26
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.

Updates the prebuilt PHP.wasm web JS wrappers (JSPI) to newer PHP patch releases and adjusts the generated runtime glue to better handle child-process pipe teardown.

Changes:

  • Bump PHP 8.5 web build from 8.5.3 → 8.5.5 (including wasm path and size metadata).
  • Bump PHP 8.4 web build from 8.4.18 → 8.4.20 (including wasm path and size metadata).
  • Add pipe data listener detachment logic to avoid errors when writing into closed Emscripten FS streams; update lastRefreshed timestamp.

Reviewed changes

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

Show a summary per file
File Description
packages/php-wasm/web-builds/8-5/jspi/php_8_5.js Updates wasm reference/version metadata; adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/8-4/jspi/php_8_4.js Updates wasm reference/version metadata; adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/8-3/jspi/php_8_3.js Updates dependencies size metadata; adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/8-2/jspi/php_8_2.js Updates dependencies size metadata; adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/8-1/jspi/php_8_1.js Adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/8-0/jspi/php_8_0.js Adds listener cleanup and guarded pipe writes.
packages/php-wasm/web-builds/7-4/jspi/php_7_4.js Adds listener cleanup and guarded pipe writes.
packages/php-wasm/supported-php-versions.mjs Refreshes the lastRefreshed timestamp.
Comments suppressed due to low confidence (1)

packages/php-wasm/web-builds/8-5/jspi/php_8_5.js:7030

  • Cleanup is only wired to the child process 'exit' event. In Node, spawn/stdio failures emit 'error' (and 'exit' may not fire), which would bypass this teardown and can leak listeners/FDs. Attach the same cleanup to 'error' (and consider 'close') with a shared idempotent cleanup function to ensure resources are released in all termination paths. (Same pattern appears in the other web-build JSPI files updated here.)
			const detachPipeDataListeners = [];
			cp.on('exit', function (code) {
				for (const detach of detachPipeDataListeners) {
					detach();
				}
				for (const fd of [stdoutChildFd, stderrChildFd, stdinChildFd]) {
					if (FS.streams[fd] && !FS.isClosed(FS.streams[fd])) {
						FS.close(FS.streams[fd]);
					}
				}

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

Comment thread packages/php-wasm/web-builds/8-5/jspi/php_8_5.js
Comment thread packages/php-wasm/web-builds/8-5/jspi/php_8_5.js
@mho22 mho22 changed the title Compilation][#3512] PHP.wasm Web [Compilation][#3512] PHP.wasm Web Apr 24, 2026
@mho22 mho22 merged commit f1540ef into trunk Apr 24, 2026
47 checks passed
@mho22 mho22 deleted the compile-php-wasm-web branch April 24, 2026 18:12
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.

2 participants