-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PHP.wasm: Load correct php.wasm paths in the built Node.js packages (#…
…1877) Gets `@php-wasm/node` and all the other CLI packages to load the .wasm binaries from the correct path after #1867 introduced JSPI and #1873 made it pass all the tests in Node.js ## Technical details In the repo, php.js files are stored in php_wasm/node/jspi or php_wasm/node/asyncify. They start with a line like this: const dependencyFilename = __dirname + '/8_0_30/php_8_0.wasm'; After the build, the contents are concatenated into a single file, which breaks the dependencyFilename variable. This plugin corrects that by replacing __dirname with the correct value such as 'jspi' or 'asyncify'. The implementation is naive and assumes the substrings __dirname is only used as a variable, are not a part of any other name, and is not seen in any string literals. ## Test plan Build the production packages with `nx build php-wasm-node` and run the PHP CLI package to confirm it doesn't crash. I couldn't get npm link to work so I created a `dist/packages/php-wasm/node_modules/@php-wasm` directory and linked all the built packages there with `ln -s`.
- Loading branch information
Showing
39 changed files
with
85 additions
and
41 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+12.5 MB
.../node/public/asyncify/7_0_33/php_7_0.wasm → ...hp-wasm/node/asyncify/7_0_33/php_7_0.wasm
Binary file not shown.
Binary file renamed
BIN
+12.9 MB
.../node/public/asyncify/7_1_30/php_7_1.wasm → ...hp-wasm/node/asyncify/7_1_30/php_7_1.wasm
Binary file not shown.
Binary file renamed
BIN
+13.5 MB
.../node/public/asyncify/7_2_34/php_7_2.wasm → ...hp-wasm/node/asyncify/7_2_34/php_7_2.wasm
Binary file not shown.
Binary file renamed
BIN
+13.6 MB
.../node/public/asyncify/7_3_33/php_7_3.wasm → ...hp-wasm/node/asyncify/7_3_33/php_7_3.wasm
Binary file not shown.
Binary file renamed
BIN
+14.3 MB
.../node/public/asyncify/7_4_33/php_7_4.wasm → ...hp-wasm/node/asyncify/7_4_33/php_7_4.wasm
Binary file not shown.
Binary file renamed
BIN
+13.8 MB
.../node/public/asyncify/8_0_30/php_8_0.wasm → ...hp-wasm/node/asyncify/8_0_30/php_8_0.wasm
Binary file not shown.
Binary file renamed
BIN
+13.8 MB
.../node/public/asyncify/8_1_23/php_8_1.wasm → ...hp-wasm/node/asyncify/8_1_23/php_8_1.wasm
Binary file not shown.
Binary file renamed
BIN
+14 MB
.../node/public/asyncify/8_2_10/php_8_2.wasm → ...hp-wasm/node/asyncify/8_2_10/php_8_2.wasm
Binary file not shown.
Binary file renamed
BIN
+14.4 MB
...m/node/public/asyncify/8_3_0/php_8_3.wasm → ...php-wasm/node/asyncify/8_3_0/php_8_3.wasm
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Binary file renamed
BIN
+12.2 MB
...wasm/node/public/jspi/7_0_33/php_7_0.wasm → ...es/php-wasm/node/jspi/7_0_33/php_7_0.wasm
Binary file not shown.
Binary file renamed
BIN
+12.7 MB
...wasm/node/public/jspi/7_1_30/php_7_1.wasm → ...es/php-wasm/node/jspi/7_1_30/php_7_1.wasm
Binary file not shown.
Binary file renamed
BIN
+13.2 MB
...wasm/node/public/jspi/7_2_34/php_7_2.wasm → ...es/php-wasm/node/jspi/7_2_34/php_7_2.wasm
Binary file not shown.
Binary file renamed
BIN
+13.4 MB
...wasm/node/public/jspi/7_3_33/php_7_3.wasm → ...es/php-wasm/node/jspi/7_3_33/php_7_3.wasm
Binary file not shown.
Binary file renamed
BIN
+14 MB
...wasm/node/public/jspi/7_4_33/php_7_4.wasm → ...es/php-wasm/node/jspi/7_4_33/php_7_4.wasm
Binary file not shown.
Binary file renamed
BIN
+13.6 MB
...wasm/node/public/jspi/8_0_30/php_8_0.wasm → ...es/php-wasm/node/jspi/8_0_30/php_8_0.wasm
Binary file not shown.
Binary file renamed
BIN
+13.6 MB
...wasm/node/public/jspi/8_1_23/php_8_1.wasm → ...es/php-wasm/node/jspi/8_1_23/php_8_1.wasm
Binary file not shown.
Binary file renamed
BIN
+13.9 MB
...wasm/node/public/jspi/8_2_10/php_8_2.wasm → ...es/php-wasm/node/jspi/8_2_10/php_8_2.wasm
Binary file not shown.
Binary file renamed
BIN
+14.2 MB
...-wasm/node/public/jspi/8_3_0/php_8_3.wasm → ...ges/php-wasm/node/jspi/8_3_0/php_8_3.wasm
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.