peachsim 0.1.2767 → 0.1.2769

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 (132) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +351 -77
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-RDD3HI5C.mjs → acorn-GNB3RJH7.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-BY3E6CUM.mjs → chunk-3WG4L5YK.mjs} +372 -106
  28. package/dist-lib/esm-chunks/{chunk-YX56RZ26.mjs → chunk-3ZKE33FC.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-555YCJDH.mjs → chunk-4GHACZYW.mjs} +5 -5
  30. package/dist-lib/esm-chunks/{chunk-CBAMX2H3.mjs → chunk-4IJOKKT2.mjs} +1 -1
  31. package/dist-lib/esm-chunks/{chunk-GKHSLOW6.mjs → chunk-53WFZATQ.mjs} +1 -1
  32. package/dist-lib/esm-chunks/{chunk-H4KLP3QO.mjs → chunk-57JPQBQL.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-PDMYH4NT.mjs → chunk-ALLMPTWQ.mjs} +2 -2
  34. package/dist-lib/esm-chunks/{chunk-UGTY5DQQ.mjs → chunk-BFLH7V77.mjs} +6 -6
  35. package/dist-lib/esm-chunks/{chunk-LO5KFOI3.mjs → chunk-BP7TLKZD.mjs} +1 -1
  36. package/dist-lib/esm-chunks/{chunk-WJKKLL2J.mjs → chunk-ETXC2XBY.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-C6YNOAXM.mjs → chunk-GHJPVQ3A.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-D6JZSVL7.mjs → chunk-L2U2IEHU.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-7G6WGJWR.mjs → chunk-MBLYJ74N.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-P2KN5U5O.mjs → chunk-MGIODRG3.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-XPSICY6F.mjs → chunk-OG5C2CN2.mjs} +3 -3
  42. package/dist-lib/esm-chunks/{chunk-4W67A7NE.mjs → chunk-OPIPPBGX.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-DFK4ZVNM.mjs → chunk-TI42U3CD.mjs} +1 -1
  44. package/dist-lib/esm-chunks/{chunk-H5C5TZNB.mjs → chunk-TJNFADI5.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-OYMWLKPN.mjs → chunk-TTVQWJGW.mjs} +4 -4
  46. package/dist-lib/esm-chunks/{chunk-7VSU2AV7.mjs → chunk-VF3CWZTM.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-AC2RBU5N.mjs → chunk-WWANYYJG.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-EJWUFWN3.mjs → chunk-XX7VUACB.mjs} +26 -13
  49. package/dist-lib/esm-chunks/{chunk-BSN5R62H.mjs → chunk-ZGNNVEWM.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-3WJRW63F.mjs → chunk-ZLYAJ4CU.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-7POGDD5P.mjs → metro-layout-parser-LT2DPN6F.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-ULD72CI5.mjs → swift-package-prebuilt-ZFFWBI33.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-VXSTLD57.mjs → swift-sdk-app-module-UZ6BZSES.mjs} +22 -17
  54. package/dist-lib/esm-chunks/{swift-sdk-image-KDJATRA6.mjs → swift-sdk-image-J2DE3SBW.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-KNBUALWN.mjs → swift-sdk-image-producer-C4U4EQRW.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +351 -77
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +351 -77
  61. package/dist-lib/host/fetch-proxy-handler.cjs +24 -20
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +64 -64
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +351 -77
  95. package/dist-lib/swift-compile.cjs +331 -57
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/render-worker/aux-pointer-native.d.ts +4 -0
  123. package/dist-types/packages/peach-engine/src/render-worker/auxPointerContract.d.ts +4 -0
  124. package/package.json +1 -1
  125. package/src/case-insensitive-header-overlay.ts +9 -1
  126. package/src/native-static-libraries.ts +16 -16
  127. package/src/swift-compile.ts +158 -42
  128. package/src/swift-distribution-mirror.ts +273 -10
  129. package/src/swift-objc-prebuilt.ts +10 -1
  130. package/src/swift-objc-standin.ts +6 -1
  131. package/src/swift-sdk-app-module.ts +10 -3
  132. package/src/swift-sdk-surface.ts +5 -1
@@ -1,10 +1,10 @@
1
- /*! peach v0.1.2767 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2769 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  import {
3
3
  acquireSwiftRootReadHold,
4
4
  hasLiveSwiftRootReaders,
5
5
  retainSwiftRootReadHold,
6
6
  withSwiftRootLock
7
- } from "./chunk-PDMYH4NT.mjs";
7
+ } from "./chunk-ALLMPTWQ.mjs";
8
8
  import {
9
9
  CORE_FOUNDATION_OVERLAY_GLOBALS,
10
10
  NATIVE_GRAPH_SDK_VERSION,
@@ -17,6 +17,8 @@ import {
17
17
  cacheDir,
18
18
  caseInsensitiveHeaderOverlay,
19
19
  clangInterfaceHeader,
20
+ clearCaseInsensitiveHeaderOverlayCache,
21
+ clearSwiftSdkPathsCache,
20
22
  emptyMacroEnvironment,
21
23
  foundationOwnerOf,
22
24
  installVerifiedTarball,
@@ -49,13 +51,14 @@ import {
49
51
  swiftSdkPaths,
50
52
  swiftSharedSdkFlags,
51
53
  swiftSharedSdkRoot,
54
+ swiftSharedSdkViewOptions,
52
55
  wasmMacroEnvironment,
53
56
  weakenFoundationOverridesInArchive,
54
57
  withFrameworkCompanionImports,
55
58
  withoutImportedSdkEnumForwards,
56
59
  withoutSwiftDeclarations,
57
60
  writeBuildFile
58
- } from "./chunk-EJWUFWN3.mjs";
61
+ } from "./chunk-XX7VUACB.mjs";
59
62
  import {
60
63
  SWIFT_AUTOLINK_LINKER,
61
64
  SWIFT_CACHE_HOLD_MARKER,
@@ -72,7 +75,7 @@ import {
72
75
  wasmThreadLinkFlags,
73
76
  windowAdmission,
74
77
  writeSwiftAutolinkLinker
75
- } from "./chunk-LO5KFOI3.mjs";
78
+ } from "./chunk-BP7TLKZD.mjs";
76
79
  import {
77
80
  SWIFT_BINARY_TREES_DIR,
78
81
  SWIFT_NATIVE_INPUT_ROOT,
@@ -87,7 +90,7 @@ import {
87
90
  isSwiftResourcePath,
88
91
  isSwiftSourceLinkGraph,
89
92
  swiftProjectFilesProblems
90
- } from "./chunk-WJKKLL2J.mjs";
93
+ } from "./chunk-ETXC2XBY.mjs";
91
94
  import {
92
95
  OBJC_RESOURCE_ACCESSOR_BODY,
93
96
  OBJC_RESOURCE_ACCESSOR_HEADER,
@@ -110,16 +113,16 @@ import {
110
113
  swiftPackagePartition,
111
114
  swiftTargetModuleName,
112
115
  withoutGlogModuleMap
113
- } from "./chunk-7G6WGJWR.mjs";
116
+ } from "./chunk-MBLYJ74N.mjs";
114
117
  import {
115
118
  rnxPublicBrand
116
- } from "./chunk-H4KLP3QO.mjs";
119
+ } from "./chunk-57JPQBQL.mjs";
117
120
  import {
118
121
  isRecord
119
- } from "./chunk-AC2RBU5N.mjs";
122
+ } from "./chunk-WWANYYJG.mjs";
120
123
  import {
121
124
  __publicField
122
- } from "./chunk-P2KN5U5O.mjs";
125
+ } from "./chunk-MGIODRG3.mjs";
123
126
 
124
127
  // src/swift-compile.ts
125
128
  import {
@@ -128,21 +131,21 @@ import {
128
131
  } from "node:child_process";
129
132
  import { createHash as createHash16, randomUUID as randomUUID4 } from "node:crypto";
130
133
  import {
131
- chmodSync as chmodSync3,
134
+ chmodSync as chmodSync4,
132
135
  copyFileSync as copyFileSync2,
133
136
  cpSync,
134
137
  existsSync as existsSync9,
135
- lstatSync,
138
+ lstatSync as lstatSync2,
136
139
  mkdirSync as mkdirSync7,
137
140
  mkdtempSync as mkdtempSync4,
138
141
  readFileSync as readFileSync13,
139
142
  readdirSync as readdirSync4,
140
- readlinkSync,
143
+ readlinkSync as readlinkSync2,
141
144
  realpathSync as realpathSync6,
142
145
  renameSync as renameSync5,
143
146
  rmSync as rmSync7,
144
- statSync as statSync4,
145
- symlinkSync as symlinkSync2,
147
+ statSync as statSync5,
148
+ symlinkSync as symlinkSync3,
146
149
  utimesSync,
147
150
  writeFileSync as writeFileSync7
148
151
  } from "node:fs";
@@ -3402,18 +3405,27 @@ function designTimeDiagnostic(output, files) {
3402
3405
  // src/swift-distribution-mirror.ts
3403
3406
  import { randomUUID as randomUUID2 } from "node:crypto";
3404
3407
  import {
3408
+ chmodSync,
3405
3409
  constants,
3406
3410
  copyFileSync,
3407
3411
  existsSync,
3412
+ lstatSync,
3408
3413
  mkdirSync,
3409
3414
  readdirSync as readdirSync2,
3410
3415
  readFileSync as readFileSync3,
3416
+ readlinkSync,
3411
3417
  renameSync as renameSync2,
3412
3418
  rmSync as rmSync2,
3419
+ statSync,
3420
+ symlinkSync as symlinkSync2,
3413
3421
  writeFileSync
3414
3422
  } from "node:fs";
3415
3423
  import path4 from "node:path";
3416
3424
  var SWIFT_DISTRIBUTION_MIRROR = ".peach-distribution";
3425
+ var SWIFT_SDK_MIRROR = ".peach-sdk";
3426
+ var SWIFT_SDK_MIRROR_ID = "peach-wasm-sdk";
3427
+ var SWIFT_SDK_MIRROR_RECORD = ".peach-sdk-mirror.json";
3428
+ var SWIFT_SDK_MIRROR_BUNDLE = "peach-wasm.artifactbundle";
3417
3429
  function syncSwiftDistributionMirror(root, source, manifest) {
3418
3430
  const mirror = path4.join(root, SWIFT_DISTRIBUTION_MIRROR);
3419
3431
  const record = path4.join(mirror, SWIFT_DISTRIBUTION_MIRROR_RECORD);
@@ -3440,9 +3452,175 @@ function syncSwiftDistributionMirror(root, source, manifest) {
3440
3452
  const partial = `${record}.${randomUUID2()}`;
3441
3453
  writeFileSync(partial, JSON.stringify(manifest.files));
3442
3454
  renameSync2(partial, record);
3455
+ if ([...changed, ...removed].some(
3456
+ (file) => !file.startsWith("lib/") && !file.startsWith("modules/")
3457
+ )) {
3458
+ clearCaseInsensitiveHeaderOverlayCache(mirror);
3459
+ clearCaseInsensitiveHeaderOverlayCache(path4.join(root, SWIFT_SDK_MIRROR));
3460
+ }
3443
3461
  }
3444
3462
  return mirror;
3445
3463
  }
3464
+ function syncSwiftSdkMirror(root, frameworkRoot, toolchainBin, sourceSdkId) {
3465
+ const viewOptions = swiftSharedSdkViewOptions(
3466
+ frameworkRoot,
3467
+ true,
3468
+ toolchainBin,
3469
+ sourceSdkId
3470
+ );
3471
+ const sourceView = viewOptions[1];
3472
+ return syncSwiftSdkMirrorFromView(root, frameworkRoot, sourceView, sourceSdkId);
3473
+ }
3474
+ function syncSwiftSdkMirrorFromView(root, frameworkRoot, sourceView, sourceSdkId) {
3475
+ const mirror = path4.join(root, SWIFT_SDK_MIRROR);
3476
+ const bundle = path4.join(mirror, SWIFT_SDK_MIRROR_BUNDLE);
3477
+ const destTriple = path4.join(bundle, "sdk", SWIFT_WASM_TRIPLE);
3478
+ const bundleInfo = path4.join(bundle, "info.json");
3479
+ const recordFile = path4.join(mirror, SWIFT_SDK_MIRROR_RECORD);
3480
+ const options = ["--swift-sdks-path", mirror];
3481
+ const previous = readSdkRecord(recordFile);
3482
+ if (previous && previous.sourceView === sourceView && previous.sourceSdkId === sourceSdkId && existsSync(bundleInfo) && existsSync(path4.join(destTriple, "swift-sdk.json"))) {
3483
+ return { id: SWIFT_SDK_MIRROR_ID, options, toolsetChanged: false };
3484
+ }
3485
+ const sourceTriple = resolveSdkViewTripleDir(sourceView, sourceSdkId);
3486
+ if (!previous) {
3487
+ rmSync2(mirror, { recursive: true, force: true });
3488
+ rmSync2(path4.join(root, ".build"), { recursive: true, force: true });
3489
+ }
3490
+ const changed = [];
3491
+ const removed = [];
3492
+ const distributionPrefix = `${frameworkRoot}${path4.sep}`;
3493
+ syncSdkTree(sourceTriple, destTriple, "", distributionPrefix, changed, removed);
3494
+ const infoText = JSON.stringify(
3495
+ {
3496
+ artifacts: {
3497
+ [SWIFT_SDK_MIRROR_ID]: {
3498
+ type: "swiftSDK",
3499
+ variants: [{ path: `sdk/${SWIFT_WASM_TRIPLE}/swift-sdk.json` }],
3500
+ version: "0.0.1"
3501
+ }
3502
+ },
3503
+ schemaVersion: "1.0"
3504
+ },
3505
+ null,
3506
+ 2
3507
+ ) + "\n";
3508
+ if (!existsSync(bundleInfo) || readFileSync3(bundleInfo, "utf8") !== infoText) {
3509
+ mkdirSync(bundle, { recursive: true });
3510
+ const partial = `${bundleInfo}.${randomUUID2()}`;
3511
+ writeFileSync(partial, infoText);
3512
+ renameSync2(partial, bundleInfo);
3513
+ }
3514
+ const touched = [...changed, ...removed];
3515
+ const toolsetChanged = !previous || touched.some(
3516
+ (file) => file === "toolset.json" || file === "swift-sdk.json" || file.startsWith("swift.xctoolchain/usr/bin/")
3517
+ );
3518
+ if (previous) {
3519
+ if (toolsetChanged) {
3520
+ rmSync2(path4.join(root, ".build"), { recursive: true, force: true });
3521
+ } else {
3522
+ const compileTouched = touched.filter(
3523
+ (file) => !file.endsWith(".a") && !file.endsWith(".o") && !file.startsWith("rust/") && file !== "runtime-products.json"
3524
+ );
3525
+ const headersChanged = compileTouched.some(
3526
+ (file) => !file.endsWith(".swiftmodule") && !file.endsWith(".swiftdoc") && !file.endsWith(".swiftsourceinfo") && !file.endsWith(".abi.json")
3527
+ );
3528
+ if (compileTouched.length > 0) {
3529
+ invalidateBuildDependents(
3530
+ root,
3531
+ [[Buffer.from(`${escapeDepPath(destTriple)}/`), ""]],
3532
+ new Set(compileTouched),
3533
+ headersChanged
3534
+ );
3535
+ }
3536
+ if (headersChanged) clearCaseInsensitiveHeaderOverlayCache(mirror);
3537
+ }
3538
+ } else {
3539
+ clearCaseInsensitiveHeaderOverlayCache(mirror);
3540
+ }
3541
+ mkdirSync(mirror, { recursive: true });
3542
+ const partialRecord = `${recordFile}.${randomUUID2()}`;
3543
+ writeFileSync(partialRecord, JSON.stringify({ version: 1, sourceView, sourceSdkId }));
3544
+ renameSync2(partialRecord, recordFile);
3545
+ return { id: SWIFT_SDK_MIRROR_ID, options, toolsetChanged };
3546
+ }
3547
+ function readSdkRecord(file) {
3548
+ if (!existsSync(file)) return null;
3549
+ const value = JSON.parse(readFileSync3(file, "utf8"));
3550
+ if (!isRecord(value) || value.version !== 1 || typeof value.sourceView !== "string" || typeof value.sourceSdkId !== "string")
3551
+ return null;
3552
+ return {
3553
+ version: value.version,
3554
+ sourceView: value.sourceView,
3555
+ sourceSdkId: value.sourceSdkId
3556
+ };
3557
+ }
3558
+ function resolveSdkViewTripleDir(sourceView, sourceSdkId) {
3559
+ for (const entry of readdirSync2(sourceView, { withFileTypes: true })) {
3560
+ if (!entry.name.endsWith(".artifactbundle")) continue;
3561
+ const bundleDir = path4.join(sourceView, entry.name);
3562
+ const infoPath = path4.join(bundleDir, "info.json");
3563
+ if (!existsSync(infoPath)) continue;
3564
+ const info = JSON.parse(readFileSync3(infoPath, "utf8"));
3565
+ if (!isRecord(info) || !isRecord(info.artifacts)) continue;
3566
+ const artifact = info.artifacts[sourceSdkId];
3567
+ if (!isRecord(artifact) || !Array.isArray(artifact.variants)) continue;
3568
+ const first = artifact.variants[0];
3569
+ if (!isRecord(first) || typeof first.path !== "string") continue;
3570
+ return path4.dirname(path4.join(bundleDir, first.path));
3571
+ }
3572
+ throw new Error(`Swift SDK ${sourceSdkId} not found in view ${sourceView}`);
3573
+ }
3574
+ function collectRemovedFiles(dir, prefix, out) {
3575
+ for (const entry of readdirSync2(dir, { withFileTypes: true })) {
3576
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
3577
+ const full = path4.join(dir, entry.name);
3578
+ if (entry.isDirectory()) collectRemovedFiles(full, rel, out);
3579
+ else out.push(rel);
3580
+ }
3581
+ }
3582
+ function syncSdkTree(sourceDir, destDir, prefix, distributionPrefix, changed, removed) {
3583
+ mkdirSync(destDir, { recursive: true });
3584
+ const wanted = /* @__PURE__ */ new Set();
3585
+ for (const entry of readdirSync2(sourceDir, { withFileTypes: true })) {
3586
+ wanted.add(entry.name);
3587
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
3588
+ const src = path4.join(sourceDir, entry.name);
3589
+ const dest = path4.join(destDir, entry.name);
3590
+ const destLstat = lstatSync(dest, { throwIfNoEntry: false });
3591
+ if (entry.isSymbolicLink()) {
3592
+ const target = readlinkSync(src);
3593
+ if (target.startsWith(distributionPrefix)) {
3594
+ if (destLstat?.isSymbolicLink() && readlinkSync(dest) === target) continue;
3595
+ if (destLstat) rmSync2(dest, { recursive: true, force: true });
3596
+ symlinkSync2(target, dest);
3597
+ changed.push(rel);
3598
+ continue;
3599
+ }
3600
+ }
3601
+ const srcStat = statSync(src, { throwIfNoEntry: false });
3602
+ if (!srcStat) continue;
3603
+ if (srcStat.isDirectory()) {
3604
+ if (destLstat && (!destLstat.isDirectory() || destLstat.isSymbolicLink()))
3605
+ rmSync2(dest, { recursive: true, force: true });
3606
+ syncSdkTree(src, dest, rel, distributionPrefix, changed, removed);
3607
+ continue;
3608
+ }
3609
+ if (destLstat?.isFile() && !destLstat.isSymbolicLink() && destLstat.size === srcStat.size && readFileSync3(src).equals(readFileSync3(dest)))
3610
+ continue;
3611
+ if (destLstat?.isDirectory()) rmSync2(dest, { recursive: true, force: true });
3612
+ place(src, dest, (srcStat.mode & 73) !== 0 ? srcStat.mode & 511 : void 0);
3613
+ changed.push(rel);
3614
+ }
3615
+ for (const entry of readdirSync2(destDir, { withFileTypes: true })) {
3616
+ if (wanted.has(entry.name)) continue;
3617
+ const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
3618
+ const dest = path4.join(destDir, entry.name);
3619
+ if (entry.isDirectory()) collectRemovedFiles(dest, rel, removed);
3620
+ else removed.push(rel);
3621
+ rmSync2(dest, { recursive: true, force: true });
3622
+ }
3623
+ }
3446
3624
  function readRecord(file) {
3447
3625
  if (!existsSync(file)) return null;
3448
3626
  const value = JSON.parse(readFileSync3(file, "utf8"));
@@ -3454,24 +3632,33 @@ function readRecord(file) {
3454
3632
  }
3455
3633
  return files;
3456
3634
  }
3457
- function place(from, to) {
3635
+ function place(from, to, mode) {
3458
3636
  mkdirSync(path4.dirname(to), { recursive: true });
3459
3637
  const partial = `${to}.${randomUUID2()}`;
3460
3638
  copyFileSync(from, partial, constants.COPYFILE_FICLONE);
3639
+ if (mode !== void 0) chmodSync(partial, mode);
3461
3640
  renameSync2(partial, to);
3462
3641
  }
3463
- function invalidateDependents(root, mirror, files) {
3464
- const read = new Set(files.filter((file) => !file.startsWith("lib/")));
3465
- if (read.size === 0) return;
3466
- const escapedMirror = mirror.replace(
3642
+ function escapeDepPath(directory) {
3643
+ return directory.replace(
3467
3644
  /[\\ #$]/g,
3468
3645
  (character) => character === "$" ? "$$" : `\\${character}`
3469
3646
  );
3647
+ }
3648
+ function invalidateDependents(root, mirror, files) {
3649
+ const read = new Set(files.filter((file) => !file.startsWith("lib/")));
3650
+ if (read.size === 0) return;
3470
3651
  const spellings = [
3471
- [Buffer.from(`${escapedMirror}/`), ""]
3652
+ [Buffer.from(`${escapeDepPath(mirror)}/`), ""]
3472
3653
  ];
3473
3654
  if (files.some((file) => file.startsWith("sdk/ios/")))
3474
3655
  spellings.push([Buffer.from("/darwin/"), "sdk/ios/"]);
3656
+ const headersChanged = files.some(
3657
+ (file) => !file.startsWith("lib/") && !file.startsWith("modules/")
3658
+ );
3659
+ invalidateBuildDependents(root, spellings, read, headersChanged);
3660
+ }
3661
+ function invalidateBuildDependents(root, spellings, read, headersChanged) {
3475
3662
  const names = (text2) => spellings.some(([prefix, base]) => {
3476
3663
  let end = 0;
3477
3664
  for (let at = text2.indexOf(prefix); at !== -1; at = text2.indexOf(prefix, end)) {
@@ -3486,9 +3673,6 @@ function invalidateDependents(root, mirror, files) {
3486
3673
  });
3487
3674
  const scratch = path4.join(root, ".build");
3488
3675
  if (!existsSync(scratch)) return;
3489
- const headersChanged = files.some(
3490
- (file) => !file.startsWith("lib/") && !file.startsWith("modules/")
3491
- );
3492
3676
  for (const triple of readdirSync2(scratch, { withFileTypes: true })) {
3493
3677
  const products = path4.join(scratch, triple.name, "release");
3494
3678
  if (!triple.isDirectory() || !existsSync(products)) continue;
@@ -13478,7 +13662,7 @@ import {
13478
13662
  readFileSync as readFileSync8,
13479
13663
  realpathSync as realpathSync2,
13480
13664
  renameSync as renameSync3,
13481
- statSync,
13665
+ statSync as statSync2,
13482
13666
  writeFileSync as writeFileSync4
13483
13667
  } from "node:fs";
13484
13668
  import path11 from "node:path";
@@ -13562,11 +13746,11 @@ Promise.all(Array.from({ length: jobs }, run))
13562
13746
  })
13563
13747
  `;
13564
13748
  function clangProducerStamp(file) {
13565
- const stat = statSync(file, { bigint: true });
13749
+ const stat = statSync2(file, { bigint: true });
13566
13750
  return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
13567
13751
  }
13568
13752
  function clangBinaryStamp(file) {
13569
- const stat = statSync(file, { bigint: true });
13753
+ const stat = statSync2(file, { bigint: true });
13570
13754
  return [file, stat.size, stat.mtimeNs].join(":");
13571
13755
  }
13572
13756
  function sha256Hex2(bytes) {
@@ -14138,14 +14322,14 @@ function logicalGuestLinkOptions(args, identities, roots) {
14138
14322
  // src/swift-project-user.ts
14139
14323
  import { execFileSync as execFileSync7 } from "node:child_process";
14140
14324
  import {
14141
- chmodSync,
14325
+ chmodSync as chmodSync2,
14142
14326
  existsSync as existsSync4,
14143
14327
  mkdirSync as mkdirSync4,
14144
14328
  readdirSync as readdirSync3,
14145
14329
  readFileSync as readFileSync9,
14146
14330
  realpathSync as realpathSync3,
14147
14331
  rmSync as rmSync5,
14148
- statSync as statSync2
14332
+ statSync as statSync3
14149
14333
  } from "node:fs";
14150
14334
  import path12 from "node:path";
14151
14335
  function prepareSwiftProjectProcess(root, user) {
@@ -14157,8 +14341,8 @@ function prepareSwiftProjectProcess(root, user) {
14157
14341
  const caches = ["cache", "config", "security"].map((name) => path12.join(swiftpm, name));
14158
14342
  for (const directory of caches) mkdirSync4(directory, { recursive: true });
14159
14343
  execFileSync7("chown", ["-R", "-P", `${user.uid}:${user.gid}`, root, home]);
14160
- chmodSync(root, 448);
14161
- chmodSync(home, 448);
14344
+ chmodSync2(root, 448);
14345
+ chmodSync2(home, 448);
14162
14346
  return {
14163
14347
  uid: user.uid,
14164
14348
  gid: user.gid,
@@ -14187,7 +14371,7 @@ function endSwiftProjectProcesses(user) {
14187
14371
  function projectOutputFile(root, file, user) {
14188
14372
  const real = realpathSync3(file);
14189
14373
  const base = realpathSync3(root);
14190
- const stat = statSync2(real);
14374
+ const stat = statSync3(real);
14191
14375
  if (!real.startsWith(base + path12.sep) || !stat.isFile() || stat.uid !== user.uid) {
14192
14376
  throw new Error(`swift-compile: project output ${file} is not a file of its build`);
14193
14377
  }
@@ -14470,7 +14654,7 @@ async function compileGuestLink(options) {
14470
14654
  };
14471
14655
  const sdk = options.sdkImage;
14472
14656
  const sdkCallers = sdk.sdkInterface.guestCallers;
14473
- const sdkObjects = (await import("./swift-sdk-image-KDJATRA6.mjs")).readSwiftSdkManifestIndex(
14657
+ const sdkObjects = (await import("./swift-sdk-image-J2DE3SBW.mjs")).readSwiftSdkManifestIndex(
14474
14658
  sdk
14475
14659
  ).guestObjects;
14476
14660
  if (!sdkCallers || !sdkObjects)
@@ -14771,7 +14955,7 @@ async function compileGuestLink(options) {
14771
14955
  swiftSdkProjectionDigest,
14772
14956
  swiftSdkProjectionSpans,
14773
14957
  writeSwiftSdkAppLink
14774
- } = await import("./swift-sdk-app-module-VXSTLD57.mjs");
14958
+ } = await import("./swift-sdk-app-module-UZ6BZSES.mjs");
14775
14959
  const project = options.project;
14776
14960
  const work = project ? mkdtempSync2(path14.join(directory, "app-module-")) : path14.join(directory, "app-module");
14777
14961
  if (project) chownSync(work, project.uid, project.gid);
@@ -14945,14 +15129,14 @@ async function compileGuestLink(options) {
14945
15129
  // src/swift-header-compiler.ts
14946
15130
  import { createHash as createHash11 } from "node:crypto";
14947
15131
  import {
14948
- chmodSync as chmodSync2,
15132
+ chmodSync as chmodSync3,
14949
15133
  existsSync as existsSync5,
14950
15134
  mkdirSync as mkdirSync6,
14951
15135
  mkdtempSync as mkdtempSync3,
14952
15136
  readFileSync as readFileSync11,
14953
15137
  renameSync as renameSync4,
14954
15138
  rmSync as rmSync6,
14955
- statSync as statSync3,
15139
+ statSync as statSync4,
14956
15140
  writeFileSync as writeFileSync6
14957
15141
  } from "node:fs";
14958
15142
  import { createServer } from "node:http";
@@ -15019,7 +15203,7 @@ function compilerCheckpoint(root, recipe, args, header) {
15019
15203
  }
15020
15204
  for (const file of outputs) {
15021
15205
  if (!file.startsWith(path15.join(root, ".build") + path15.sep)) return;
15022
- const stat = statSync3(file, { bigint: true, throwIfNoEntry: false });
15206
+ const stat = statSync4(file, { bigint: true, throwIfNoEntry: false });
15023
15207
  if (!stat?.isFile() || stat.size === 0n) return;
15024
15208
  digest.update(JSON.stringify([file, String(stat.size), String(stat.mtimeNs)]));
15025
15209
  }
@@ -15051,7 +15235,7 @@ async function withSwiftHeaderCompiler(root, toolchainBin, recipe, producers, bu
15051
15235
  ""
15052
15236
  ].join("\n")
15053
15237
  );
15054
- chmodSync2(wrapper, 493);
15238
+ chmodSync3(wrapper, 493);
15055
15239
  const directory = mkdtempSync3("/tmp/peach-headers-");
15056
15240
  const socket = path15.join(directory, "compile");
15057
15241
  const server = createServer(async (request, response) => {
@@ -16643,7 +16827,7 @@ function providedModulesPath(root, modules, excluded) {
16643
16827
  for (const entry of readdirSync4(directory))
16644
16828
  rmSync7(path23.join(directory, entry), { recursive: true, force: true });
16645
16829
  for (const entry of entries2) {
16646
- symlinkSync2(path23.join(modules, entry), path23.join(directory, entry));
16830
+ symlinkSync3(path23.join(modules, entry), path23.join(directory, entry));
16647
16831
  }
16648
16832
  writeFileSync7(complete, "");
16649
16833
  }
@@ -16751,7 +16935,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
16751
16935
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
16752
16936
  var MULTI_MANIFEST_VERSION = 76;
16753
16937
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
16754
- var compilerSourceDigest = true ? "e28f3765de44ea471f6097cb0ae6ead762595ae2bb24b4e38d4210f32b9434c1" : swiftCompilerSourceDigest(import.meta.dirname);
16938
+ var compilerSourceDigest = true ? "404914a824c2f550a36612007732c8afa8459125cb02e28f12c34e2e6d8878d3" : swiftCompilerSourceDigest(import.meta.dirname);
16755
16939
  function swiftArtifactHash(input, release, moduleRoot) {
16756
16940
  return swiftCompileInputHash(input, release).update(swiftModuleDigest(moduleRoot)).digest("hex");
16757
16941
  }
@@ -17375,7 +17559,7 @@ function syncSwiftTree(base, files, alreadySynced) {
17375
17559
  if (process.platform !== "linux") {
17376
17560
  kept = /* @__PURE__ */ new Set();
17377
17561
  for (const file of files.keys()) {
17378
- const stat = statSync4(file, { throwIfNoEntry: false });
17562
+ const stat = statSync5(file, { throwIfNoEntry: false });
17379
17563
  if (stat) kept.add(stat.ino);
17380
17564
  }
17381
17565
  }
@@ -17384,10 +17568,10 @@ function syncSwiftTree(base, files, alreadySynced) {
17384
17568
  const full = path23.join(dir, entry.name);
17385
17569
  if (dir === base && (entry.name === ".build" || entry.name === SWIFT_CACHE_HOLD_MARKER || entry.name.startsWith(".peach-modules-") || // distribution clang maps are written beside the project, so a sync
17386
17570
  // must not remove them.
17387
- entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_BUILD_ROOT_SHAPE))
17571
+ entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_SDK_MIRROR || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_BUILD_ROOT_SHAPE))
17388
17572
  continue;
17389
17573
  if (entry.isDirectory()) walk(full);
17390
- else if (!files.has(full) && (!kept || !kept.has(lstatSync(full).ino)))
17574
+ else if (!files.has(full) && (!kept || !kept.has(lstatSync2(full).ino)))
17391
17575
  rmSync7(full, { force: true });
17392
17576
  }
17393
17577
  };
@@ -18151,7 +18335,7 @@ function needsNativeToolset(input, prebuilt) {
18151
18335
  input.packageFiles || prebuilt || Object.keys(input.files).some(isSwiftNativeTranslationUnit)
18152
18336
  );
18153
18337
  }
18154
- function writeSwiftProject(layout2, input, moduleRoot, prebuilt, allowHeaderCompiler = false, objcPrebuiltStage) {
18338
+ function writeSwiftProject(layout2, input, moduleRoot, prebuilt, allowHeaderCompiler = false, objcPrebuiltStage, compileSdk) {
18155
18339
  const nativeToolset = needsNativeToolset(input, prebuilt);
18156
18340
  if (input.headerAliases !== void 0 && !isSwiftHeaderAliases(input.headerAliases))
18157
18341
  throw new Error("swift compile input has invalid original header aliases");
@@ -18280,6 +18464,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
18280
18464
  checkedToolchain = swiftToolchain(pin.release, swiftModuleSdk(moduleRoot));
18281
18465
  return checkedToolchain;
18282
18466
  };
18467
+ const resolvedSdkPaths = (toolchainBin) => swiftSdkPaths(moduleRoot, toolchainBin, compileSdk?.options, compileSdk?.id);
18283
18468
  const targetStagedFiles = /* @__PURE__ */ new Map();
18284
18469
  const stageTargetFile = (target, file, contents, options) => {
18285
18470
  const relative = path23.relative(layout2.root, file).split(path23.sep).join(path23.posix.sep);
@@ -18406,9 +18591,25 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
18406
18591
  files.set(destination, contents);
18407
18592
  }
18408
18593
  }
18594
+ const binaryTreePrefix = `${SWIFT_BINARY_TREES_DIR}/`;
18595
+ const binaryTreeSegment = `/${SWIFT_BINARY_TREES_DIR}/`;
18596
+ const isBinaryTreeFile = (file) => file.startsWith(binaryTreePrefix) || file.includes(binaryTreeSegment);
18597
+ const stageBinaryTreeFile = (file, contents) => {
18598
+ const destination = path23.join(layout2.root, file);
18599
+ if (files.has(destination)) return;
18600
+ writeBuildFile(destination, contents);
18601
+ alreadySynced.set(destination, contents);
18602
+ files.set(destination, contents);
18603
+ };
18604
+ for (const [file, contents] of Object.entries(input.files))
18605
+ if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, contents);
18606
+ for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
18607
+ if (isBinaryTreeFile(file) && !file.endsWith(".swift"))
18608
+ stageBinaryTreeFile(file, Buffer.from(bytes, "base64"));
18609
+ for (const [file, bytes] of Object.entries(input.projectFiles ?? {}))
18610
+ if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, Buffer.from(bytes, "base64"));
18409
18611
  const fromInputRoot = (file) => file.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) ? path23.join(layout2.root, file.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1)) : file;
18410
18612
  const inRoot = `${layout2.root}${path23.sep}`;
18411
- const binaryTree = `${path23.sep}${SWIFT_BINARY_TREES_DIR}${path23.sep}`;
18412
18613
  const headerSearch = writeXcodeHeaderSearch(
18413
18614
  path23.join(layout2.root, ".build", "peach-xcode-headers"),
18414
18615
  nativeTargets.map((settings) => {
@@ -18460,7 +18661,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
18460
18661
  path23.join(layout2.root, file)
18461
18662
  ])
18462
18663
  ),
18463
- (file) => !file.startsWith(inRoot) || files.has(file) || file.includes(binaryTree)
18664
+ (file) => !file.startsWith(inRoot) || files.has(file)
18464
18665
  );
18465
18666
  const importModuleMaps = /* @__PURE__ */ new Map();
18466
18667
  const sourceModuleMaps = /* @__PURE__ */ new Map();
@@ -18603,7 +18804,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
18603
18804
  ];
18604
18805
  })();
18605
18806
  const sdkInclude = path23.join(
18606
- swiftSdkPaths(moduleRoot, toolchainBin).sysroot,
18807
+ resolvedSdkPaths(toolchainBin).sysroot,
18607
18808
  "darwin/usr/include"
18608
18809
  );
18609
18810
  const dependencyModuleMaps = clangImportModuleMapFlags(
@@ -19350,7 +19551,8 @@ ${entry}`);
19350
19551
  );
19351
19552
  if (nativeFlags) {
19352
19553
  const toolchainBin = nativeToolchain();
19353
- const headers = path23.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "darwin");
19554
+ const headers = path23.join(resolvedSdkPaths(toolchainBin).sysroot, "darwin");
19555
+ const sdkOverlayDirectory = compileSdk?.id === SWIFT_SDK_MIRROR_ID ? path23.join(layout2.root, SWIFT_SDK_MIRROR) : void 0;
19354
19556
  const dependencies2 = swiftTargetDependencies(input.files, targets);
19355
19557
  const reachesNative = (name, seen = /* @__PURE__ */ new Set()) => {
19356
19558
  if (native.has(name)) return true;
@@ -19368,7 +19570,12 @@ ${entry}`);
19368
19570
  throw new Error(
19369
19571
  target.name + ": missing or unsupported declared iOS deployment target " + JSON.stringify(version2)
19370
19572
  );
19371
- const sdkIntake = objcSdkIntakeFlags(headers, toolchainBin, minimum);
19573
+ const sdkIntake = objcSdkIntakeFlags(
19574
+ headers,
19575
+ toolchainBin,
19576
+ minimum,
19577
+ sdkOverlayDirectory
19578
+ );
19372
19579
  const sdkOverlay = sdkIntake.indexOf("-ivfsoverlay");
19373
19580
  if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]);
19374
19581
  const intake = [
@@ -19590,7 +19797,7 @@ ${entry}`);
19590
19797
  distribution: distribution ?? void 0,
19591
19798
  moduleExcludes,
19592
19799
  deferDarwinOverlay: native.size > 0 && toolsetOrdersLibcxxBeforeDarwinOverlay(
19593
- swiftSdkPaths(moduleRoot, nativeToolchain()).cFlags
19800
+ resolvedSdkPaths(nativeToolchain()).cFlags
19594
19801
  ),
19595
19802
  ...reachesFrameworks ? {
19596
19803
  distributionLink: {
@@ -19633,7 +19840,7 @@ ${entry}`);
19633
19840
  ...headerAliasFlags,
19634
19841
  ...native.size > 0 ? [
19635
19842
  "-fmodule-map-file=" + path23.join(
19636
- swiftSdkPaths(moduleRoot, nativeToolchain()).sysroot,
19843
+ resolvedSdkPaths(nativeToolchain()).sysroot,
19637
19844
  "darwin/wasm/include/module.modulemap"
19638
19845
  )
19639
19846
  ] : []
@@ -19643,7 +19850,7 @@ ${entry}`);
19643
19850
  const prebuiltCompiler = distribution && objcPrebuiltStage !== false ? swiftObjCPrebuiltCompiler(
19644
19851
  clang,
19645
19852
  layout2.root,
19646
- swiftSdkPaths(moduleRoot, nativeToolchain()).sysroot,
19853
+ resolvedSdkPaths(nativeToolchain()).sysroot,
19647
19854
  distribution.id,
19648
19855
  [...native.keys()],
19649
19856
  objcPrebuiltStage
@@ -19901,12 +20108,55 @@ package.targets += [.target(name: ${JSON.stringify(name)}, dependencies: ${JSON.
19901
20108
  `;
19902
20109
  return name;
19903
20110
  };
19904
- const headerBuilds = headerCompiler ? [
19905
- {
19906
- target: buildProduct(SWIFT_HEADER_PRODUCTS_TARGET, orderedProducers),
19907
- producers: orderedProducers
20111
+ const producerUnitCount = /* @__PURE__ */ new Map();
20112
+ for (const target of targets) {
20113
+ if (!producerSet.has(target.name)) continue;
20114
+ producerUnitCount.set(
20115
+ target.name,
20116
+ Math.max(
20117
+ 1,
20118
+ targetEntries(target).filter(([file]) => file.endsWith(".swift")).length
20119
+ )
20120
+ );
20121
+ }
20122
+ const MAX_HEADER_STAGE_TARGETS = 100;
20123
+ const MAX_HEADER_STAGE_UNITS = 400;
20124
+ const chunkHeaderProducers = (producers2) => {
20125
+ const levelOrdered = [...producers2].sort(
20126
+ (left, right) => depths.get(left) - depths.get(right)
20127
+ );
20128
+ const totalUnits = levelOrdered.reduce(
20129
+ (sum, name) => sum + (producerUnitCount.get(name) ?? 1),
20130
+ 0
20131
+ );
20132
+ if (levelOrdered.length <= 1 || levelOrdered.length <= MAX_HEADER_STAGE_TARGETS && totalUnits <= MAX_HEADER_STAGE_UNITS) {
20133
+ return [
20134
+ {
20135
+ target: buildProduct(SWIFT_HEADER_PRODUCTS_TARGET, levelOrdered),
20136
+ producers: levelOrdered
20137
+ }
20138
+ ];
19908
20139
  }
19909
- ] : [...stages].sort(([left], [right]) => left - right).map(([level, producers2]) => ({
20140
+ const chunks = [];
20141
+ let current = [];
20142
+ let units = 0;
20143
+ for (const name of levelOrdered) {
20144
+ const size = producerUnitCount.get(name) ?? 1;
20145
+ if (current.length > 0 && (current.length >= MAX_HEADER_STAGE_TARGETS || units + size > MAX_HEADER_STAGE_UNITS)) {
20146
+ chunks.push(current);
20147
+ current = [];
20148
+ units = 0;
20149
+ }
20150
+ current.push(name);
20151
+ units += size;
20152
+ }
20153
+ if (current.length > 0) chunks.push(current);
20154
+ return chunks.map((members, index) => ({
20155
+ target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${index + 1}`, members),
20156
+ producers: members
20157
+ }));
20158
+ };
20159
+ const headerBuilds = headerCompiler ? chunkHeaderProducers(orderedProducers) : [...stages].sort(([left], [right]) => left - right).map(([level, producers2]) => ({
19910
20160
  target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${level}`, producers2),
19911
20161
  producers: producers2
19912
20162
  }));
@@ -20031,8 +20281,8 @@ package.targets += [.target(name: ${JSON.stringify(name)}, dependencies: ${JSON.
20031
20281
  for (const target of targets)
20032
20282
  mkdirSync7(path23.join(layout2.root, target.path), { recursive: true });
20033
20283
  const clangWrapper = path23.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
20034
- if (files.has(clangWrapper) && (statSync4(clangWrapper).mode & 4095) !== 493)
20035
- chmodSync3(clangWrapper, 493);
20284
+ if (files.has(clangWrapper) && (statSync5(clangWrapper).mode & 4095) !== 493)
20285
+ chmodSync4(clangWrapper, 493);
20036
20286
  return {
20037
20287
  ...nativePrerequisiteStageTargets.length ? { nativePrerequisiteTargets: nativePrerequisiteStageTargets } : {},
20038
20288
  headerBuilds,
@@ -20214,12 +20464,12 @@ function pruneSharedArtifacts(parent, keep) {
20214
20464
  encoding: "utf8"
20215
20465
  })) {
20216
20466
  try {
20217
- bytes += statSync4(path23.join(directory, "artifact", file)).size;
20467
+ bytes += statSync5(path23.join(directory, "artifact", file)).size;
20218
20468
  } catch (error) {
20219
20469
  if (!vanished(error)) throw error;
20220
20470
  }
20221
20471
  }
20222
- entries2.push({ directory, used: statSync4(directory).mtimeMs, bytes });
20472
+ entries2.push({ directory, used: statSync5(directory).mtimeMs, bytes });
20223
20473
  } catch (error) {
20224
20474
  if (!vanished(error)) throw error;
20225
20475
  }
@@ -20234,7 +20484,7 @@ function pruneSharedArtifacts(parent, keep) {
20234
20484
  `${RETIRED_PREFIX}${process.pid}-${path23.basename(entry.directory)}`
20235
20485
  );
20236
20486
  try {
20237
- if (statSync4(entry.directory).mtimeMs !== entry.used) continue;
20487
+ if (statSync5(entry.directory).mtimeMs !== entry.used) continue;
20238
20488
  renameSync5(entry.directory, retired);
20239
20489
  } catch (error) {
20240
20490
  if (vanished(error)) continue;
@@ -20497,7 +20747,7 @@ var frameworkProductsReceiptSchema = object({
20497
20747
  });
20498
20748
  function readFrameworkProductsReceipt(scratch, receiptKey, planChangedAt = 0n) {
20499
20749
  const receiptFile = path23.join(scratch, "products-ready", `${receiptKey}.json`);
20500
- const receiptStat = statSync4(receiptFile, { bigint: true, throwIfNoEntry: false });
20750
+ const receiptStat = statSync5(receiptFile, { bigint: true, throwIfNoEntry: false });
20501
20751
  if (!receiptStat || receiptStat.mtimeNs < planChangedAt) return null;
20502
20752
  let parsed;
20503
20753
  try {
@@ -20589,7 +20839,7 @@ function prepareFrameworkCompileCache(scratch, moduleRoot, toolchainBin, sdkOpti
20589
20839
  ].join("\n");
20590
20840
  const partial = `${wrapper}.${process.pid}.${randomUUID4()}.partial`;
20591
20841
  writeFileSync7(partial, script, { mode: 493 });
20592
- chmodSync3(partial, 493);
20842
+ chmodSync4(partial, 493);
20593
20843
  renameSync5(partial, wrapper);
20594
20844
  return { wrapper, statsFile };
20595
20845
  }
@@ -20642,8 +20892,8 @@ async function buildFrameworkProducts(scratch, args, allowWrite) {
20642
20892
  if (!allowWrite) return;
20643
20893
  const linkRoot = path23.join(scratch, "link");
20644
20894
  const manifest = path23.join(linkRoot, "Package.swift");
20645
- const manifestStat = statSync4(manifest, { bigint: true, throwIfNoEntry: false });
20646
- const planStat = statSync4(path23.join(scratch, "release.yaml"), {
20895
+ const manifestStat = statSync5(manifest, { bigint: true, throwIfNoEntry: false });
20896
+ const planStat = statSync5(path23.join(scratch, "release.yaml"), {
20647
20897
  bigint: true,
20648
20898
  throwIfNoEntry: false
20649
20899
  });
@@ -20826,7 +21076,7 @@ async function buildFrameworkProducts(scratch, args, allowWrite) {
20826
21076
  const dir = path23.join(release, `${target}.build`);
20827
21077
  if (!target || target === "Darwin" || !object2.startsWith(dir + path23.sep)) continue;
20828
21078
  const name = `${target}-${path23.relative(dir, object2).replaceAll(path23.sep, "-").replace(/\.swift\.o$/, ".o")}`;
20829
- symlinkSync2(object2, path23.join(stagedArchive, name));
21079
+ symlinkSync3(object2, path23.join(stagedArchive, name));
20830
21080
  archived.set(object2, `lib/${name}`);
20831
21081
  }
20832
21082
  rmSync7(archiveRoot, { recursive: true, force: true });
@@ -20936,7 +21186,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
20936
21186
  const own = (slot) => swiftFrameworkSlotRecord(slot, SWIFT_FRAMEWORK_SLOT_ORIGIN) === moduleRoot;
20937
21187
  const slotMtimeMs = (slot) => {
20938
21188
  try {
20939
- return statSync4(slot).mtimeMs;
21189
+ return statSync5(slot).mtimeMs;
20940
21190
  } catch (error) {
20941
21191
  if (vanished(error)) return 0;
20942
21192
  throw error;
@@ -20944,7 +21194,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
20944
21194
  };
20945
21195
  const handoffFile = (slot) => path23.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF);
20946
21196
  const hasPendingForeignHandoff = (slot, now) => {
20947
- const stamp = statSync4(handoffFile(slot), { throwIfNoEntry: false });
21197
+ const stamp = statSync5(handoffFile(slot), { throwIfNoEntry: false });
20948
21198
  return stamp !== void 0 && !own(slot) && now - stamp.mtimeMs < SWIFT_FRAMEWORK_HANDOFF_MS;
20949
21199
  };
20950
21200
  const trySlot = (slot, mode, logSelection, allowPendingHandoff = true) => {
@@ -21005,7 +21255,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
21005
21255
  for (const [file, contents] of inputs) {
21006
21256
  try {
21007
21257
  const candidate = path23.join(source, file);
21008
- if (statSync4(candidate).size !== contents.length || !readFileSync13(candidate).equals(contents))
21258
+ if (statSync5(candidate).size !== contents.length || !readFileSync13(candidate).equals(contents))
21009
21259
  changes++;
21010
21260
  } catch (error) {
21011
21261
  if (!vanished(error)) throw error;
@@ -21081,7 +21331,7 @@ async function withSwiftBuildRootSlot(baseRoot, exactShape, compatShape, signal,
21081
21331
  utimesSync(slot, now, now);
21082
21332
  return work(slot, lease, waitedMs);
21083
21333
  };
21084
- const built = new Map(slots.map((slot) => [slot, statSync4(slot).mtimeMs]));
21334
+ const built = new Map(slots.map((slot) => [slot, statSync5(slot).mtimeMs]));
21085
21335
  const ranked = slots.map((slot, index) => {
21086
21336
  const record = swiftFrameworkSlotRecord(slot, SWIFT_BUILD_ROOT_SHAPE);
21087
21337
  const [slotExact, slotCompat] = record ? record.split("\n") : [null, null];
@@ -21118,7 +21368,7 @@ function mirrorTree(source, target, skip) {
21118
21368
  const to = path23.join(target, entry.name);
21119
21369
  let existing = null;
21120
21370
  try {
21121
- existing = lstatSync(to);
21371
+ existing = lstatSync2(to);
21122
21372
  } catch (error) {
21123
21373
  if (!vanished(error)) throw error;
21124
21374
  }
@@ -21127,12 +21377,12 @@ function mirrorTree(source, target, skip) {
21127
21377
  if (existing && !existing.isDirectory()) rmSync7(to, { force: true });
21128
21378
  if (mirrorTree(from, to)) restructured = true;
21129
21379
  } else if (entry.isSymbolicLink()) {
21130
- const link = readlinkSync(from);
21131
- if (existing?.isSymbolicLink() && readlinkSync(to) === link) continue;
21380
+ const link = readlinkSync2(from);
21381
+ if (existing?.isSymbolicLink() && readlinkSync2(to) === link) continue;
21132
21382
  if (existing) rmSync7(to, { recursive: true, force: true });
21133
- symlinkSync2(link, to);
21383
+ symlinkSync3(link, to);
21134
21384
  } else {
21135
- const stat = statSync4(from);
21385
+ const stat = statSync5(from);
21136
21386
  if (existing?.isFile() && existing.size === stat.size && (existing.mtimeMs === stat.mtimeMs || readFileSync13(from).equals(readFileSync13(to))))
21137
21387
  continue;
21138
21388
  if (existing) rmSync7(to, { recursive: true, force: true });
@@ -21186,9 +21436,9 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
21186
21436
  throw new Error("Swift staged framework source differs from the caller");
21187
21437
  const modules = path23.join(staged, "node_modules");
21188
21438
  const target = realpathSync6(path23.join(moduleRoot, "../../node_modules"));
21189
- if (!existsSync9(modules) || readlinkSync(modules) !== target) {
21439
+ if (!existsSync9(modules) || readlinkSync2(modules) !== target) {
21190
21440
  rmSync7(modules, { recursive: true, force: true });
21191
- symlinkSync2(target, modules);
21441
+ symlinkSync3(target, modules);
21192
21442
  }
21193
21443
  writeFileSync7(path23.join(slot, SWIFT_FRAMEWORK_SLOT_RELEASE), release);
21194
21444
  writeFileSync7(path23.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), frameworkKey);
@@ -21207,7 +21457,7 @@ ${args.frameworkKey}
21207
21457
  hash.update("package-host-macros\n" + JSON.stringify(args.packageHostMacros));
21208
21458
  if (!args.prebuilt) return hash.digest("hex");
21209
21459
  const statOf = (file) => {
21210
- const stat = statSync4(file, { bigint: true });
21460
+ const stat = statSync5(file, { bigint: true });
21211
21461
  return `${stat.size}:${stat.mtimeNs}`;
21212
21462
  };
21213
21463
  for (const object2 of args.prebuilt.objects)
@@ -21310,7 +21560,7 @@ async function compileSwiftProjectOnce(sources, options) {
21310
21560
  const distribution = swiftDistributionAt(moduleRoot);
21311
21561
  const mirrorDistribution = options.linkOnly || options.project ? null : distribution;
21312
21562
  if (distribution) refreshSwiftCacheHold(moduleRoot);
21313
- const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-ULD72CI5.mjs")).useSwiftPackagePrebuilts(
21563
+ const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-ZFFWBI33.mjs")).useSwiftPackagePrebuilts(
21314
21564
  sources,
21315
21565
  moduleRoot,
21316
21566
  options.toolchainBin
@@ -21323,7 +21573,7 @@ async function compileSwiftProjectOnce(sources, options) {
21323
21573
  sources: path23.join(root, "Sources", "App"),
21324
21574
  multi: compileTargets(input).length > 0
21325
21575
  };
21326
- const sdkImage = options.linkOnly ? void 0 : await (await import("./swift-sdk-image-KDJATRA6.mjs")).buildSwiftSdkImage(
21576
+ const sdkImage = options.linkOnly ? void 0 : await (await import("./swift-sdk-image-J2DE3SBW.mjs")).buildSwiftSdkImage(
21327
21577
  moduleRoot,
21328
21578
  !!guestGraph,
21329
21579
  distribution ? [] : linkedFrameworkTargets(moduleRoot, input).imports,
@@ -21464,8 +21714,15 @@ ${compatShape}` : "";
21464
21714
  frameworkLease
21465
21715
  );
21466
21716
  const compileFrameworkRoot2 = distribution ? swiftDistributionCompileView(frameworkRoot2, distribution) : frameworkRoot2;
21467
- const sdk2 = swiftModuleSdk(frameworkRoot2).wasmSdkId;
21468
- const icu2 = options.linkOnly ? null : swiftIcuAsset(options.toolchainBin, sdk2);
21717
+ const sdk = swiftModuleSdk(frameworkRoot2).wasmSdkId;
21718
+ const compileSdk2 = mirrorDistribution ? syncSwiftSdkMirror(root2, frameworkRoot2, options.toolchainBin, sdk) : {
21719
+ id: sdk,
21720
+ options: swiftCompileSdkOptions(frameworkRoot2, options.toolchainBin),
21721
+ toolsetChanged: false
21722
+ };
21723
+ if (mirrorDistribution && compileSdk2.toolsetChanged)
21724
+ clearSwiftSdkPathsCache(path23.join(root2, SWIFT_SDK_MIRROR));
21725
+ const icu2 = options.linkOnly ? null : swiftIcuAsset(options.toolchainBin, sdk);
21469
21726
  let prebuilt2;
21470
21727
  if (!distribution) {
21471
21728
  if (allowWrite) stage("compiling framework products");
@@ -21476,7 +21733,7 @@ ${compatShape}` : "";
21476
21733
  frameworkKey,
21477
21734
  input,
21478
21735
  swift,
21479
- sdk: sdk2,
21736
+ sdk,
21480
21737
  toolchainBin: options.toolchainBin,
21481
21738
  plugins: macroPlugins2,
21482
21739
  buildOptions: {
@@ -21501,7 +21758,8 @@ ${compatShape}` : "";
21501
21758
  frameworkRoot: frameworkRoot2,
21502
21759
  compileFrameworkRoot: compileFrameworkRoot2,
21503
21760
  macroPlugins: macroPlugins2,
21504
- sdk: sdk2,
21761
+ sdk,
21762
+ compileSdk: compileSdk2,
21505
21763
  icu: icu2,
21506
21764
  prebuilt: prebuilt2,
21507
21765
  readHold: readHold2
@@ -21522,7 +21780,7 @@ ${compatShape}` : "";
21522
21780
  frameworkRoot,
21523
21781
  compileFrameworkRoot,
21524
21782
  macroPlugins,
21525
- sdk,
21783
+ compileSdk,
21526
21784
  icu,
21527
21785
  prebuilt
21528
21786
  } = frameworks;
@@ -21540,13 +21798,13 @@ ${compatShape}` : "";
21540
21798
  if (retireStaleSwiftLink(
21541
21799
  root2,
21542
21800
  swiftLinkStamp({
21543
- frameworkKey: `${options.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
21801
+ frameworkKey: mirrorDistribution ? `${options.release}\0mirror` : `${options.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
21544
21802
  packageHostMacros
21545
21803
  }),
21546
21804
  swiftLinkStamp({
21547
- // a distribution's objects reach only the deferred link, and
21548
- // the root's mirror keeps its compile inputs at fixed paths
21549
- frameworkKey: distribution ? `${options.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
21805
+ // mirrored distributions and their WASI SDK mirror invalidate
21806
+ // dependents per changed file instead of wiping every Clang object.
21807
+ frameworkKey: mirrorDistribution ? `${options.release}\0mirror` : distribution ? `${options.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
21550
21808
  prebuilt,
21551
21809
  packageHostMacros
21552
21810
  }),
@@ -21560,7 +21818,8 @@ ${compatShape}` : "";
21560
21818
  frameworkRoot,
21561
21819
  prebuilt,
21562
21820
  !options.project,
21563
- options.project ? false : options.objcPrebuiltStage ?? (options.intermediates ? false : void 0)
21821
+ options.project ? false : options.objcPrebuiltStage ?? (options.intermediates ? false : void 0),
21822
+ compileSdk
21564
21823
  );
21565
21824
  const productFile = path23.join(frameworkRoot, SWIFT_FRAMEWORK_PRODUCT_FILE);
21566
21825
  writeSwiftAutolinkLinker(
@@ -21599,7 +21858,7 @@ ${compatShape}` : "";
21599
21858
  ""
21600
21859
  ].join("\n")
21601
21860
  );
21602
- chmodSync3(swiftc, 493);
21861
+ chmodSync4(swiftc, 493);
21603
21862
  compiler.SWIFT_EXEC = swiftc;
21604
21863
  compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
21605
21864
  compiler.PEACH_SWIFTC = path23.join(options.toolchainBin, "swiftc");
@@ -21636,6 +21895,7 @@ ${compatShape}` : "";
21636
21895
  const jobs = swiftCompilerJobs();
21637
21896
  const incrementalPreview = sdkImage !== void 0 && !guestGraph && !options.project && !input.optimize && !input.unoptimized;
21638
21897
  const perFile = input.unoptimized || incrementalPreview;
21898
+ const reproducibleFrameworkRoot = mirrorDistribution ? frameworkRoot : compileFrameworkRoot;
21639
21899
  const buildArgs = [
21640
21900
  "build",
21641
21901
  ...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
@@ -21645,10 +21905,10 @@ ${compatShape}` : "";
21645
21905
  String(jobs),
21646
21906
  "--package-path",
21647
21907
  root2,
21648
- ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
21908
+ ...compileSdk.options,
21649
21909
  ...swiftObjCSelectorOptions(frameworkRoot),
21650
21910
  "--swift-sdk",
21651
- sdk,
21911
+ compileSdk.id,
21652
21912
  ...preparation.targetToolset ? ["--toolset", path23.join(root2, ".peach-target-toolset.json")] : [],
21653
21913
  "-c",
21654
21914
  "release",
@@ -21683,7 +21943,7 @@ ${compatShape}` : "";
21683
21943
  ],
21684
21944
  ...swiftReproducibleBuildFlags([
21685
21945
  [path23.dirname(options.toolchainBin), "toolchain"],
21686
- [compileFrameworkRoot, "framework"],
21946
+ [reproducibleFrameworkRoot, "framework"],
21687
21947
  [root2, "build"],
21688
21948
  ...forwarders
21689
21949
  ]).flatMap((flag, index, flags) => {
@@ -21693,8 +21953,8 @@ ${compatShape}` : "";
21693
21953
  let mapped = flag;
21694
21954
  for (const [dir, target] of [
21695
21955
  [root2, "/peach/build"],
21696
- [compileFrameworkRoot, "/peach/framework"],
21697
- [realpathSync6(compileFrameworkRoot), "/peach/framework"],
21956
+ [reproducibleFrameworkRoot, "/peach/framework"],
21957
+ [realpathSync6(reproducibleFrameworkRoot), "/peach/framework"],
21698
21958
  [toolchainDir, "/peach/toolchain"],
21699
21959
  [realpathSync6(toolchainDir), "/peach/toolchain"]
21700
21960
  ]) {
@@ -21719,12 +21979,18 @@ ${compatShape}` : "";
21719
21979
  ];
21720
21980
  const linked = builtArtifact(layout3);
21721
21981
  rmSync7(path23.join(root2, ".peach-link.rsp"), { force: true });
21722
- if (options.linkOnly || existsSync9(linked) && statSync4(linked).size <= 8)
21982
+ if (options.linkOnly || existsSync9(linked) && statSync5(linked).size <= 8)
21723
21983
  rmSync7(linked, { force: true });
21724
21984
  stage("compiling and linking Swift modules");
21725
21985
  const frameworkInterfaces = /* @__PURE__ */ new Map();
21986
+ const compileSdkPaths = swiftSdkPaths(
21987
+ frameworkRoot,
21988
+ options.toolchainBin,
21989
+ compileSdk.options,
21990
+ compileSdk.id
21991
+ );
21726
21992
  const sdkFrameworks = path23.join(
21727
- swiftSdkPaths(frameworkRoot, options.toolchainBin).darwin,
21993
+ compileSdkPaths.darwin,
21728
21994
  "System/Library/Frameworks"
21729
21995
  );
21730
21996
  const generatedInterface = (source) => withoutImportedSdkEnumForwards(
@@ -21861,7 +22127,7 @@ ${compatShape}` : "";
21861
22127
  if (!options.project && producers.length === 0 && buildDbExists) {
21862
22128
  const expectedObjects = preparation.nativeStageObjects.get(target);
21863
22129
  if (expectedObjects && expectedObjects.length > 0 && expectedObjects.every(
21864
- (relative) => statSync4(path23.join(releaseDir, relative), {
22130
+ (relative) => statSync5(path23.join(releaseDir, relative), {
21865
22131
  throwIfNoEntry: false
21866
22132
  })?.isFile()
21867
22133
  ))
@@ -21928,7 +22194,7 @@ ${compatShape}` : "";
21928
22194
  options.toolchainBin,
21929
22195
  recipe,
21930
22196
  new Map(
21931
- preparation.headerBuilds[0].producers.map((producer) => {
22197
+ preparation.headerBuilds.flatMap((stage2) => stage2.producers).map((producer) => {
21932
22198
  const paths = headerPaths(producer);
21933
22199
  return [
21934
22200
  swiftTargetModuleName(producer),
@@ -22002,7 +22268,7 @@ ${compatShape}` : "";
22002
22268
  resourceReferences
22003
22269
  );
22004
22270
  if (options.linkOnly) {
22005
- if (statSync4(linked).size <= 8)
22271
+ if (statSync5(linked).size <= 8)
22006
22272
  throw new Error("swift-compile: deferred linker produced no executable");
22007
22273
  stage("project link verified");
22008
22274
  if (readHold && retainSwiftRootReadHold(readHold)) readHold = void 0;
@@ -22022,7 +22288,7 @@ ${compatShape}` : "";
22022
22288
  moduleRoot: frameworkRoot,
22023
22289
  toolchainBin: options.toolchainBin,
22024
22290
  swiftCompiler: preparation.headerCompiler ? path23.join(root2, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? path23.join(options.toolchainBin, "swiftc"),
22025
- sysroot: swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot,
22291
+ sysroot: compileSdkPaths.sysroot,
22026
22292
  sdk: swiftModuleSdk(frameworkRoot),
22027
22293
  sdkImage,
22028
22294
  compilerDigest: compilerSourceDigest,
@@ -22042,7 +22308,7 @@ ${compatShape}` : "";
22042
22308
  });
22043
22309
  sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
22044
22310
  } else {
22045
- const { buildSwiftAppModule } = await import("./swift-sdk-app-module-VXSTLD57.mjs");
22311
+ const { buildSwiftAppModule } = await import("./swift-sdk-app-module-UZ6BZSES.mjs");
22046
22312
  const binding = await buildSwiftAppModule({
22047
22313
  buildRoot: root2,
22048
22314
  toolchainBin: options.toolchainBin,
@@ -22052,9 +22318,7 @@ ${compatShape}` : "";
22052
22318
  project: options.project && {
22053
22319
  ...options.project,
22054
22320
  env: { ...options.project.env, ...projectProcess?.env },
22055
- sdkRoot: path23.dirname(
22056
- swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot
22057
- ),
22321
+ sdkRoot: path23.dirname(compileSdkPaths.sysroot),
22058
22322
  linked: output
22059
22323
  }
22060
22324
  });
@@ -22084,6 +22348,8 @@ ${compatShape}` : "";
22084
22348
 
22085
22349
  export {
22086
22350
  DARWIN_RECORDS_PREFIX,
22351
+ SWIFT_DISTRIBUTION_MIRROR,
22352
+ SWIFT_SDK_MIRROR,
22087
22353
  peachGuestServiceAllowlist,
22088
22354
  guestWasmDataSegments,
22089
22355
  assertPeachGuestEngineLink,