@ai-ecoverse/slicc-kernel 1.29.1 → 1.30.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/README.md +28 -5
- package/dist/driver-worker.js.map +2 -2
- package/dist/driver.js.map +2 -2
- package/dist/kernel-worker.js +59 -12
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +106 -36
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +59 -12
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +106 -36
- package/dist/process-worker.js.map +3 -3
- package/package.json +2 -2
package/dist/kernel-worker.js
CHANGED
|
@@ -183,6 +183,11 @@ function rangedOps(fs) {
|
|
|
183
183
|
if (!pread || !pwrite || !truncate) return void 0;
|
|
184
184
|
return { pread: pread.bind(fs), pwrite: pwrite.bind(fs), truncate: truncate.bind(fs) };
|
|
185
185
|
}
|
|
186
|
+
async function lutimesOf(fs, path, atime, mtime) {
|
|
187
|
+
if (fs.lutimes) return fs.lutimes(path, atime, mtime);
|
|
188
|
+
if ((await fs.lstat(path)).isSymbolicLink) throw fsError("EOPNOTSUPP", path);
|
|
189
|
+
return fs.utimes(path, atime, mtime);
|
|
190
|
+
}
|
|
186
191
|
function fsError(code, path) {
|
|
187
192
|
return Object.assign(new Error(`${code}: ${path}`), { code });
|
|
188
193
|
}
|
|
@@ -470,7 +475,7 @@ var OpfsFs = class {
|
|
|
470
475
|
size: new TextEncoder().encode(entry.link).length,
|
|
471
476
|
mode: S_IFLNK | 511,
|
|
472
477
|
mtime: time2,
|
|
473
|
-
atime: time2,
|
|
478
|
+
atime: entry.atimeMs === void 0 ? time2 : new Date(entry.atimeMs),
|
|
474
479
|
ctime: new Date(entry.ctimeMs ?? 0),
|
|
475
480
|
ino: entry.ino ?? inodeOf(entry.path)
|
|
476
481
|
};
|
|
@@ -766,7 +771,24 @@ var OpfsFs = class {
|
|
|
766
771
|
}));
|
|
767
772
|
}
|
|
768
773
|
async utimes(path, atime, mtime) {
|
|
769
|
-
|
|
774
|
+
await this.setTimes(await this.locate(path, true), atime, mtime);
|
|
775
|
+
}
|
|
776
|
+
async lutimes(path, atime, mtime) {
|
|
777
|
+
await this.setTimes(await this.locate(path, false), atime, mtime);
|
|
778
|
+
}
|
|
779
|
+
async setTimes(found, atime, mtime) {
|
|
780
|
+
const { link: link2 } = found;
|
|
781
|
+
if (link2) {
|
|
782
|
+
const ctimeMs2 = Date.now();
|
|
783
|
+
await this.meta.update(found.path, (entry) => ({
|
|
784
|
+
...link2,
|
|
785
|
+
...entry,
|
|
786
|
+
atimeMs: atime.getTime(),
|
|
787
|
+
mtimeMs: mtime.getTime(),
|
|
788
|
+
ctimeMs: ctimeMs2
|
|
789
|
+
}));
|
|
790
|
+
return;
|
|
791
|
+
}
|
|
770
792
|
const handle = found.handle;
|
|
771
793
|
const file = handle.kind === "file" ? await handle.getFile() : void 0;
|
|
772
794
|
const ctimeMs = Date.now();
|
|
@@ -4528,6 +4550,7 @@ function commandOf(pkg, name2, raw, packageAbi, shared) {
|
|
|
4528
4550
|
wasm,
|
|
4529
4551
|
argv0,
|
|
4530
4552
|
...raw.argv0Path === true ? { argv0Path: true } : {},
|
|
4553
|
+
...abi === "wasi" && raw.preopenRoot === true ? { preopenRoot: true } : {},
|
|
4531
4554
|
...args ? { args } : {},
|
|
4532
4555
|
...withEnv,
|
|
4533
4556
|
...imports ? { imports } : {}
|
|
@@ -4740,6 +4763,7 @@ function withCommandDirs(fs, names) {
|
|
|
4740
4763
|
readlink: (path) => fs.readlink(path),
|
|
4741
4764
|
chmod: (path, mode) => fs.chmod(path, mode),
|
|
4742
4765
|
utimes: (path, atime, mtime) => fs.utimes(path, atime, mtime),
|
|
4766
|
+
lutimes: (path, atime, mtime) => lutimesOf(fs, path, atime, mtime),
|
|
4743
4767
|
...rangedOps(fs) ?? {}
|
|
4744
4768
|
};
|
|
4745
4769
|
}
|
|
@@ -4815,7 +4839,11 @@ var FsWatchers = class {
|
|
|
4815
4839
|
rename: after(fs.rename.bind(fs), (from, to) => [from, to]),
|
|
4816
4840
|
symlink: after(fs.symlink.bind(fs), (_target, path) => [path]),
|
|
4817
4841
|
chmod: after(fs.chmod.bind(fs), (path) => [path]),
|
|
4818
|
-
utimes: after(fs.utimes.bind(fs), (path) => [path])
|
|
4842
|
+
utimes: after(fs.utimes.bind(fs), (path) => [path]),
|
|
4843
|
+
lutimes: after(
|
|
4844
|
+
(path, atime, mtime) => lutimesOf(fs, path, atime, mtime),
|
|
4845
|
+
(path) => [path]
|
|
4846
|
+
)
|
|
4819
4847
|
};
|
|
4820
4848
|
const ranged2 = rangedOps(fs);
|
|
4821
4849
|
if (ranged2) {
|
|
@@ -5743,10 +5771,23 @@ var MountFs = class {
|
|
|
5743
5771
|
await found.mount.conn.call({ op: "setattr", path: found.rel, mode });
|
|
5744
5772
|
}
|
|
5745
5773
|
async utimes(path, atime, mtime) {
|
|
5774
|
+
const real = await this.follow(path);
|
|
5775
|
+
const found = this.at(real);
|
|
5776
|
+
if (!found) return this.base.utimes(real, atime, mtime);
|
|
5777
|
+
await this.setMtime(found, real, mtime);
|
|
5778
|
+
}
|
|
5779
|
+
async lutimes(path, atime, mtime) {
|
|
5746
5780
|
const found = this.at(path);
|
|
5747
|
-
if (!found) return this.base
|
|
5748
|
-
|
|
5749
|
-
|
|
5781
|
+
if (!found) return lutimesOf(this.base, path, atime, mtime);
|
|
5782
|
+
const real = normalizePath(path);
|
|
5783
|
+
if (!found.mount.caps.linkTimes && (await this.lstat(real)).isSymbolicLink) {
|
|
5784
|
+
throw errnoError("EOPNOTSUPP", path);
|
|
5785
|
+
}
|
|
5786
|
+
await this.setMtime(found, real, mtime);
|
|
5787
|
+
}
|
|
5788
|
+
async setMtime(found, real, mtime) {
|
|
5789
|
+
this.writable(found.mount, real);
|
|
5790
|
+
this.table.forget(found.mount, real);
|
|
5750
5791
|
await found.mount.conn.call({ op: "setattr", path: found.rel, mtime: mtime.getTime() });
|
|
5751
5792
|
}
|
|
5752
5793
|
};
|
|
@@ -5860,6 +5901,9 @@ async function run(entry, path, req) {
|
|
|
5860
5901
|
case "utimes":
|
|
5861
5902
|
await fs.utimes(path, new Date(req.atimeMs ?? 0), new Date(req.mtimeMs ?? 0));
|
|
5862
5903
|
return done;
|
|
5904
|
+
case "lutimes":
|
|
5905
|
+
await lutimesOf(fs, path, new Date(req.atimeMs ?? 0), new Date(req.mtimeMs ?? 0));
|
|
5906
|
+
return done;
|
|
5863
5907
|
case "pread":
|
|
5864
5908
|
case "pwrite":
|
|
5865
5909
|
case "truncate":
|
|
@@ -7956,9 +8000,10 @@ var WasmProcess = class {
|
|
|
7956
8000
|
json: this.fds.numbers().map((fd) => ({ fd, ...this.fdInfo(fd) }))
|
|
7957
8001
|
};
|
|
7958
8002
|
case "fd-meta": {
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
8003
|
+
if (!this.fds.get(req.fd).file.held) throw new KernelError("EBADF");
|
|
8004
|
+
const cloexec = this.fds.closesOnExec(req.fd);
|
|
8005
|
+
this.fds.installAt(req.fd, heldFile(req.meta));
|
|
8006
|
+
if (cloexec) this.fds.setCloseOnExec(req.fd);
|
|
7962
8007
|
return { ok: true, kind: "void" };
|
|
7963
8008
|
}
|
|
7964
8009
|
case "fd-setfl":
|
|
@@ -9850,7 +9895,8 @@ function targetOf(command) {
|
|
|
9850
9895
|
...command.args ? { prefix: command.args } : {},
|
|
9851
9896
|
...command.env ? { env: command.env } : {},
|
|
9852
9897
|
...command.unset ? { unset: command.unset } : {},
|
|
9853
|
-
...command.imports ? { imports: command.imports } : {}
|
|
9898
|
+
...command.imports ? { imports: command.imports } : {},
|
|
9899
|
+
...command.preopenRoot ? { preopenRoot: true } : {}
|
|
9854
9900
|
};
|
|
9855
9901
|
}
|
|
9856
9902
|
function childHandle(handle) {
|
|
@@ -10086,7 +10132,8 @@ var Launcher = class {
|
|
|
10086
10132
|
...memory ? { memory } : {},
|
|
10087
10133
|
foreign,
|
|
10088
10134
|
...names ? { names } : {},
|
|
10089
|
-
...imports !== void 0 ? { imports } : {}
|
|
10135
|
+
...imports !== void 0 ? { imports } : {},
|
|
10136
|
+
...target.preopenRoot ? { preopenRoot: true } : {}
|
|
10090
10137
|
};
|
|
10091
10138
|
}
|
|
10092
10139
|
async launch(planned, req) {
|
|
@@ -10311,7 +10358,7 @@ var Launcher = class {
|
|
|
10311
10358
|
serveFilesystem(
|
|
10312
10359
|
port2,
|
|
10313
10360
|
tmpfs(),
|
|
10314
|
-
{ symlinks: true, chmod: true, ranges: true, attrTtl: 0 },
|
|
10361
|
+
{ symlinks: true, chmod: true, linkTimes: true, ranges: true, attrTtl: 0 },
|
|
10315
10362
|
{ owned: true }
|
|
10316
10363
|
);
|
|
10317
10364
|
return {
|