@php-wasm/node 2.0.18 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asyncify/7_2_34/php_7_2.wasm +0 -0
- package/asyncify/7_3_33/php_7_3.wasm +0 -0
- package/asyncify/7_4_33/php_7_4.wasm +0 -0
- package/asyncify/8_0_30/php_8_0.wasm +0 -0
- package/asyncify/8_1_33/php_8_1.wasm +0 -0
- package/asyncify/8_2_29/php_8_2.wasm +0 -0
- package/asyncify/{8_3_24 → 8_3_25}/php_8_3.wasm +0 -0
- package/asyncify/{8_4_11 → 8_4_12}/php_8_4.wasm +0 -0
- package/asyncify/php_7_2.js +59 -42
- package/asyncify/php_7_3.js +59 -42
- package/asyncify/php_7_4.js +63 -46
- package/asyncify/php_8_0.js +63 -46
- package/asyncify/php_8_1.js +63 -46
- package/asyncify/php_8_2.js +63 -46
- package/asyncify/php_8_3.js +65 -48
- package/asyncify/php_8_4.js +65 -48
- package/index.cjs +3468 -1535
- package/index.js +3468 -1535
- package/jspi/7_2_34/php_7_2.wasm +0 -0
- package/jspi/7_3_33/php_7_3.wasm +0 -0
- package/jspi/7_4_33/php_7_4.wasm +0 -0
- package/jspi/8_0_30/php_8_0.wasm +0 -0
- package/jspi/8_1_33/php_8_1.wasm +0 -0
- package/jspi/8_2_29/php_8_2.wasm +0 -0
- package/jspi/8_3_25/php_8_3.wasm +0 -0
- package/jspi/{8_4_11 → 8_4_12}/php_8_4.wasm +0 -0
- package/jspi/php_7_2.js +64 -50
- package/jspi/php_7_3.js +60 -46
- package/jspi/php_7_4.js +64 -50
- package/jspi/php_8_0.js +64 -50
- package/jspi/php_8_1.js +64 -50
- package/jspi/php_8_2.js +64 -50
- package/jspi/php_8_3.js +34346 -31524
- package/jspi/php_8_4.js +66 -52
- package/package.json +7 -7
- package/shared/icudt74l.dat +0 -0
package/jspi/php_8_0.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from 'path';
|
|
|
8
8
|
|
|
9
9
|
const dependencyFilename = path.join(__dirname, '8_0_30', 'php_8_0.wasm');
|
|
10
10
|
export { dependencyFilename };
|
|
11
|
-
export const dependenciesTotalSize =
|
|
11
|
+
export const dependenciesTotalSize = 24293572;
|
|
12
12
|
const phpVersionString = '8.0.30';
|
|
13
13
|
export function init(RuntimeName, PHPLoader) {
|
|
14
14
|
// The rest of the code comes from the built php.js file and esm-suffix.js
|
|
@@ -848,7 +848,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
848
848
|
},
|
|
849
849
|
};
|
|
850
850
|
|
|
851
|
-
var ___heap_base =
|
|
851
|
+
var ___heap_base = 12843552;
|
|
852
852
|
|
|
853
853
|
var alignMemory = (size, alignment) => {
|
|
854
854
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1743,13 +1743,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1743
1743
|
1024
|
|
1744
1744
|
);
|
|
1745
1745
|
|
|
1746
|
-
var ___stack_high =
|
|
1746
|
+
var ___stack_high = 12843552;
|
|
1747
1747
|
|
|
1748
|
-
var ___stack_low =
|
|
1748
|
+
var ___stack_low = 11794976;
|
|
1749
1749
|
|
|
1750
1750
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1751
1751
|
{ value: 'i32', mutable: true },
|
|
1752
|
-
|
|
1752
|
+
12843552
|
|
1753
1753
|
);
|
|
1754
1754
|
|
|
1755
1755
|
var PATH = {
|
|
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6884
6884
|
|
|
6885
6885
|
var _fd_close = function fd_close(fd) {
|
|
6886
6886
|
return Asyncify.handleAsync(async () => {
|
|
6887
|
-
const
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6892
|
-
fd,
|
|
6893
|
-
pathResolutionErrno
|
|
6894
|
-
);
|
|
6895
|
-
return -ERRNO_CODES.EBADF;
|
|
6896
|
-
}
|
|
6897
|
-
|
|
6898
|
-
const result = _builtin_fd_close(fd);
|
|
6899
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6900
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6901
|
-
return result;
|
|
6887
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6888
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6889
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6890
|
+
return fdCloseResult;
|
|
6902
6891
|
}
|
|
6903
|
-
const nativeFilePath =
|
|
6904
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6905
6892
|
|
|
6906
6893
|
try {
|
|
6894
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6895
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6896
|
+
if (pathResolutionErrno !== 0) {
|
|
6897
|
+
_js_wasm_trace(
|
|
6898
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6899
|
+
fd,
|
|
6900
|
+
pathResolutionErrno
|
|
6901
|
+
);
|
|
6902
|
+
/*
|
|
6903
|
+
* It looks like the file may have had an associated lock,
|
|
6904
|
+
* but since we cannot look up the path,
|
|
6905
|
+
* there is nothing more for us to do.
|
|
6906
|
+
*
|
|
6907
|
+
* NOTE: This seems possible for files that are locked and
|
|
6908
|
+
* then unlinked before close. It is an opportunity for a
|
|
6909
|
+
* lock to be orphaned in the lock manager.
|
|
6910
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6911
|
+
*/
|
|
6912
|
+
return fdCloseResult;
|
|
6913
|
+
}
|
|
6914
|
+
|
|
6915
|
+
const nativeFilePath =
|
|
6916
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6907
6917
|
await PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6908
6918
|
PHPLoader.processId,
|
|
6909
6919
|
fd,
|
|
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6915
6925
|
} finally {
|
|
6916
6926
|
locking.maybeLockedFds.delete(fd);
|
|
6917
6927
|
}
|
|
6918
|
-
return
|
|
6928
|
+
return fdCloseResult;
|
|
6919
6929
|
});
|
|
6920
6930
|
};
|
|
6921
6931
|
_fd_close.sig = 'ii';
|
|
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7030
7040
|
}
|
|
7031
7041
|
},
|
|
7032
7042
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7033
|
-
|
|
7034
|
-
|
|
7043
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7044
|
+
noent_okay: true,
|
|
7045
|
+
});
|
|
7046
|
+
if (!node) {
|
|
7047
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7048
|
+
}
|
|
7035
7049
|
if (node.mount.type === NODEFS) {
|
|
7036
7050
|
return NODEFS.realPath(node);
|
|
7037
7051
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7312
7326
|
return -ERRNO_CODES.EINVAL;
|
|
7313
7327
|
}
|
|
7314
7328
|
|
|
7315
|
-
const nativeFilePath =
|
|
7316
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7317
|
-
|
|
7318
7329
|
try {
|
|
7330
|
+
const nativeFilePath =
|
|
7331
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7319
7332
|
const conflictingLock = await Promise.resolve(
|
|
7320
7333
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7321
7334
|
nativeFilePath,
|
|
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7451
7464
|
pid,
|
|
7452
7465
|
};
|
|
7453
7466
|
|
|
7454
|
-
const nativeFilePath =
|
|
7455
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7456
|
-
_js_wasm_trace(
|
|
7457
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7458
|
-
fd,
|
|
7459
|
-
vfsPath,
|
|
7460
|
-
rangeLock
|
|
7461
|
-
);
|
|
7462
|
-
|
|
7463
7467
|
try {
|
|
7468
|
+
const nativeFilePath =
|
|
7469
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7470
|
+
_js_wasm_trace(
|
|
7471
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7472
|
+
fd,
|
|
7473
|
+
vfsPath,
|
|
7474
|
+
rangeLock
|
|
7475
|
+
);
|
|
7476
|
+
|
|
7464
7477
|
const succeeded = await Promise.resolve(
|
|
7465
7478
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7466
7479
|
nativeFilePath,
|
|
@@ -17367,9 +17380,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17367
17380
|
return -ERRNO_CODES.EINVAL;
|
|
17368
17381
|
}
|
|
17369
17382
|
|
|
17370
|
-
const nativeFilePath =
|
|
17371
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17372
17383
|
try {
|
|
17384
|
+
const nativeFilePath =
|
|
17385
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17373
17386
|
const obtainedLock = await Promise.resolve(
|
|
17374
17387
|
PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
|
|
17375
17388
|
type: lockOpType,
|
|
@@ -17705,9 +17718,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17705
17718
|
if (!cp.stdin.closed) {
|
|
17706
17719
|
cp.stdin.end();
|
|
17707
17720
|
}
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17721
|
+
PHPLoader['free'](buffer);
|
|
17722
|
+
PHPLoader['free'](iov);
|
|
17723
|
+
PHPLoader['free'](pnum);
|
|
17711
17724
|
}
|
|
17712
17725
|
|
|
17713
17726
|
// pump() can never alter the result of this function.
|
|
@@ -18249,7 +18262,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18249
18262
|
},
|
|
18250
18263
|
instrumentWasmExports(exports) {
|
|
18251
18264
|
var exportPattern =
|
|
18252
|
-
/^(php_wasm_init|
|
|
18265
|
+
/^(php_wasm_init|wasm_sleep|wasm_read|emscripten_sleep|wasm_sapi_handle_request|wasm_sapi_request_shutdown|wasm_poll_socket|wrap_select|__wrap_select|select|php_pollfd_for|fflush|wasm_popen|wasm_read|wasm_php_exec|run_cli|wasm_recv|fd_close|main|__main_argc_argv)$/;
|
|
18253
18266
|
Asyncify.asyncExports = new Set();
|
|
18254
18267
|
var ret = {};
|
|
18255
18268
|
for (let [x, original] of Object.entries(exports)) {
|
|
@@ -18358,6 +18371,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18358
18371
|
return ret;
|
|
18359
18372
|
};
|
|
18360
18373
|
|
|
18374
|
+
var setErrNo = (value) => {
|
|
18375
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18376
|
+
return value;
|
|
18377
|
+
};
|
|
18378
|
+
|
|
18361
18379
|
var FS_createPath = FS.createPath;
|
|
18362
18380
|
|
|
18363
18381
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -30782,11 +30800,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
30782
30800
|
|
|
30783
30801
|
var allocateUTF8 = stringToNewUTF8;
|
|
30784
30802
|
|
|
30785
|
-
var setErrNo = (value) => {
|
|
30786
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
30787
|
-
return value;
|
|
30788
|
-
};
|
|
30789
|
-
|
|
30790
30803
|
var demangle = (func) => {
|
|
30791
30804
|
// If demangle has failed before, stop demangling any further function names
|
|
30792
30805
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -31262,13 +31275,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31262
31275
|
// End JS library code
|
|
31263
31276
|
|
|
31264
31277
|
var ASM_CONSTS = {
|
|
31265
|
-
|
|
31278
|
+
11564558: ($0) => {
|
|
31266
31279
|
if (!$0) {
|
|
31267
31280
|
AL.alcErr = 0xa004;
|
|
31268
31281
|
return 1;
|
|
31269
31282
|
}
|
|
31270
31283
|
},
|
|
31271
|
-
|
|
31284
|
+
11564606: ($0) => {
|
|
31272
31285
|
if (!AL.currentCtx) {
|
|
31273
31286
|
err('alGetProcAddress() called without a valid context');
|
|
31274
31287
|
return 1;
|
|
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34263
34276
|
Module['FS_createDevice'] = FS_createDevice;
|
|
34264
34277
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
34265
34278
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
34279
|
+
Module['setErrNo'] = setErrNo;
|
|
34266
34280
|
Module['PROXYFS'] = PROXYFS;
|
|
34267
34281
|
|
|
34268
34282
|
async function callMain(args = []) {
|
package/jspi/php_8_1.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from 'path';
|
|
|
8
8
|
|
|
9
9
|
const dependencyFilename = path.join(__dirname, '8_1_33', 'php_8_1.wasm');
|
|
10
10
|
export { dependencyFilename };
|
|
11
|
-
export const dependenciesTotalSize =
|
|
11
|
+
export const dependenciesTotalSize = 24628805;
|
|
12
12
|
const phpVersionString = '8.1.33';
|
|
13
13
|
export function init(RuntimeName, PHPLoader) {
|
|
14
14
|
// The rest of the code comes from the built php.js file and esm-suffix.js
|
|
@@ -848,7 +848,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
848
848
|
},
|
|
849
849
|
};
|
|
850
850
|
|
|
851
|
-
var ___heap_base =
|
|
851
|
+
var ___heap_base = 12922336;
|
|
852
852
|
|
|
853
853
|
var alignMemory = (size, alignment) => {
|
|
854
854
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1743,13 +1743,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1743
1743
|
1024
|
|
1744
1744
|
);
|
|
1745
1745
|
|
|
1746
|
-
var ___stack_high =
|
|
1746
|
+
var ___stack_high = 12922336;
|
|
1747
1747
|
|
|
1748
|
-
var ___stack_low =
|
|
1748
|
+
var ___stack_low = 11873760;
|
|
1749
1749
|
|
|
1750
1750
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1751
1751
|
{ value: 'i32', mutable: true },
|
|
1752
|
-
|
|
1752
|
+
12922336
|
|
1753
1753
|
);
|
|
1754
1754
|
|
|
1755
1755
|
var PATH = {
|
|
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6884
6884
|
|
|
6885
6885
|
var _fd_close = function fd_close(fd) {
|
|
6886
6886
|
return Asyncify.handleAsync(async () => {
|
|
6887
|
-
const
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6892
|
-
fd,
|
|
6893
|
-
pathResolutionErrno
|
|
6894
|
-
);
|
|
6895
|
-
return -ERRNO_CODES.EBADF;
|
|
6896
|
-
}
|
|
6897
|
-
|
|
6898
|
-
const result = _builtin_fd_close(fd);
|
|
6899
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6900
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6901
|
-
return result;
|
|
6887
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6888
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6889
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6890
|
+
return fdCloseResult;
|
|
6902
6891
|
}
|
|
6903
|
-
const nativeFilePath =
|
|
6904
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6905
6892
|
|
|
6906
6893
|
try {
|
|
6894
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6895
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6896
|
+
if (pathResolutionErrno !== 0) {
|
|
6897
|
+
_js_wasm_trace(
|
|
6898
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6899
|
+
fd,
|
|
6900
|
+
pathResolutionErrno
|
|
6901
|
+
);
|
|
6902
|
+
/*
|
|
6903
|
+
* It looks like the file may have had an associated lock,
|
|
6904
|
+
* but since we cannot look up the path,
|
|
6905
|
+
* there is nothing more for us to do.
|
|
6906
|
+
*
|
|
6907
|
+
* NOTE: This seems possible for files that are locked and
|
|
6908
|
+
* then unlinked before close. It is an opportunity for a
|
|
6909
|
+
* lock to be orphaned in the lock manager.
|
|
6910
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6911
|
+
*/
|
|
6912
|
+
return fdCloseResult;
|
|
6913
|
+
}
|
|
6914
|
+
|
|
6915
|
+
const nativeFilePath =
|
|
6916
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6907
6917
|
await PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6908
6918
|
PHPLoader.processId,
|
|
6909
6919
|
fd,
|
|
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6915
6925
|
} finally {
|
|
6916
6926
|
locking.maybeLockedFds.delete(fd);
|
|
6917
6927
|
}
|
|
6918
|
-
return
|
|
6928
|
+
return fdCloseResult;
|
|
6919
6929
|
});
|
|
6920
6930
|
};
|
|
6921
6931
|
_fd_close.sig = 'ii';
|
|
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7030
7040
|
}
|
|
7031
7041
|
},
|
|
7032
7042
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7033
|
-
|
|
7034
|
-
|
|
7043
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7044
|
+
noent_okay: true,
|
|
7045
|
+
});
|
|
7046
|
+
if (!node) {
|
|
7047
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7048
|
+
}
|
|
7035
7049
|
if (node.mount.type === NODEFS) {
|
|
7036
7050
|
return NODEFS.realPath(node);
|
|
7037
7051
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7312
7326
|
return -ERRNO_CODES.EINVAL;
|
|
7313
7327
|
}
|
|
7314
7328
|
|
|
7315
|
-
const nativeFilePath =
|
|
7316
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7317
|
-
|
|
7318
7329
|
try {
|
|
7330
|
+
const nativeFilePath =
|
|
7331
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7319
7332
|
const conflictingLock = await Promise.resolve(
|
|
7320
7333
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7321
7334
|
nativeFilePath,
|
|
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7451
7464
|
pid,
|
|
7452
7465
|
};
|
|
7453
7466
|
|
|
7454
|
-
const nativeFilePath =
|
|
7455
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7456
|
-
_js_wasm_trace(
|
|
7457
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7458
|
-
fd,
|
|
7459
|
-
vfsPath,
|
|
7460
|
-
rangeLock
|
|
7461
|
-
);
|
|
7462
|
-
|
|
7463
7467
|
try {
|
|
7468
|
+
const nativeFilePath =
|
|
7469
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7470
|
+
_js_wasm_trace(
|
|
7471
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7472
|
+
fd,
|
|
7473
|
+
vfsPath,
|
|
7474
|
+
rangeLock
|
|
7475
|
+
);
|
|
7476
|
+
|
|
7464
7477
|
const succeeded = await Promise.resolve(
|
|
7465
7478
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7466
7479
|
nativeFilePath,
|
|
@@ -17369,9 +17382,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17369
17382
|
return -ERRNO_CODES.EINVAL;
|
|
17370
17383
|
}
|
|
17371
17384
|
|
|
17372
|
-
const nativeFilePath =
|
|
17373
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17374
17385
|
try {
|
|
17386
|
+
const nativeFilePath =
|
|
17387
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17375
17388
|
const obtainedLock = await Promise.resolve(
|
|
17376
17389
|
PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
|
|
17377
17390
|
type: lockOpType,
|
|
@@ -17707,9 +17720,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17707
17720
|
if (!cp.stdin.closed) {
|
|
17708
17721
|
cp.stdin.end();
|
|
17709
17722
|
}
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17723
|
+
PHPLoader['free'](buffer);
|
|
17724
|
+
PHPLoader['free'](iov);
|
|
17725
|
+
PHPLoader['free'](pnum);
|
|
17713
17726
|
}
|
|
17714
17727
|
|
|
17715
17728
|
// pump() can never alter the result of this function.
|
|
@@ -18255,7 +18268,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18255
18268
|
},
|
|
18256
18269
|
instrumentWasmExports(exports) {
|
|
18257
18270
|
var exportPattern =
|
|
18258
|
-
/^(php_wasm_init|
|
|
18271
|
+
/^(php_wasm_init|wasm_sleep|wasm_read|emscripten_sleep|wasm_sapi_handle_request|wasm_sapi_request_shutdown|wasm_poll_socket|wrap_select|__wrap_select|select|php_pollfd_for|fflush|wasm_popen|wasm_read|wasm_php_exec|run_cli|wasm_recv|fd_close|main|__main_argc_argv)$/;
|
|
18259
18272
|
Asyncify.asyncExports = new Set();
|
|
18260
18273
|
var ret = {};
|
|
18261
18274
|
for (let [x, original] of Object.entries(exports)) {
|
|
@@ -18364,6 +18377,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18364
18377
|
return ret;
|
|
18365
18378
|
};
|
|
18366
18379
|
|
|
18380
|
+
var setErrNo = (value) => {
|
|
18381
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18382
|
+
return value;
|
|
18383
|
+
};
|
|
18384
|
+
|
|
18367
18385
|
var FS_createPath = FS.createPath;
|
|
18368
18386
|
|
|
18369
18387
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -30788,11 +30806,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
30788
30806
|
|
|
30789
30807
|
var allocateUTF8 = stringToNewUTF8;
|
|
30790
30808
|
|
|
30791
|
-
var setErrNo = (value) => {
|
|
30792
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
30793
|
-
return value;
|
|
30794
|
-
};
|
|
30795
|
-
|
|
30796
30809
|
var demangle = (func) => {
|
|
30797
30810
|
// If demangle has failed before, stop demangling any further function names
|
|
30798
30811
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -31262,13 +31275,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31262
31275
|
// End JS library code
|
|
31263
31276
|
|
|
31264
31277
|
var ASM_CONSTS = {
|
|
31265
|
-
|
|
31278
|
+
11643758: ($0) => {
|
|
31266
31279
|
if (!$0) {
|
|
31267
31280
|
AL.alcErr = 0xa004;
|
|
31268
31281
|
return 1;
|
|
31269
31282
|
}
|
|
31270
31283
|
},
|
|
31271
|
-
|
|
31284
|
+
11643806: ($0) => {
|
|
31272
31285
|
if (!AL.currentCtx) {
|
|
31273
31286
|
err('alGetProcAddress() called without a valid context');
|
|
31274
31287
|
return 1;
|
|
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34263
34276
|
Module['FS_createDevice'] = FS_createDevice;
|
|
34264
34277
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
34265
34278
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
34279
|
+
Module['setErrNo'] = setErrNo;
|
|
34266
34280
|
Module['PROXYFS'] = PROXYFS;
|
|
34267
34281
|
|
|
34268
34282
|
async function callMain(args = []) {
|
package/jspi/php_8_2.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from 'path';
|
|
|
8
8
|
|
|
9
9
|
const dependencyFilename = path.join(__dirname, '8_2_29', 'php_8_2.wasm');
|
|
10
10
|
export { dependencyFilename };
|
|
11
|
-
export const dependenciesTotalSize =
|
|
11
|
+
export const dependenciesTotalSize = 24915546;
|
|
12
12
|
const phpVersionString = '8.2.29';
|
|
13
13
|
export function init(RuntimeName, PHPLoader) {
|
|
14
14
|
// The rest of the code comes from the built php.js file and esm-suffix.js
|
|
@@ -848,7 +848,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
848
848
|
},
|
|
849
849
|
};
|
|
850
850
|
|
|
851
|
-
var ___heap_base =
|
|
851
|
+
var ___heap_base = 12959456;
|
|
852
852
|
|
|
853
853
|
var alignMemory = (size, alignment) => {
|
|
854
854
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1743,13 +1743,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1743
1743
|
1024
|
|
1744
1744
|
);
|
|
1745
1745
|
|
|
1746
|
-
var ___stack_high =
|
|
1746
|
+
var ___stack_high = 12959456;
|
|
1747
1747
|
|
|
1748
|
-
var ___stack_low =
|
|
1748
|
+
var ___stack_low = 11910880;
|
|
1749
1749
|
|
|
1750
1750
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1751
1751
|
{ value: 'i32', mutable: true },
|
|
1752
|
-
|
|
1752
|
+
12959456
|
|
1753
1753
|
);
|
|
1754
1754
|
|
|
1755
1755
|
var PATH = {
|
|
@@ -6884,26 +6884,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6884
6884
|
|
|
6885
6885
|
var _fd_close = function fd_close(fd) {
|
|
6886
6886
|
return Asyncify.handleAsync(async () => {
|
|
6887
|
-
const
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6892
|
-
fd,
|
|
6893
|
-
pathResolutionErrno
|
|
6894
|
-
);
|
|
6895
|
-
return -ERRNO_CODES.EBADF;
|
|
6896
|
-
}
|
|
6897
|
-
|
|
6898
|
-
const result = _builtin_fd_close(fd);
|
|
6899
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6900
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6901
|
-
return result;
|
|
6887
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6888
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6889
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6890
|
+
return fdCloseResult;
|
|
6902
6891
|
}
|
|
6903
|
-
const nativeFilePath =
|
|
6904
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6905
6892
|
|
|
6906
6893
|
try {
|
|
6894
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6895
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6896
|
+
if (pathResolutionErrno !== 0) {
|
|
6897
|
+
_js_wasm_trace(
|
|
6898
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6899
|
+
fd,
|
|
6900
|
+
pathResolutionErrno
|
|
6901
|
+
);
|
|
6902
|
+
/*
|
|
6903
|
+
* It looks like the file may have had an associated lock,
|
|
6904
|
+
* but since we cannot look up the path,
|
|
6905
|
+
* there is nothing more for us to do.
|
|
6906
|
+
*
|
|
6907
|
+
* NOTE: This seems possible for files that are locked and
|
|
6908
|
+
* then unlinked before close. It is an opportunity for a
|
|
6909
|
+
* lock to be orphaned in the lock manager.
|
|
6910
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6911
|
+
*/
|
|
6912
|
+
return fdCloseResult;
|
|
6913
|
+
}
|
|
6914
|
+
|
|
6915
|
+
const nativeFilePath =
|
|
6916
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6907
6917
|
await PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6908
6918
|
PHPLoader.processId,
|
|
6909
6919
|
fd,
|
|
@@ -6915,7 +6925,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6915
6925
|
} finally {
|
|
6916
6926
|
locking.maybeLockedFds.delete(fd);
|
|
6917
6927
|
}
|
|
6918
|
-
return
|
|
6928
|
+
return fdCloseResult;
|
|
6919
6929
|
});
|
|
6920
6930
|
};
|
|
6921
6931
|
_fd_close.sig = 'ii';
|
|
@@ -7030,8 +7040,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7030
7040
|
}
|
|
7031
7041
|
},
|
|
7032
7042
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7033
|
-
|
|
7034
|
-
|
|
7043
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7044
|
+
noent_okay: true,
|
|
7045
|
+
});
|
|
7046
|
+
if (!node) {
|
|
7047
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7048
|
+
}
|
|
7035
7049
|
if (node.mount.type === NODEFS) {
|
|
7036
7050
|
return NODEFS.realPath(node);
|
|
7037
7051
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7312,10 +7326,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7312
7326
|
return -ERRNO_CODES.EINVAL;
|
|
7313
7327
|
}
|
|
7314
7328
|
|
|
7315
|
-
const nativeFilePath =
|
|
7316
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7317
|
-
|
|
7318
7329
|
try {
|
|
7330
|
+
const nativeFilePath =
|
|
7331
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7319
7332
|
const conflictingLock = await Promise.resolve(
|
|
7320
7333
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7321
7334
|
nativeFilePath,
|
|
@@ -7451,16 +7464,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7451
7464
|
pid,
|
|
7452
7465
|
};
|
|
7453
7466
|
|
|
7454
|
-
const nativeFilePath =
|
|
7455
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7456
|
-
_js_wasm_trace(
|
|
7457
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7458
|
-
fd,
|
|
7459
|
-
vfsPath,
|
|
7460
|
-
rangeLock
|
|
7461
|
-
);
|
|
7462
|
-
|
|
7463
7467
|
try {
|
|
7468
|
+
const nativeFilePath =
|
|
7469
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7470
|
+
_js_wasm_trace(
|
|
7471
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7472
|
+
fd,
|
|
7473
|
+
vfsPath,
|
|
7474
|
+
rangeLock
|
|
7475
|
+
);
|
|
7476
|
+
|
|
7464
7477
|
const succeeded = await Promise.resolve(
|
|
7465
7478
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7466
7479
|
nativeFilePath,
|
|
@@ -17371,9 +17384,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17371
17384
|
return -ERRNO_CODES.EINVAL;
|
|
17372
17385
|
}
|
|
17373
17386
|
|
|
17374
|
-
const nativeFilePath =
|
|
17375
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17376
17387
|
try {
|
|
17388
|
+
const nativeFilePath =
|
|
17389
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17377
17390
|
const obtainedLock = await Promise.resolve(
|
|
17378
17391
|
PHPLoader.fileLockManager.lockWholeFile(nativeFilePath, {
|
|
17379
17392
|
type: lockOpType,
|
|
@@ -17709,9 +17722,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17709
17722
|
if (!cp.stdin.closed) {
|
|
17710
17723
|
cp.stdin.end();
|
|
17711
17724
|
}
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17725
|
+
PHPLoader['free'](buffer);
|
|
17726
|
+
PHPLoader['free'](iov);
|
|
17727
|
+
PHPLoader['free'](pnum);
|
|
17715
17728
|
}
|
|
17716
17729
|
|
|
17717
17730
|
// pump() can never alter the result of this function.
|
|
@@ -18257,7 +18270,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18257
18270
|
},
|
|
18258
18271
|
instrumentWasmExports(exports) {
|
|
18259
18272
|
var exportPattern =
|
|
18260
|
-
/^(php_wasm_init|
|
|
18273
|
+
/^(php_wasm_init|wasm_sleep|wasm_read|emscripten_sleep|wasm_sapi_handle_request|wasm_sapi_request_shutdown|wasm_poll_socket|wrap_select|__wrap_select|select|php_pollfd_for|fflush|wasm_popen|wasm_read|wasm_php_exec|run_cli|wasm_recv|fd_close|main|__main_argc_argv)$/;
|
|
18261
18274
|
Asyncify.asyncExports = new Set();
|
|
18262
18275
|
var ret = {};
|
|
18263
18276
|
for (let [x, original] of Object.entries(exports)) {
|
|
@@ -18366,6 +18379,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18366
18379
|
return ret;
|
|
18367
18380
|
};
|
|
18368
18381
|
|
|
18382
|
+
var setErrNo = (value) => {
|
|
18383
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18384
|
+
return value;
|
|
18385
|
+
};
|
|
18386
|
+
|
|
18369
18387
|
var FS_createPath = FS.createPath;
|
|
18370
18388
|
|
|
18371
18389
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -30790,11 +30808,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
30790
30808
|
|
|
30791
30809
|
var allocateUTF8 = stringToNewUTF8;
|
|
30792
30810
|
|
|
30793
|
-
var setErrNo = (value) => {
|
|
30794
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
30795
|
-
return value;
|
|
30796
|
-
};
|
|
30797
|
-
|
|
30798
30811
|
var demangle = (func) => {
|
|
30799
30812
|
// If demangle has failed before, stop demangling any further function names
|
|
30800
30813
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -31262,13 +31275,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31262
31275
|
// End JS library code
|
|
31263
31276
|
|
|
31264
31277
|
var ASM_CONSTS = {
|
|
31265
|
-
|
|
31278
|
+
11682334: ($0) => {
|
|
31266
31279
|
if (!$0) {
|
|
31267
31280
|
AL.alcErr = 0xa004;
|
|
31268
31281
|
return 1;
|
|
31269
31282
|
}
|
|
31270
31283
|
},
|
|
31271
|
-
|
|
31284
|
+
11682382: ($0) => {
|
|
31272
31285
|
if (!AL.currentCtx) {
|
|
31273
31286
|
err('alGetProcAddress() called without a valid context');
|
|
31274
31287
|
return 1;
|
|
@@ -34263,6 +34276,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
34263
34276
|
Module['FS_createDevice'] = FS_createDevice;
|
|
34264
34277
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
34265
34278
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
34279
|
+
Module['setErrNo'] = setErrNo;
|
|
34266
34280
|
Module['PROXYFS'] = PROXYFS;
|
|
34267
34281
|
|
|
34268
34282
|
async function callMain(args = []) {
|