@ai-ecoverse/slicc-kernel 1.124.10 → 1.124.12

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.
@@ -801,6 +801,17 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
801
801
  else cache.mutated([]);
802
802
  }
803
803
  };
804
+ const relabeling = (p, op) => {
805
+ if (exact || !bridge.identifyNext) return rewriting(p, op);
806
+ bridge.identifyNext();
807
+ try {
808
+ return op();
809
+ } finally {
810
+ const st = bridge.identified?.() ?? null;
811
+ if (st) cache.mutated([p], st.ino);
812
+ else cache.mutated([]);
813
+ }
814
+ };
804
815
  const rewriting = (p, op, ...also) => {
805
816
  if (exact) return identified(p, op, also);
806
817
  const ino = cache.inoOf(p, () => bridge.stat(p));
@@ -857,8 +868,8 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
857
868
  unlink: (p) => mutating(() => bridge.unlink(p)),
858
869
  rmdir: (p) => mutating(() => bridge.rmdir(p)),
859
870
  symlink: (target, link) => mutating(() => bridge.symlink(target, link), ...entry(link)),
860
- chmod: (p, mode) => rewriting(p, () => bridge.chmod(p, mode)),
861
- utimes: (p, a, m, now2) => rewriting(p, () => bridge.utimes(p, a, m, now2)),
871
+ chmod: (p, mode) => relabeling(p, () => bridge.chmod(p, mode)),
872
+ utimes: (p, a, m, now2) => relabeling(p, () => bridge.utimes(p, a, m, now2)),
862
873
  lutimes: (p, a, m, now2) => mutating(() => bridge.lutimes(p, a, m, now2)),
863
874
  ...bridge.hold ? { hold: bridge.hold.bind(bridge) } : {},
864
875
  ...bridge.access ? { access: bridge.access.bind(bridge) } : {},
@@ -872,7 +883,7 @@ function cachingBridge(bridge, now = () => performance.now(), shared) {
872
883
  mkfifo: (p, mode) => mutating(() => bridge.mkfifo?.(p, mode), ...entry(p))
873
884
  } : {},
874
885
  ...chown ? {
875
- chown: (p, ...rest2) => rewriting(p, () => chown.call(bridge, p, ...rest2))
886
+ chown: (p, ...rest2) => relabeling(p, () => chown.call(bridge, p, ...rest2))
876
887
  } : {},
877
888
  ...bridge.pread && bridge.pwrite && bridge.truncate ? {
878
889
  pread: bridge.pread.bind(bridge),
@@ -5488,7 +5499,7 @@ var KERNEL_VERSION, OS_RELEASE;
5488
5499
  var init_version = __esm({
5489
5500
  "src/version.ts"() {
5490
5501
  "use strict";
5491
- KERNEL_VERSION = true ? "1.124.10" : "0.0.0-dev";
5502
+ KERNEL_VERSION = true ? "1.124.12" : "0.0.0-dev";
5492
5503
  OS_RELEASE = "6.0.0-slicc";
5493
5504
  }
5494
5505
  });
@@ -7394,7 +7405,7 @@ function createSyncSabTransport(sab, port3, deps = {}) {
7394
7405
  return;
7395
7406
  }
7396
7407
  const remaining = deadline - now();
7397
- if (remaining <= 0) throw syncError("ETIMEDOUT", label);
7408
+ if (remaining <= 0) throw syncError("EIO", label);
7398
7409
  wait2(header, SAB_I_PUB, published, remaining);
7399
7410
  }
7400
7411
  }
@@ -7403,7 +7414,6 @@ function createSyncSabTransport(sab, port3, deps = {}) {
7403
7414
  if (deps.memory) publishMemory(sab, deps.memory());
7404
7415
  const id = ++seq;
7405
7416
  calls += Number(!PATH_OPS.has(req.op));
7406
- const deadline = now() + timeoutMs2;
7407
7417
  let out = null;
7408
7418
  let status2 = 0;
7409
7419
  let offset = 0;
@@ -7418,7 +7428,7 @@ function createSyncSabTransport(sab, port3, deps = {}) {
7418
7428
  } catch {
7419
7429
  throw syncError("EIO", label);
7420
7430
  }
7421
- awaitReady(id, deadline, label);
7431
+ awaitReady(id, now() + timeoutMs2, label);
7422
7432
  const total = loadU53(header, SAB_I_TOTAL, SAB_I_TOTAL_HI);
7423
7433
  const chunk = Atomics.load(header, SAB_I_CHUNK);
7424
7434
  const at = loadU53(header, SAB_I_OFFSET, SAB_I_OFFSET_HI);
@@ -7448,10 +7458,12 @@ function errnoError(code2, path) {
7448
7458
  function createSyncFsSabBridge(transport, opts = {}) {
7449
7459
  const timeoutMs2 = opts.timeoutMs ?? SYNC_FS_REQUEST_TIMEOUT_MS;
7450
7460
  let identity = {};
7461
+ let once = false;
7451
7462
  let last = null;
7452
7463
  function run(req, path, transfer) {
7453
7464
  last = null;
7454
- const result = transport.call(req, timeoutMs2, `sync-sab bridge, '${path}'`, transfer);
7465
+ const silence = READ_ONLY.has(req.op) ? timeoutMs2 : Number.POSITIVE_INFINITY;
7466
+ const result = transport.call(req, silence, `sync-sab bridge, '${path}'`, transfer);
7455
7467
  if (!result.ok) throw errnoError(result.errno, path);
7456
7468
  return result;
7457
7469
  }
@@ -7466,7 +7478,9 @@ function createSyncFsSabBridge(transport, opts = {}) {
7466
7478
  throw errnoError("EIO", path);
7467
7479
  }
7468
7480
  const changing = (req, path, transfer) => {
7469
- const r = run({ ...req, ...identity }, path, transfer);
7481
+ const ask = once ? { identity: true } : identity;
7482
+ once = false;
7483
+ const r = run({ ...req, ...ask }, path, transfer);
7470
7484
  if (r.ok && r.kind === "json") last = parseSyncFsStat(r.json);
7471
7485
  };
7472
7486
  const io = (id) => ({
@@ -7563,7 +7577,14 @@ function createSyncFsSabBridge(transport, opts = {}) {
7563
7577
  identify: () => {
7564
7578
  identity = { identity: true };
7565
7579
  },
7566
- identified: () => last,
7580
+ identifyNext: () => {
7581
+ once = true;
7582
+ last = null;
7583
+ },
7584
+ identified: () => {
7585
+ once = false;
7586
+ return last;
7587
+ },
7567
7588
  lutimes: (path, atimeMs, mtimeMs, now) => {
7568
7589
  run({ op: "lutimes", path, atimeMs, mtimeMs, ...now ? { now } : {} }, path);
7569
7590
  },
@@ -7604,7 +7625,7 @@ function createSyncFsSabBridge(transport, opts = {}) {
7604
7625
  statfs: (path = "/") => parseSyncFsUsage(json2({ op: "statfs", path }, path))
7605
7626
  };
7606
7627
  }
7607
- var PATH_OPS, calls, looks, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
7628
+ var PATH_OPS, READ_ONLY, calls, looks, SPIN_MS, SPIN_STRIDE, SPIN_STRIDES, SPIN_CORES, spinning, SPIN_CAP_MS;
7608
7629
  var init_sync_sab_bridge = __esm({
7609
7630
  "src/realm/sync-sab-bridge.ts"() {
7610
7631
  "use strict";
@@ -7613,6 +7634,19 @@ var init_sync_sab_bridge = __esm({
7613
7634
  init_sync_fs_wire();
7614
7635
  init_sync_sab_wire();
7615
7636
  PATH_OPS = new Set(SYNC_FS_OPS);
7637
+ READ_ONLY = /* @__PURE__ */ new Set([
7638
+ "read",
7639
+ "pread",
7640
+ "exists",
7641
+ "stat",
7642
+ "lstat",
7643
+ "readdir",
7644
+ "readdir-stat",
7645
+ "readlink",
7646
+ "statfs",
7647
+ "kept",
7648
+ "access"
7649
+ ]);
7616
7650
  calls = 0;
7617
7651
  looks = 0;
7618
7652
  SPIN_MS = 0.06;