@ai-ecoverse/slicc-kernel 1.103.1 → 1.103.2

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.
@@ -4300,7 +4300,9 @@ var init_wasix_process = __esm({
4300
4300
  });
4301
4301
  }
4302
4302
  spawn(req, exec = false) {
4303
- const { stdio, inherit, cwd, opened: opened2 } = this.childFds(req.ops ?? []);
4303
+ const ops = req.ops ?? [];
4304
+ const { stdio, inherit, cwd, opened: opened2 } = this.childFds(ops);
4305
+ const moved = ops.some((op) => op.cmd === "chdir" || op.cmd === "fchdir");
4304
4306
  try {
4305
4307
  const spawn = {
4306
4308
  op: "proc-spawn",
@@ -4308,6 +4310,7 @@ var init_wasix_process = __esm({
4308
4310
  argv: req.argv.length > 0 ? req.argv : [req.name],
4309
4311
  env: req.env ?? this.environment(),
4310
4312
  cwd,
4313
+ ...moved ? { chdir: true } : {},
4311
4314
  stdio,
4312
4315
  inherit,
4313
4316
  ...exec ? { exec } : {},
@@ -4590,6 +4593,7 @@ function processes(host, call2, inThread) {
4590
4593
  argv: o.argv,
4591
4594
  env: o.env ?? { ...host.o.env },
4592
4595
  cwd: o.cwd ?? host.cwd,
4596
+ ...o.cwd !== void 0 ? { chdir: true } : {},
4593
4597
  stdio,
4594
4598
  ...inThread ? {} : { restart: true }
4595
4599
  };
@@ -4781,7 +4785,7 @@ var KERNEL_VERSION, OS_RELEASE;
4781
4785
  var init_version = __esm({
4782
4786
  "src/version.ts"() {
4783
4787
  "use strict";
4784
- KERNEL_VERSION = true ? "1.103.1" : "0.0.0-dev";
4788
+ KERNEL_VERSION = true ? "1.103.2" : "0.0.0-dev";
4785
4789
  OS_RELEASE = "6.0.0-slicc";
4786
4790
  }
4787
4791
  });
@@ -5091,6 +5095,7 @@ function childOps(kernel, io, defaults, sync) {
5091
5095
  ...named,
5092
5096
  env: { ...o.env ?? defaults.env },
5093
5097
  cwd: o.cwd ?? defaults.cwd,
5098
+ ...o.cwd !== void 0 ? { chdir: true } : {},
5094
5099
  stdio,
5095
5100
  ...group,
5096
5101
  ...death
@@ -8671,6 +8676,7 @@ function kernelUname(imports, hostname, memory, glue) {
8671
8676
  function kernelChdir(Fs) {
8672
8677
  const { chdir, lookupPath, ErrnoError } = Fs;
8673
8678
  if (!chdir || !lookupPath || !ErrnoError) return;
8679
+ Fs.sliccChdirAt = chdir;
8674
8680
  Fs.chdir = (path) => {
8675
8681
  const { node } = lookupPath.call(Fs, path, { follow: true });
8676
8682
  const directory = Fs.isDir?.(node.mode) === true;
@@ -9748,6 +9754,7 @@ function runSync(kernel, d, o) {
9748
9754
  ...named,
9749
9755
  env: { ...o.env ?? d.env },
9750
9756
  cwd: o.cwd === void 0 ? d.cwd : d.resolve(o.cwd),
9757
+ ...o.cwd === void 0 ? {} : { chdir: true },
9751
9758
  ...group,
9752
9759
  stdin: stdioOf(o.stdin),
9753
9760
  ...input ? { input } : {},
@@ -11042,7 +11049,7 @@ function mountVfsIntoEmscripten(Fs, deps) {
11042
11049
  linuxRmdir(Fs);
11043
11050
  if (deps.cred) Fs.sliccCred = deps.cred;
11044
11051
  try {
11045
- Fs.chdir(deps.cwd);
11052
+ (Fs.sliccChdirAt ?? Fs.chdir).call(Fs, deps.cwd);
11046
11053
  } catch (err) {
11047
11054
  warn(`cannot chdir to ${deps.cwd}: errno ${err.errno}`);
11048
11055
  }
@@ -12119,6 +12126,7 @@ function createProcessKernel(deps) {
12119
12126
  argv,
12120
12127
  env: env ?? deps.env,
12121
12128
  cwd: cwd ?? Fs.cwd(),
12129
+ ...cwd !== null ? { chdir: true } : {},
12122
12130
  stdio,
12123
12131
  ...inherit.length > 0 ? { inherit } : {},
12124
12132
  ...exec ? { exec } : {},