[PHP.wasm] Upgrade emscripten version from 4.0.5 to 4.0.19 #2910
[PHP.wasm] Upgrade emscripten version from 4.0.5 to 4.0.19 #2910
Conversation
9d08def to
0c23c20
Compare
|
The remaining failure seems unrelated to this PR 👍 Let's rebuild all the wasm files to make sure all the tests pass and we're good! I love how much smaller the built binaries are becoming. |
|
@adamziel Me too! I am currently rebuilding PHP.wasm node Asyncify as the 5th step in the description list. This will unlock the Intl dynamic extension for Web PR. I will create a new pull request to try to correct the failed test as I think the current failure could be related to PHP not running |
|
@adamziel The |
45be38f to
0f20c02
Compare
|
@mho22 following up sounds good, but I'm suspicious about it not failing anymore. Are we adding something to the asyncify list in this PR? Why is it not failing anymore? |
|
@adamziel I will investigate. I didn't add anything to the ASYNCIFY list but I think there could be two reasons :
I suspect the second option. |
|
In order to keep consistency between every PHP version I will need to re-run the compilation of every PHPs... Since a new version of PHP 8.4 has been released and a minor change has been added in I hope we won’t need to upgrade Emscripten again for a long time after this pull request 😅 |
|
@adamziel That's it! It is now ready for review! |
## Motivation for the change, related issues Based on [this comment](#2910 (comment)) The `nx run playground-blueprints:"test:vite"` command systematically fails due to 10 seconds timeout on the `should activate a plugin file located in the plugins directory` test. IIRC I also faced that situation with the PHP.wasm node tests and adding dispose methods made the trick. Let's see if it works here too. ## Implementation details Adding the following portion of code where necessary : ```typescript afterEach(async () => { php.exit(); await handler[Symbol.asyncDispose](); }); ``` ## Testing Instructions CI
…ild without RELOCATABLE option needed
42fd81c to
d8c329a
Compare
|
I will convert this to draft for now by adding the failing crash test again. It works for versions |
|
@adamziel I was wrong earlier, nothing was broken, the code had to be rearranged! Let's wait the check results. Ready for review again! |
|
🎉 🎉 🎉 |
|
@adamziel Ow! This pull request still had Intl supported as a static extension. The Intl dynamic extension in web pull request should have done the 6Mb decrease. However it didn't... I don't know why. I am on it. |
|
I am mixing things here since I am on the Intl for web pull request : Before this pull request we had :
Because of MAIN_MODULE, the node version had that 8Mb spike due to the This PR helped remove that 8MB increase when using MAIN_MODULE. But however added 2-3 more MB. This means why Node lost 6Mb while Web became 3Mb heavier. I will of course still investigate to find ways to reduce those sizes. [ MAIN_MODULE=2 is one of those probable ways ]. |
|
Good digging, thank you @mho22! |


Motivation for the change
We need this pull request in order for our PHP.wasm build to be built without
RELOCATABLEand avoid size increases when building withMAIN_MODULE. The pull request is in4.0.19release.Implementation details
base-imageDockerfile.setErrNoandmallocfromEXPORT_RUNTIME_METHODSsetErrNoby__errno_locationinphpwasm-emscripten-libraryPHPLoader["free"]with_freeinphpwasm-emscripten-librarywasmExports['free']toPHPLoader['free']inphp/DockerfilewasmExports['malloc']toPHPLoader['malloc']inphp/Dockerfilefd_closefromJSPI_IMPORTSandJSPI_EXPORTSdue toSuspendError: trying to suspend JS framesdefault.profrawfile in.gitignore__funcs_on_exitfunction inJSPI_EXPORTSto solve issues from PHP7.4 and PHP7.3__funcs_on_exitfunction inEXPORTED_FUNCTIONSto solve issues from PHP7.4 and PHP7.3zend_list_free_wrapperin PHP7.4 and PHP7.3HEAPU32andHEAPU8inEXPORT_RUNTIME_METHODSphp-crash.spec.tsfile to run test on each supported php version_mallocfunction inEXPORTED_FUNCTIONSphp-crash.spec.tsTesting Instructions
CI