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.
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
datalistener detachment logic to avoid errors when writing into closed Emscripten FS streams; updatelastRefreshedtimestamp.
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.
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.
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.