@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/asyncify/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 = 24845949;
|
|
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
|
|
@@ -831,7 +831,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
831
831
|
},
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
var ___heap_base =
|
|
834
|
+
var ___heap_base = 12842432;
|
|
835
835
|
|
|
836
836
|
var alignMemory = (size, alignment) => {
|
|
837
837
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1786,13 +1786,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1786
1786
|
1024
|
|
1787
1787
|
);
|
|
1788
1788
|
|
|
1789
|
-
var ___stack_high =
|
|
1789
|
+
var ___stack_high = 12842432;
|
|
1790
1790
|
|
|
1791
|
-
var ___stack_low =
|
|
1791
|
+
var ___stack_low = 11793856;
|
|
1792
1792
|
|
|
1793
1793
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1794
1794
|
{ value: 'i32', mutable: true },
|
|
1795
|
-
|
|
1795
|
+
12842432
|
|
1796
1796
|
);
|
|
1797
1797
|
|
|
1798
1798
|
var PATH = {
|
|
@@ -6926,24 +6926,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6926
6926
|
}
|
|
6927
6927
|
|
|
6928
6928
|
function _fd_close(fd) {
|
|
6929
|
-
const
|
|
6930
|
-
if (
|
|
6931
|
-
_js_wasm_trace(
|
|
6932
|
-
|
|
6933
|
-
fd,
|
|
6934
|
-
pathResolutionErrno
|
|
6935
|
-
);
|
|
6936
|
-
return -ERRNO_CODES.EBADF;
|
|
6937
|
-
}
|
|
6938
|
-
|
|
6939
|
-
const result = _builtin_fd_close(fd);
|
|
6940
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6941
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6942
|
-
return result;
|
|
6929
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6930
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6931
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6932
|
+
return fdCloseResult;
|
|
6943
6933
|
}
|
|
6944
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
6945
6934
|
|
|
6946
6935
|
try {
|
|
6936
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6937
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6938
|
+
if (pathResolutionErrno !== 0) {
|
|
6939
|
+
_js_wasm_trace(
|
|
6940
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6941
|
+
fd,
|
|
6942
|
+
pathResolutionErrno
|
|
6943
|
+
);
|
|
6944
|
+
/*
|
|
6945
|
+
* It looks like the file may have had an associated lock,
|
|
6946
|
+
* but since we cannot look up the path,
|
|
6947
|
+
* there is nothing more for us to do.
|
|
6948
|
+
*
|
|
6949
|
+
* NOTE: This seems possible for files that are locked and
|
|
6950
|
+
* then unlinked before close. It is an opportunity for a
|
|
6951
|
+
* lock to be orphaned in the lock manager.
|
|
6952
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6953
|
+
*/
|
|
6954
|
+
return fdCloseResult;
|
|
6955
|
+
}
|
|
6956
|
+
|
|
6957
|
+
const nativeFilePath =
|
|
6958
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6947
6959
|
PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6948
6960
|
PHPLoader.processId,
|
|
6949
6961
|
fd,
|
|
@@ -6955,7 +6967,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6955
6967
|
} finally {
|
|
6956
6968
|
locking.maybeLockedFds.delete(fd);
|
|
6957
6969
|
}
|
|
6958
|
-
return
|
|
6970
|
+
return fdCloseResult;
|
|
6959
6971
|
}
|
|
6960
6972
|
_fd_close.sig = 'ii';
|
|
6961
6973
|
function _builtin_fd_close(fd) {
|
|
@@ -7069,8 +7081,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7069
7081
|
}
|
|
7070
7082
|
},
|
|
7071
7083
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7072
|
-
|
|
7073
|
-
|
|
7084
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7085
|
+
noent_okay: true,
|
|
7086
|
+
});
|
|
7087
|
+
if (!node) {
|
|
7088
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7089
|
+
}
|
|
7074
7090
|
if (node.mount.type === NODEFS) {
|
|
7075
7091
|
return NODEFS.realPath(node);
|
|
7076
7092
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7340,10 +7356,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7340
7356
|
return -ERRNO_CODES.EINVAL;
|
|
7341
7357
|
}
|
|
7342
7358
|
|
|
7343
|
-
const nativeFilePath =
|
|
7344
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7345
|
-
|
|
7346
7359
|
try {
|
|
7360
|
+
const nativeFilePath =
|
|
7361
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7347
7362
|
const conflictingLock =
|
|
7348
7363
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7349
7364
|
nativeFilePath,
|
|
@@ -7477,16 +7492,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7477
7492
|
pid,
|
|
7478
7493
|
};
|
|
7479
7494
|
|
|
7480
|
-
const nativeFilePath =
|
|
7481
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7482
|
-
_js_wasm_trace(
|
|
7483
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7484
|
-
fd,
|
|
7485
|
-
vfsPath,
|
|
7486
|
-
rangeLock
|
|
7487
|
-
);
|
|
7488
|
-
|
|
7489
7495
|
try {
|
|
7496
|
+
const nativeFilePath =
|
|
7497
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7498
|
+
_js_wasm_trace(
|
|
7499
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7500
|
+
fd,
|
|
7501
|
+
vfsPath,
|
|
7502
|
+
rangeLock
|
|
7503
|
+
);
|
|
7504
|
+
|
|
7490
7505
|
const succeeded =
|
|
7491
7506
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7492
7507
|
nativeFilePath,
|
|
@@ -17403,8 +17418,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17403
17418
|
return -ERRNO_CODES.EINVAL;
|
|
17404
17419
|
}
|
|
17405
17420
|
|
|
17406
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
17407
17421
|
try {
|
|
17422
|
+
const nativeFilePath =
|
|
17423
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17408
17424
|
const obtainedLock = PHPLoader.fileLockManager.lockWholeFile(
|
|
17409
17425
|
nativeFilePath,
|
|
17410
17426
|
{
|
|
@@ -17740,9 +17756,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17740
17756
|
if (!cp.stdin.closed) {
|
|
17741
17757
|
cp.stdin.end();
|
|
17742
17758
|
}
|
|
17743
|
-
|
|
17744
|
-
|
|
17745
|
-
|
|
17759
|
+
PHPLoader['free'](buffer);
|
|
17760
|
+
PHPLoader['free'](iov);
|
|
17761
|
+
PHPLoader['free'](pnum);
|
|
17746
17762
|
}
|
|
17747
17763
|
|
|
17748
17764
|
// pump() can never alter the result of this function.
|
|
@@ -18571,6 +18587,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18571
18587
|
return ret;
|
|
18572
18588
|
};
|
|
18573
18589
|
|
|
18590
|
+
var setErrNo = (value) => {
|
|
18591
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18592
|
+
return value;
|
|
18593
|
+
};
|
|
18594
|
+
|
|
18574
18595
|
var FS_createPath = FS.createPath;
|
|
18575
18596
|
|
|
18576
18597
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -31587,11 +31608,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31587
31608
|
|
|
31588
31609
|
var allocateUTF8 = stringToNewUTF8;
|
|
31589
31610
|
|
|
31590
|
-
var setErrNo = (value) => {
|
|
31591
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
31592
|
-
return value;
|
|
31593
|
-
};
|
|
31594
|
-
|
|
31595
31611
|
var demangle = (func) => {
|
|
31596
31612
|
// If demangle has failed before, stop demangling any further function names
|
|
31597
31613
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -32099,13 +32115,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
32099
32115
|
// End JS library code
|
|
32100
32116
|
|
|
32101
32117
|
var ASM_CONSTS = {
|
|
32102
|
-
|
|
32118
|
+
11563981: ($0) => {
|
|
32103
32119
|
if (!$0) {
|
|
32104
32120
|
AL.alcErr = 0xa004;
|
|
32105
32121
|
return 1;
|
|
32106
32122
|
}
|
|
32107
32123
|
},
|
|
32108
|
-
|
|
32124
|
+
11564029: ($0) => {
|
|
32109
32125
|
if (!AL.currentCtx) {
|
|
32110
32126
|
err('alGetProcAddress() called without a valid context');
|
|
32111
32127
|
return 1;
|
|
@@ -35519,6 +35535,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35519
35535
|
Module['FS_createDevice'] = FS_createDevice;
|
|
35520
35536
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
35521
35537
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
35538
|
+
Module['setErrNo'] = setErrNo;
|
|
35522
35539
|
Module['PROXYFS'] = PROXYFS;
|
|
35523
35540
|
|
|
35524
35541
|
function callMain(args = []) {
|
package/asyncify/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 = 25172855;
|
|
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
|
|
@@ -831,7 +831,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
831
831
|
},
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
var ___heap_base =
|
|
834
|
+
var ___heap_base = 12921280;
|
|
835
835
|
|
|
836
836
|
var alignMemory = (size, alignment) => {
|
|
837
837
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1786,13 +1786,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1786
1786
|
1024
|
|
1787
1787
|
);
|
|
1788
1788
|
|
|
1789
|
-
var ___stack_high =
|
|
1789
|
+
var ___stack_high = 12921280;
|
|
1790
1790
|
|
|
1791
|
-
var ___stack_low =
|
|
1791
|
+
var ___stack_low = 11872704;
|
|
1792
1792
|
|
|
1793
1793
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1794
1794
|
{ value: 'i32', mutable: true },
|
|
1795
|
-
|
|
1795
|
+
12921280
|
|
1796
1796
|
);
|
|
1797
1797
|
|
|
1798
1798
|
var PATH = {
|
|
@@ -6926,24 +6926,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6926
6926
|
}
|
|
6927
6927
|
|
|
6928
6928
|
function _fd_close(fd) {
|
|
6929
|
-
const
|
|
6930
|
-
if (
|
|
6931
|
-
_js_wasm_trace(
|
|
6932
|
-
|
|
6933
|
-
fd,
|
|
6934
|
-
pathResolutionErrno
|
|
6935
|
-
);
|
|
6936
|
-
return -ERRNO_CODES.EBADF;
|
|
6937
|
-
}
|
|
6938
|
-
|
|
6939
|
-
const result = _builtin_fd_close(fd);
|
|
6940
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6941
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6942
|
-
return result;
|
|
6929
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6930
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6931
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6932
|
+
return fdCloseResult;
|
|
6943
6933
|
}
|
|
6944
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
6945
6934
|
|
|
6946
6935
|
try {
|
|
6936
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6937
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6938
|
+
if (pathResolutionErrno !== 0) {
|
|
6939
|
+
_js_wasm_trace(
|
|
6940
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6941
|
+
fd,
|
|
6942
|
+
pathResolutionErrno
|
|
6943
|
+
);
|
|
6944
|
+
/*
|
|
6945
|
+
* It looks like the file may have had an associated lock,
|
|
6946
|
+
* but since we cannot look up the path,
|
|
6947
|
+
* there is nothing more for us to do.
|
|
6948
|
+
*
|
|
6949
|
+
* NOTE: This seems possible for files that are locked and
|
|
6950
|
+
* then unlinked before close. It is an opportunity for a
|
|
6951
|
+
* lock to be orphaned in the lock manager.
|
|
6952
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6953
|
+
*/
|
|
6954
|
+
return fdCloseResult;
|
|
6955
|
+
}
|
|
6956
|
+
|
|
6957
|
+
const nativeFilePath =
|
|
6958
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6947
6959
|
PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6948
6960
|
PHPLoader.processId,
|
|
6949
6961
|
fd,
|
|
@@ -6955,7 +6967,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6955
6967
|
} finally {
|
|
6956
6968
|
locking.maybeLockedFds.delete(fd);
|
|
6957
6969
|
}
|
|
6958
|
-
return
|
|
6970
|
+
return fdCloseResult;
|
|
6959
6971
|
}
|
|
6960
6972
|
_fd_close.sig = 'ii';
|
|
6961
6973
|
function _builtin_fd_close(fd) {
|
|
@@ -7069,8 +7081,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7069
7081
|
}
|
|
7070
7082
|
},
|
|
7071
7083
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7072
|
-
|
|
7073
|
-
|
|
7084
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7085
|
+
noent_okay: true,
|
|
7086
|
+
});
|
|
7087
|
+
if (!node) {
|
|
7088
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7089
|
+
}
|
|
7074
7090
|
if (node.mount.type === NODEFS) {
|
|
7075
7091
|
return NODEFS.realPath(node);
|
|
7076
7092
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7340,10 +7356,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7340
7356
|
return -ERRNO_CODES.EINVAL;
|
|
7341
7357
|
}
|
|
7342
7358
|
|
|
7343
|
-
const nativeFilePath =
|
|
7344
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7345
|
-
|
|
7346
7359
|
try {
|
|
7360
|
+
const nativeFilePath =
|
|
7361
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7347
7362
|
const conflictingLock =
|
|
7348
7363
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7349
7364
|
nativeFilePath,
|
|
@@ -7477,16 +7492,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7477
7492
|
pid,
|
|
7478
7493
|
};
|
|
7479
7494
|
|
|
7480
|
-
const nativeFilePath =
|
|
7481
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7482
|
-
_js_wasm_trace(
|
|
7483
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7484
|
-
fd,
|
|
7485
|
-
vfsPath,
|
|
7486
|
-
rangeLock
|
|
7487
|
-
);
|
|
7488
|
-
|
|
7489
7495
|
try {
|
|
7496
|
+
const nativeFilePath =
|
|
7497
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7498
|
+
_js_wasm_trace(
|
|
7499
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7500
|
+
fd,
|
|
7501
|
+
vfsPath,
|
|
7502
|
+
rangeLock
|
|
7503
|
+
);
|
|
7504
|
+
|
|
7490
7505
|
const succeeded =
|
|
7491
7506
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7492
7507
|
nativeFilePath,
|
|
@@ -17405,8 +17420,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17405
17420
|
return -ERRNO_CODES.EINVAL;
|
|
17406
17421
|
}
|
|
17407
17422
|
|
|
17408
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
17409
17423
|
try {
|
|
17424
|
+
const nativeFilePath =
|
|
17425
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17410
17426
|
const obtainedLock = PHPLoader.fileLockManager.lockWholeFile(
|
|
17411
17427
|
nativeFilePath,
|
|
17412
17428
|
{
|
|
@@ -17742,9 +17758,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17742
17758
|
if (!cp.stdin.closed) {
|
|
17743
17759
|
cp.stdin.end();
|
|
17744
17760
|
}
|
|
17745
|
-
|
|
17746
|
-
|
|
17747
|
-
|
|
17761
|
+
PHPLoader['free'](buffer);
|
|
17762
|
+
PHPLoader['free'](iov);
|
|
17763
|
+
PHPLoader['free'](pnum);
|
|
17748
17764
|
}
|
|
17749
17765
|
|
|
17750
17766
|
// pump() can never alter the result of this function.
|
|
@@ -18577,6 +18593,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18577
18593
|
return ret;
|
|
18578
18594
|
};
|
|
18579
18595
|
|
|
18596
|
+
var setErrNo = (value) => {
|
|
18597
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18598
|
+
return value;
|
|
18599
|
+
};
|
|
18600
|
+
|
|
18580
18601
|
var FS_createPath = FS.createPath;
|
|
18581
18602
|
|
|
18582
18603
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -31593,11 +31614,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31593
31614
|
|
|
31594
31615
|
var allocateUTF8 = stringToNewUTF8;
|
|
31595
31616
|
|
|
31596
|
-
var setErrNo = (value) => {
|
|
31597
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
31598
|
-
return value;
|
|
31599
|
-
};
|
|
31600
|
-
|
|
31601
31617
|
var demangle = (func) => {
|
|
31602
31618
|
// If demangle has failed before, stop demangling any further function names
|
|
31603
31619
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -32099,13 +32115,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
32099
32115
|
// End JS library code
|
|
32100
32116
|
|
|
32101
32117
|
var ASM_CONSTS = {
|
|
32102
|
-
|
|
32118
|
+
11643197: ($0) => {
|
|
32103
32119
|
if (!$0) {
|
|
32104
32120
|
AL.alcErr = 0xa004;
|
|
32105
32121
|
return 1;
|
|
32106
32122
|
}
|
|
32107
32123
|
},
|
|
32108
|
-
|
|
32124
|
+
11643245: ($0) => {
|
|
32109
32125
|
if (!AL.currentCtx) {
|
|
32110
32126
|
err('alGetProcAddress() called without a valid context');
|
|
32111
32127
|
return 1;
|
|
@@ -35532,6 +35548,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35532
35548
|
Module['FS_createDevice'] = FS_createDevice;
|
|
35533
35549
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
35534
35550
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
35551
|
+
Module['setErrNo'] = setErrNo;
|
|
35535
35552
|
Module['PROXYFS'] = PROXYFS;
|
|
35536
35553
|
|
|
35537
35554
|
function callMain(args = []) {
|
package/asyncify/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 = 25477333;
|
|
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
|
|
@@ -831,7 +831,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
831
831
|
},
|
|
832
832
|
};
|
|
833
833
|
|
|
834
|
-
var ___heap_base =
|
|
834
|
+
var ___heap_base = 12958272;
|
|
835
835
|
|
|
836
836
|
var alignMemory = (size, alignment) => {
|
|
837
837
|
return Math.ceil(size / alignment) * alignment;
|
|
@@ -1786,13 +1786,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
1786
1786
|
1024
|
|
1787
1787
|
);
|
|
1788
1788
|
|
|
1789
|
-
var ___stack_high =
|
|
1789
|
+
var ___stack_high = 12958272;
|
|
1790
1790
|
|
|
1791
|
-
var ___stack_low =
|
|
1791
|
+
var ___stack_low = 11909696;
|
|
1792
1792
|
|
|
1793
1793
|
var ___stack_pointer = new WebAssembly.Global(
|
|
1794
1794
|
{ value: 'i32', mutable: true },
|
|
1795
|
-
|
|
1795
|
+
12958272
|
|
1796
1796
|
);
|
|
1797
1797
|
|
|
1798
1798
|
var PATH = {
|
|
@@ -6926,24 +6926,36 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6926
6926
|
}
|
|
6927
6927
|
|
|
6928
6928
|
function _fd_close(fd) {
|
|
6929
|
-
const
|
|
6930
|
-
if (
|
|
6931
|
-
_js_wasm_trace(
|
|
6932
|
-
|
|
6933
|
-
fd,
|
|
6934
|
-
pathResolutionErrno
|
|
6935
|
-
);
|
|
6936
|
-
return -ERRNO_CODES.EBADF;
|
|
6937
|
-
}
|
|
6938
|
-
|
|
6939
|
-
const result = _builtin_fd_close(fd);
|
|
6940
|
-
if (result !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6941
|
-
_js_wasm_trace('fd_close(%d) result %d', fd, result);
|
|
6942
|
-
return result;
|
|
6929
|
+
const fdCloseResult = _builtin_fd_close(fd);
|
|
6930
|
+
if (fdCloseResult !== 0 || !locking.maybeLockedFds.has(fd)) {
|
|
6931
|
+
_js_wasm_trace('fd_close(%d) result %d', fd, fdCloseResult);
|
|
6932
|
+
return fdCloseResult;
|
|
6943
6933
|
}
|
|
6944
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
6945
6934
|
|
|
6946
6935
|
try {
|
|
6936
|
+
const [vfsPath, pathResolutionErrno] =
|
|
6937
|
+
locking.get_vfs_path_from_fd(fd);
|
|
6938
|
+
if (pathResolutionErrno !== 0) {
|
|
6939
|
+
_js_wasm_trace(
|
|
6940
|
+
'fd_close(%d) get_vfs_path_from_fd error %d',
|
|
6941
|
+
fd,
|
|
6942
|
+
pathResolutionErrno
|
|
6943
|
+
);
|
|
6944
|
+
/*
|
|
6945
|
+
* It looks like the file may have had an associated lock,
|
|
6946
|
+
* but since we cannot look up the path,
|
|
6947
|
+
* there is nothing more for us to do.
|
|
6948
|
+
*
|
|
6949
|
+
* NOTE: This seems possible for files that are locked and
|
|
6950
|
+
* then unlinked before close. It is an opportunity for a
|
|
6951
|
+
* lock to be orphaned in the lock manager.
|
|
6952
|
+
* @TODO: Explore how to ensure cleanup in this case.
|
|
6953
|
+
*/
|
|
6954
|
+
return fdCloseResult;
|
|
6955
|
+
}
|
|
6956
|
+
|
|
6957
|
+
const nativeFilePath =
|
|
6958
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
6947
6959
|
PHPLoader.fileLockManager.releaseLocksForProcessFd(
|
|
6948
6960
|
PHPLoader.processId,
|
|
6949
6961
|
fd,
|
|
@@ -6955,7 +6967,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
6955
6967
|
} finally {
|
|
6956
6968
|
locking.maybeLockedFds.delete(fd);
|
|
6957
6969
|
}
|
|
6958
|
-
return
|
|
6970
|
+
return fdCloseResult;
|
|
6959
6971
|
}
|
|
6960
6972
|
_fd_close.sig = 'ii';
|
|
6961
6973
|
function _builtin_fd_close(fd) {
|
|
@@ -7069,8 +7081,12 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7069
7081
|
}
|
|
7070
7082
|
},
|
|
7071
7083
|
get_native_path_from_vfs_path(vfsPath) {
|
|
7072
|
-
|
|
7073
|
-
|
|
7084
|
+
const { node } = FS.lookupPath(vfsPath, {
|
|
7085
|
+
noent_okay: true,
|
|
7086
|
+
});
|
|
7087
|
+
if (!node) {
|
|
7088
|
+
throw new Error(`No node found for VFS path ${vfsPath}`);
|
|
7089
|
+
}
|
|
7074
7090
|
if (node.mount.type === NODEFS) {
|
|
7075
7091
|
return NODEFS.realPath(node);
|
|
7076
7092
|
} else if (node.mount.type === PROXYFS) {
|
|
@@ -7340,10 +7356,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7340
7356
|
return -ERRNO_CODES.EINVAL;
|
|
7341
7357
|
}
|
|
7342
7358
|
|
|
7343
|
-
const nativeFilePath =
|
|
7344
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7345
|
-
|
|
7346
7359
|
try {
|
|
7360
|
+
const nativeFilePath =
|
|
7361
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7347
7362
|
const conflictingLock =
|
|
7348
7363
|
PHPLoader.fileLockManager.findFirstConflictingByteRangeLock(
|
|
7349
7364
|
nativeFilePath,
|
|
@@ -7477,16 +7492,16 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
7477
7492
|
pid,
|
|
7478
7493
|
};
|
|
7479
7494
|
|
|
7480
|
-
const nativeFilePath =
|
|
7481
|
-
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7482
|
-
_js_wasm_trace(
|
|
7483
|
-
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7484
|
-
fd,
|
|
7485
|
-
vfsPath,
|
|
7486
|
-
rangeLock
|
|
7487
|
-
);
|
|
7488
|
-
|
|
7489
7495
|
try {
|
|
7496
|
+
const nativeFilePath =
|
|
7497
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
7498
|
+
_js_wasm_trace(
|
|
7499
|
+
'fcntl(%d, F_SETLK) %s calling lockFileByteRange for range lock %s',
|
|
7500
|
+
fd,
|
|
7501
|
+
vfsPath,
|
|
7502
|
+
rangeLock
|
|
7503
|
+
);
|
|
7504
|
+
|
|
7490
7505
|
const succeeded =
|
|
7491
7506
|
PHPLoader.fileLockManager.lockFileByteRange(
|
|
7492
7507
|
nativeFilePath,
|
|
@@ -17407,8 +17422,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17407
17422
|
return -ERRNO_CODES.EINVAL;
|
|
17408
17423
|
}
|
|
17409
17424
|
|
|
17410
|
-
const nativeFilePath = locking.get_native_path_from_vfs_path(vfsPath);
|
|
17411
17425
|
try {
|
|
17426
|
+
const nativeFilePath =
|
|
17427
|
+
locking.get_native_path_from_vfs_path(vfsPath);
|
|
17412
17428
|
const obtainedLock = PHPLoader.fileLockManager.lockWholeFile(
|
|
17413
17429
|
nativeFilePath,
|
|
17414
17430
|
{
|
|
@@ -17744,9 +17760,9 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
17744
17760
|
if (!cp.stdin.closed) {
|
|
17745
17761
|
cp.stdin.end();
|
|
17746
17762
|
}
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17763
|
+
PHPLoader['free'](buffer);
|
|
17764
|
+
PHPLoader['free'](iov);
|
|
17765
|
+
PHPLoader['free'](pnum);
|
|
17750
17766
|
}
|
|
17751
17767
|
|
|
17752
17768
|
// pump() can never alter the result of this function.
|
|
@@ -18579,6 +18595,11 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
18579
18595
|
return ret;
|
|
18580
18596
|
};
|
|
18581
18597
|
|
|
18598
|
+
var setErrNo = (value) => {
|
|
18599
|
+
HEAP32[___errno_location() >> 2] = value;
|
|
18600
|
+
return value;
|
|
18601
|
+
};
|
|
18602
|
+
|
|
18582
18603
|
var FS_createPath = FS.createPath;
|
|
18583
18604
|
|
|
18584
18605
|
var FS_unlink = (path) => FS.unlink(path);
|
|
@@ -31595,11 +31616,6 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
31595
31616
|
|
|
31596
31617
|
var allocateUTF8 = stringToNewUTF8;
|
|
31597
31618
|
|
|
31598
|
-
var setErrNo = (value) => {
|
|
31599
|
-
HEAP32[___errno_location() >> 2] = value;
|
|
31600
|
-
return value;
|
|
31601
|
-
};
|
|
31602
|
-
|
|
31603
31619
|
var demangle = (func) => {
|
|
31604
31620
|
// If demangle has failed before, stop demangling any further function names
|
|
31605
31621
|
// This avoids an infinite recursion with malloc()->abort()->stackTrace()->demangle()->malloc()->...
|
|
@@ -32099,13 +32115,13 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
32099
32115
|
// End JS library code
|
|
32100
32116
|
|
|
32101
32117
|
var ASM_CONSTS = {
|
|
32102
|
-
|
|
32118
|
+
11681709: ($0) => {
|
|
32103
32119
|
if (!$0) {
|
|
32104
32120
|
AL.alcErr = 0xa004;
|
|
32105
32121
|
return 1;
|
|
32106
32122
|
}
|
|
32107
32123
|
},
|
|
32108
|
-
|
|
32124
|
+
11681757: ($0) => {
|
|
32109
32125
|
if (!AL.currentCtx) {
|
|
32110
32126
|
err('alGetProcAddress() called without a valid context');
|
|
32111
32127
|
return 1;
|
|
@@ -35532,6 +35548,7 @@ export function init(RuntimeName, PHPLoader) {
|
|
|
35532
35548
|
Module['FS_createDevice'] = FS_createDevice;
|
|
35533
35549
|
Module['FS_createDataFile'] = FS_createDataFile;
|
|
35534
35550
|
Module['FS_createLazyFile'] = FS_createLazyFile;
|
|
35551
|
+
Module['setErrNo'] = setErrNo;
|
|
35535
35552
|
Module['PROXYFS'] = PROXYFS;
|
|
35536
35553
|
|
|
35537
35554
|
function callMain(args = []) {
|