@php-wasm/universal : Add Phar support in php-wasm
Based on issue #1241.
This is an initial pull request version. I may need further guidance to ensure it is ready for merging.
@adamziel I'm currently trying to run the composer PHAR file in php-wasm/web, but I'm encountering the following stack trace when running php.cli( [ 'php', 'composer.phar', 'install' ] );:
Uncaught (in promise) RuntimeError: null function or function signature mismatch
at 032749f6:0xdfebf
at 032749f6:0x7e623
at 032749f6:0x2c68d9
at 032749f6:0x6a6ec2
at 032749f6:0x707bcc
at 032749f6:0x74b9b4
at 032749f6:0x2e9fbe
at 032749f6:0x6eb13e
at 032749f6:0x6ae8a1
at ret.<computed> (php_8_2.js:43:72504)Caused by: Error
at Asyncify.handleSleep (php_8_2.js:60:49)
at _emscripten_sleep (php_8_2.js:43:39745)
at 032749f6:0xddacd
at 032749f6:0x6a6dbe
at 032749f6:0x707bcc
at 032749f6:0x74b9b4
at 032749f6:0x2e9fbe
at 032749f6:0x6eb13e
at 032749f6:0x6ae8a1
at ret.<computed> (php_8_2.js:43:72504)
with :
Uncaught RuntimeError: unreachable
at 032749f6:0x6e6706
at ret.<computed> (php_8_2.js:43:72504)
at t.wasmExports.<computed> (index.js:522:18)
at Object.doRewind (php_8_2.js:43:74168)
at php_8_2.js:43:74741
at callUserCallback (php_8_2.js:43:37432)
at php_8_2.js:43:39676Caused by: Error
at Asyncify.handleSleep (php_8_2.js:60:49)
at _emscripten_sleep (php_8_2.js:43:39745)
at 032749f6:0xddacd
at 032749f6:0x6a6dbe
at 032749f6:0x707bcc
at 032749f6:0x74b9b4
at 032749f6:0x2e9fbe
at 032749f6:0x6eb13e
at 032749f6:0x6ae8a1
at ret.<computed> (php_8_2.js:43:72504)
This stack trace looks somewhat familiar but is obviously hard to read. Do you have any insights or suggestions on how to make this more debuggable?
@mho22 the Node.js build should give you the same error with all the c function names. I would so love to start shipping the JSPI build to the browser ms and server side environments that support it as it would solve all such errors in one swoop.
@adamziel I made a mistake. I solved it and here is what returns php-wasm/web when I run php.cli( [ 'php', 'composer.phar', 'install' ] ) now :
With [#1093] implementation :
And here is what returns php-wasm/node when I run php.cli( [ 'php', 'composer.phar', 'install' ] ) :
This looks promising for the pull request I think.
In my quest to correct the errors above I found out other elements to add into the Asyncify functions list :
"Curl_proxy_connect",\
"call_extract_if_dead",\
"Curl_conncache_foreach",\
Should I update the current pull request ?
Should I update the current pull request ?
Yes please, especially since we've had another .wasm updating PR merged in the meantime and there are wasm merge conflicts.
@adamziel done 👌
@adamziel My apologies. The conflicts have been resolved. But test-e2e and build failed?
It seems like they passed after rebasing. Thank you @mho22!