@agoric/xsnap 0.14.3-upgrade-17-dev-3b97a9f.0 → 0.14.3-upgrade-17-dev-e67cd91.0
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/package.json +4 -4
- package/src/avaXS.js +2 -1
- package/src/build.js +2 -1
- package/src/replay.js +11 -4
- package/src/xsnap.js +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/xsnap",
|
|
3
|
-
"version": "0.14.3-upgrade-17-dev-
|
|
3
|
+
"version": "0.14.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
4
4
|
"description": "Snapshotting VM worker based on Moddable's XS Javascript engine",
|
|
5
5
|
"author": "Agoric",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"test:xs": "exit 0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@agoric/internal": "0.3.3-upgrade-17-dev-
|
|
32
|
-
"@agoric/xsnap-lockdown": "0.14.1-upgrade-17-dev-
|
|
31
|
+
"@agoric/internal": "0.3.3-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
32
|
+
"@agoric/xsnap-lockdown": "0.14.1-upgrade-17-dev-e67cd91.0+e67cd91",
|
|
33
33
|
"@endo/bundle-source": "^3.4.0",
|
|
34
34
|
"@endo/errors": "^1.2.5",
|
|
35
35
|
"@endo/eventual-send": "^1.2.5",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"typeCoverage": {
|
|
79
79
|
"atLeast": 94.04
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e67cd918f33dafb1708bd4341f2a737b79fa574f"
|
|
82
82
|
}
|
package/src/avaXS.js
CHANGED
|
@@ -9,6 +9,7 @@ Usage:
|
|
|
9
9
|
import '@endo/init';
|
|
10
10
|
|
|
11
11
|
import fs from 'fs';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
12
13
|
import { tmpName } from 'tmp';
|
|
13
14
|
|
|
14
15
|
import { assert, q, Fail } from '@endo/errors';
|
|
@@ -21,7 +22,7 @@ const avaHandler = `./avaHandler.cjs`;
|
|
|
21
22
|
|
|
22
23
|
/** @type { (ref: string, readFile: typeof import('fs').promises.readFile ) => Promise<string> } */
|
|
23
24
|
const asset = (ref, readFile) =>
|
|
24
|
-
readFile(new URL(ref, import.meta.url)
|
|
25
|
+
readFile(fileURLToPath(new URL(ref, import.meta.url)), 'utf8');
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* When we bundle test scripts, we leave these externals
|
package/src/build.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/* global process */
|
|
3
3
|
import * as childProcessTop from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
4
5
|
import fsTop from 'fs';
|
|
5
6
|
import osTop from 'os';
|
|
6
7
|
|
|
7
8
|
const { freeze } = Object;
|
|
8
9
|
|
|
9
10
|
/** @param {string} path */
|
|
10
|
-
const asset = path => new URL(path, import.meta.url)
|
|
11
|
+
const asset = path => fileURLToPath(new URL(path, import.meta.url));
|
|
11
12
|
|
|
12
13
|
const ModdableSDK = {
|
|
13
14
|
MODDABLE: asset('../moddable'),
|
package/src/replay.js
CHANGED
|
@@ -13,6 +13,7 @@ import osPowers from 'os';
|
|
|
13
13
|
import fsPowers from 'fs';
|
|
14
14
|
import { Readable } from 'stream';
|
|
15
15
|
import { tmpName as tmpNamePower } from 'tmp';
|
|
16
|
+
import { fileURLToPath } from 'url';
|
|
16
17
|
import { makeQueue } from '@endo/stream';
|
|
17
18
|
import { xsnap, DEFAULT_CRANK_METERING_LIMIT } from './xsnap.js';
|
|
18
19
|
|
|
@@ -38,7 +39,9 @@ function makeSyncStorage(path, { writeFileSync }) {
|
|
|
38
39
|
file: fn => {
|
|
39
40
|
/** @param {Uint8Array} data */
|
|
40
41
|
const put = data =>
|
|
41
|
-
writeFileSync(new URL(fn, base)
|
|
42
|
+
writeFileSync(fileURLToPath(new URL(fn, base)), data, {
|
|
43
|
+
flag: 'wx',
|
|
44
|
+
});
|
|
42
45
|
|
|
43
46
|
return freeze({
|
|
44
47
|
put,
|
|
@@ -60,14 +63,18 @@ function makeSyncAccess(path, { readdirSync, readFileSync }) {
|
|
|
60
63
|
const base = new URL(path, 'file://');
|
|
61
64
|
/** @param {string} fn */
|
|
62
65
|
const file = fn => {
|
|
63
|
-
const fullname = new URL(fn, base)
|
|
66
|
+
const fullname = fileURLToPath(new URL(fn, base));
|
|
64
67
|
|
|
65
68
|
return freeze({
|
|
66
69
|
getData: () => readFileSync(fullname),
|
|
67
70
|
getText: () => readFileSync(fullname, 'utf-8'),
|
|
68
71
|
});
|
|
69
72
|
};
|
|
70
|
-
return freeze({
|
|
73
|
+
return freeze({
|
|
74
|
+
path,
|
|
75
|
+
file,
|
|
76
|
+
readdir: () => readdirSync(fileURLToPath(base)),
|
|
77
|
+
});
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
/**
|
|
@@ -320,7 +327,7 @@ export async function main(
|
|
|
320
327
|
}
|
|
321
328
|
|
|
322
329
|
/* global process */
|
|
323
|
-
if (process.argv[1] === new URL(import.meta.url)
|
|
330
|
+
if (process.argv[1] === fileURLToPath(new URL(import.meta.url))) {
|
|
324
331
|
main([...process.argv.slice(2)], {
|
|
325
332
|
spawn: childProcessPowers.spawn,
|
|
326
333
|
fs: { ...fsPowers, ...fsPowers.promises },
|
package/src/xsnap.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { finished } from 'stream/promises';
|
|
5
5
|
import { PassThrough, Readable } from 'stream';
|
|
6
6
|
import { promisify } from 'util';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
7
8
|
import { Fail, q } from '@endo/errors';
|
|
8
9
|
import { makeNetstringReader, makeNetstringWriter } from '@endo/netstring';
|
|
9
10
|
import { makeNodeReader, makeNodeWriter } from '@endo/stream-node';
|
|
@@ -174,12 +175,14 @@ export async function xsnap(options) {
|
|
|
174
175
|
throw Error(`xsnap does not support platform ${os}`);
|
|
175
176
|
}
|
|
176
177
|
|
|
177
|
-
let bin =
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
let bin = fileURLToPath(
|
|
179
|
+
new URL(
|
|
180
|
+
`../xsnap-native/xsnap/build/bin/${platform}/${
|
|
181
|
+
debug ? 'debug' : 'release'
|
|
182
|
+
}/xsnap-worker`,
|
|
183
|
+
import.meta.url,
|
|
184
|
+
),
|
|
185
|
+
);
|
|
183
186
|
|
|
184
187
|
/** @type {PromiseKit<void>} */
|
|
185
188
|
const vatExit = makePromiseKit();
|