peachsim 0.1.1640 → 0.1.1641

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.
Files changed (109) hide show
  1. package/README.md +5 -0
  2. package/cli/app-stubs.ts +38 -13
  3. package/cli/cloud-session.ts +16 -0
  4. package/cli/commands/assert.ts +17 -4
  5. package/cli/commands/box.ts +33 -19
  6. package/cli/commands/doctor.ts +24 -15
  7. package/cli/commands/inspect/actions.ts +3 -2
  8. package/cli/commands/inspect/core.ts +0 -8
  9. package/cli/commands/inspect.ts +0 -14
  10. package/cli/commands/platform.ts +2 -1
  11. package/cli/commands/record.ts +64 -28
  12. package/cli/commands/swift.ts +10 -2
  13. package/cli/commands/three-mode.ts +4 -38
  14. package/cli/commands/upload.ts +8 -8
  15. package/cli/flow-live-status.ts +0 -2
  16. package/cli/main.ts +1 -1
  17. package/cli/ws-bridge.ts +0 -6
  18. package/detox/attempt-events.cjs +41 -5
  19. package/detox/index.ts +155 -109
  20. package/detox/jest-environment.cjs +5 -1
  21. package/dist-lib/agent-daemon-client.cjs +1 -1
  22. package/dist-lib/agent-events.cjs +1 -1
  23. package/dist-lib/attached-projects.cjs +1 -1
  24. package/dist-lib/auth/shared-session.cjs +1 -1
  25. package/dist-lib/backend-origin.cjs +10 -1
  26. package/dist-lib/beta.cjs +1 -1
  27. package/dist-lib/beta.mjs +1 -1
  28. package/dist-lib/bridge-constants.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.cjs +1 -1
  30. package/dist-lib/bridge-contract-input.mjs +1 -1
  31. package/dist-lib/bridge-contract.cjs +1 -1
  32. package/dist-lib/bridge-contract.mjs +1 -1
  33. package/dist-lib/bundle-channel.cjs +2059 -1368
  34. package/dist-lib/capture-contract.cjs +1 -1
  35. package/dist-lib/capture-contract.mjs +1 -1
  36. package/dist-lib/cloud-contract.cjs +1 -1
  37. package/dist-lib/cloud-contract.mjs +1 -1
  38. package/dist-lib/cloud-test-args.cjs +1 -1
  39. package/dist-lib/cloud-test-args.mjs +1 -1
  40. package/dist-lib/cloud.cjs +1 -1
  41. package/dist-lib/cloud.mjs +1 -1
  42. package/dist-lib/config.cjs +1 -1
  43. package/dist-lib/config.mjs +1 -1
  44. package/dist-lib/detox/index.cjs +572 -125
  45. package/dist-lib/detox/jest-environment.cjs +5 -1
  46. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  47. package/dist-lib/expo-swift-bundle.cjs +1837 -1164
  48. package/dist-lib/expo-swift-metadata.cjs +1 -1
  49. package/dist-lib/expo-swift-metadata.mjs +1 -1
  50. package/dist-lib/home-paths.cjs +1 -1
  51. package/dist-lib/host/bridge-host.cjs +2290 -1616
  52. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  53. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  54. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  55. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  56. package/dist-lib/host/websocket-proxy.cjs +1 -1
  57. package/dist-lib/index.cjs +44 -17
  58. package/dist-lib/jump-to-source-babel.cjs +1 -1
  59. package/dist-lib/jump-to-source-native.cjs +1 -1
  60. package/dist-lib/kotlin-host.cjs +1 -1
  61. package/dist-lib/menu.cjs +1 -1
  62. package/dist-lib/menu.mjs +1 -1
  63. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  64. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  65. package/dist-lib/metro-production-bundle.cjs +1 -1
  66. package/dist-lib/metro-production-bundle.mjs +1 -1
  67. package/dist-lib/metro.cjs +33 -13
  68. package/dist-lib/native-app-identity-project.cjs +7 -4
  69. package/dist-lib/native-app-identity-project.mjs +7 -4
  70. package/dist-lib/native-app-identity.cjs +1 -1
  71. package/dist-lib/native-app-identity.mjs +1 -1
  72. package/dist-lib/native-firebase-metadata.cjs +1 -1
  73. package/dist-lib/native-firebase-metadata.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/react-native-host-modules.cjs +1 -1
  79. package/dist-lib/react-native-host-modules.mjs +1 -1
  80. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  81. package/dist-lib/sdk.cjs +4 -3
  82. package/dist-lib/sdk.mjs +4 -3
  83. package/dist-lib/skills.cjs +2823 -2109
  84. package/dist-lib/swift-compile.cjs +370 -239
  85. package/dist-lib/swift-compile.mjs +368 -230
  86. package/dist-lib/swift-package.cjs +1 -1
  87. package/dist-lib/swift-package.mjs +1 -1
  88. package/dist-lib/swift-submit.cjs +8 -3
  89. package/dist-lib/swift-submit.mjs +8 -3
  90. package/dist-lib/swift-toolchain.cjs +1 -1
  91. package/dist-lib/swift.cjs +1 -1
  92. package/dist-lib/vite-swift.cjs +1757 -1108
  93. package/dist-lib/vite.cjs +1 -1
  94. package/dist-lib/worklet-executable.cjs +1 -1
  95. package/dist-lib/worklet-executable.mjs +1 -1
  96. package/package.json +1 -1
  97. package/src/backend-origin.ts +8 -0
  98. package/src/react-native-bridge-modules.ts +89 -76
  99. package/src/swift-compile.ts +134 -107
  100. package/src/swift-distribution.lock.json +9 -8
  101. package/src/swift-host.ts +6 -4
  102. package/src/swift-objc-compile.ts +385 -193
  103. package/src/swift-objc-metadata.ts +204 -0
  104. package/src/swift-objc-sdk.ts +195 -2
  105. package/src/swift-package-manifest.ts +6 -3
  106. package/src/swift-root-lock.ts +153 -0
  107. package/src/swift-submit.ts +15 -2
  108. package/src/swiftContract.ts +12 -0
  109. package/src/xcode-project.ts +10 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1640 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1641 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -67,11 +67,11 @@ __export(swift_compile_exports, {
67
67
  writeSwiftProject: () => writeSwiftProject
68
68
  });
69
69
  module.exports = __toCommonJS(swift_compile_exports);
70
- var import_node_child_process4 = require("node:child_process");
71
- var import_node_crypto2 = require("node:crypto");
72
- var import_node_fs3 = require("node:fs");
70
+ var import_node_child_process5 = require("node:child_process");
71
+ var import_node_crypto3 = require("node:crypto");
72
+ var import_node_fs4 = require("node:fs");
73
73
  var import_node_os3 = __toESM(require("node:os"), 1);
74
- var import_node_path5 = __toESM(require("node:path"), 1);
74
+ var import_node_path6 = __toESM(require("node:path"), 1);
75
75
 
76
76
  // src/admitted-mac-build.ts
77
77
  var import_node_child_process = require("node:child_process");
@@ -773,9 +773,9 @@ var EXCERPT = /^(\s*)(\d+)( \| )(.*)$/;
773
773
  var MARKER = /^(\s*)( \| )(.*)$/;
774
774
  function designTimeDiagnostic(output, files) {
775
775
  const rewritten = /* @__PURE__ */ new Map();
776
- const linesOf = (path5) => {
776
+ const linesOf = (path6) => {
777
777
  const file = Object.keys(files).find(
778
- (name) => name.endsWith(".swift") && (path5 === name || path5.endsWith(`/${name}`))
778
+ (name) => name.endsWith(".swift") && (path6 === name || path6.endsWith(`/${name}`))
779
779
  );
780
780
  if (file === void 0) return null;
781
781
  let lines = rewritten.get(file);
@@ -1176,6 +1176,117 @@ function swiftPackagePartition(manifest, resourcePaths = []) {
1176
1176
  return targets.length === 1 && targets[0].executable && targets[0].path === "." && targets[0].languageMode === 5 && !targets[0].mainActorIsolation && !targets[0].defines?.length && !targets[0].linkedLibraries?.length && !targets[0].cxxInterop && !swiftManifestCxxLanguageStandard(manifest) ? [] : targets;
1177
1177
  }
1178
1178
 
1179
+ // src/swift-root-lock.ts
1180
+ var import_node_child_process4 = require("node:child_process");
1181
+ var import_node_crypto2 = require("node:crypto");
1182
+ var import_node_fs3 = require("node:fs");
1183
+ var import_node_path5 = __toESM(require("node:path"), 1);
1184
+ var POLL_MS = 250;
1185
+ function processStart(pid) {
1186
+ try {
1187
+ return (0, import_node_child_process4.execFileSync)("ps", ["-o", "lstart=", "-p", String(pid)], {
1188
+ encoding: "utf8",
1189
+ stdio: ["ignore", "pipe", "ignore"]
1190
+ }).trim() || null;
1191
+ } catch {
1192
+ return null;
1193
+ }
1194
+ }
1195
+ function parseHolder(text2) {
1196
+ try {
1197
+ const value = JSON.parse(text2);
1198
+ if (value && typeof value === "object" && "pid" in value && typeof value.pid === "number" && "start" in value && (typeof value.start === "string" || value.start === null))
1199
+ return { pid: value.pid, start: value.start };
1200
+ } catch {
1201
+ }
1202
+ return null;
1203
+ }
1204
+ function readLock(lock) {
1205
+ try {
1206
+ return (0, import_node_fs3.readFileSync)(lock, "utf8");
1207
+ } catch (error) {
1208
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
1209
+ throw error;
1210
+ }
1211
+ }
1212
+ function holderAlive(text2) {
1213
+ const holder = parseHolder(text2);
1214
+ if (!holder) return false;
1215
+ const start = processStart(holder.pid);
1216
+ return start !== null && start === holder.start;
1217
+ }
1218
+ function pause(ms, signal) {
1219
+ return new Promise((resolve) => {
1220
+ const done = () => {
1221
+ clearTimeout(timer);
1222
+ signal?.removeEventListener("abort", done);
1223
+ resolve();
1224
+ };
1225
+ const timer = setTimeout(done, ms);
1226
+ signal?.addEventListener("abort", done, { once: true });
1227
+ });
1228
+ }
1229
+ async function withSwiftRootLock(root, work, signal) {
1230
+ const directory = import_node_path5.default.join(rnxHomeDir(), "cache", "swift-root-locks");
1231
+ (0, import_node_fs3.mkdirSync)(directory, { recursive: true });
1232
+ const lock = import_node_path5.default.join(
1233
+ directory,
1234
+ `${(0, import_node_crypto2.createHash)("sha256").update(root).digest("hex").slice(0, 32)}.lock`
1235
+ );
1236
+ const token = (0, import_node_crypto2.randomUUID)();
1237
+ const owner = JSON.stringify({
1238
+ pid: process.pid,
1239
+ start: processStart(process.pid),
1240
+ token
1241
+ });
1242
+ const pending = `${lock}.${token}`;
1243
+ (0, import_node_fs3.writeFileSync)(pending, owner);
1244
+ try {
1245
+ for (; ; ) {
1246
+ signal?.throwIfAborted();
1247
+ try {
1248
+ (0, import_node_fs3.linkSync)(pending, lock);
1249
+ break;
1250
+ } catch (error) {
1251
+ if (!(error instanceof Error && "code" in error && error.code === "EEXIST"))
1252
+ throw error;
1253
+ }
1254
+ const held = readLock(lock);
1255
+ if (held === null) continue;
1256
+ if (holderAlive(held)) {
1257
+ await pause(POLL_MS, signal);
1258
+ continue;
1259
+ }
1260
+ const dead = `${lock}.dead-${token}`;
1261
+ try {
1262
+ (0, import_node_fs3.renameSync)(lock, dead);
1263
+ } catch (error) {
1264
+ if (error instanceof Error && "code" in error && error.code === "ENOENT") continue;
1265
+ throw error;
1266
+ }
1267
+ try {
1268
+ if (readLock(dead) !== held) {
1269
+ try {
1270
+ (0, import_node_fs3.linkSync)(dead, lock);
1271
+ } catch (error) {
1272
+ if (!(error instanceof Error && "code" in error && error.code === "EEXIST"))
1273
+ throw error;
1274
+ }
1275
+ }
1276
+ } finally {
1277
+ (0, import_node_fs3.rmSync)(dead, { force: true });
1278
+ }
1279
+ }
1280
+ } finally {
1281
+ (0, import_node_fs3.rmSync)(pending, { force: true });
1282
+ }
1283
+ try {
1284
+ return await work();
1285
+ } finally {
1286
+ if (readLock(lock) === owner) (0, import_node_fs3.rmSync)(lock, { force: true });
1287
+ }
1288
+ }
1289
+
1179
1290
  // src/swiftContract.ts
1180
1291
  function isSwiftResourcePath(value) {
1181
1292
  return typeof value === "string" && value.length <= 4096 && !value.startsWith("/") && !value.includes("\\") && !value.includes("\0") && value.split("/").every((part) => part !== "" && part !== "." && part !== "..");
@@ -1193,7 +1304,7 @@ function isSwiftResourceBundles(value) {
1193
1304
  async function runCompiler(command, args, options, stream = false, quiet) {
1194
1305
  const { signal } = options;
1195
1306
  signal?.throwIfAborted();
1196
- const child = (0, import_node_child_process4.spawn)(command, args, {
1307
+ const child = (0, import_node_child_process5.spawn)(command, args, {
1197
1308
  cwd: options.cwd,
1198
1309
  env: swiftEnvironment(options.env),
1199
1310
  detached: true,
@@ -1279,12 +1390,12 @@ var BUILD_JOBS = String(
1279
1390
  Math.min(4, Math.max(1, Math.floor(import_node_os3.default.availableParallelism() / 2)))
1280
1391
  );
1281
1392
  function swiftDistributionAt(root) {
1282
- const file = import_node_path5.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
1283
- if (!(0, import_node_fs3.existsSync)(file)) return null;
1284
- return parseSwiftDistributionManifest(JSON.parse((0, import_node_fs3.readFileSync)(file, "utf8")));
1393
+ const file = import_node_path6.default.join(root, SWIFT_DISTRIBUTION_MANIFEST);
1394
+ if (!(0, import_node_fs4.existsSync)(file)) return null;
1395
+ return parseSwiftDistributionManifest(JSON.parse((0, import_node_fs4.readFileSync)(file, "utf8")));
1285
1396
  }
1286
1397
  function swiftModuleSdk(root) {
1287
- const pin = swiftDistributionAt(root) ?? JSON.parse((0, import_node_fs3.readFileSync)(import_node_path5.default.join(root, "toolchain.json"), "utf8"));
1398
+ const pin = swiftDistributionAt(root) ?? JSON.parse((0, import_node_fs4.readFileSync)(import_node_path6.default.join(root, "toolchain.json"), "utf8"));
1288
1399
  if (!pin || typeof pin !== "object" || typeof Reflect.get(pin, "wasmSdkId") !== "string" || typeof Reflect.get(pin, "wasmSdkUrl") !== "string" || typeof Reflect.get(pin, "wasmSdkChecksum") !== "string")
1289
1400
  throw new Error(`${root} pins no wasm SDK id, url and checksum`);
1290
1401
  return {
@@ -1310,7 +1421,7 @@ function swiftModuleInputFiles(root) {
1310
1421
  "toolchain.json"
1311
1422
  ];
1312
1423
  const walk = (dir) => {
1313
- for (const entry of (0, import_node_fs3.readdirSync)(import_node_path5.default.join(root, dir), {
1424
+ for (const entry of (0, import_node_fs4.readdirSync)(import_node_path6.default.join(root, dir), {
1314
1425
  withFileTypes: true
1315
1426
  })) {
1316
1427
  const relative = `${dir}/${entry.name}`;
@@ -1328,39 +1439,39 @@ function swiftMacroPlugins(moduleRoot) {
1328
1439
  const distribution = swiftDistributionAt(moduleRoot);
1329
1440
  if (distribution)
1330
1441
  return {
1331
- libraries: distribution.plugins.map((plugin) => import_node_path5.default.join(moduleRoot, plugin)),
1442
+ libraries: distribution.plugins.map((plugin) => import_node_path6.default.join(moduleRoot, plugin)),
1332
1443
  stale: false
1333
1444
  };
1334
- const dir = import_node_path5.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
1445
+ const dir = import_node_path6.default.join(moduleRoot, ".build/host/RnxPreviewMacros");
1335
1446
  const release = JSON.parse(
1336
- (0, import_node_fs3.readFileSync)(import_node_path5.default.join(moduleRoot, "toolchain.json"), "utf8")
1447
+ (0, import_node_fs4.readFileSync)(import_node_path6.default.join(moduleRoot, "toolchain.json"), "utf8")
1337
1448
  ).release;
1338
- const compilerStamp = import_node_path5.default.join(dir, "compiler-release");
1449
+ const compilerStamp = import_node_path6.default.join(dir, "compiler-release");
1339
1450
  const ext = process.platform === "darwin" ? "dylib" : "so";
1340
1451
  const plugins = [
1341
1452
  {
1342
- library: import_node_path5.default.join(dir, `libRnxPreviewMacros.${ext}`),
1343
- sources: [import_node_path5.default.join(moduleRoot, "Sources/RnxPreviewMacros/PreviewMacro.swift")]
1453
+ library: import_node_path6.default.join(dir, `libRnxPreviewMacros.${ext}`),
1454
+ sources: [import_node_path6.default.join(moduleRoot, "Sources/RnxPreviewMacros/PreviewMacro.swift")]
1344
1455
  },
1345
1456
  {
1346
- library: import_node_path5.default.join(dir, `libFoundationMacros.${ext}`),
1457
+ library: import_node_path6.default.join(dir, `libFoundationMacros.${ext}`),
1347
1458
  sources: [
1348
- import_node_path5.default.join(moduleRoot, "Sources/FoundationMacros/PredicateMacro.swift"),
1349
- import_node_path5.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
1459
+ import_node_path6.default.join(moduleRoot, "Sources/FoundationMacros/PredicateMacro.swift"),
1460
+ import_node_path6.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
1350
1461
  ]
1351
1462
  },
1352
1463
  {
1353
- library: import_node_path5.default.join(dir, `libTipKitMacros.${ext}`),
1464
+ library: import_node_path6.default.join(dir, `libTipKitMacros.${ext}`),
1354
1465
  sources: [
1355
- import_node_path5.default.join(moduleRoot, "Sources/TipKitMacros/TipKitMacros.swift"),
1356
- import_node_path5.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
1466
+ import_node_path6.default.join(moduleRoot, "Sources/TipKitMacros/TipKitMacros.swift"),
1467
+ import_node_path6.default.join(moduleRoot, "Sources/SwiftMacroSupport/PredicateExpression.swift")
1357
1468
  ]
1358
1469
  }
1359
1470
  ];
1360
1471
  return {
1361
1472
  libraries: plugins.map(({ library }) => library),
1362
- stale: !(0, import_node_fs3.existsSync)(compilerStamp) || (0, import_node_fs3.readFileSync)(compilerStamp, "utf8").trim() !== release || plugins.some(
1363
- ({ library, sources }) => !(0, import_node_fs3.existsSync)(library) || sources.some((source) => (0, import_node_fs3.statSync)(source).mtimeMs > (0, import_node_fs3.statSync)(library).mtimeMs)
1473
+ stale: !(0, import_node_fs4.existsSync)(compilerStamp) || (0, import_node_fs4.readFileSync)(compilerStamp, "utf8").trim() !== release || plugins.some(
1474
+ ({ library, sources }) => !(0, import_node_fs4.existsSync)(library) || sources.some((source) => (0, import_node_fs4.statSync)(source).mtimeMs > (0, import_node_fs4.statSync)(library).mtimeMs)
1364
1475
  )
1365
1476
  };
1366
1477
  }
@@ -1370,14 +1481,14 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin, release, signal) {
1370
1481
  await runCompiler(
1371
1482
  "sh",
1372
1483
  [
1373
- import_node_path5.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
1484
+ import_node_path6.default.join(moduleRoot, "scripts/build-preview-plugin.sh"),
1374
1485
  toolchainBin,
1375
1486
  libraries[0]
1376
1487
  ],
1377
1488
  { signal }
1378
1489
  );
1379
- (0, import_node_fs3.writeFileSync)(
1380
- import_node_path5.default.join(import_node_path5.default.dirname(libraries[0]), "compiler-release"),
1490
+ (0, import_node_fs4.writeFileSync)(
1491
+ import_node_path6.default.join(import_node_path6.default.dirname(libraries[0]), "compiler-release"),
1381
1492
  `${release}
1382
1493
  `
1383
1494
  );
@@ -1391,9 +1502,9 @@ function clearLinkedModuleDigests(root) {
1391
1502
  }
1392
1503
  function swiftModuleDigest(root) {
1393
1504
  const files = swiftModuleInputFiles(root);
1394
- const stampHash = (0, import_node_crypto2.createHash)("sha256");
1505
+ const stampHash = (0, import_node_crypto3.createHash)("sha256");
1395
1506
  for (const file of files) {
1396
- const stat = (0, import_node_fs3.statSync)(import_node_path5.default.join(root, file), { bigint: true });
1507
+ const stat = (0, import_node_fs4.statSync)(import_node_path6.default.join(root, file), { bigint: true });
1397
1508
  stampHash.update(file);
1398
1509
  stampHash.update(
1399
1510
  `${stat.dev}:${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}
@@ -1403,11 +1514,11 @@ function swiftModuleDigest(root) {
1403
1514
  const stamp = stampHash.digest("hex");
1404
1515
  const cached = linkedModuleDigests.get(root);
1405
1516
  if (cached?.stamp === stamp) return cached.digest;
1406
- const hash = (0, import_node_crypto2.createHash)("sha256");
1517
+ const hash = (0, import_node_crypto3.createHash)("sha256");
1407
1518
  for (const file of files) {
1408
- hash.update((0, import_node_crypto2.createHash)("sha256").update(file).digest());
1519
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
1409
1520
  hash.update(
1410
- (0, import_node_crypto2.createHash)("sha256").update((0, import_node_fs3.readFileSync)(import_node_path5.default.join(root, file))).digest()
1521
+ (0, import_node_crypto3.createHash)("sha256").update((0, import_node_fs4.readFileSync)(import_node_path6.default.join(root, file))).digest()
1411
1522
  );
1412
1523
  }
1413
1524
  const digest = hash.digest();
@@ -1415,7 +1526,7 @@ function swiftModuleDigest(root) {
1415
1526
  return digest;
1416
1527
  }
1417
1528
  function swiftProjectBuildKey(moduleRoot, release) {
1418
- return (0, import_node_crypto2.createHash)("sha256").update(`${release}\0${swiftModuleSdk(moduleRoot).wasmSdkId}`).update(swiftModuleDigest(moduleRoot)).digest("hex").slice(0, 32);
1529
+ return (0, import_node_crypto3.createHash)("sha256").update(`${release}\0${swiftModuleSdk(moduleRoot).wasmSdkId}`).update(swiftModuleDigest(moduleRoot)).digest("hex").slice(0, 32);
1419
1530
  }
1420
1531
  function compileTargets(input) {
1421
1532
  const manifest = input.files["Package.swift"];
@@ -1431,7 +1542,7 @@ function withNativeSourceGlue(input, glue) {
1431
1542
  ...input,
1432
1543
  files: {
1433
1544
  ...input.files,
1434
- [import_node_path5.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
1545
+ [import_node_path6.default.posix.join(targetPath, "OneNativeSource.generated.swift")]: glue
1435
1546
  },
1436
1547
  oneModule: true
1437
1548
  };
@@ -1556,7 +1667,7 @@ function swiftImportNames(contents, available) {
1556
1667
  function swiftPeachModules(moduleRoot) {
1557
1668
  const distribution = swiftDistributionAt(moduleRoot);
1558
1669
  return distribution ? distribution.modules : [
1559
- ...(0, import_node_fs3.readFileSync)(import_node_path5.default.join(moduleRoot, "Package.swift"), "utf8").matchAll(
1670
+ ...(0, import_node_fs4.readFileSync)(import_node_path6.default.join(moduleRoot, "Package.swift"), "utf8").matchAll(
1560
1671
  /\.(?:target|systemLibrary)\(\s*name:\s*"([^"]+)"/g
1561
1672
  )
1562
1673
  ].map((match) => match[1]);
@@ -1567,8 +1678,8 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
1567
1678
  const key = JSON.stringify([toolchainBin, sdk, swiftSdkOptions()]);
1568
1679
  const cached = sdkPaths.get(key);
1569
1680
  if (cached) return cached;
1570
- const configuration = (0, import_node_child_process4.execFileSync)(
1571
- import_node_path5.default.join(toolchainBin, "swift"),
1681
+ const configuration = (0, import_node_child_process5.execFileSync)(
1682
+ import_node_path6.default.join(toolchainBin, "swift"),
1572
1683
  [
1573
1684
  "sdk",
1574
1685
  "configure",
@@ -1599,14 +1710,14 @@ function swiftAvailableModules(moduleRoot, toolchainBin) {
1599
1710
  if (cached) return cached;
1600
1711
  const modules = new Set(swiftPeachModules(moduleRoot));
1601
1712
  const { resources } = swiftSdkPaths(moduleRoot, toolchainBin);
1602
- for (const entry of (0, import_node_fs3.readdirSync)(import_node_path5.default.join(resources, "wasi"))) {
1713
+ for (const entry of (0, import_node_fs4.readdirSync)(import_node_path6.default.join(resources, "wasi"))) {
1603
1714
  if (entry.endsWith(".swiftmodule"))
1604
1715
  modules.add(entry.slice(0, -".swiftmodule".length));
1605
1716
  }
1606
- for (const entry of (0, import_node_fs3.readdirSync)(resources)) {
1607
- const map = import_node_path5.default.join(resources, entry, "module.modulemap");
1608
- if (!(0, import_node_fs3.existsSync)(map)) continue;
1609
- for (const match of (0, import_node_fs3.readFileSync)(map, "utf8").matchAll(/^module\s+([A-Za-z_]\w*)/gm))
1717
+ for (const entry of (0, import_node_fs4.readdirSync)(resources)) {
1718
+ const map = import_node_path6.default.join(resources, entry, "module.modulemap");
1719
+ if (!(0, import_node_fs4.existsSync)(map)) continue;
1720
+ for (const match of (0, import_node_fs4.readFileSync)(map, "utf8").matchAll(/^module\s+([A-Za-z_]\w*)/gm))
1610
1721
  modules.add(match[1]);
1611
1722
  }
1612
1723
  availableModules.set(key, modules);
@@ -1670,9 +1781,9 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
1670
1781
  `;
1671
1782
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
1672
1783
  var MULTI_MANIFEST_VERSION = 39;
1673
- var compilerSourceDigest = true ? "0c614fef8e4e656ac3500002f7d1f2746f20f462321142e2f69a93e94f2321c4" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
1784
+ var compilerSourceDigest = true ? "ee2738333bb81c79211d5bee8a503c539cf65f25c95fb024c45b840450b5359e" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
1674
1785
  function swiftArtifactHash(input, release, moduleRoot) {
1675
- const hash = (0, import_node_crypto2.createHash)("sha256");
1786
+ const hash = (0, import_node_crypto3.createHash)("sha256");
1676
1787
  hash.update(`swift-compile
1677
1788
  ${release}
1678
1789
  `);
@@ -1680,32 +1791,32 @@ ${release}
1680
1791
  if (input.oneModule) hash.update("one-module\n");
1681
1792
  hash.update(swiftModuleDigest(moduleRoot));
1682
1793
  for (const file of Object.keys(input.files).sort()) {
1683
- hash.update((0, import_node_crypto2.createHash)("sha256").update(file).digest());
1684
- hash.update((0, import_node_crypto2.createHash)("sha256").update(input.files[file]).digest());
1794
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
1795
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(input.files[file]).digest());
1685
1796
  }
1686
1797
  for (const file of Object.keys(input.metalSources ?? {}).sort()) {
1687
1798
  hash.update("metal-source\n");
1688
- hash.update((0, import_node_crypto2.createHash)("sha256").update(file).digest());
1799
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
1689
1800
  hash.update(
1690
- (0, import_node_crypto2.createHash)("sha256").update(input.metalSources?.[file] ?? "").digest()
1801
+ (0, import_node_crypto3.createHash)("sha256").update(input.metalSources?.[file] ?? "").digest()
1691
1802
  );
1692
1803
  }
1693
1804
  for (const base of Object.keys(input.resources ?? {}).sort()) {
1694
- hash.update((0, import_node_crypto2.createHash)("sha256").update(base).digest());
1805
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(base).digest());
1695
1806
  hash.update(
1696
- (0, import_node_crypto2.createHash)("sha256").update(input.resources?.[base] ?? "").digest()
1807
+ (0, import_node_crypto3.createHash)("sha256").update(input.resources?.[base] ?? "").digest()
1697
1808
  );
1698
1809
  }
1699
1810
  for (const name of Object.keys(input.images ?? {}).sort()) {
1700
1811
  const image = input.images?.[name];
1701
1812
  if (!image) continue;
1702
- hash.update((0, import_node_crypto2.createHash)("sha256").update(name).digest());
1703
- hash.update((0, import_node_crypto2.createHash)("sha256").update(image.file).digest());
1704
- hash.update((0, import_node_crypto2.createHash)("sha256").update(image.data).digest());
1813
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(name).digest());
1814
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(image.file).digest());
1815
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(image.data).digest());
1705
1816
  }
1706
1817
  for (const file of [...new Set(input.resourcePaths ?? [])].sort()) {
1707
1818
  hash.update("resource-path\n");
1708
- hash.update((0, import_node_crypto2.createHash)("sha256").update(file).digest());
1819
+ hash.update((0, import_node_crypto3.createHash)("sha256").update(file).digest());
1709
1820
  }
1710
1821
  hash.update(
1711
1822
  JSON.stringify(
@@ -1717,7 +1828,7 @@ ${release}
1717
1828
  ${target}
1718
1829
  `);
1719
1830
  hash.update(
1720
- (0, import_node_crypto2.createHash)("sha256").update(input.libraries?.[target] ?? "").digest()
1831
+ (0, import_node_crypto3.createHash)("sha256").update(input.libraries?.[target] ?? "").digest()
1721
1832
  );
1722
1833
  }
1723
1834
  const targets = compileTargets(input);
@@ -1764,21 +1875,21 @@ function emitSwiftPackageManifest(args) {
1764
1875
  distributionLink.files.set(
1765
1876
  distributionLink.path,
1766
1877
  objects.map(
1767
- (object) => `"${import_node_path5.default.join(moduleRoot, object).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`
1878
+ (object) => `"${import_node_path6.default.join(moduleRoot, object).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`
1768
1879
  ).join("\n") + "\n"
1769
1880
  );
1770
1881
  }
1771
- const overlayRoot = import_node_path5.default.join(
1882
+ const overlayRoot = import_node_path6.default.join(
1772
1883
  moduleRoot,
1773
1884
  distribution ? "modules" : "cross-import-overlays"
1774
1885
  );
1775
- const overlayFlags = (0, import_node_fs3.readdirSync)(overlayRoot, { encoding: "utf8", recursive: true }).filter((file) => file.endsWith(".swiftoverlay")).sort((left, right) => left.localeCompare(right)).flatMap((file) => [
1886
+ const overlayFlags = (0, import_node_fs4.readdirSync)(overlayRoot, { encoding: "utf8", recursive: true }).filter((file) => file.endsWith(".swiftoverlay")).sort((left, right) => left.localeCompare(right)).flatMap((file) => [
1776
1887
  "-Xfrontend",
1777
1888
  "-swift-module-cross-import",
1778
1889
  "-Xfrontend",
1779
- import_node_path5.default.basename(import_node_path5.default.dirname(file), ".swiftcrossimport"),
1890
+ import_node_path6.default.basename(import_node_path6.default.dirname(file), ".swiftcrossimport"),
1780
1891
  "-Xfrontend",
1781
- import_node_path5.default.join(overlayRoot, file)
1892
+ import_node_path6.default.join(overlayRoot, file)
1782
1893
  ]).map((flag) => `, ${JSON.stringify(flag)}`).join("");
1783
1894
  const executable = targets.find((target) => target.executable);
1784
1895
  if (!executable) throw new Error("swift-compile: no executable target to emit");
@@ -1788,14 +1899,14 @@ function emitSwiftPackageManifest(args) {
1788
1899
  const isolation = target.mainActorIsolation ? " .defaultIsolation(MainActor.self)," : "";
1789
1900
  const interoperability = target.cxxInterop ? " .interoperabilityMode(.Cxx)," : "";
1790
1901
  const defines = (target.defines ?? []).map((name) => ` .define(${JSON.stringify(name)}),`).join("");
1791
- const imports = distribution ? `, "-I", ${JSON.stringify(import_node_path5.default.join(moduleRoot, "modules"))}` : "";
1902
+ const imports = distribution ? `, "-I", ${JSON.stringify(import_node_path6.default.join(moduleRoot, "modules"))}` : "";
1792
1903
  const native = args.native?.get(target.name);
1793
1904
  const nativeImports = (siblings.get(target.name) ?? []).filter((name) => args.native?.has(name)).map(
1794
1905
  (name) => `, "-Xfrontend", "-import-module", "-Xfrontend", ${JSON.stringify(swiftTargetModuleName(name))}`
1795
1906
  ).join("");
1796
1907
  const header = args.headerDirectory && [...args.native?.values() ?? []].some(
1797
1908
  (value) => value.late?.producers.includes(target.name)
1798
- ) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path5.default.join(args.headerDirectory, `${target.name}-Swift.h`))}` : "";
1909
+ ) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path6.default.join(args.headerDirectory, `${target.name}-Swift.h`))}` : "";
1799
1910
  const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines} .unsafeFlags(["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports}${nativeImports}${header}])]`;
1800
1911
  const deps = [
1801
1912
  ...target.executable ? [...args.native?.values() ?? []].flatMap(
@@ -1810,7 +1921,7 @@ function emitSwiftPackageManifest(args) {
1810
1921
  (dependency) => OPTIONAL_FRAMEWORKS.has(dependency) && !targets.some((candidate) => candidate.name === dependency) ? distribution ? [] : [`.product(name: "${dependency}", package: "sootsim-swift")`] : [`"${dependency}"`]
1811
1922
  )
1812
1923
  ].join(", ");
1813
- const library = distribution && distributionLink ? ["-Xlinker", `@${distributionLink.path}`, ...distribution.link].map((flag) => `, ${JSON.stringify(flag)}`).join("") : "";
1924
+ const library = distribution && distributionLink ? ["-Xclang-linker", `--config=${distributionLink.path}`, ...distribution.link].map((flag) => `, ${JSON.stringify(flag)}`).join("") : "";
1814
1925
  const kind = target.executable ? ".executableTarget" : ".target";
1815
1926
  const linkedLibraries = (target.linkedLibraries ?? []).map(
1816
1927
  (name) => `.linkedLibrary(${JSON.stringify(name)})`
@@ -1868,21 +1979,21 @@ function emitSwiftPackageManifest(args) {
1868
1979
  ].join("\n");
1869
1980
  }
1870
1981
  function syncSwiftTree(base, files) {
1871
- (0, import_node_fs3.mkdirSync)(base, { recursive: true });
1982
+ (0, import_node_fs4.mkdirSync)(base, { recursive: true });
1872
1983
  const walk = (dir) => {
1873
- for (const entry of (0, import_node_fs3.readdirSync)(dir, { withFileTypes: true })) {
1874
- const full = import_node_path5.default.join(dir, entry.name);
1984
+ for (const entry of (0, import_node_fs4.readdirSync)(dir, { withFileTypes: true })) {
1985
+ const full = import_node_path6.default.join(dir, entry.name);
1875
1986
  if (dir === base && entry.name === ".build") continue;
1876
1987
  if (entry.isDirectory()) walk(full);
1877
- else if (!files.has(full)) (0, import_node_fs3.rmSync)(full, { force: true });
1988
+ else if (!files.has(full)) (0, import_node_fs4.rmSync)(full, { force: true });
1878
1989
  }
1879
1990
  };
1880
1991
  walk(base);
1881
1992
  for (const [full, contents] of files) {
1882
- if ((0, import_node_fs3.existsSync)(full) && (typeof contents === "string" ? (0, import_node_fs3.readFileSync)(full, "utf8") === contents : (0, import_node_fs3.readFileSync)(full).equals(contents)))
1993
+ if ((0, import_node_fs4.existsSync)(full) && (typeof contents === "string" ? (0, import_node_fs4.readFileSync)(full, "utf8") === contents : (0, import_node_fs4.readFileSync)(full).equals(contents)))
1883
1994
  continue;
1884
- (0, import_node_fs3.mkdirSync)(import_node_path5.default.dirname(full), { recursive: true });
1885
- (0, import_node_fs3.writeFileSync)(full, contents);
1995
+ (0, import_node_fs4.mkdirSync)(import_node_path6.default.dirname(full), { recursive: true });
1996
+ (0, import_node_fs4.writeFileSync)(full, contents);
1886
1997
  }
1887
1998
  }
1888
1999
  var DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
@@ -5595,7 +5706,7 @@ function swiftApplicationEntry(file, source) {
5595
5706
  else if (source[at] === "}") depth--;
5596
5707
  else if (depth === 0 && /^@(?:main|UIApplicationMain)\b/.test(source.slice(at)))
5597
5708
  return true;
5598
- else if (depth === 0 && import_node_path5.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
5709
+ else if (depth === 0 && import_node_path6.default.basename(file) === "main.swift" && /^UIApplicationMain\s*\(/.test(source.slice(at)))
5599
5710
  return true;
5600
5711
  }
5601
5712
  return false;
@@ -5695,33 +5806,33 @@ function swiftCodeScan(source) {
5695
5806
  return { lineStarts: starts, tokens };
5696
5807
  }
5697
5808
  function prepareSwiftDependency(source, destination) {
5698
- (0, import_node_fs3.rmSync)(destination, { recursive: true, force: true });
5809
+ (0, import_node_fs4.rmSync)(destination, { recursive: true, force: true });
5699
5810
  const origins = {};
5700
5811
  const gather = (from) => {
5701
- for (const entry of (0, import_node_fs3.readdirSync)(from, { withFileTypes: true })) {
5812
+ for (const entry of (0, import_node_fs4.readdirSync)(from, { withFileTypes: true })) {
5702
5813
  if (entry.name === ".git" || entry.name === ".build" || entry.name === ".swiftpm")
5703
5814
  continue;
5704
- const file = import_node_path5.default.join(from, entry.name);
5815
+ const file = import_node_path6.default.join(from, entry.name);
5705
5816
  if (entry.isDirectory()) gather(file);
5706
5817
  else if (entry.isFile() && entry.name.endsWith(".swift"))
5707
- origins[import_node_path5.default.relative(source, file)] = (0, import_node_fs3.readFileSync)(file, "utf8");
5818
+ origins[import_node_path6.default.relative(source, file)] = (0, import_node_fs4.readFileSync)(file, "utf8");
5708
5819
  }
5709
5820
  };
5710
5821
  gather(source);
5711
- const manifest = import_node_path5.default.join(source, "Package.swift");
5712
- const targets = (0, import_node_fs3.existsSync)(manifest) ? swiftManifestTargets((0, import_node_fs3.readFileSync)(manifest, "utf8")) : [];
5822
+ const manifest = import_node_path6.default.join(source, "Package.swift");
5823
+ const targets = (0, import_node_fs4.existsSync)(manifest) ? swiftManifestTargets((0, import_node_fs4.readFileSync)(manifest, "utf8")) : [];
5713
5824
  const compiled = compiledSwiftSources(origins, targets);
5714
5825
  const copy = (from, to) => {
5715
- (0, import_node_fs3.mkdirSync)(to, { recursive: true });
5716
- for (const entry of (0, import_node_fs3.readdirSync)(from, { withFileTypes: true })) {
5826
+ (0, import_node_fs4.mkdirSync)(to, { recursive: true });
5827
+ for (const entry of (0, import_node_fs4.readdirSync)(from, { withFileTypes: true })) {
5717
5828
  if (entry.name === ".git" || entry.name === ".build" || entry.name === ".swiftpm")
5718
5829
  continue;
5719
- const file = import_node_path5.default.join(from, entry.name);
5720
- const target = import_node_path5.default.join(to, entry.name);
5830
+ const file = import_node_path6.default.join(from, entry.name);
5831
+ const target = import_node_path6.default.join(to, entry.name);
5721
5832
  if (entry.isDirectory()) copy(file, target);
5722
5833
  else if (entry.isFile() && entry.name.endsWith(".swift"))
5723
- (0, import_node_fs3.writeFileSync)(target, compiled.get(import_node_path5.default.relative(source, file)));
5724
- else (0, import_node_fs3.cpSync)(file, target, { verbatimSymlinks: true });
5834
+ (0, import_node_fs4.writeFileSync)(target, compiled.get(import_node_path6.default.relative(source, file)));
5835
+ else (0, import_node_fs4.cpSync)(file, target, { verbatimSymlinks: true });
5725
5836
  }
5726
5837
  };
5727
5838
  copy(source, destination);
@@ -5737,7 +5848,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5737
5848
  const targets = distribution && compileTargets(input).length === 0 ? [
5738
5849
  {
5739
5850
  name: "App",
5740
- path: import_node_path5.default.relative(layout.root, layout.sources),
5851
+ path: import_node_path6.default.relative(layout.root, layout.sources),
5741
5852
  executable: true,
5742
5853
  languageMode: 5,
5743
5854
  mainActorIsolation: false,
@@ -5746,7 +5857,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5746
5857
  ] : compileTargets(input);
5747
5858
  const files = /* @__PURE__ */ new Map();
5748
5859
  const native = /* @__PURE__ */ new Map();
5749
- const headerDirectory = import_node_path5.default.join(layout.root, ".build", "peach-cxx-headers");
5860
+ const headerDirectory = import_node_path6.default.join(layout.root, ".build", "peach-cxx-headers");
5750
5861
  for (const target of targets) {
5751
5862
  const prefix = target.path === "." ? "" : `${target.path}/`;
5752
5863
  const entries = Object.entries(input.files).filter(
@@ -5769,7 +5880,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5769
5880
  if (producer && targets.some((value) => value.name === producer))
5770
5881
  producers.add(producer);
5771
5882
  const local = [
5772
- import_node_path5.default.posix.join(import_node_path5.default.posix.dirname(file), include),
5883
+ import_node_path6.default.posix.join(import_node_path6.default.posix.dirname(file), include),
5773
5884
  `${includes}${include}`
5774
5885
  ].find((candidate) => input.files[candidate] !== void 0);
5775
5886
  if (local) {
@@ -5791,7 +5902,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5791
5902
  const late = units.filter(([file]) => consumers.get(file).size > 0);
5792
5903
  native.set(target.name, {
5793
5904
  path: target.path,
5794
- includeDirectory: import_node_path5.default.join(layout.root, includes),
5905
+ includeDirectory: import_node_path6.default.join(layout.root, includes),
5795
5906
  lateSources: late.map(([file]) => file.slice(prefix.length)),
5796
5907
  ...late.length > 0 ? {
5797
5908
  late: {
@@ -5808,7 +5919,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5808
5919
  ([file]) => file.startsWith(includes) && /\.(?:h|hpp|hh|hxx)$/.test(file) && consumers.get(file).size === 0
5809
5920
  );
5810
5921
  files.set(
5811
- import_node_path5.default.join(layout.root, includes, "module.modulemap"),
5922
+ import_node_path6.default.join(layout.root, includes, "module.modulemap"),
5812
5923
  [
5813
5924
  `module ${target.name} {`,
5814
5925
  ...roots.map(
@@ -5820,14 +5931,14 @@ function writeSwiftProject(layout, input, moduleRoot) {
5820
5931
  ].join("\n")
5821
5932
  );
5822
5933
  }
5823
- if (native.size > 0) (0, import_node_fs3.mkdirSync)(headerDirectory, { recursive: true });
5824
- const modulePlan = (0, import_node_crypto2.createHash)("sha256").update(
5934
+ if (native.size > 0) (0, import_node_fs4.mkdirSync)(headerDirectory, { recursive: true });
5935
+ const modulePlan = (0, import_node_crypto3.createHash)("sha256").update(
5825
5936
  swiftModuleInputFiles(moduleRoot).join("\n")
5826
5937
  );
5827
5938
  if (!distribution) {
5828
- modulePlan.update((0, import_node_fs3.readFileSync)(import_node_path5.default.join(moduleRoot, "Package.swift")));
5939
+ modulePlan.update((0, import_node_fs4.readFileSync)(import_node_path6.default.join(moduleRoot, "Package.swift")));
5829
5940
  }
5830
- const resourcePlan = (0, import_node_crypto2.createHash)("sha256").update(
5941
+ const resourcePlan = (0, import_node_crypto3.createHash)("sha256").update(
5831
5942
  JSON.stringify(
5832
5943
  resourceTargets.filter((target) => target.resources).map((target) => [
5833
5944
  target.name,
@@ -5852,10 +5963,10 @@ function writeSwiftProject(layout, input, moduleRoot) {
5852
5963
  if (targets.length === 0) {
5853
5964
  for (const [file, contents] of Object.entries(input.files)) {
5854
5965
  if (file === "Package.swift") continue;
5855
- files.set(import_node_path5.default.join(layout.sources, file), compiled.get(file) ?? contents);
5966
+ files.set(import_node_path6.default.join(layout.sources, file), compiled.get(file) ?? contents);
5856
5967
  }
5857
- let manifest = (0, import_node_fs3.readFileSync)(
5858
- import_node_path5.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
5968
+ let manifest = (0, import_node_fs4.readFileSync)(
5969
+ import_node_path6.default.join(moduleRoot, "scripts/contrast-app-Package.swift"),
5859
5970
  "utf8"
5860
5971
  ).replaceAll("__SOOTSIM_SWIFT_PACKAGE__", moduleRoot);
5861
5972
  const reactor = ` ${REACTOR_FLAG}`;
@@ -5899,21 +6010,21 @@ function writeSwiftProject(layout, input, moduleRoot) {
5899
6010
  manifest = manifest.replace(anchor, `${anchor}
5900
6011
  ${SPRITEKIT_PRODUCT},`);
5901
6012
  }
5902
- files.set(import_node_path5.default.join(layout.root, "Package.swift"), manifest + moduleFiles);
6013
+ files.set(import_node_path6.default.join(layout.root, "Package.swift"), manifest + moduleFiles);
5903
6014
  } else {
5904
6015
  const base = layout.multi ? layout.root : layout.sources;
5905
6016
  const libraries = /* @__PURE__ */ new Map();
5906
6017
  for (const [target, data] of Object.entries(input.libraries ?? {})) {
5907
- const file = import_node_path5.default.join(layout.root, ".peach-libraries", `lib${target}.a`);
6018
+ const file = import_node_path6.default.join(layout.root, ".peach-libraries", `lib${target}.a`);
5908
6019
  files.set(file, Buffer.from(data, "base64"));
5909
6020
  libraries.set(target, file);
5910
6021
  }
5911
6022
  for (const [file, contents] of Object.entries(input.files)) {
5912
6023
  if (file === "Package.swift") continue;
5913
- files.set(import_node_path5.default.join(base, file), compiled.get(file) ?? contents);
6024
+ files.set(import_node_path6.default.join(base, file), compiled.get(file) ?? contents);
5914
6025
  }
5915
6026
  files.set(
5916
- import_node_path5.default.join(layout.root, "Package.swift"),
6027
+ import_node_path6.default.join(layout.root, "Package.swift"),
5917
6028
  emitSwiftPackageManifest({
5918
6029
  targets,
5919
6030
  native,
@@ -5930,7 +6041,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
5930
6041
  spriteKit: importsSpriteKit(input.files),
5931
6042
  distribution: distribution ?? void 0,
5932
6043
  distributionLink: {
5933
- path: import_node_path5.default.join(layout.root, ".peach-distribution-objects.rsp"),
6044
+ path: import_node_path6.default.join(layout.root, ".peach-distribution-objects.rsp"),
5934
6045
  files
5935
6046
  },
5936
6047
  libraries
@@ -5946,9 +6057,9 @@ function writeSwiftProject(layout, input, moduleRoot) {
5946
6057
  throw new Error(
5947
6058
  `swift resource target ${target.name} has no matching bundle assignment`
5948
6059
  );
5949
- const directory = layout.multi ? import_node_path5.default.join(layout.root, target.path) : layout.sources;
6060
+ const directory = layout.multi ? import_node_path6.default.join(layout.root, target.path) : layout.sources;
5950
6061
  files.set(
5951
- import_node_path5.default.join(directory, "ResourceBundleAccessor.generated.swift"),
6062
+ import_node_path6.default.join(directory, "ResourceBundleAccessor.generated.swift"),
5952
6063
  [
5953
6064
  "import Foundation",
5954
6065
  "",
@@ -5981,15 +6092,15 @@ function outputOf(error) {
5981
6092
  return error instanceof Error ? error.message : String(error);
5982
6093
  }
5983
6094
  function builtArtifact(layout) {
5984
- const binDir = import_node_path5.default.join(layout.root, ".build", WASM_TRIPLE, "release");
5985
- const manifest = (0, import_node_fs3.readFileSync)(import_node_path5.default.join(layout.root, "Package.swift"), "utf8");
6095
+ const binDir = import_node_path6.default.join(layout.root, ".build", WASM_TRIPLE, "release");
6096
+ const manifest = (0, import_node_fs4.readFileSync)(import_node_path6.default.join(layout.root, "Package.swift"), "utf8");
5986
6097
  const executable = swiftManifestTargets(manifest).find((target) => target.executable);
5987
6098
  if (executable === void 0) {
5988
6099
  throw new Error("swift-compile: the written manifest names no executable target");
5989
6100
  }
5990
- const file = import_node_path5.default.join(binDir, `${executable.name}.wasm`);
5991
- if (!(0, import_node_fs3.existsSync)(file)) {
5992
- const found = (0, import_node_fs3.existsSync)(binDir) ? (0, import_node_fs3.readdirSync)(binDir).filter((name) => name.endsWith(".wasm")).sort() : [];
6101
+ const file = import_node_path6.default.join(binDir, `${executable.name}.wasm`);
6102
+ if (!(0, import_node_fs4.existsSync)(file)) {
6103
+ const found = (0, import_node_fs4.existsSync)(binDir) ? (0, import_node_fs4.readdirSync)(binDir).filter((name) => name.endsWith(".wasm")).sort() : [];
5993
6104
  throw new Error(
5994
6105
  `swift-compile: the build produced no ${executable.name}.wasm (found: ${found.join(", ") || "none"})`
5995
6106
  );
@@ -5998,7 +6109,7 @@ function builtArtifact(layout) {
5998
6109
  }
5999
6110
  function projectDiagnostic(output, layout, files) {
6000
6111
  const base = layout.multi ? layout.root : layout.sources;
6001
- const prefix = `${base}${import_node_path5.default.sep}`;
6112
+ const prefix = `${base}${import_node_path6.default.sep}`;
6002
6113
  return designTimeDiagnostic(output, files).split("\n").filter((line) => !SWIFTPM_NOISE.test(line)).map((line) => line.startsWith(prefix) ? line.slice(prefix.length) : line).join("\n").trim();
6003
6114
  }
6004
6115
  var ROOT_LOCKS = Symbol.for("peachsim.swiftCompile.rootLocks");
@@ -6034,13 +6145,13 @@ function serialize(root, work, signal) {
6034
6145
  function readCompiledArtifact(directory, hash) {
6035
6146
  try {
6036
6147
  const receipt = JSON.parse(
6037
- (0, import_node_fs3.readFileSync)(import_node_path5.default.join(directory, "artifact.json"), "utf8")
6148
+ (0, import_node_fs4.readFileSync)(import_node_path6.default.join(directory, "artifact.json"), "utf8")
6038
6149
  );
6039
6150
  if (!receipt || typeof receipt !== "object" || !("hash" in receipt) || receipt.hash !== hash || !("icu" in receipt) || typeof receipt.icu !== "string" || !("wasm" in receipt) || typeof receipt.wasm !== "string")
6040
6151
  return null;
6041
- const bytes = (0, import_node_fs3.readFileSync)(import_node_path5.default.join(directory, "app.wasm"));
6042
- const gzip2 = (0, import_node_fs3.readFileSync)(import_node_path5.default.join(directory, "icu.gz"));
6043
- if ((0, import_node_crypto2.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto2.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length < 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
6152
+ const bytes = (0, import_node_fs4.readFileSync)(import_node_path6.default.join(directory, "app.wasm"));
6153
+ const gzip2 = (0, import_node_fs4.readFileSync)(import_node_path6.default.join(directory, "icu.gz"));
6154
+ if ((0, import_node_crypto3.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto3.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length < 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
6044
6155
  return null;
6045
6156
  return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 } };
6046
6157
  } catch (error) {
@@ -6050,25 +6161,25 @@ function readCompiledArtifact(directory, hash) {
6050
6161
  }
6051
6162
  }
6052
6163
  function saveCompiledArtifact(root, artifact) {
6053
- const directory = import_node_path5.default.join(root, "artifact");
6054
- (0, import_node_fs3.mkdirSync)(directory, { recursive: true });
6055
- const pending = (0, import_node_fs3.mkdtempSync)(import_node_path5.default.join(root, ".artifact-"));
6164
+ const directory = import_node_path6.default.join(root, "artifact");
6165
+ (0, import_node_fs4.mkdirSync)(directory, { recursive: true });
6166
+ const pending = (0, import_node_fs4.mkdtempSync)(import_node_path6.default.join(root, ".artifact-"));
6056
6167
  try {
6057
- (0, import_node_fs3.writeFileSync)(import_node_path5.default.join(pending, "app.wasm"), artifact.bytes);
6058
- (0, import_node_fs3.writeFileSync)(import_node_path5.default.join(pending, "icu.gz"), artifact.icu.gzip);
6059
- (0, import_node_fs3.writeFileSync)(
6060
- import_node_path5.default.join(pending, "artifact.json"),
6168
+ (0, import_node_fs4.writeFileSync)(import_node_path6.default.join(pending, "app.wasm"), artifact.bytes);
6169
+ (0, import_node_fs4.writeFileSync)(import_node_path6.default.join(pending, "icu.gz"), artifact.icu.gzip);
6170
+ (0, import_node_fs4.writeFileSync)(
6171
+ import_node_path6.default.join(pending, "artifact.json"),
6061
6172
  JSON.stringify({
6062
6173
  hash: artifact.hash,
6063
- wasm: (0, import_node_crypto2.createHash)("sha256").update(artifact.bytes).digest("hex"),
6174
+ wasm: (0, import_node_crypto3.createHash)("sha256").update(artifact.bytes).digest("hex"),
6064
6175
  icu: artifact.icu.sha256
6065
6176
  })
6066
6177
  );
6067
6178
  for (const file of ["app.wasm", "icu.gz", "artifact.json"]) {
6068
- (0, import_node_fs3.renameSync)(import_node_path5.default.join(pending, file), import_node_path5.default.join(directory, file));
6179
+ (0, import_node_fs4.renameSync)(import_node_path6.default.join(pending, file), import_node_path6.default.join(directory, file));
6069
6180
  }
6070
6181
  } finally {
6071
- (0, import_node_fs3.rmSync)(pending, { recursive: true, force: true });
6182
+ (0, import_node_fs4.rmSync)(pending, { recursive: true, force: true });
6072
6183
  }
6073
6184
  }
6074
6185
  var retainedArtifacts = /* @__PURE__ */ new Map();
@@ -6084,17 +6195,20 @@ function retain(root, artifact) {
6084
6195
  }
6085
6196
  function compileSwiftProjectUnit(input, options) {
6086
6197
  options.signal?.throwIfAborted();
6087
- (0, import_node_fs3.mkdirSync)(options.buildRoot, { recursive: true });
6088
- const root = (0, import_node_fs3.realpathSync)(options.buildRoot);
6089
- const moduleRoot = import_node_path5.default.resolve(options.moduleRoot);
6198
+ (0, import_node_fs4.mkdirSync)(options.buildRoot, { recursive: true });
6199
+ const root = (0, import_node_fs4.realpathSync)(options.buildRoot);
6200
+ const moduleRoot = import_node_path6.default.resolve(options.moduleRoot);
6090
6201
  const layout = {
6091
6202
  root,
6092
- sources: import_node_path5.default.join(root, "Sources", "App"),
6203
+ sources: import_node_path6.default.join(root, "Sources", "App"),
6093
6204
  multi: compileTargets(input).length > 0
6094
6205
  };
6095
6206
  const hash = swiftArtifactHash(input, options.release, moduleRoot);
6096
- const sharedRoot = import_node_path5.default.join(rnxHomeDir(), "cache", "swift-projects", hash);
6097
- const report = (message) => console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`);
6207
+ const sharedRoot = import_node_path6.default.join(rnxHomeDir(), "cache", "swift-projects", hash);
6208
+ const report = (message) => {
6209
+ console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`);
6210
+ options.onStage?.(message);
6211
+ };
6098
6212
  report("checking verified artifacts");
6099
6213
  return serialize(
6100
6214
  root,
@@ -6104,18 +6218,18 @@ function compileSwiftProjectUnit(input, options) {
6104
6218
  report("reusing memory artifact");
6105
6219
  return retain(root, retained);
6106
6220
  }
6107
- const cached = readCompiledArtifact(import_node_path5.default.join(sharedRoot, "artifact"), hash);
6108
- const previous = cached ?? readCompiledArtifact(import_node_path5.default.join(root, "artifact"), hash);
6221
+ const cached = readCompiledArtifact(import_node_path6.default.join(sharedRoot, "artifact"), hash);
6222
+ const previous = cached ?? readCompiledArtifact(import_node_path6.default.join(root, "artifact"), hash);
6109
6223
  if (previous) {
6110
6224
  if (!cached) saveCompiledArtifact(sharedRoot, previous);
6111
6225
  report("reusing verified disk artifact");
6112
6226
  return retain(root, previous);
6113
6227
  }
6114
- if (process.platform === "darwin" && process.env.TM_SESSION && !admittedMacBuilderSlot() && process.env.CI !== "true" && moduleRoot === import_node_path5.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
6115
- const requestRoot = (0, import_node_fs3.mkdtempSync)(import_node_path5.default.join(root, ".builder-request-"));
6116
- const output = import_node_path5.default.join(requestRoot, "output");
6117
- const request = import_node_path5.default.join(requestRoot, "request.json");
6118
- (0, import_node_fs3.writeFileSync)(
6228
+ if (process.platform === "darwin" && process.env.TM_SESSION && !admittedMacBuilderSlot() && process.env.CI !== "true" && moduleRoot === import_node_path6.default.resolve(__sootsim_import_meta_dirname, "../../sootsim-swift") && !swiftDistributionAt(moduleRoot)) {
6229
+ const requestRoot = (0, import_node_fs4.mkdtempSync)(import_node_path6.default.join(root, ".builder-request-"));
6230
+ const output = import_node_path6.default.join(requestRoot, "output");
6231
+ const request = import_node_path6.default.join(requestRoot, "request.json");
6232
+ (0, import_node_fs4.writeFileSync)(
6119
6233
  request,
6120
6234
  JSON.stringify({
6121
6235
  input,
@@ -6128,12 +6242,12 @@ function compileSwiftProjectUnit(input, options) {
6128
6242
  })
6129
6243
  );
6130
6244
  try {
6131
- const repo = import_node_path5.default.resolve(moduleRoot, "../..");
6245
+ const repo = import_node_path6.default.resolve(moduleRoot, "../..");
6132
6246
  report("requesting builder admission or cached result");
6133
6247
  await runCompiler(
6134
6248
  "bun",
6135
6249
  [
6136
- import_node_path5.default.join(repo, "scripts/build/swift-project.ts"),
6250
+ import_node_path6.default.join(repo, "scripts/build/swift-project.ts"),
6137
6251
  "--request",
6138
6252
  request,
6139
6253
  "--output",
@@ -6150,93 +6264,88 @@ function compileSwiftProjectUnit(input, options) {
6150
6264
  if (options.signal?.aborted) throw error;
6151
6265
  throw new Error(outputOf(error), { cause: error });
6152
6266
  });
6153
- const artifact2 = readCompiledArtifact(output, hash);
6154
- if (!artifact2) {
6267
+ const artifact = readCompiledArtifact(output, hash);
6268
+ if (!artifact) {
6155
6269
  throw new Error(
6156
6270
  "swift-compile: builder artifact source, digest or wasm header is invalid"
6157
6271
  );
6158
6272
  }
6159
- saveCompiledArtifact(root, artifact2);
6160
- saveCompiledArtifact(sharedRoot, artifact2);
6273
+ saveCompiledArtifact(root, artifact);
6274
+ saveCompiledArtifact(sharedRoot, artifact);
6161
6275
  report("builder artifact verified");
6162
- return retain(root, artifact2);
6276
+ return retain(root, artifact);
6163
6277
  } finally {
6164
- (0, import_node_fs3.rmSync)(requestRoot, { recursive: true, force: true });
6278
+ (0, import_node_fs4.rmSync)(requestRoot, { recursive: true, force: true });
6165
6279
  }
6166
6280
  }
6167
- writeSwiftProject(layout, input, moduleRoot);
6168
- const swift = import_node_path5.default.join(options.toolchainBin, "swift");
6169
- if (!(0, import_node_fs3.existsSync)(swift)) {
6170
- throw new Error(
6171
- `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
6172
- );
6173
- }
6174
- report("preparing compiler plugins");
6175
- const macroPlugins = await ensureMacroPlugins(
6176
- moduleRoot,
6177
- options.toolchainBin,
6178
- options.release,
6179
- options.signal
6180
- );
6181
- const sdk = swiftModuleSdk(moduleRoot).wasmSdkId;
6182
- const icu = swiftIcuAsset(options.toolchainBin, sdk);
6183
- const buildArgs = [
6184
- "build",
6185
- ...swiftPackageCacheOptions(),
6186
- "--build-system",
6187
- "native",
6188
- "-j",
6189
- BUILD_JOBS,
6190
- "--package-path",
6281
+ return withSwiftRootLock(
6191
6282
  root,
6192
- ...swiftSdkOptions(),
6193
- "--swift-sdk",
6194
- sdk,
6195
- "-c",
6196
- "release",
6197
- "-Xswiftc",
6198
- "-Osize",
6199
- "-Xswiftc",
6200
- "-num-threads",
6201
- "-Xswiftc",
6202
- BUILD_JOBS,
6203
- ...macroPlugins.flatMap((plugin) => [
6204
- "-Xswiftc",
6205
- "-load-plugin-library",
6206
- "-Xswiftc",
6207
- plugin
6208
- ])
6209
- ];
6210
- const buildOptions = {
6211
- env: {
6212
- ...process.env,
6213
- // shipped host plugins resolve against the selected compiler's runtime.
6214
- ...process.platform === "linux" ? {
6215
- LD_LIBRARY_PATH: [
6216
- import_node_path5.default.resolve(options.toolchainBin, "../lib/swift/linux"),
6217
- import_node_path5.default.resolve(options.toolchainBin, "../lib/swift/host"),
6218
- process.env.LD_LIBRARY_PATH
6219
- ].filter(Boolean).join(":")
6220
- } : {}
6221
- },
6222
- maxBuffer: 64 * 1024 * 1024,
6223
- timeout: options.timeoutMs,
6224
- signal: options.signal
6225
- };
6226
- report("compiling and linking Swift modules");
6227
- try {
6228
- await runCompiler(swift, buildArgs, buildOptions, SWIFTPM_PROGRESS, SWIFTPM_NOISE);
6229
- } catch (error) {
6230
- const output = outputOf(error);
6231
- const moduleCache = import_node_path5.default.join(
6232
- root,
6233
- ".build",
6234
- WASM_TRIPLE,
6235
- "release",
6236
- "ModuleCache"
6237
- );
6238
- if (output.includes("was compiled with module cache path") && (0, import_node_fs3.existsSync)(moduleCache)) {
6239
- (0, import_node_fs3.rmSync)(moduleCache, { recursive: true, force: true });
6283
+ async () => {
6284
+ const built = readCompiledArtifact(import_node_path6.default.join(sharedRoot, "artifact"), hash);
6285
+ if (built) {
6286
+ report("reusing verified disk artifact");
6287
+ return retain(root, built);
6288
+ }
6289
+ writeSwiftProject(layout, input, moduleRoot);
6290
+ const swift = import_node_path6.default.join(options.toolchainBin, "swift");
6291
+ if (!(0, import_node_fs4.existsSync)(swift)) {
6292
+ throw new Error(
6293
+ `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
6294
+ );
6295
+ }
6296
+ report("preparing compiler plugins");
6297
+ const macroPlugins = await ensureMacroPlugins(
6298
+ moduleRoot,
6299
+ options.toolchainBin,
6300
+ options.release,
6301
+ options.signal
6302
+ );
6303
+ const sdk = swiftModuleSdk(moduleRoot).wasmSdkId;
6304
+ const icu = swiftIcuAsset(options.toolchainBin, sdk);
6305
+ const buildArgs = [
6306
+ "build",
6307
+ ...swiftPackageCacheOptions(),
6308
+ "--build-system",
6309
+ "native",
6310
+ "-j",
6311
+ BUILD_JOBS,
6312
+ "--package-path",
6313
+ root,
6314
+ ...swiftSdkOptions(),
6315
+ "--swift-sdk",
6316
+ sdk,
6317
+ "-c",
6318
+ "release",
6319
+ "-Xswiftc",
6320
+ "-Osize",
6321
+ "-Xswiftc",
6322
+ "-num-threads",
6323
+ "-Xswiftc",
6324
+ BUILD_JOBS,
6325
+ ...macroPlugins.flatMap((plugin) => [
6326
+ "-Xswiftc",
6327
+ "-load-plugin-library",
6328
+ "-Xswiftc",
6329
+ plugin
6330
+ ])
6331
+ ];
6332
+ const buildOptions = {
6333
+ env: {
6334
+ ...process.env,
6335
+ // shipped host plugins resolve against the selected compiler's runtime.
6336
+ ...process.platform === "linux" ? {
6337
+ LD_LIBRARY_PATH: [
6338
+ import_node_path6.default.resolve(options.toolchainBin, "../lib/swift/linux"),
6339
+ import_node_path6.default.resolve(options.toolchainBin, "../lib/swift/host"),
6340
+ process.env.LD_LIBRARY_PATH
6341
+ ].filter(Boolean).join(":")
6342
+ } : {}
6343
+ },
6344
+ maxBuffer: 64 * 1024 * 1024,
6345
+ timeout: options.timeoutMs,
6346
+ signal: options.signal
6347
+ };
6348
+ report("compiling and linking Swift modules");
6240
6349
  try {
6241
6350
  await runCompiler(
6242
6351
  swift,
@@ -6245,29 +6354,51 @@ function compileSwiftProjectUnit(input, options) {
6245
6354
  SWIFTPM_PROGRESS,
6246
6355
  SWIFTPM_NOISE
6247
6356
  );
6248
- } catch (retryError) {
6249
- throw new Error(
6250
- projectDiagnostic(outputOf(retryError), layout, input.files),
6251
- {
6252
- cause: retryError
6253
- }
6357
+ } catch (error) {
6358
+ const output = outputOf(error);
6359
+ const moduleCache = import_node_path6.default.join(
6360
+ root,
6361
+ ".build",
6362
+ WASM_TRIPLE,
6363
+ "release",
6364
+ "ModuleCache"
6254
6365
  );
6366
+ if (output.includes("was compiled with module cache path") && (0, import_node_fs4.existsSync)(moduleCache)) {
6367
+ (0, import_node_fs4.rmSync)(moduleCache, { recursive: true, force: true });
6368
+ try {
6369
+ await runCompiler(
6370
+ swift,
6371
+ buildArgs,
6372
+ buildOptions,
6373
+ SWIFTPM_PROGRESS,
6374
+ SWIFTPM_NOISE
6375
+ );
6376
+ } catch (retryError) {
6377
+ throw new Error(
6378
+ projectDiagnostic(outputOf(retryError), layout, input.files),
6379
+ {
6380
+ cause: retryError
6381
+ }
6382
+ );
6383
+ }
6384
+ } else {
6385
+ throw new Error(projectDiagnostic(output, layout, input.files), {
6386
+ cause: error
6387
+ });
6388
+ }
6255
6389
  }
6256
- } else {
6257
- throw new Error(projectDiagnostic(output, layout, input.files), {
6258
- cause: error
6259
- });
6260
- }
6261
- }
6262
- const artifact = {
6263
- hash,
6264
- bytes: (0, import_node_fs3.readFileSync)(builtArtifact(layout)),
6265
- icu: await icu
6266
- };
6267
- saveCompiledArtifact(root, artifact);
6268
- saveCompiledArtifact(sharedRoot, artifact);
6269
- report("compiled artifact verified");
6270
- return retain(root, artifact);
6390
+ const artifact = {
6391
+ hash,
6392
+ bytes: (0, import_node_fs4.readFileSync)(builtArtifact(layout)),
6393
+ icu: await icu
6394
+ };
6395
+ saveCompiledArtifact(root, artifact);
6396
+ saveCompiledArtifact(sharedRoot, artifact);
6397
+ report("compiled artifact verified");
6398
+ return retain(root, artifact);
6399
+ },
6400
+ options.signal
6401
+ );
6271
6402
  },
6272
6403
  options.signal
6273
6404
  );