peachsim 0.1.2224 → 0.1.2228

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 (171) hide show
  1. package/cli/bridge-flow-runner.ts +56 -3
  2. package/cli/commands/control.ts +27 -1
  3. package/cli/commands/flow.ts +26 -0
  4. package/cli/commands/package.ts +9 -2
  5. package/cli/drivers/playwright.ts +1 -0
  6. package/cli/drivers/types.ts +3 -0
  7. package/cli/internal-child.ts +4 -2
  8. package/dist-lib/agent-daemon-client.cjs +1 -1
  9. package/dist-lib/agent-events.cjs +1 -1
  10. package/dist-lib/attached-projects.cjs +1 -1
  11. package/dist-lib/auth/shared-session.cjs +1 -1
  12. package/dist-lib/backend-origin.cjs +1 -1
  13. package/dist-lib/beta.cjs +1 -1
  14. package/dist-lib/beta.mjs +1 -1
  15. package/dist-lib/bridge-constants.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.cjs +1 -1
  17. package/dist-lib/bridge-contract-input.mjs +1 -1
  18. package/dist-lib/bridge-contract.cjs +1 -1
  19. package/dist-lib/bridge-contract.mjs +1 -1
  20. package/dist-lib/bundle-channel.cjs +931 -455
  21. package/dist-lib/capture-contract.cjs +1 -1
  22. package/dist-lib/capture-contract.mjs +1 -1
  23. package/dist-lib/cloud-contract.cjs +1 -1
  24. package/dist-lib/cloud-contract.mjs +1 -1
  25. package/dist-lib/cloud-test-args.cjs +1 -1
  26. package/dist-lib/cloud-test-args.mjs +1 -1
  27. package/dist-lib/cloud.cjs +1 -1
  28. package/dist-lib/cloud.mjs +1 -1
  29. package/dist-lib/config.cjs +1 -1
  30. package/dist-lib/config.mjs +1 -1
  31. package/dist-lib/detox/index.cjs +2 -2
  32. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  33. package/dist-lib/expo-swift-bundle.cjs +867 -391
  34. package/dist-lib/expo-swift-metadata.cjs +1 -1
  35. package/dist-lib/expo-swift-metadata.mjs +1 -1
  36. package/dist-lib/home-paths.cjs +1 -1
  37. package/dist-lib/host/bridge-host.cjs +926 -450
  38. package/dist-lib/host/fetch-proxy-handler.cjs +55 -12
  39. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  40. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  41. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  42. package/dist-lib/host/websocket-proxy.cjs +1 -1
  43. package/dist-lib/index.cjs +60 -16
  44. package/dist-lib/jump-to-source-babel.cjs +1 -1
  45. package/dist-lib/jump-to-source-native.cjs +1 -1
  46. package/dist-lib/kotlin-host.cjs +1 -1
  47. package/dist-lib/menu.cjs +1 -1
  48. package/dist-lib/menu.mjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  50. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  51. package/dist-lib/metro-production-bundle.cjs +11 -4
  52. package/dist-lib/metro-production-bundle.mjs +10 -4
  53. package/dist-lib/metro.cjs +60 -16
  54. package/dist-lib/native-app-identity-project.cjs +53 -9
  55. package/dist-lib/native-app-identity-project.mjs +84 -37
  56. package/dist-lib/native-app-identity.cjs +1 -1
  57. package/dist-lib/native-app-identity.mjs +1 -1
  58. package/dist-lib/native-firebase-metadata.cjs +1 -1
  59. package/dist-lib/native-firebase-metadata.mjs +1 -1
  60. package/dist-lib/pdfium-raster.cjs +1 -1
  61. package/dist-lib/pdfium-raster.mjs +1 -1
  62. package/dist-lib/plist.cjs +1 -1
  63. package/dist-lib/plist.mjs +1 -1
  64. package/dist-lib/profiles.cjs +1 -1
  65. package/dist-lib/public-brand.cjs +1 -1
  66. package/dist-lib/public-origins-lib-esm.json +26 -24
  67. package/dist-lib/public-origins-lib.json +66 -54
  68. package/dist-lib/react-native-host-modules.cjs +1 -1
  69. package/dist-lib/react-native-host-modules.mjs +1 -1
  70. package/dist-lib/reap-browser.cjs +1 -1
  71. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  72. package/dist-lib/sdk.cjs +1 -1
  73. package/dist-lib/sdk.mjs +1 -1
  74. package/dist-lib/skills.cjs +1049 -512
  75. package/dist-lib/swift-compile.cjs +557 -121
  76. package/dist-lib/swift-compile.mjs +693 -258
  77. package/dist-lib/swift-package.cjs +1 -1
  78. package/dist-lib/swift-package.mjs +1 -1
  79. package/dist-lib/swift-submit.cjs +1 -1
  80. package/dist-lib/swift-submit.mjs +1 -1
  81. package/dist-lib/swift-toolchain.cjs +38 -2
  82. package/dist-lib/swift.cjs +1 -1
  83. package/dist-lib/vite-swift.cjs +1726 -1209
  84. package/dist-lib/vite.cjs +55 -12
  85. package/dist-lib/worklet-executable.cjs +1 -1
  86. package/dist-lib/worklet-executable.mjs +1 -1
  87. package/dist-types/packages/peach-engine/src/bundle-parse-receipt.d.ts +17 -0
  88. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +2 -1
  89. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +2 -2
  90. package/dist-types/packages/peach-engine/src/engine/native-layout.d.ts +1 -0
  91. package/dist-types/packages/peach-engine/src/engine/native-paragraph.d.ts +4 -0
  92. package/dist-types/packages/peach-engine/src/engine/node.d.ts +2 -0
  93. package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +1 -1
  94. package/dist-types/packages/peach-engine/src/engine/types.d.ts +7 -0
  95. package/dist-types/packages/peach-engine/src/engine/yoga-layout.d.ts +2 -0
  96. package/dist-types/packages/peach-engine/src/metro-fingerprint.d.ts +3 -2
  97. package/dist-types/packages/peach-engine/src/preview/preview-room-contract.d.ts +6 -0
  98. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
  99. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -3
  100. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +0 -5
  101. package/dist-types/packages/peach-kit/src/capabilities.d.ts +2 -0
  102. package/dist-types/packages/peach-kit/src/internal.d.ts +1 -1
  103. package/dist-types/packages/peach-kit/src/ios-tint.d.ts +2 -0
  104. package/kotlin/sdk.tar.gz +0 -0
  105. package/package.json +1 -1
  106. package/runtime-companion.json +1 -1
  107. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h +0 -6
  108. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h +1 -1
  109. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSURL.h +1 -1
  110. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIControl.h +0 -26
  111. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +27 -0
  112. package/sdk/ios/usr/include/AvailabilityInternal.h +2 -2
  113. package/sdk/ios/usr/include/ObjectiveC.apinotes +380 -7
  114. package/sdk/ios/usr/include/peach/pthread.h +1 -7
  115. package/sdk/ios/wasm/include/TargetConditionals.h +2 -3
  116. package/sdk/ios/wasm/include/__struct_timeval.h +15 -0
  117. package/sdk/ios/wasm/include/__typedef_suseconds_t.h +9 -0
  118. package/sdk/ios/wasm/include/limits.h +1 -1
  119. package/sdk/ios/wasm/include/machine/_types.h +1 -1
  120. package/sdk/ios/wasm/include/machine/limits.h +1 -1
  121. package/sdk/ios/wasm/include/machine/param.h +2 -2
  122. package/sdk/ios/wasm/include/math.h +13 -0
  123. package/sdk/ios/wasm/include/pthread.h +1 -13
  124. package/sdk/ios/wasm/include/sys/resource.h +3 -0
  125. package/sdk/ios/wasm/include/sys/socket.h +0 -10
  126. package/sdk/ios/wasm/include/sys/stat.h +5 -2
  127. package/sdk/ios/wasm/include/sys/time.h +16 -3
  128. package/sdk/ios/wasm/include/sys/types.h +4 -1
  129. package/sdk/ios/wasm/include/time.h +2 -0
  130. package/sdk/ios/wasm/storage-include/TargetConditionals.h +2 -3
  131. package/sdk/native-hashes.json +14 -14
  132. package/src/metro-production-bundle.ts +15 -2
  133. package/src/native-slices.ts +3 -2
  134. package/src/native-static-libraries.ts +23 -23
  135. package/src/native-swift-slices.ts +2 -2
  136. package/src/nitro-adapter.lock.json +288 -288
  137. package/src/nitro-compiler-digest.ts +0 -1
  138. package/src/nitro-dependencies.ts +8 -9
  139. package/src/nitro-superset.lock.json +4 -4
  140. package/src/react-native-core-build.ts +2 -2
  141. package/src/swift-compile.ts +209 -47
  142. package/src/swift-compiler-digest.ts +2 -0
  143. package/src/swift-cxx-standin.ts +1 -1
  144. package/src/swift-darwin-records.ts +4 -4
  145. package/src/swift-distribution-contract.ts +2 -2
  146. package/src/swift-distribution.lock.json +13 -12
  147. package/src/swift-guest-compile.ts +6 -5
  148. package/src/swift-guest-image-ledger.ts +5 -5
  149. package/src/swift-guest-link.ts +1 -1
  150. package/src/swift-guest-linked-spans.ts +7 -4
  151. package/src/swift-guest-manifest.ts +2 -2
  152. package/src/swift-guest-source-inputs.ts +16 -5
  153. package/src/swift-host.ts +10 -5
  154. package/src/swift-icu.ts +1 -1
  155. package/src/swift-objc-compile.ts +9 -4
  156. package/src/swift-objc-standin.ts +1 -4
  157. package/src/swift-package-manifest.ts +5 -1
  158. package/src/swift-packages.ts +2 -2
  159. package/src/swift-shared-sdk.ts +1 -1
  160. package/src/swift-standin-emit.ts +3 -16
  161. package/src/swift-standins.ts +119 -87
  162. package/src/swift-toolchain.ts +37 -1
  163. package/src/swift-uniform-type-constants.ts +1 -1
  164. package/src/swift-wasm-prune.ts +17 -12
  165. package/src/swiftGuestImageContract.ts +4 -4
  166. package/src/swiftNativePinContract.ts +1 -1
  167. package/src/swiftRuntimeProductContract.ts +1 -1
  168. package/src/turbo-runtime.lock.json +28 -28
  169. package/src/wasm-narrow-boundary.ts +296 -0
  170. package/src/wasm-optimize.ts +59 -14
  171. package/src/xcode-project.ts +6 -4
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.2224 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.2228 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
39
39
  var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
40
40
  var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
41
41
  "<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
42
- define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "29c2661be4b952101c9b9b8fd861560e6ce63b25dd4464f47475aaf72024f4fe", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "25505683ca29a0b380413bf2a5026d4967eacf886e35bc11ece6e15317e5bb02", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "b6e04100805ba81f14d751383416fd4aab46901a6f94f5b62f831e66c28001c1", "xcode-target-members.ts": "d49af77a690cff481b38333b5f63f6600123b1bb57f410b0adb298b010d2047b", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
42
+ define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1", "swift-coverage/source.ts": "c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b", "swift-package.ts": "338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "8deef5a824ed49209458a4b398cd8e88df260a0c8f1894d568279f6211866547", "home-paths.ts": "d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "40ec039e7a2920e6b4e7610986eb3ba75c5811eed4ea41570c2a7e2424911721", "xcode-target-members.ts": "d49af77a690cff481b38333b5f63f6600123b1bb57f410b0adb298b010d2047b", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
43
43
  }
44
44
  });
45
45
 
@@ -869,7 +869,7 @@ function glogSources() {
869
869
  for (const unit2 of GLOG_UNITS) sources.push(read(unit2));
870
870
  return sources;
871
871
  }
872
- var import_node_child_process2, import_node_crypto2, import_node_fs5, import_node_path5, import_node_util2, run2, DOUBLE_CONVERSION_WASM32_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
872
+ var import_node_child_process2, import_node_crypto2, import_node_fs5, import_node_path5, import_node_util2, run2, DOUBLE_CONVERSION_WASM64_BACKPORT, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
873
873
  var init_nitro_dependencies = __esm({
874
874
  "src/nitro-dependencies.ts"() {
875
875
  "use strict";
@@ -885,12 +885,12 @@ var init_nitro_dependencies = __esm({
885
885
  init_swift_source_file();
886
886
  init_swift_submit();
887
887
  run2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
888
- DOUBLE_CONVERSION_WASM32_BACKPORT = {
888
+ DOUBLE_CONVERSION_WASM64_BACKPORT = {
889
889
  upstreamCommit: "8857767d5b2f5a035321e3712e8cd0008840ba6b",
890
890
  originalSha256: "b495b11f7b61693486894f747add5b454894b8b3ca41aa1610d370ba16407ab7",
891
- derivedSha256: "642d9f83289672def295f6a0a4f8c94823c20c3186e2b1b9ec36b436cb366da8",
891
+ derivedSha256: "d8e40c283479c1d8682646a65a869ed42c68b6dc3fb27e502aed5291d7dd223c",
892
892
  before: " defined(__AARCH64EL__)\n",
893
- after: " defined(__AARCH64EL__) || defined(__wasm32__)\n"
893
+ after: " defined(__AARCH64EL__) || defined(__wasm64__)\n"
894
894
  };
895
895
  RN_SHARED_DEPENDENCIES = [
896
896
  {
@@ -917,7 +917,7 @@ var init_nitro_dependencies = __esm({
917
917
  prefix: "double-conversion-1.1.6",
918
918
  headers: { from: "src", to: "double-conversion" },
919
919
  files: /\.(?:h|cc)$/,
920
- backport: { file: "src/utils.h", ...DOUBLE_CONVERSION_WASM32_BACKPORT }
920
+ backport: { file: "src/utils.h", ...DOUBLE_CONVERSION_WASM64_BACKPORT }
921
921
  },
922
922
  {
923
923
  name: "fast_float",
@@ -1030,7 +1030,7 @@ var init_nitro_dependencies = __esm({
1030
1030
  PACKAGE_TARNAME: '"glog"',
1031
1031
  PACKAGE_URL: '""',
1032
1032
  PACKAGE_VERSION: '"0.3.5"',
1033
- SIZEOF_VOID_P: "4",
1033
+ SIZEOF_VOID_P: "8",
1034
1034
  STDC_HEADERS: "1",
1035
1035
  STL_NAMESPACE: "std",
1036
1036
  TEST_SRC_DIR: '"."',
@@ -3885,7 +3885,7 @@ function parseOpenStepPlist(text6) {
3885
3885
  } else return;
3886
3886
  }
3887
3887
  };
3888
- const quoted = () => {
3888
+ const quoted2 = () => {
3889
3889
  i++;
3890
3890
  let out = "";
3891
3891
  for (; ; ) {
@@ -3943,7 +3943,7 @@ function parseOpenStepPlist(text6) {
3943
3943
  else if (text6[i] !== ")") fail("expected , or )");
3944
3944
  }
3945
3945
  }
3946
- if (ch === '"') return quoted();
3946
+ if (ch === '"') return quoted2();
3947
3947
  const start = i;
3948
3948
  while (i < text6.length && /[A-Za-z0-9_$+/:.\-<>]/.test(text6[i])) i++;
3949
3949
  if (i === start) fail(`unexpected ${JSON.stringify(ch ?? "end of file")}`);
@@ -8210,7 +8210,7 @@ function validateSwiftSdkIdentity(sdk) {
8210
8210
  function swiftSdkBundle(swift, id, options) {
8211
8211
  const configuration = (0, import_node_child_process13.execFileSync)(
8212
8212
  swift,
8213
- ["sdk", "configure", ...options, "--show-configuration", id, "wasm32-unknown-wasip1"],
8213
+ ["sdk", "configure", ...options, "--show-configuration", id, "wasm64-unknown-wasip1"],
8214
8214
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
8215
8215
  );
8216
8216
  const sysroot = /^sdkRootPath: (.+)$/m.exec(configuration)?.[1]?.trim();
@@ -8553,6 +8553,42 @@ var init_swift_toolchain = __esm({
8553
8553
  SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
8554
8554
  SWIFT_HOST_COMPILER_ID = "81b2c791c27276bf";
8555
8555
  compilerArchives = {
8556
+ "swift-6.4.0-RELEASE-custom-fb42d2535739dfd2": {
8557
+ identity: "fb42d2535739dfd2",
8558
+ archive: "tar.zst",
8559
+ hosts: {
8560
+ "darwin-arm64": {
8561
+ checksum: "5e417d415ca74a435755e298a1d2d19ec47637fd03479de7a7d958eb382941f1",
8562
+ manifest: "eb5a0356aebabe89c7b2780f8809e13d6e2ad6f342fed87cf99f9a5834344363"
8563
+ },
8564
+ "linux-arm64": {
8565
+ checksum: "8ac7ad97f3d68bf485423001d1ce3cd92a8d4625313c47c8071867a9aeed3af9",
8566
+ manifest: "6126266dd65b43c43d719e4dc4d33c4ea6a3267f99f34e3638637439a995af2e"
8567
+ },
8568
+ "linux-x64": {
8569
+ checksum: "7d76463079619ba822123d250601bd35f6744ed5f8054a657ce472ce4dac76c8",
8570
+ manifest: "f1a6c0c61d15eddb2ecfa4c3a72a5154621881ac2f0c413162ff1d0f4343bd0e"
8571
+ }
8572
+ }
8573
+ },
8574
+ "swift-6.4.0-RELEASE-custom-44ecd25f163bb359": {
8575
+ identity: "44ecd25f163bb359",
8576
+ archive: "tar.zst",
8577
+ hosts: {
8578
+ "darwin-arm64": {
8579
+ checksum: "d06dda4435f99d8376179cc7a3804907aa7305513135ece6288fd8e6d4695ae6",
8580
+ manifest: "bc0d8b955f923f096dda2aa8bbb1d56176a73f3d4a4df4cc9a1f59d31417061a"
8581
+ },
8582
+ "linux-x64": {
8583
+ checksum: "f95b56440693c5de7995f10ea14c57fc7e659a161018a17f17a74b61a98e88a4",
8584
+ manifest: "c18a60b14d5c89a8b2e1dbb2b4b52342c5fb92c7f3069fdc55c985bce61683a7"
8585
+ },
8586
+ "linux-arm64": {
8587
+ checksum: "afb74ae60df2b5bd7792bfbcf29bcea03675a5c814b758dd6cb91a760c220cd2",
8588
+ manifest: "ac037f6b0fdc4a6ae582eebc22bcf811fa2becdc30d083057137fc857f3c456a"
8589
+ }
8590
+ }
8591
+ },
8556
8592
  "swift-6.4.0-RELEASE-custom-11345d60dca47496": {
8557
8593
  identity: "11345d60dca47496",
8558
8594
  archive: "tar.zst",
@@ -9970,7 +10006,7 @@ function emitSwiftStandin(sourceGraphs, options) {
9970
10006
  "Equatable",
9971
10007
  "CustomStringConvertible",
9972
10008
  "CustomDebugStringConvertible"
9973
- ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path74)?.has(name3)
10009
+ ].includes(name3)) && !(name3 === nsObjectProtocol && externalRoot(id) === nsObject) && !options.unconformed?.get(path74)?.has(name3.split(/::|\./).pop()) && !options.unconformed?.get(path74)?.has(name3)
9974
10010
  )
9975
10011
  ].filter((name3, at, all2) => all2.indexOf(name3) === at);
9976
10012
  const parentSymbol = superId.has(id) ? byId.get(superId.get(id)) : void 0;
@@ -10090,8 +10126,7 @@ function emitSwiftStandin(sourceGraphs, options) {
10090
10126
  for (const member of members2) {
10091
10127
  if (raw2 && (leaf(member) === "rawValue" || leaf(member) === "init(rawValue:)" || leaf(member) === "init(_:)" || synthesizedEquality(member, list2)))
10092
10128
  continue;
10093
- const header2 = values.get(member.identifier.precise);
10094
- const value = header2 === void 0 ? void 0 : atWidth(header2, raw2);
10129
+ const value = values.get(member.identifier.precise);
10095
10130
  if (value !== void 0 && member.kind.identifier === "swift.type.property") {
10096
10131
  emit(
10097
10132
  `${inner}public static let ${tick(leaf(member))} = ${shape.name}(rawValue: ${value})`
@@ -10137,8 +10172,7 @@ function emitSwiftStandin(sourceGraphs, options) {
10137
10172
  );
10138
10173
  const seenValues = /* @__PURE__ */ new Map();
10139
10174
  for (const member of cases) {
10140
- const header2 = values.get(member.identifier.precise);
10141
- const value = header2 === void 0 ? void 0 : atWidth(header2, raw2);
10175
+ const value = values.get(member.identifier.precise);
10142
10176
  if (value !== void 0 && seenValues.has(value)) {
10143
10177
  emit(
10144
10178
  `${inner}public static var ${tick(leaf(member))}: ${shape.name} { .${seenValues.get(value)} }`
@@ -10303,7 +10337,6 @@ function emitSwiftStandin(sourceGraphs, options) {
10303
10337
  }
10304
10338
  return null;
10305
10339
  };
10306
- const atWidth = (value, raw2) => (raw2 === "UInt" || raw2 === "Swift.UInt") && value === "18446744073709551615" ? "4294967295" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "9223372036854775807" ? "2147483647" : (raw2 === "Int" || raw2 === "Swift.Int") && value === "-9223372036854775808" ? "-2147483648" : value;
10307
10340
  const emitGlobal = scoped((symbol2) => {
10308
10341
  const path74 = pathOf(symbol2);
10309
10342
  const kind = symbol2.kind.identifier;
@@ -10697,14 +10730,11 @@ function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
10697
10730
  return [
10698
10731
  ...swiftObjCPlatformFlags(toolchainBin, minimum),
10699
10732
  // AvailabilityInternal.h derives these through __is_target_os(ios), which
10700
- // is false for wasm32. the maximum is the sdk the headers come from, as
10733
+ // is false for wasm64. the maximum is the sdk the headers come from, as
10701
10734
  // xcode defines it, so `#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_26_0`
10702
10735
  // sources see the members the sdk declares instead of a 17.0 default.
10703
10736
  `-D__IPHONE_OS_VERSION_MIN_REQUIRED=${minimum}`,
10704
10737
  `-D__IPHONE_OS_VERSION_MAX_ALLOWED=__IPHONE_${NATIVE_GRAPH_SDK_VERSION.replace(".", "_")}`,
10705
- // apple's build setting for a 32-bit target to keep NSInteger and
10706
- // NSUInteger long, the nominal types they have on arm64.
10707
- "-DNS_BUILD_32_LIKE_64=1",
10708
10738
  // the installed libc's default feature set otherwise defines
10709
10739
  // _XOPEN_SOURCE, which darwin's sys/cdefs.h turns into a strict posix
10710
10740
  // level; iOS compiles at darwin's full level with neither defined.
@@ -12035,7 +12065,7 @@ function swiftSharedSdkViewOptions(moduleRoot, distribution, toolchainBin, sdk)
12035
12065
  ...swiftSdkOptions(),
12036
12066
  "--show-configuration",
12037
12067
  sdk,
12038
- "wasm32-unknown-wasip1"
12068
+ "wasm64-unknown-wasip1"
12039
12069
  ],
12040
12070
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
12041
12071
  );
@@ -12194,7 +12224,7 @@ function compileDarwinRecords(args) {
12194
12224
  (0, import_node_child_process17.execFileSync)(
12195
12225
  import_node_path31.default.join(args.bin, "clang"),
12196
12226
  [
12197
- "--target=wasm32-unknown-wasip1",
12227
+ "--target=wasm64-unknown-wasip1",
12198
12228
  `--sysroot=${args.sysroot}`,
12199
12229
  "-Oz",
12200
12230
  "-g0",
@@ -12205,7 +12235,7 @@ function compileDarwinRecords(args) {
12205
12235
  `-ffile-prefix-map=${records}${import_node_path31.default.sep}=DarwinRecords/`,
12206
12236
  // apple's headers select on the ios identity original units compile
12207
12237
  // with, and TargetConditionals.h refuses a compiler without it
12208
- ...file.endsWith(".m") ? objcSdkIntakeFlags(args.darwin, args.bin, args.minimum) : [
12238
+ ...file === "sysctl.c" || file.endsWith(".m") ? objcSdkIntakeFlags(args.darwin, args.bin, args.minimum) : [
12209
12239
  ...swiftObjCPlatformFlags(args.bin, args.minimum),
12210
12240
  ...WASI_EMULATION_FLAGS,
12211
12241
  // the sdk build compiles these with libobjc2's headers in
@@ -12826,7 +12856,7 @@ var init_swiftRuntimeProductContract = __esm({
12826
12856
  v.object({
12827
12857
  id: v.string(),
12828
12858
  installName: v.string(),
12829
- target: v.literal("wasm32-unknown-wasip1"),
12859
+ target: v.literal("wasm64-unknown-wasip1"),
12830
12860
  linkNames: v.array(v.string()),
12831
12861
  // absent records declare no framework namespace, even when a library name matches.
12832
12862
  frameworkAliases: v.optional(
@@ -13756,7 +13786,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
13756
13786
  } else {
13757
13787
  lazyBuildObjects.set(t, parseWasmObjectCached(t, false, false));
13758
13788
  }
13759
- } else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm32.a") && import_node_fs35.default.existsSync(t)) {
13789
+ } else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && import_node_fs35.default.existsSync(t)) {
13760
13790
  const members2 = readArMembers(new Uint8Array(import_node_fs35.default.readFileSync(t)));
13761
13791
  for (const m of members2) {
13762
13792
  extraArchiveObjs.push(parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false));
@@ -14238,7 +14268,11 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
14238
14268
  }
14239
14269
  }
14240
14270
  const keptDataRelocBytes = [];
14241
- const zeroDataRelocOffsets = [];
14271
+ const zeroDataRelocs = [];
14272
+ const zeroDataReloc = (r) => zeroDataRelocs.push({
14273
+ ro: r.ro,
14274
+ width: WIDE_DATA_RELOCS.has(r.rawBytes[0]) ? 8 : 4
14275
+ });
14242
14276
  const usedSyms = /* @__PURE__ */ new Set();
14243
14277
  for (const r of keptCodeRelocs) if (r.rawBytes[0] !== 6) usedSyms.add(r.rs);
14244
14278
  for (const r of obj.dataRelocList) {
@@ -14249,7 +14283,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
14249
14283
  keptDataRelocBytes.push(r.rawBytes);
14250
14284
  usedSyms.add(r.rs);
14251
14285
  } else if (sName === "__objc_classes") {
14252
- zeroDataRelocOffsets.push(r.ro);
14286
+ zeroDataReloc(r);
14253
14287
  } else {
14254
14288
  const repl = firstLiveInSpecialSeg.get(r.segIdx);
14255
14289
  const roBytes = encodeULEB(r.ro);
@@ -14262,17 +14296,17 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
14262
14296
  } else if (r.ownerSymIdx !== -1) {
14263
14297
  if (dLive.has(r.ownerSymIdx)) {
14264
14298
  if (obj.isDist && dropsReflection(obj, obj.symNames[r.rs])) {
14265
- zeroDataRelocOffsets.push(r.ro);
14299
+ zeroDataReloc(r);
14266
14300
  } else {
14267
14301
  keptDataRelocBytes.push(r.rawBytes);
14268
14302
  usedSyms.add(r.rs);
14269
14303
  }
14270
14304
  } else if (sName === "__objc_class_refs") {
14271
- zeroDataRelocOffsets.push(r.ro);
14305
+ zeroDataReloc(r);
14272
14306
  }
14273
14307
  } else if (sLive[r.segIdx] === 1) {
14274
14308
  if (obj.isDist && obj.symNames[r.rs]?.startsWith("l__swift5_reflection_descriptor") && dropsReflection(obj, obj.symNames[r.rs])) {
14275
- zeroDataRelocOffsets.push(r.ro);
14309
+ zeroDataReloc(r);
14276
14310
  } else {
14277
14311
  keptDataRelocBytes.push(r.rawBytes);
14278
14312
  usedSyms.add(r.rs);
@@ -14455,11 +14489,8 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
14455
14489
  outChunks.push(buf.subarray(secStart, end));
14456
14490
  }
14457
14491
  } else {
14458
- if (id === 11 && zeroDataRelocOffsets.length > 0) {
14459
- for (const ro of zeroDataRelocOffsets) {
14460
- buf.fill(0, p + ro, p + ro + 4);
14461
- }
14462
- }
14492
+ if (id === 11)
14493
+ for (const { ro, width } of zeroDataRelocs) buf.fill(0, p + ro, p + ro + width);
14463
14494
  outChunks.push(buf.subarray(secStart, end));
14464
14495
  }
14465
14496
  pos = end;
@@ -14558,7 +14589,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
14558
14589
  });
14559
14590
  import_node_fs35.default.rmSync(rspPath, { force: true });
14560
14591
  }
14561
- var import_node_child_process18, import_node_crypto14, import_node_fs35, import_node_os7, import_node_path32, v2, HAS_ADDEND, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, parsedObjectCache, SWIFTUI_WRAPPER_HOST_PROTOCOLS;
14592
+ var import_node_child_process18, import_node_crypto14, import_node_fs35, import_node_os7, import_node_path32, v2, HAS_ADDEND, WIDE_DATA_RELOCS, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, parsedObjectCache, SWIFTUI_WRAPPER_HOST_PROTOCOLS;
14562
14593
  var init_swift_wasm_prune = __esm({
14563
14594
  "src/swift-wasm-prune.ts"() {
14564
14595
  "use strict";
@@ -14571,7 +14602,8 @@ var init_swift_wasm_prune = __esm({
14571
14602
  v2 = __toESM(require("valibot"), 1);
14572
14603
  init_swift_foundation();
14573
14604
  init_swiftRuntimeProductContract();
14574
- HAS_ADDEND = /* @__PURE__ */ new Set([3, 4, 5, 8, 9, 11, 13, 14, 15, 16, 21, 22, 23, 24, 25]);
14605
+ HAS_ADDEND = /* @__PURE__ */ new Set([3, 4, 5, 8, 9, 11, 14, 15, 16, 17, 21, 22, 23, 25]);
14606
+ WIDE_DATA_RELOCS = /* @__PURE__ */ new Set([16, 19, 22]);
14575
14607
  ROOT_SEG_PREFIXES = [
14576
14608
  ".init_array",
14577
14609
  "__objc_init_func",
@@ -14733,7 +14765,7 @@ function readNumber(bytes, position) {
14733
14765
  let value = 0;
14734
14766
  let shift = 0;
14735
14767
  for (; ; ) {
14736
- if (position >= bytes.length || shift > 28) throw new Error("invalid wasm integer");
14768
+ if (position >= bytes.length || shift > 63) throw new Error("invalid wasm integer");
14737
14769
  const byte = bytes[position++];
14738
14770
  value += (byte & 127) * 2 ** shift;
14739
14771
  if (!(byte & 128)) return [value, position];
@@ -14779,7 +14811,7 @@ function llvmType(value) {
14779
14811
  function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLookups, preserveCanonical) {
14780
14812
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
14781
14813
  throw new Error("expected wasm object");
14782
- const sections = [Buffer.from(bytes.subarray(0, 8))];
14814
+ const sections2 = [Buffer.from(bytes.subarray(0, 8))];
14783
14815
  const types = [];
14784
14816
  const functionTypes = [];
14785
14817
  const definitions = [];
@@ -14836,12 +14868,12 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
14836
14868
  if (referenceType !== 112 && referenceType !== 111)
14837
14869
  throw new Error("unsupported table type");
14838
14870
  const flags = number3();
14839
- if (flags & ~3) throw new Error("unsupported table limits");
14871
+ if (flags & ~7) throw new Error("unsupported table limits");
14840
14872
  number3();
14841
14873
  if (flags & 1) number3();
14842
14874
  } else if (kind === 2) {
14843
14875
  const flags = number3();
14844
- if (flags & ~3) throw new Error("unsupported memory limits");
14876
+ if (flags & ~7) throw new Error("unsupported memory limits");
14845
14877
  number3();
14846
14878
  if (flags & 1) number3();
14847
14879
  } else if (kind === 3) offset += 2;
@@ -14854,7 +14886,7 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
14854
14886
  if (module2 === "env" && names.has(name3)) usedSymbols.add(name3);
14855
14887
  if (isDlsym || isDlerror) {
14856
14888
  const type = types[functionType2];
14857
- const expected = isDlsym ? "127,127:127" : ":127";
14889
+ const expected = isDlsym ? "126,126:126" : ":126";
14858
14890
  if (!type || `${type.parameters.join(",")}:${type.results.join(",")}` !== expected)
14859
14891
  throw new Error(`unexpected ${name3} import type`);
14860
14892
  }
@@ -14996,10 +15028,10 @@ function rewriteObject(bytes, names, callerAlias, bindings, instrumentDynamicLoo
14996
15028
  section = Buffer.concat(parts);
14997
15029
  }
14998
15030
  }
14999
- sections.push(Buffer.from([id]), encodeNumber(section.length), section);
15031
+ sections2.push(Buffer.from([id]), encodeNumber(section.length), section);
15000
15032
  }
15001
15033
  return {
15002
- bytes: Buffer.concat(sections),
15034
+ bytes: Buffer.concat(sections2),
15003
15035
  definitions,
15004
15036
  usesDlsym,
15005
15037
  usedSymbols: [...usedSymbols]
@@ -15166,7 +15198,7 @@ function createGuestImageLedger(input) {
15166
15198
  return [...bytes].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("");
15167
15199
  }).join("");
15168
15200
  const ir = [
15169
- 'target triple = "wasm32-unknown-wasip1"',
15201
+ 'target triple = "wasm64-unknown-wasip1"',
15170
15202
  `@.names = private constant [${nameSize} x i8] c"${nameContents}"`
15171
15203
  ];
15172
15204
  for (const definition2 of exported.values()) {
@@ -15297,8 +15329,8 @@ function selectedGuestManifestInputs(plan, selection, identities) {
15297
15329
  }
15298
15330
  function createGuestImageManifest(image) {
15299
15331
  const target = {
15300
- triple: "wasm32-unknown-wasip1",
15301
- pointerWidth: 32,
15332
+ triple: "wasm64-unknown-wasip1",
15333
+ pointerWidth: 64,
15302
15334
  byteOrder: "little",
15303
15335
  cpuType: -1,
15304
15336
  cpuSubtype: 0
@@ -15378,16 +15410,16 @@ function signedAddress(bytes, start) {
15378
15410
  function layout(bytes) {
15379
15411
  if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
15380
15412
  throw new Error("expected linked wasm module");
15381
- const sections = /* @__PURE__ */ new Map();
15413
+ const sections2 = /* @__PURE__ */ new Map();
15382
15414
  let offset = 8;
15383
15415
  while (offset < bytes.length) {
15384
15416
  const id = bytes[offset++];
15385
15417
  const [size, start] = number2(bytes, offset);
15386
15418
  if (start + size > bytes.length) throw new Error("invalid wasm section");
15387
- if (id) sections.set(id, [start, start + size]);
15419
+ if (id) sections2.set(id, [start, start + size]);
15388
15420
  offset = start + size;
15389
15421
  }
15390
- const exports2 = sections.get(7);
15422
+ const exports2 = sections2.get(7);
15391
15423
  if (!exports2) throw new Error("guest wasm does not export memory and table");
15392
15424
  let exportPosition = exports2[0];
15393
15425
  const readExport = () => {
@@ -15408,7 +15440,7 @@ function layout(bytes) {
15408
15440
  throw new Error("guest wasm does not export memory and table");
15409
15441
  let imports2 = 0;
15410
15442
  let memoryPages;
15411
- const section = sections.get(2);
15443
+ const section = sections2.get(2);
15412
15444
  if (section) {
15413
15445
  let pos = section[0];
15414
15446
  const read = () => {
@@ -15423,7 +15455,7 @@ function layout(bytes) {
15423
15455
  };
15424
15456
  const limits = () => {
15425
15457
  const flags = read();
15426
- if (flags & ~3) throw new Error("unsupported wasm limits");
15458
+ if (flags & ~7) throw new Error("unsupported wasm limits");
15427
15459
  const minimum = read();
15428
15460
  if (flags & 1) read();
15429
15461
  return minimum;
@@ -15451,7 +15483,7 @@ function layout(bytes) {
15451
15483
  }
15452
15484
  if (pos !== section[1]) throw new Error("invalid wasm imports");
15453
15485
  }
15454
- const memory = sections.get(5);
15486
+ const memory = sections2.get(5);
15455
15487
  if (memory) {
15456
15488
  let pos = memory[0];
15457
15489
  const read = () => {
@@ -15462,14 +15494,14 @@ function layout(bytes) {
15462
15494
  if (read() !== 1 || memoryPages !== void 0)
15463
15495
  throw new Error("unsupported wasm memories");
15464
15496
  const flags = read();
15465
- if (flags & ~3) throw new Error("unsupported wasm memory limits");
15497
+ if (flags & ~7) throw new Error("unsupported wasm memory limits");
15466
15498
  memoryPages = read();
15467
15499
  if (flags & 1) read();
15468
15500
  if (pos !== memory[1]) throw new Error("invalid wasm memory section");
15469
15501
  }
15470
15502
  if (memoryPages === void 0) throw new Error("guest wasm has no memory");
15471
15503
  const functionsByCodeOffset = /* @__PURE__ */ new Map();
15472
- const code = sections.get(10);
15504
+ const code = sections2.get(10);
15473
15505
  if (code) {
15474
15506
  let pos = code[0];
15475
15507
  let count;
@@ -15485,7 +15517,7 @@ function layout(bytes) {
15485
15517
  if (pos !== code[1]) throw new Error("invalid wasm code section");
15486
15518
  }
15487
15519
  const functionsByTableSlot = /* @__PURE__ */ new Map();
15488
- const elements = sections.get(9);
15520
+ const elements = sections2.get(9);
15489
15521
  if (elements) {
15490
15522
  let pos = elements[0];
15491
15523
  const read = () => {
@@ -15499,7 +15531,7 @@ function layout(bytes) {
15499
15531
  if (flags !== 0 && flags !== 2)
15500
15532
  throw new Error(`unsupported wasm element segment ${flags}`);
15501
15533
  if (flags === 2 && read() !== 0) throw new Error("unsupported wasm table index");
15502
- if (bytes[pos++] !== 65) throw new Error("nonconstant wasm table offset");
15534
+ if (!constant(bytes[pos++])) throw new Error("nonconstant wasm table offset");
15503
15535
  let base;
15504
15536
  [base, pos] = signedAddress(bytes, pos);
15505
15537
  if (bytes[pos++] !== 11) throw new Error("invalid wasm table offset");
@@ -15516,7 +15548,7 @@ function layout(bytes) {
15516
15548
  if (pos !== elements[1]) throw new Error("invalid wasm element section");
15517
15549
  }
15518
15550
  const data = [];
15519
- const dataSection = sections.get(11);
15551
+ const dataSection = sections2.get(11);
15520
15552
  if (dataSection) {
15521
15553
  let pos = dataSection[0];
15522
15554
  const read = () => {
@@ -15530,7 +15562,7 @@ function layout(bytes) {
15530
15562
  if (flags !== 0 && flags !== 2)
15531
15563
  throw new Error(`unsupported wasm data segment ${flags}`);
15532
15564
  if (flags === 2 && read() !== 0) throw new Error("unsupported wasm memory index");
15533
- if (bytes[pos++] !== 65) throw new Error("nonconstant wasm data offset");
15565
+ if (!constant(bytes[pos++])) throw new Error("nonconstant wasm data offset");
15534
15566
  let address;
15535
15567
  [address, pos] = signedAddress(bytes, pos);
15536
15568
  if (bytes[pos++] !== 11) throw new Error("invalid wasm data offset");
@@ -15645,10 +15677,12 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
15645
15677
  }
15646
15678
  return spans;
15647
15679
  }
15680
+ var constant;
15648
15681
  var init_swift_guest_linked_spans = __esm({
15649
15682
  "src/swift-guest-linked-spans.ts"() {
15650
15683
  "use strict";
15651
15684
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
15685
+ constant = (opcode) => opcode === 65 || opcode === 66;
15652
15686
  }
15653
15687
  });
15654
15688
 
@@ -15658,7 +15692,7 @@ function isSwiftGuestImageManifest(value) {
15658
15692
  const text6 = (value2) => typeof value2 === "string" && value2.length > 0 && value2.length <= 4096 && !value2.includes("\0");
15659
15693
  const name3 = (value2) => text6(value2) && new TextEncoder().encode(value2).length <= 16;
15660
15694
  const version2 = (value2) => isRecord(value2) && uint(value2.major, 65535) && uint(value2.minor, 255) && uint(value2.patch, 255);
15661
- if (!isRecord(value) || value.version !== 1 || !text6(value.id) || !text6(value.installName) || value.fileType !== "executable" && value.fileType !== "dylib" || !isRecord(value.target) || value.target.triple !== "wasm32-unknown-wasip1" || value.target.pointerWidth !== 32 || value.target.byteOrder !== "little" || value.target.cpuType !== -1 || value.target.cpuSubtype !== 0 || typeof value.inputsSha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.inputsSha256) || value.uuid !== value.inputsSha256.slice(0, 32) || !isRecord(value.buildVersion) || !uint(value.buildVersion.platform, 4294967295) || !version2(value.buildVersion.minimum) || !version2(value.buildVersion.sdk) || !Array.isArray(value.regions))
15695
+ if (!isRecord(value) || value.version !== 1 || !text6(value.id) || !text6(value.installName) || value.fileType !== "executable" && value.fileType !== "dylib" || !isRecord(value.target) || value.target.triple !== "wasm64-unknown-wasip1" || value.target.pointerWidth !== 64 || value.target.byteOrder !== "little" || value.target.cpuType !== -1 || value.target.cpuSubtype !== 0 || typeof value.inputsSha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.inputsSha256) || value.uuid !== value.inputsSha256.slice(0, 32) || !isRecord(value.buildVersion) || !uint(value.buildVersion.platform, 4294967295) || !version2(value.buildVersion.minimum) || !version2(value.buildVersion.sdk) || !Array.isArray(value.regions))
15662
15696
  return false;
15663
15697
  return value.regions.every((region) => {
15664
15698
  if (!isRecord(region) || !name3(region.name) || region.space !== "linear-memory" && region.space !== "function-table" || !uint(region.address, 4294967295) || !uint(region.length, 4294967295) || region.address + region.length > 4294967296 || !uint(region.initialProtection, 7) || !uint(region.maximumProtection, 7) || (region.initialProtection & region.maximumProtection) !== region.initialProtection || !Array.isArray(region.sections))
@@ -17141,7 +17175,7 @@ function linkGuestImages(options) {
17141
17175
  import_node_fs39.default.writeFileSync(irPath, ledger.llvmIR);
17142
17176
  (0, import_node_child_process20.execFileSync)(
17143
17177
  clang,
17144
- ["--target=wasm32-unknown-wasip1", "-c", irPath, "-o", ledgerObject],
17178
+ ["--target=wasm64-unknown-wasip1", "-c", irPath, "-o", ledgerObject],
17145
17179
  { stdio: "pipe" }
17146
17180
  );
17147
17181
  linkedOwners.set(ledgerObject, options.ledgerDataImage);
@@ -17871,10 +17905,16 @@ function sourceGuestClangLinkOptions(options) {
17871
17905
  throw new Error(`unsupported source object producer ${file}`);
17872
17906
  continue;
17873
17907
  }
17874
- if (command.tool !== "clang" || !command.args.length || (0, import_node_fs40.realpathSync)(command.args[0]) !== (0, import_node_fs40.realpathSync)(import_node_path37.default.join(options.toolchainBin, "clang")))
17908
+ const compiler = command.args[0] ? (0, import_node_fs40.realpathSync)(command.args[0]) : "";
17909
+ if (command.tool !== "clang" || compiler !== (0, import_node_fs40.realpathSync)(import_node_path37.default.join(options.toolchainBin, "clang")) && compiler !== (0, import_node_fs40.realpathSync)(import_node_path37.default.join(options.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)))
17875
17910
  throw new Error(`unsupported source object producer ${file}`);
17876
17911
  const args = command.args.slice(1).filter((arg) => arg !== "-c");
17877
- const output2 = import_node_path37.default.join(options.directory, `clang-link-${index}.ll`);
17912
+ const outputDirectory = import_node_path37.default.join(
17913
+ options.directory,
17914
+ import_node_path37.default.basename(import_node_path37.default.dirname(file))
17915
+ );
17916
+ (0, import_node_fs40.mkdirSync)(outputDirectory, { recursive: true });
17917
+ const output2 = import_node_path37.default.join(outputDirectory, `clang-link-${index}.ll`);
17878
17918
  for (const flag of ["-o", "-MF"]) {
17879
17919
  const index2 = args.lastIndexOf(flag);
17880
17920
  if (index2 < 0 || index2 + 1 >= args.length)
@@ -18112,7 +18152,7 @@ function logicalGuestLinkOptions(args, identities, roots) {
18112
18152
  }
18113
18153
  return output2;
18114
18154
  }
18115
- var import_node_child_process21, import_node_crypto18, import_node_fs40, import_node_path37;
18155
+ var import_node_child_process21, import_node_crypto18, import_node_fs40, import_node_path37, CLANG_TARGET_MODULE_WRAPPER;
18116
18156
  var init_swift_guest_source_inputs = __esm({
18117
18157
  "src/swift-guest-source-inputs.ts"() {
18118
18158
  "use strict";
@@ -18123,11 +18163,254 @@ var init_swift_guest_source_inputs = __esm({
18123
18163
  import_node_path37 = __toESM(require("node:path"), 1);
18124
18164
  init_swift_guest_source_plan();
18125
18165
  init_swift_runtime_products();
18166
+ CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
18167
+ }
18168
+ });
18169
+
18170
+ // src/wasm-narrow-boundary.ts
18171
+ function encodeNumber2(value) {
18172
+ const bytes = [];
18173
+ for (let rest = value; ; ) {
18174
+ const byte = rest % 128;
18175
+ rest = Math.floor(rest / 128);
18176
+ if (rest === 0) return [...bytes, byte];
18177
+ bytes.push(byte | 128);
18178
+ }
18179
+ }
18180
+ function encodeName(name3) {
18181
+ const bytes = [...Buffer.from(name3)];
18182
+ return [...encodeNumber2(bytes.length), ...bytes];
18183
+ }
18184
+ function reader(bytes, start, end) {
18185
+ let at = start;
18186
+ const number3 = () => {
18187
+ let value = 0;
18188
+ for (let shift = 0; ; shift += 7) {
18189
+ if (at >= end || shift > 63) throw new Error("invalid wasm integer");
18190
+ const byte = bytes[at++];
18191
+ value += (byte & 127) * 2 ** shift;
18192
+ if (!(byte & 128)) return value;
18193
+ }
18194
+ };
18195
+ return {
18196
+ number: number3,
18197
+ byte: () => {
18198
+ if (at >= end) throw new Error("truncated wasm section");
18199
+ return bytes[at++];
18200
+ },
18201
+ name: () => {
18202
+ const length = number3();
18203
+ at += length;
18204
+ if (at > end) throw new Error("truncated wasm name");
18205
+ return Buffer.from(bytes.subarray(at - length, at)).toString();
18206
+ },
18207
+ position: () => at,
18208
+ done: () => at === end
18209
+ };
18210
+ }
18211
+ function sections(bytes) {
18212
+ if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
18213
+ throw new Error("not a wasm module");
18214
+ const found = [];
18215
+ for (let at = 8; at < bytes.length; ) {
18216
+ const header = reader(bytes, at, bytes.length);
18217
+ const id = header.byte();
18218
+ const size = header.number();
18219
+ const start = header.position();
18220
+ found.push({ id, start, end: start + size });
18221
+ at = start + size;
18222
+ }
18223
+ return found;
18224
+ }
18225
+ function withSections(bytes, layout2, replacements) {
18226
+ const parts = [bytes.subarray(0, 8)];
18227
+ let at = 8;
18228
+ for (const section of layout2) {
18229
+ const body = replacements.get(section.id);
18230
+ parts.push(
18231
+ body ? Uint8Array.from([section.id, ...encodeNumber2(body.length), ...body]) : bytes.subarray(at, section.end)
18232
+ );
18233
+ at = section.end;
18234
+ }
18235
+ return Buffer.concat(parts);
18236
+ }
18237
+ function narrowWasmBoundary(bytes) {
18238
+ const layout2 = sections(bytes);
18239
+ const section = (id) => {
18240
+ const found = layout2.find((entry) => entry.id === id);
18241
+ return found && reader(bytes, found.start, found.end);
18242
+ };
18243
+ const types = [];
18244
+ const typeSection = section(1);
18245
+ if (typeSection) {
18246
+ for (let count = typeSection.number(); count > 0; count--) {
18247
+ if (typeSection.byte() !== 96) throw new Error("unsupported wasm type");
18248
+ const values = () => Array.from({ length: typeSection.number() }, () => typeSection.byte());
18249
+ types.push({ parameters: values(), results: values() });
18250
+ }
18251
+ }
18252
+ const typeAt = (index) => {
18253
+ const type = types[index];
18254
+ if (!type) throw new Error("invalid wasm type index");
18255
+ return type;
18256
+ };
18257
+ const thunks = [];
18258
+ const functionTypes = [];
18259
+ const importBody = [];
18260
+ const importSection = section(2);
18261
+ if (importSection) {
18262
+ const count = importSection.number();
18263
+ importBody.push(...encodeNumber2(count));
18264
+ for (let index = 0; index < count; index++) {
18265
+ const module2 = importSection.name();
18266
+ const name3 = importSection.name();
18267
+ const start = importSection.position();
18268
+ const kind = importSection.byte();
18269
+ const limits = () => {
18270
+ const flags = importSection.number();
18271
+ importSection.number();
18272
+ if (flags & 1) importSection.number();
18273
+ };
18274
+ let type;
18275
+ if (kind === 0) {
18276
+ type = typeAt(importSection.number());
18277
+ functionTypes.push(type);
18278
+ } else if (kind === 1) {
18279
+ importSection.byte();
18280
+ limits();
18281
+ } else if (kind === 2) limits();
18282
+ else if (kind === 3) {
18283
+ importSection.byte();
18284
+ importSection.byte();
18285
+ } else if (kind === 4) {
18286
+ importSection.byte();
18287
+ importSection.number();
18288
+ } else throw new Error("unsupported wasm import");
18289
+ const scalar64 = (parameter) => module2 === "wasi_snapshot_preview1" && (!name3.startsWith("peach_") || name3 === "peach_fs_path_birthtime_set" && parameter === 2) || module2 === "peach" && name3 === "hw_memsize" && parameter === null || module2 === "peach_notify" && name3 === "set" && parameter === 1;
18290
+ const parameters = type?.parameters.map(
18291
+ (value, index2) => value === I64 && !scalar64(index2) ? 127 : value
18292
+ );
18293
+ const results = type?.results.map(
18294
+ (value) => value === I64 && !scalar64(null) ? 127 : value
18295
+ );
18296
+ if (type && parameters && results && (parameters.some((value, index2) => value !== type.parameters[index2]) || results.some((value, index2) => value !== type.results[index2]))) {
18297
+ if (type.results.length > 1)
18298
+ throw new Error(`import ${module2}.${name3} returns several values`);
18299
+ const id = thunks.length;
18300
+ const call = `(call $host${id}${type.parameters.map(
18301
+ (value, at) => value !== parameters[at] ? ` (i32.wrap_i64 (local.get ${at}))` : ` (local.get ${at})`
18302
+ ).join("")})`;
18303
+ thunks.push(
18304
+ `(import ${quoted(module2)} ${quoted(name3)} (func $host${id}${signature(parameters, "param", false)}${signature(results, "result", false)}))`,
18305
+ `(func (export "${NARROW}${id}")${signature(type.parameters, "param", false)}${signature(type.results, "result", false)} ${type.results[0] !== results[0] ? `(i64.extend_i32_u ${call})` : call})`
18306
+ );
18307
+ importBody.push(...encodeName(BOUNDARY), ...encodeName(`${NARROW}${id}`));
18308
+ } else importBody.push(...encodeName(module2), ...encodeName(name3));
18309
+ importBody.push(...bytes.subarray(start, importSection.position()));
18310
+ }
18311
+ if (!importSection.done()) throw new Error("invalid wasm imports");
18312
+ }
18313
+ const functionSection = section(3);
18314
+ if (functionSection)
18315
+ for (let count = functionSection.number(); count > 0; count--)
18316
+ functionTypes.push(typeAt(functionSection.number()));
18317
+ const exportBody = [];
18318
+ const exportSection = section(7);
18319
+ if (exportSection) {
18320
+ const count = exportSection.number();
18321
+ exportBody.push(...encodeNumber2(count));
18322
+ for (let index = 0; index < count; index++) {
18323
+ const name3 = exportSection.name();
18324
+ const kind = exportSection.byte();
18325
+ const target = exportSection.number();
18326
+ const type = kind === 0 ? functionTypes[target] : void 0;
18327
+ if (kind === 0 && !type) throw new Error("invalid wasm export");
18328
+ if (type && wide(type)) {
18329
+ if (type.results.length > 1)
18330
+ throw new Error(`export ${name3} returns several values`);
18331
+ const id = thunks.length;
18332
+ const call = `(call $guest${id}${type.parameters.map(
18333
+ (value, at) => value === I64 ? ` (i64.extend_i32_u (local.get ${at}))` : ` (local.get ${at})`
18334
+ ).join("")})`;
18335
+ thunks.push(
18336
+ `(import "${GUEST}" "${WIDE}${id}" (func $guest${id}${signature(type.parameters, "param", false)}${signature(type.results, "result", false)}))`,
18337
+ `(func (export ${quoted(name3)})${signature(type.parameters, "param", true)}${signature(type.results, "result", true)} ${type.results[0] === I64 ? `(i32.wrap_i64 ${call})` : call})`
18338
+ );
18339
+ exportBody.push(...encodeName(`${WIDE}${id}`));
18340
+ } else exportBody.push(...encodeName(name3));
18341
+ exportBody.push(kind, ...encodeNumber2(target));
18342
+ }
18343
+ if (!exportSection.done()) throw new Error("invalid wasm exports");
18344
+ }
18345
+ if (thunks.length === 0) return void 0;
18346
+ const imports2 = thunks.filter((line) => line.startsWith("(import"));
18347
+ const functions = thunks.filter((line) => !line.startsWith("(import"));
18348
+ return {
18349
+ module: withSections(
18350
+ bytes,
18351
+ layout2,
18352
+ /* @__PURE__ */ new Map([
18353
+ [2, importBody],
18354
+ [7, exportBody]
18355
+ ])
18356
+ ),
18357
+ thunks: `(module
18358
+ ${[...imports2, ...functions].join("\n")}
18359
+ )
18360
+ `
18361
+ };
18362
+ }
18363
+ function dropBoundaryExports(bytes) {
18364
+ const layout2 = sections(bytes);
18365
+ const found = layout2.find((entry) => entry.id === 7);
18366
+ if (!found) throw new Error("merged module has no exports");
18367
+ const exportSection = reader(bytes, found.start, found.end);
18368
+ const kept = [];
18369
+ for (let count = exportSection.number(); count > 0; count--) {
18370
+ const name3 = exportSection.name();
18371
+ const kind = exportSection.byte();
18372
+ const target = exportSection.number();
18373
+ if (!name3.startsWith(WIDE) && !name3.startsWith(NARROW))
18374
+ kept.push([...encodeName(name3), kind, ...encodeNumber2(target)]);
18375
+ }
18376
+ return withSections(
18377
+ bytes,
18378
+ layout2,
18379
+ /* @__PURE__ */ new Map([[7, [...encodeNumber2(kept.length), ...kept.flat()]]])
18380
+ );
18381
+ }
18382
+ var I64, VALUE_TYPES, GUEST, BOUNDARY, WIDE, NARROW, quoted, signature, wide, NARROW_MERGE_NAMES;
18383
+ var init_wasm_narrow_boundary = __esm({
18384
+ "src/wasm-narrow-boundary.ts"() {
18385
+ "use strict";
18386
+ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18387
+ I64 = 126;
18388
+ VALUE_TYPES = /* @__PURE__ */ new Map([
18389
+ [127, "i32"],
18390
+ [I64, "i64"],
18391
+ [125, "f32"],
18392
+ [124, "f64"],
18393
+ [123, "v128"],
18394
+ [112, "funcref"],
18395
+ [111, "externref"]
18396
+ ]);
18397
+ GUEST = "guest";
18398
+ BOUNDARY = "boundary";
18399
+ WIDE = "$wide.";
18400
+ NARROW = "$narrow.";
18401
+ quoted = (name3) => `"${[...Buffer.from(name3)].map((byte) => `\\${byte.toString(16).padStart(2, "0")}`).join("")}"`;
18402
+ signature = (types, keyword, narrow) => types.length === 0 ? "" : ` (${keyword} ${types.map((type) => {
18403
+ const name3 = VALUE_TYPES.get(narrow && type === I64 ? 127 : type);
18404
+ if (!name3) throw new Error(`unsupported wasm boundary type ${type}`);
18405
+ return name3;
18406
+ }).join(" ")})`;
18407
+ wide = (type) => type.parameters.includes(I64) || type.results.includes(I64);
18408
+ NARROW_MERGE_NAMES = { guest: GUEST, boundary: BOUNDARY };
18126
18409
  }
18127
18410
  });
18128
18411
 
18129
18412
  // src/wasm-optimize.ts
18130
- async function runWasmOpt(file, output2, skipPasses, binary2) {
18413
+ async function runWasmOpt(file, output2, optimize, skipPasses, binary2) {
18131
18414
  const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
18132
18415
  const requestedCores = Number(process.env.BINARYEN_CORES);
18133
18416
  const environment = { ...process.env, WASM_OPT_PATH: binary2 };
@@ -18135,18 +18418,43 @@ async function runWasmOpt(file, output2, skipPasses, binary2) {
18135
18418
  environment.BINARYEN_CORES = String(
18136
18419
  Number.isInteger(requestedCores) && requestedCores > 0 ? Math.min(admittedCores, requestedCores) : admittedCores
18137
18420
  );
18421
+ const features = FEATURES.map((feature) => `--enable-${feature}`);
18422
+ const names = optimize && !KEEP_WASM_NAMES ? [] : ["-g"];
18423
+ const narrowed = narrowWasmBoundary((0, import_node_fs41.readFileSync)(file));
18424
+ const merged = `${output2}.narrowed`;
18425
+ if (narrowed) {
18426
+ const guest = `${output2}.guest`;
18427
+ const thunks = `${output2}.thunks.wat`;
18428
+ (0, import_node_fs41.writeFileSync)(guest, narrowed.module);
18429
+ (0, import_node_fs41.writeFileSync)(thunks, narrowed.thunks);
18430
+ await (0, import_node_util7.promisify)(import_node_child_process22.execFile)((0, import_node_path38.join)((0, import_node_path38.dirname)(binary2), "wasm-merge"), [
18431
+ ...features,
18432
+ ...names,
18433
+ guest,
18434
+ NARROW_MERGE_NAMES.guest,
18435
+ thunks,
18436
+ NARROW_MERGE_NAMES.boundary,
18437
+ "-o",
18438
+ merged
18439
+ ]);
18440
+ (0, import_node_fs41.writeFileSync)(merged, dropBoundaryExports((0, import_node_fs41.readFileSync)(merged)));
18441
+ (0, import_node_fs41.rmSync)(guest);
18442
+ (0, import_node_fs41.rmSync)(thunks);
18443
+ }
18138
18444
  const result = await (0, import_wasm_opt.wasmOpt)(
18139
18445
  [
18140
- "-Oz",
18141
- ...KEEP_WASM_NAMES ? ["-g"] : [],
18446
+ ...LOWERING,
18447
+ ...optimize ? ["-Oz"] : [],
18448
+ ...names,
18142
18449
  ...skipPasses.flatMap((pass) => ["--skip-pass", pass]),
18143
- ...FEATURES.map((feature) => `--enable-${feature}`),
18144
- file,
18450
+ ...features,
18451
+ narrowed ? merged : file,
18145
18452
  "-o",
18146
18453
  output2
18147
18454
  ],
18148
18455
  { env: environment }
18149
18456
  );
18457
+ if (narrowed) (0, import_node_fs41.rmSync)(merged);
18150
18458
  if (result.status !== 0)
18151
18459
  throw new Error(`wasm-opt exited ${result.status}: ${result.stderr}`);
18152
18460
  }
@@ -18169,21 +18477,31 @@ async function installWasmOpt() {
18169
18477
  });
18170
18478
  return binary2;
18171
18479
  }
18172
- async function optimizeWasm(file, output2, skipPasses = []) {
18173
- await runWasmOpt(file, output2, skipPasses, await installWasmOpt());
18480
+ async function lowerWasm(file, output2, options) {
18481
+ await runWasmOpt(
18482
+ file,
18483
+ output2,
18484
+ options.optimize,
18485
+ options.skipPasses ?? [],
18486
+ await installWasmOpt()
18487
+ );
18174
18488
  }
18175
- var import_node_fs41, import_node_path38, import_wasm_opt, FEATURES, KEEP_WASM_NAMES, WASM_OPTIMIZE_IDENTITY, PINNED_BINARYEN_VERSION, BINARYEN_RELEASES;
18489
+ var import_node_child_process22, import_node_fs41, import_node_path38, import_node_util7, import_wasm_opt, FEATURES, KEEP_WASM_NAMES, LOWERING, WASM_LOWER_IDENTITY, PINNED_BINARYEN_VERSION, BINARYEN_RELEASES;
18176
18490
  var init_wasm_optimize = __esm({
18177
18491
  "src/wasm-optimize.ts"() {
18178
18492
  "use strict";
18179
18493
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18494
+ import_node_child_process22 = require("node:child_process");
18180
18495
  import_node_fs41 = require("node:fs");
18181
18496
  import_node_path38 = require("node:path");
18497
+ import_node_util7 = require("node:util");
18182
18498
  init_src();
18183
18499
  import_wasm_opt = require("wasm-opt");
18184
18500
  init_admitted_mac_build();
18185
18501
  init_home_paths();
18502
+ init_wasm_narrow_boundary();
18186
18503
  FEATURES = [
18504
+ "memory64",
18187
18505
  "threads",
18188
18506
  "bulk-memory",
18189
18507
  "bulk-memory-opt",
@@ -18196,7 +18514,8 @@ var init_wasm_optimize = __esm({
18196
18514
  "sign-ext"
18197
18515
  ];
18198
18516
  KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === "1";
18199
- WASM_OPTIMIZE_IDENTITY = `wasm-opt ${import_wasm_opt.BINARYEN_VERSION} -Oz ${FEATURES.join(",")}${KEEP_WASM_NAMES ? " -g" : ""}`;
18517
+ LOWERING = ["--memory64-lowering", "--table64-lowering"];
18518
+ WASM_LOWER_IDENTITY = `binaryen ${import_wasm_opt.BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} unoptimized-names`;
18200
18519
  PINNED_BINARYEN_VERSION = "132";
18201
18520
  BINARYEN_RELEASES = /* @__PURE__ */ new Map([
18202
18521
  [
@@ -18255,7 +18574,7 @@ async function compileGuestLink(options) {
18255
18574
  };
18256
18575
  const buildVersion = imageBuildVersion(entry.buildVersion);
18257
18576
  const clangOptions = [
18258
- "--target=wasm32-unknown-wasip1",
18577
+ "--target=wasm64-unknown-wasip1",
18259
18578
  `--sysroot=${options.sysroot}`,
18260
18579
  `-I${import_node_path39.default.join(options.moduleRoot, "include")}`
18261
18580
  ];
@@ -18265,7 +18584,7 @@ async function compileGuestLink(options) {
18265
18584
  stubSource,
18266
18585
  '#include "guest-image-projection.h"\nconst struct peach_guest_image __peach_guest_images[] = {{0}};\nconst uint32_t __peach_guest_image_count = 0;\n'
18267
18586
  );
18268
- (0, import_node_child_process22.execFileSync)(
18587
+ (0, import_node_child_process23.execFileSync)(
18269
18588
  import_node_path39.default.join(options.toolchainBin, "clang"),
18270
18589
  [...clangOptions, "-c", stubSource, "-o", stub],
18271
18590
  { stdio: "pipe" }
@@ -18563,9 +18882,10 @@ async function compileGuestLink(options) {
18563
18882
  }
18564
18883
  });
18565
18884
  if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
18566
- await optimizeWasm(options.output, options.optimized, [
18567
- "duplicate-function-elimination"
18568
- ]);
18885
+ await lowerWasm(options.output, options.optimized, {
18886
+ optimize: true,
18887
+ skipPasses: ["duplicate-function-elimination"]
18888
+ });
18569
18889
  const map2 = (0, import_node_fs42.readFileSync)(result.mapPath, "utf8");
18570
18890
  if (!/ __peach_guest_images$/m.test(map2)) return;
18571
18891
  const finalized = finalizeGuestProjectionStorage({
@@ -18579,12 +18899,12 @@ async function compileGuestLink(options) {
18579
18899
  });
18580
18900
  (0, import_node_fs42.writeFileSync)(options.optimized, finalized.wasm);
18581
18901
  }
18582
- var import_node_child_process22, import_node_fs42, import_node_path39;
18902
+ var import_node_child_process23, import_node_fs42, import_node_path39;
18583
18903
  var init_swift_guest_compile = __esm({
18584
18904
  "src/swift-guest-compile.ts"() {
18585
18905
  "use strict";
18586
18906
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18587
- import_node_child_process22 = require("node:child_process");
18907
+ import_node_child_process23 = require("node:child_process");
18588
18908
  import_node_fs42 = require("node:fs");
18589
18909
  import_node_path39 = __toESM(require("node:path"), 1);
18590
18910
  init_swift_guest_archive();
@@ -18710,7 +19030,7 @@ async function load(toolchainBin, sdk) {
18710
19030
  ...swiftSdkOptions(),
18711
19031
  "--show-configuration",
18712
19032
  sdk,
18713
- "wasm32-unknown-wasip1"
19033
+ "wasm64-unknown-wasip1"
18714
19034
  ],
18715
19035
  { env: swiftEnvironment() }
18716
19036
  );
@@ -18804,25 +19124,25 @@ async function swiftIcuBundleAsset(icu) {
18804
19124
  contentType: "application/octet-stream"
18805
19125
  };
18806
19126
  }
18807
- var import_node_child_process23, import_node_crypto19, import_node_fs43, import_promises4, import_node_os8, import_node_path40, import_node_util7, import_node_zlib2, run5, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, packedFiles;
19127
+ var import_node_child_process24, import_node_crypto19, import_node_fs43, import_promises4, import_node_os8, import_node_path40, import_node_util8, import_node_zlib2, run5, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, packedFiles;
18808
19128
  var init_swift_icu = __esm({
18809
19129
  "src/swift-icu.ts"() {
18810
19130
  "use strict";
18811
19131
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
18812
- import_node_child_process23 = require("node:child_process");
19132
+ import_node_child_process24 = require("node:child_process");
18813
19133
  import_node_crypto19 = require("node:crypto");
18814
19134
  import_node_fs43 = require("node:fs");
18815
19135
  import_promises4 = require("node:fs/promises");
18816
19136
  import_node_os8 = __toESM(require("node:os"), 1);
18817
19137
  import_node_path40 = __toESM(require("node:path"), 1);
18818
- import_node_util7 = require("node:util");
19138
+ import_node_util8 = require("node:util");
18819
19139
  import_node_zlib2 = require("node:zlib");
18820
19140
  init_icuData();
18821
19141
  init_swift_toolchain();
18822
- run5 = (0, import_node_util7.promisify)(import_node_child_process23.execFile);
18823
- deflate = (0, import_node_util7.promisify)(import_node_zlib2.gzip);
18824
- compressBrotli = (0, import_node_util7.promisify)(import_node_zlib2.brotliCompress);
18825
- inflateGzip = (0, import_node_util7.promisify)(import_node_zlib2.gunzip);
19142
+ run5 = (0, import_node_util8.promisify)(import_node_child_process24.execFile);
19143
+ deflate = (0, import_node_util8.promisify)(import_node_zlib2.gzip);
19144
+ compressBrotli = (0, import_node_util8.promisify)(import_node_zlib2.brotliCompress);
19145
+ inflateGzip = (0, import_node_util8.promisify)(import_node_zlib2.gunzip);
18826
19146
  ARCHIVE = "wasi/lib_FoundationICU.a";
18827
19147
  MEMBER = "icu_packaged_data.cpp.obj";
18828
19148
  raw = /* @__PURE__ */ new Map();
@@ -19006,7 +19326,7 @@ function prepareSwiftProjectProcess(root, user) {
19006
19326
  (0, import_node_fs45.mkdirSync)(tmp, { recursive: true });
19007
19327
  const caches = ["cache", "config", "security"].map((name3) => import_node_path42.default.join(swiftpm, name3));
19008
19328
  for (const directory2 of caches) (0, import_node_fs45.mkdirSync)(directory2, { recursive: true });
19009
- (0, import_node_child_process24.execFileSync)("chown", ["-R", "-P", `${user.uid}:${user.gid}`, root, home]);
19329
+ (0, import_node_child_process25.execFileSync)("chown", ["-R", "-P", `${user.uid}:${user.gid}`, root, home]);
19010
19330
  (0, import_node_fs45.chmodSync)(root, 448);
19011
19331
  (0, import_node_fs45.chmodSync)(home, 448);
19012
19332
  return {
@@ -19029,7 +19349,7 @@ function prepareSwiftProjectProcess(root, user) {
19029
19349
  };
19030
19350
  }
19031
19351
  function endSwiftProjectProcesses(user) {
19032
- (0, import_node_child_process24.execFileSync)("sh", ["-c", "kill -s KILL -- -1 2>/dev/null || true"], {
19352
+ (0, import_node_child_process25.execFileSync)("sh", ["-c", "kill -s KILL -- -1 2>/dev/null || true"], {
19033
19353
  uid: user.uid,
19034
19354
  gid: user.gid
19035
19355
  });
@@ -19056,12 +19376,12 @@ function removeProjectLinks(root) {
19056
19376
  }
19057
19377
  }
19058
19378
  }
19059
- var import_node_child_process24, import_node_fs45, import_node_path42;
19379
+ var import_node_child_process25, import_node_fs45, import_node_path42;
19060
19380
  var init_swift_project_user = __esm({
19061
19381
  "src/swift-project-user.ts"() {
19062
19382
  "use strict";
19063
19383
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
19064
- import_node_child_process24 = require("node:child_process");
19384
+ import_node_child_process25 = require("node:child_process");
19065
19385
  import_node_fs45 = require("node:fs");
19066
19386
  import_node_path42 = __toESM(require("node:path"), 1);
19067
19387
  }
@@ -19256,7 +19576,7 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
19256
19576
  }
19257
19577
  },
19258
19578
  spawn(command, args, options, companion) {
19259
- const child = (0, import_node_child_process25.spawn)(
19579
+ const child = (0, import_node_child_process26.spawn)(
19260
19580
  "/bin/sh",
19261
19581
  ["-c", 'IFS= read -r go || exit 1; exec "$@" </dev/null', "sh", command, ...args],
19262
19582
  { ...options, detached: true, stdio: ["pipe", "pipe", "pipe"] }
@@ -19286,12 +19606,12 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
19286
19606
  (0, import_node_fs47.writeFileSync)(import_node_path43.default.join(directory2, name2(held, "released")), "");
19287
19607
  }
19288
19608
  }
19289
- var import_node_child_process25, import_node_crypto20, import_node_fs47, import_node_os10, import_node_path43, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name2;
19609
+ var import_node_child_process26, import_node_crypto20, import_node_fs47, import_node_os10, import_node_path43, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name2;
19290
19610
  var init_swift_root_lock = __esm({
19291
19611
  "src/swift-root-lock.ts"() {
19292
19612
  "use strict";
19293
19613
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
19294
- import_node_child_process25 = require("node:child_process");
19614
+ import_node_child_process26 = require("node:child_process");
19295
19615
  import_node_crypto20 = require("node:crypto");
19296
19616
  import_node_fs47 = require("node:fs");
19297
19617
  import_node_os10 = require("node:os");
@@ -19309,10 +19629,10 @@ var init_swift_root_lock = __esm({
19309
19629
  function compileUniformTypeConstants(args) {
19310
19630
  const source = import_node_path44.default.join(args.packageRoot, "runtime/UniformTypeIdentifiersConstants.m");
19311
19631
  const object6 = import_node_path44.default.join(args.out, "UniformTypeIdentifiers-NativeConstants.o");
19312
- (0, import_node_child_process26.execFileSync)(
19632
+ (0, import_node_child_process27.execFileSync)(
19313
19633
  import_node_path44.default.join(args.bin, "clang"),
19314
19634
  [
19315
- "--target=wasm32-unknown-wasip1",
19635
+ "--target=wasm64-unknown-wasip1",
19316
19636
  `--sysroot=${args.sysroot}`,
19317
19637
  "-Oz",
19318
19638
  "-g0",
@@ -19330,12 +19650,12 @@ function compileUniformTypeConstants(args) {
19330
19650
  );
19331
19651
  return object6;
19332
19652
  }
19333
- var import_node_child_process26, import_node_path44;
19653
+ var import_node_child_process27, import_node_path44;
19334
19654
  var init_swift_uniform_type_constants = __esm({
19335
19655
  "src/swift-uniform-type-constants.ts"() {
19336
19656
  "use strict";
19337
19657
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
19338
- import_node_child_process26 = require("node:child_process");
19658
+ import_node_child_process27 = require("node:child_process");
19339
19659
  import_node_path44 = __toESM(require("node:path"), 1);
19340
19660
  init_swift_objc_runtime();
19341
19661
  init_swift_objc_standin();
@@ -19477,7 +19797,7 @@ async function runCompiler(command, args, options, stream = false, quiet) {
19477
19797
  detached: true,
19478
19798
  stdio: ["ignore", "pipe", "pipe"]
19479
19799
  };
19480
- const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : (0, import_node_child_process27.spawn)(command, args, launch);
19800
+ const child = options.lease ? options.lease.spawn(command, args, launch, options.frameworkLease) : (0, import_node_child_process28.spawn)(command, args, launch);
19481
19801
  let stopping;
19482
19802
  try {
19483
19803
  return await new Promise((resolve3, reject) => {
@@ -19593,6 +19913,20 @@ function swiftModuleInterface(moduleRoot, name3, interfaceRoot) {
19593
19913
  if (declared.size === 0) return null;
19594
19914
  return { declared, header: clangInterfaceHeader((0, import_node_fs50.readFileSync)(built2, "utf8")) };
19595
19915
  }
19916
+ function swiftHeaderWithSuperclassImports(header, interfaceFor) {
19917
+ const superclasses = new Set(
19918
+ [...header.matchAll(/@interface\s+\w+\s*:\s*(\w+)/g)].map((match) => match[1])
19919
+ );
19920
+ return header.replace(/^@import (\w+);$/gm, (statement, name3) => {
19921
+ const dependency = interfaceFor(name3);
19922
+ if (!dependency || ![...swiftInterfaceDeclarations(dependency.header)].some(
19923
+ (name4) => superclasses.has(name4)
19924
+ ))
19925
+ return statement;
19926
+ return `${statement}
19927
+ #import ${JSON.stringify(dependency.file)}`;
19928
+ });
19929
+ }
19596
19930
  function withoutSwiftDeclarations(text6, declared, interfaceImport) {
19597
19931
  const out = [];
19598
19932
  let skipping;
@@ -19877,10 +20211,11 @@ function swiftCondition(text6, available) {
19877
20211
  const call = /^(\w+)\s*\(\s*([^,()]*?)\s*(?:,[^()]*)?\)$/.exec(token ?? "");
19878
20212
  if (!call) return void 0;
19879
20213
  const [, name3, argument] = call;
19880
- if (name3 === "os") return argument === "iOS" || argument === "WASI";
19881
- if (name3 === "canImport") return available?.has(argument);
20214
+ if (name3 === "os") return argument === "iOS";
20215
+ if (name3 === "canImport")
20216
+ return argument !== "FoundationNetworking" && available?.has(argument);
19882
20217
  if (name3 === "targetEnvironment") return argument === "simulator";
19883
- if (name3 === "arch") return argument === "wasm32";
20218
+ if (name3 === "arch") return argument === "wasm64";
19884
20219
  return void 0;
19885
20220
  };
19886
20221
  const both = () => {
@@ -19948,7 +20283,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
19948
20283
  const key2 = JSON.stringify([toolchainBin, sdk, options]);
19949
20284
  const cached2 = sdkPaths.get(key2);
19950
20285
  if (cached2) return cached2;
19951
- const configuration = (0, import_node_child_process27.execFileSync)(
20286
+ const configuration = (0, import_node_child_process28.execFileSync)(
19952
20287
  import_node_path47.default.join(toolchainBin, "swift"),
19953
20288
  [
19954
20289
  "sdk",
@@ -19956,7 +20291,7 @@ function swiftSdkPaths(moduleRoot, toolchainBin) {
19956
20291
  ...options,
19957
20292
  "--show-configuration",
19958
20293
  sdk,
19959
- "wasm32-unknown-wasip1"
20294
+ "wasm64-unknown-wasip1"
19960
20295
  ],
19961
20296
  { encoding: "utf8", env: swiftEnvironment(), stdio: ["ignore", "pipe", "pipe"] }
19962
20297
  );
@@ -20257,6 +20592,13 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
20257
20592
  }
20258
20593
  return siblings;
20259
20594
  }
20595
+ function withPreconcurrencyFoundationModules(source) {
20596
+ if (!PRECONCURRENCY_FOUNDATION_IMPORT.test(source)) return source;
20597
+ return `${source}${source.endsWith("\n") ? "" : "\n"}#if canImport(PeachObjC)
20598
+ ${["ObjectiveC", ...FOUNDATION_IMPLICIT_MODULES].map((module2) => `@preconcurrency import ${module2}
20599
+ `).join("")}#endif
20600
+ `;
20601
+ }
20260
20602
  function swiftArtifactHash(input, release, moduleRoot) {
20261
20603
  const hash = (0, import_node_crypto21.createHash)("sha256");
20262
20604
  hash.update(`swift-compile
@@ -20266,9 +20608,10 @@ ${release}
20266
20608
  if (input.oneModule) hash.update("one-module\n");
20267
20609
  if (KEEP_WASM_NAMES) hash.update("names\n");
20268
20610
  hash.update(swiftModuleDigest(moduleRoot));
20269
- if (input.optimize) hash.update(`optimize
20270
- ${WASM_OPTIMIZE_IDENTITY}
20611
+ hash.update(`lower
20612
+ ${WASM_LOWER_IDENTITY}
20271
20613
  `);
20614
+ if (input.optimize) hash.update("optimize\n");
20272
20615
  for (const file of Object.keys(input.files).sort()) {
20273
20616
  hash.update((0, import_node_crypto21.createHash)("sha256").update(file).digest());
20274
20617
  hash.update((0, import_node_crypto21.createHash)("sha256").update(input.files[file]).digest());
@@ -20440,7 +20783,7 @@ function emitSwiftPackageManifest(args) {
20440
20783
  (name3) => !object6.startsWith(`lib/${name3}-`) || reachedFrameworks.has(name3)
20441
20784
  )
20442
20785
  );
20443
- const quoted = (object6) => `"${import_node_path47.default.join(moduleRoot, object6).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
20786
+ const quoted2 = (object6) => `"${import_node_path47.default.join(moduleRoot, object6).replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
20444
20787
  const categoryObjects = new Set(
20445
20788
  foundationCategoryObjects.map((name3) => `lib/Foundation-${name3}.o`)
20446
20789
  );
@@ -20449,11 +20792,11 @@ function emitSwiftPackageManifest(args) {
20449
20792
  objects.filter((object6) => roots.has(object6) || categoryObjects.has(object6))
20450
20793
  );
20451
20794
  const list2 = [
20452
- ...[...eager].map(quoted),
20795
+ ...[...eager].map(quoted2),
20453
20796
  "-Wl,--start-lib",
20454
- ...available.filter((object6) => !eager.has(object6)).map(quoted),
20797
+ ...available.filter((object6) => !eager.has(object6)).map(quoted2),
20455
20798
  "-Wl,--end-lib",
20456
- ...darwinRecordsRegion(distribution.objects.filter(isProvider).map(quoted))
20799
+ ...darwinRecordsRegion(distribution.objects.filter(isProvider).map(quoted2))
20457
20800
  ].join("\n") + "\n";
20458
20801
  distributionLinkPath = distributionLink.path.replace(
20459
20802
  /\.rsp$/,
@@ -20575,7 +20918,8 @@ function emitSwiftPackageManifest(args) {
20575
20918
  (value) => value.late?.producers.includes(target.name)
20576
20919
  )) ? `, "-emit-objc-header-path", ${JSON.stringify(import_node_path47.default.join(args.headerDirectory, `${target.name}-Swift${args.nativeHeaderDeclarations?.[target.name] ? ".original" : ""}.h`))}` : "";
20577
20920
  const clangMode = target.cxxInterop ? "" : ', "-Xcc", "-fno-cxx-modules"';
20578
- const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports2}${nativeImportFlags}${objcFlags}${header}${clangMode}${upstream}]`)})]`;
20921
+ const deployment = `, "-Xfrontend", "-peach-ios-deployment-target", "-Xfrontend", ${JSON.stringify(target.iosDeploymentTarget ?? SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET)}`;
20922
+ const swiftSettings = `swiftSettings: [.swiftLanguageMode(.v${target.languageMode}),${isolation}${interoperability}${defines}${features}${upcoming} .unsafeFlags(${swiftFlagArray(`["-Osize", "-Xfrontend", "-enable-cross-import-overlays"${overlayFlags}${FOUNDATION_IMPLICIT_FLAGS}${oneModule ? ONE_IMPLICIT_FLAGS : ""}${imports2}${nativeImportFlags}${objcFlags}${header}${clangMode}${deployment}${upstream}]`)})]`;
20579
20923
  const deps = [
20580
20924
  .../* @__PURE__ */ new Set([
20581
20925
  ...(target.dependencies ?? []).flatMap(
@@ -20771,14 +21115,14 @@ function compiledSwiftSources(files2, targets, overlayFrameworks) {
20771
21115
  );
20772
21116
  });
20773
21117
  const manifest = /(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file);
20774
- return [
20775
- file,
20776
- manifest && (!owner || /^Package(?:@swift-[\d.]+)?\.swift$/.test(file)) ? source : swiftSourceAsIOS(
20777
- source,
20778
- overlayFrameworks,
20779
- owner?.defines?.includes(SWIFT_XCODE_BUILD_CONDITION) && !owner.defines.includes("SWIFT_PACKAGE") ? false : void 0
20780
- )
20781
- ];
21118
+ if (manifest && (!owner || /^Package(?:@swift-[\d.]+)?\.swift$/.test(file)))
21119
+ return [file, source];
21120
+ const ios = swiftSourceAsIOS(
21121
+ source,
21122
+ overlayFrameworks,
21123
+ owner?.defines?.includes(SWIFT_XCODE_BUILD_CONDITION) && !owner.defines.includes("SWIFT_PACKAGE") ? false : void 0
21124
+ );
21125
+ return [file, withPreconcurrencyFoundationModules(ios)];
20782
21126
  })
20783
21127
  );
20784
21128
  }
@@ -20918,16 +21262,22 @@ function foundationOwnerOf(name3) {
20918
21262
  return "PeachFoundation";
20919
21263
  return void 0;
20920
21264
  }
20921
- function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
20922
- const { lineStarts, tokens: tokens2 } = swiftCodeScan(source);
21265
+ function swiftPackageSourceAsIOS(source) {
21266
+ return swiftConditionsAsIOS(source, swiftCodeScan(source).lineStarts);
21267
+ }
21268
+ function swiftConditionsAsIOS(source, lineStarts, swiftPackage) {
20923
21269
  let offset = 0;
20924
- const conditioned = source.split("\n").map((line) => {
21270
+ return source.split("\n").map((line) => {
20925
21271
  const start = offset;
20926
21272
  offset += line.length + 1;
20927
21273
  if (!lineStarts.has(start) || !DIRECTIVE.test(line)) return line;
20928
- const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length));
21274
+ const platform = line.replace(OS_IOS, (match) => "true".padEnd(match.length)).replace(NOT_ON_IOS, (match) => "false".padEnd(match.length));
20929
21275
  return swiftPackage === false ? platform.replace(/\bSWIFT_PACKAGE\b/g, (match) => "false".padEnd(match.length)) : platform;
20930
21276
  }).join("\n");
21277
+ }
21278
+ function swiftSourceAsIOS(source, overlayFrameworks, swiftPackage) {
21279
+ const { lineStarts, tokens: tokens2 } = swiftCodeScan(source);
21280
+ const conditioned = swiftConditionsAsIOS(source, lineStarts, swiftPackage);
20931
21281
  let out = "";
20932
21282
  let copied = 0;
20933
21283
  const sceneLifecycleBodies = /* @__PURE__ */ new Set();
@@ -22791,8 +23141,15 @@ module ${moduleName}.Swift {
22791
23141
  }) + moduleFiles
22792
23142
  );
22793
23143
  }
22794
- for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
22795
- files2.set(import_node_path47.default.join(layout2.root, file), Buffer.from(bytes, "base64"));
23144
+ for (const [file, bytes] of Object.entries(input.packageFiles ?? {})) {
23145
+ const contents = Buffer.from(bytes, "base64");
23146
+ files2.set(
23147
+ import_node_path47.default.join(layout2.root, file),
23148
+ file.endsWith(".swift") && !/(?:^|\/)Package(?:@swift-[\d.]+)?\.swift$/.test(file) ? withPreconcurrencyFoundationModules(
23149
+ swiftPackageSourceAsIOS(contents.toString("utf8"))
23150
+ ) : contents
23151
+ );
23152
+ }
22796
23153
  for (const [file, bytes] of Object.entries(input.projectFiles ?? {})) {
22797
23154
  const destination = import_node_path47.default.join(layout2.root, file);
22798
23155
  if (files2.has(destination)) continue;
@@ -22809,14 +23166,36 @@ module ${moduleName}.Swift {
22809
23166
  )
22810
23167
  ] : []
22811
23168
  ];
23169
+ const clangWrapper2 = import_node_path47.default.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
23170
+ files2.set(
23171
+ clangWrapper2,
23172
+ [
23173
+ "#!/bin/sh",
23174
+ "name=",
23175
+ "prev=",
23176
+ 'for arg in "$@"; do',
23177
+ ' if [ "$prev" = -o ]; then name=${arg%/*}; name=${name##*/}; fi',
23178
+ " prev=$arg",
23179
+ "done",
23180
+ "case $name in",
23181
+ ` *.build) exec '${import_node_path47.default.join(nativeToolchain(), "clang")}' "-fmodule-name=\${name%.build}" "$@" ;;`,
23182
+ ` *) exec '${import_node_path47.default.join(nativeToolchain(), "clang")}' "$@" ;;`,
23183
+ "esac",
23184
+ ""
23185
+ ].join("\n")
23186
+ );
22812
23187
  files2.set(
22813
23188
  import_node_path47.default.join(layout2.root, ".peach-target-toolset.json"),
22814
23189
  JSON.stringify({
22815
23190
  schemaVersion: "1.0",
22816
- ...nativeToolsetFlags.length > 0 ? {
22817
- cCompiler: { extraCLIOptions: nativeToolsetFlags },
22818
- cxxCompiler: { extraCLIOptions: nativeToolsetFlags }
22819
- } : {},
23191
+ cCompiler: {
23192
+ extraCLIOptions: [
23193
+ ...nativeToolsetFlags,
23194
+ "-fmodules",
23195
+ `-fmodules-cache-path=${import_node_path47.default.join(layout2.root, ".build", "ModuleCache")}`
23196
+ ]
23197
+ },
23198
+ ...nativeToolsetFlags.length > 0 ? { cxxCompiler: { extraCLIOptions: nativeToolsetFlags } } : {},
22820
23199
  swiftCompiler: {
22821
23200
  extraCLIOptions: [
22822
23201
  ...headerAliasFlags.flatMap((flag) => ["-Xcc", flag]),
@@ -22897,6 +23276,8 @@ module ${moduleName}.Swift {
22897
23276
  "// dependency targets emit their native compatibility headers.\n"
22898
23277
  );
22899
23278
  syncSwiftTree(layout2.root, files2);
23279
+ const clangWrapper = import_node_path47.default.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
23280
+ if (files2.has(clangWrapper)) (0, import_node_fs50.chmodSync)(clangWrapper, 493);
22900
23281
  const dependencies = new Map(
22901
23282
  swiftManifestTargets(
22902
23283
  (0, import_node_fs50.readFileSync)(import_node_path47.default.join(layout2.root, "Package.swift"), "utf8")
@@ -23335,6 +23716,9 @@ async function buildFrameworkProducts(scratch2, args) {
23335
23716
  "release",
23336
23717
  "-Xswiftc",
23337
23718
  "-Osize",
23719
+ // the release link strips all debug info, so none is generated
23720
+ "-Xswiftc",
23721
+ "-gnone",
23338
23722
  "-Xswiftc",
23339
23723
  "-num-threads",
23340
23724
  "-Xswiftc",
@@ -23831,12 +24215,13 @@ function compileSwiftProjectOnce(input, options) {
23831
24215
  ] : []
23832
24216
  );
23833
24217
  const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
24218
+ const compiler = preparation.targetToolset ? { CC: import_node_path47.default.join(root, CLANG_TARGET_MODULE_WRAPPER) } : {};
23834
24219
  const appOptions = projectProcess ? {
23835
24220
  ...buildOptions,
23836
24221
  uid: projectProcess.uid,
23837
24222
  gid: projectProcess.gid,
23838
- confined: projectProcess.env
23839
- } : buildOptions;
24223
+ confined: { ...projectProcess.env, ...compiler }
24224
+ } : { ...buildOptions, env: { ...buildOptions.env, ...compiler } };
23840
24225
  const unprepared = preparation.targetFailures.map(
23841
24226
  (failure2) => `error: target ${failure2}`
23842
24227
  );
@@ -23866,6 +24251,9 @@ function compileSwiftProjectOnce(input, options) {
23866
24251
  ...preparation.targetToolset ? ["--toolset", import_node_path47.default.join(root, ".peach-target-toolset.json")] : [],
23867
24252
  "-c",
23868
24253
  "release",
24254
+ // the link strips debug info, so none is generated (as for the framework)
24255
+ "-Xswiftc",
24256
+ "-gnone",
23869
24257
  "-Xswiftc",
23870
24258
  "-num-threads",
23871
24259
  "-Xswiftc",
@@ -23899,6 +24287,51 @@ function compileSwiftProjectOnce(input, options) {
23899
24287
  if ((0, import_node_fs50.existsSync)(linked) && (0, import_node_fs50.statSync)(linked).size <= 8)
23900
24288
  (0, import_node_fs50.rmSync)(linked, { force: true });
23901
24289
  report("compiling and linking Swift modules");
24290
+ const frameworkInterfaces = /* @__PURE__ */ new Map();
24291
+ const frameworkInterface = (name3) => {
24292
+ if (frameworkInterfaces.has(name3)) return frameworkInterfaces.get(name3);
24293
+ const source = distribution ? import_node_path47.default.join(frameworkRoot, "modules", `${name3}-Swift.h`) : import_node_path47.default.join(
24294
+ prebuilt.modules,
24295
+ "..",
24296
+ `${name3}.build/include/${name3}-Swift.h`
24297
+ );
24298
+ if (!(0, import_node_fs50.existsSync)(source)) {
24299
+ frameworkInterfaces.set(name3, null);
24300
+ return null;
24301
+ }
24302
+ const headers = import_node_path47.default.join(
24303
+ swiftSdkPaths(frameworkRoot, options.toolchainBin).darwin,
24304
+ `System/Library/Frameworks/${name3}.framework/Headers`
24305
+ );
24306
+ const declared = /* @__PURE__ */ new Set();
24307
+ if ((0, import_node_fs50.existsSync)(headers)) {
24308
+ for (const file of (0, import_node_fs50.readdirSync)(headers, {
24309
+ recursive: true,
24310
+ encoding: "utf8"
24311
+ }))
24312
+ if (file.endsWith(".h"))
24313
+ for (const name4 of swiftInterfaceDeclarations(
24314
+ (0, import_node_fs50.readFileSync)(import_node_path47.default.join(headers, file), "utf8")
24315
+ ))
24316
+ declared.add(name4);
24317
+ }
24318
+ const header = withoutSwiftDeclarations(
24319
+ clangInterfaceHeader((0, import_node_fs50.readFileSync)(source, "utf8")),
24320
+ declared,
24321
+ `#import <${name3}/${name3}.h>`
24322
+ );
24323
+ const value = {
24324
+ file: import_node_path47.default.join(root, ".build/peach-framework-objc", `${name3}-Swift.h`),
24325
+ header
24326
+ };
24327
+ frameworkInterfaces.set(name3, value);
24328
+ writeBuildFile(
24329
+ value.file,
24330
+ ((0, import_node_fs50.existsSync)(import_node_path47.default.join(headers, `${name3}.h`)) ? `#import <${name3}/${name3}.h>
24331
+ ` : "") + swiftHeaderWithSuperclassImports(header, frameworkInterface)
24332
+ );
24333
+ return value;
24334
+ };
23902
24335
  try {
23903
24336
  const headerBuilds = preparation.headerProductTarget ? [
23904
24337
  ...Object.keys(preparation.nativeHeaderDeclarations),
@@ -23926,7 +24359,10 @@ function compileSwiftProjectOnce(input, options) {
23926
24359
  writeBuildFile(
23927
24360
  emitted,
23928
24361
  withoutSwiftDeclarations(
23929
- clangInterfaceHeader((0, import_node_fs50.readFileSync)(original, "utf8")),
24362
+ swiftHeaderWithSuperclassImports(
24363
+ clangInterfaceHeader((0, import_node_fs50.readFileSync)(original, "utf8")),
24364
+ frameworkInterface
24365
+ ),
23930
24366
  new Set(preparation.nativeHeaderDeclarations[producer]),
23931
24367
  `#import <${producer}/${producer}.h>`
23932
24368
  )
@@ -24043,16 +24479,15 @@ function compileSwiftProjectOnce(input, options) {
24043
24479
  output: output2,
24044
24480
  optimized
24045
24481
  });
24046
- else if (input.optimize) await optimizeWasm(output2, optimized);
24047
- const executable = input.optimize ? optimized : output2;
24482
+ else await lowerWasm(output2, optimized, { optimize: input.optimize === true });
24048
24483
  await runCompiler(
24049
24484
  import_node_path47.default.join(options.toolchainBin, "llvm-objcopy"),
24050
- ["--remove-section=.swift1_autolink_entries", executable],
24485
+ ["--remove-section=.swift1_autolink_entries", optimized],
24051
24486
  buildOptions
24052
24487
  );
24053
24488
  const artifact = {
24054
24489
  hash,
24055
- bytes: (0, import_node_fs50.readFileSync)(executable),
24490
+ bytes: (0, import_node_fs50.readFileSync)(optimized),
24056
24491
  icu: await icu
24057
24492
  };
24058
24493
  if (artifact.bytes.length <= 8)
@@ -24069,12 +24504,12 @@ function compileSwiftProjectOnce(input, options) {
24069
24504
  options.signal
24070
24505
  );
24071
24506
  }
24072
- var import_node_child_process27, import_node_crypto21, import_node_fs50, import_node_os11, import_node_path47, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, FOUNDATION_IMPLICIT_MODULES, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, DIRECTIVE, OS_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, wasmMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
24507
+ var import_node_child_process28, import_node_crypto21, import_node_fs50, import_node_os11, import_node_path47, v5, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_BUILDER_TRANSPORT_MARGIN_MS, SWIFT_BUILDER_DEFAULT_COMPILE_MS, clangInterfaceHeader, swiftInterfaceDeclarations, linkedModuleDigests, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, sdkPaths, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, FOUNDATION_IMPLICIT_MODULES, PRECONCURRENCY_FOUNDATION_IMPORT, FOUNDATION_IMPLICIT_FLAGS, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, DIRECTIVE, OS_IOS, NOT_ON_IOS, DELEGATE_CLASS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, emptyMacroEnvironment, wasmMacroEnvironment, HIDDEN_UNITS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, SWIFT_LINK_STAMP, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN;
24073
24508
  var init_swift_compile = __esm({
24074
24509
  "src/swift-compile.ts"() {
24075
24510
  "use strict";
24076
24511
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
24077
- import_node_child_process27 = require("node:child_process");
24512
+ import_node_child_process28 = require("node:child_process");
24078
24513
  import_node_crypto21 = require("node:crypto");
24079
24514
  import_node_fs50 = require("node:fs");
24080
24515
  import_node_os11 = __toESM(require("node:os"), 1);
@@ -24089,6 +24524,7 @@ var init_swift_compile = __esm({
24089
24524
  init_swift_distribution_contract();
24090
24525
  init_swift_foundation();
24091
24526
  init_swift_guest_compile();
24527
+ init_swift_guest_source_inputs();
24092
24528
  init_swift_icu();
24093
24529
  init_swift_link_roots();
24094
24530
  init_swift_objc_import();
@@ -24107,7 +24543,7 @@ var init_swift_compile = __esm({
24107
24543
  init_wasm_optimize();
24108
24544
  init_write_build_file();
24109
24545
  init_xcode_header_search();
24110
- WASM_TRIPLE = "wasm32-unknown-wasip1";
24546
+ WASM_TRIPLE = "wasm64-unknown-wasip1";
24111
24547
  SWIFTPM_PROGRESS = /^\[\d+\/\d+\] /;
24112
24548
  SWIFTPM_NOISE = /^(?:\[\d+\/\d+\] |Building for production\.\.\.$|warning: '--build-system native' has been deprecated)/;
24113
24549
  SWIFT_BUILDER_TRANSPORT_MARGIN_MS = 3e5;
@@ -24201,7 +24637,7 @@ var init_swift_compile = __esm({
24201
24637
  ExpoModulesCore: []
24202
24638
  };
24203
24639
  OPTIONAL_FRAMEWORKS = new Set(Object.keys(OPTIONAL_FRAMEWORK_DEPENDENCIES));
24204
- SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
24640
+ SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+|(?:public|package|internal|fileprivate|private)\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
24205
24641
  kleeneNot = (value) => value === void 0 ? void 0 : !value;
24206
24642
  kleeneAnd = (left, right) => left === false || right === false ? false : left === true && right === true ? true : void 0;
24207
24643
  kleeneOr = (left, right) => left === true || right === true ? true : left === false && right === false ? false : void 0;
@@ -24278,6 +24714,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
24278
24714
  "PeachFoundationCombine",
24279
24715
  "Darwin"
24280
24716
  ];
24717
+ PRECONCURRENCY_FOUNDATION_IMPORT = /^[ \t]*@preconcurrency[ \t]+(?:(?:public|package|internal|fileprivate|private)[ \t]+)?import[ \t]+(?:Foundation|UIKit|SwiftUI)[ \t]*(?:\/\/.*)?$/m;
24281
24718
  FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
24282
24719
  (module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
24283
24720
  ).join("");
@@ -24293,16 +24730,18 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
24293
24730
  "-Xlinker", "--wrap=swift_udata_open",
24294
24731
  "-Xlinker", "--wrap=swift_udata_openChoice",
24295
24732
  `;
24296
- darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quoted, "-Wl,--end-lib"] : [];
24733
+ darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...quoted2, "-Wl,--end-lib"] : [];
24297
24734
  REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
24298
24735
  MULTI_MANIFEST_VERSION = 68;
24299
24736
  SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
24300
- compilerSourceDigest = true ? "ae9e08389e6ab1901846342a7b347d7c10f8074172cf5d4d6505f7e955879ad4" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
24737
+ compilerSourceDigest = true ? "280e858b01b1c1393d3765c8d6ff1b3ce4a1a93d7fb7e3dd2d4d3e5f1d5f1ac2" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
24301
24738
  nativeCxxCompilerFlags = ["-fno-cxx-modules"];
24302
24739
  cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
24303
24740
  cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
24741
+ SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET = "12.0";
24304
24742
  DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
24305
24743
  OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
24744
+ NOT_ON_IOS = /\b(?:os\(\s*WASI\s*\)|canImport\(\s*FoundationNetworking\s*\))/g;
24306
24745
  DELEGATE_CLASS = /^class\s+[A-Za-z_]\w*\s*(?:<[^>{]*>)?\s*:[^{]*\b(?:UIApplicationDelegate|UISceneDelegate|UIWindowSceneDelegate)\b[^{]*\{/;
24307
24746
  FOUNDATION_NETWORKING_TYPES = /* @__PURE__ */ new Set([
24308
24747
  "NSURLConnection",
@@ -24824,7 +25263,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
24824
25263
  ...emptyMacroEnvironment,
24825
25264
  defines: /* @__PURE__ */ new Map([
24826
25265
  ["__wasm__", "1"],
24827
- ["__wasm32__", "1"],
25266
+ ["__wasm64__", "1"],
24828
25267
  ["__wasi__", "1"]
24829
25268
  ])
24830
25269
  };
@@ -24985,7 +25424,7 @@ var init_swiftNativePinContract = __esm({
24985
25424
  init_nitroAdapterContract();
24986
25425
  init_swift_distribution_contract();
24987
25426
  SWIFT_NATIVE_PIN_PATH = "node/swift-native.json";
24988
- SWIFT_NATIVE_PIN_SCHEMA = 2;
25427
+ SWIFT_NATIVE_PIN_SCHEMA = 3;
24989
25428
  DIGEST = /^[a-f0-9]{64}$/;
24990
25429
  }
24991
25430
  });
@@ -25329,7 +25768,7 @@ function dumpInputs(dir) {
25329
25768
  path: command,
25330
25769
  realpath: import_node_fs52.default.realpathSync(command),
25331
25770
  sha256: (0, import_node_crypto22.createHash)("sha256").update(import_node_fs52.default.readFileSync(command)).digest("hex"),
25332
- version: (0, import_node_child_process28.execFileSync)(command, ["--version"], {
25771
+ version: (0, import_node_child_process29.execFileSync)(command, ["--version"], {
25333
25772
  encoding: "utf8",
25334
25773
  env: swiftEnvironment(),
25335
25774
  stdio: ["ignore", "pipe", "pipe"]
@@ -25392,7 +25831,7 @@ function dump(dir, requirePrepared = false) {
25392
25831
  if (requirePrepared) throw new SwiftManifestPreparationRequired(dir);
25393
25832
  let output2;
25394
25833
  try {
25395
- output2 = (0, import_node_child_process28.execFileSync)(
25834
+ output2 = (0, import_node_child_process29.execFileSync)(
25396
25835
  command,
25397
25836
  [
25398
25837
  "package",
@@ -25531,7 +25970,10 @@ function swiftPackageManifest(dir, platform = GUEST_PLATFORMS, requirePrepared =
25531
25970
  (highest, mode) => Number(mode) > Number(highest) ? mode : highest
25532
25971
  ) : tools >= 6 ? "6" : tools >= 5 ? "5" : string4(record(raw2.toolsVersion)._version) ?? "unknown";
25533
25972
  let mainActorIsolation = false;
25534
- const defines = [];
25973
+ const defines = [...traits].map((name5) => ({
25974
+ name: name5,
25975
+ configuration: null
25976
+ }));
25535
25977
  const libraries = [];
25536
25978
  const frameworks = [];
25537
25979
  const experimentalFeatures = [];
@@ -25769,7 +26211,7 @@ async function resolveSwiftPackageRequirementsAsync(requirements, destination, s
25769
26211
  const { dir, args, options, failed, publish } = resolveRequest(requirements);
25770
26212
  try {
25771
26213
  try {
25772
- await (0, import_node_util8.promisify)(import_node_child_process28.execFile)(swiftCommand(), args, { ...options, signal });
26214
+ await (0, import_node_util9.promisify)(import_node_child_process29.execFile)(swiftCommand(), args, { ...options, signal });
25773
26215
  } catch (error) {
25774
26216
  throw failed(error);
25775
26217
  }
@@ -25810,17 +26252,17 @@ function swiftTargetFiles(manifest, target) {
25810
26252
  }
25811
26253
  return [...new Set(files2)].sort();
25812
26254
  }
25813
- var import_node_child_process28, import_node_crypto22, import_node_fs52, import_node_os13, import_node_path49, import_node_util8, TARGET_TYPES, targetRelative, isTargetType, record, array3, string4, cacheDir3, evaluated, execFileAsync, cachedToolchain, SwiftManifestPreparationRequired, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
26255
+ var import_node_child_process29, import_node_crypto22, import_node_fs52, import_node_os13, import_node_path49, import_node_util9, TARGET_TYPES, targetRelative, isTargetType, record, array3, string4, cacheDir3, evaluated, execFileAsync, cachedToolchain, SwiftManifestPreparationRequired, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
25814
26256
  var init_swift_package_manifest = __esm({
25815
26257
  "src/swift-package-manifest.ts"() {
25816
26258
  "use strict";
25817
26259
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
25818
- import_node_child_process28 = require("node:child_process");
26260
+ import_node_child_process29 = require("node:child_process");
25819
26261
  import_node_crypto22 = require("node:crypto");
25820
26262
  import_node_fs52 = __toESM(require("node:fs"), 1);
25821
26263
  import_node_os13 = __toESM(require("node:os"), 1);
25822
26264
  import_node_path49 = __toESM(require("node:path"), 1);
25823
- import_node_util8 = require("node:util");
26265
+ import_node_util9 = require("node:util");
25824
26266
  init_home_paths();
25825
26267
  init_swift_distribution();
25826
26268
  init_swift_native_pin();
@@ -25842,7 +26284,7 @@ var init_swift_package_manifest = __esm({
25842
26284
  string4 = (value) => typeof value === "string" ? value : void 0;
25843
26285
  cacheDir3 = import_node_path49.default.join(cacheDir(), "swift-manifests");
25844
26286
  evaluated = /* @__PURE__ */ new Map();
25845
- execFileAsync = (0, import_node_util8.promisify)(import_node_child_process28.execFile);
26287
+ execFileAsync = (0, import_node_util9.promisify)(import_node_child_process29.execFile);
25846
26288
  SwiftManifestPreparationRequired = class extends Error {
25847
26289
  constructor(dir) {
25848
26290
  super(`swift package manifest requires preparation: ${dir}`);
@@ -26587,7 +27029,7 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
26587
27029
  const derivedSettings = {
26588
27030
  DEVELOPER_DIR: () => options.environment?.DEVELOPER_DIR ?? process.env.DEVELOPER_DIR ?? (developerDir ??= process.platform === "darwin" ? (
26589
27031
  // runner-toolchain-platform: darwin
26590
- (0, import_node_child_process29.execFileSync)("xcode-select", ["-p"], {
27032
+ (0, import_node_child_process30.execFileSync)("xcode-select", ["-p"], {
26591
27033
  encoding: "utf8",
26592
27034
  stdio: ["ignore", "pipe", "pipe"]
26593
27035
  }).trim()
@@ -26628,7 +27070,7 @@ function settingList(value) {
26628
27070
  items2.push(
26629
27071
  word.replace(
26630
27072
  /"((?:\\.|[^"\\])*)"|\\(.)/g,
26631
- (_, quoted, escaped) => quoted !== void 0 ? quoted.replace(/\\(.)/g, "$1") : escaped
27073
+ (_, quoted2, escaped) => quoted2 !== void 0 ? quoted2.replace(/\\(.)/g, "$1") : escaped
26632
27074
  )
26633
27075
  );
26634
27076
  return items2;
@@ -26880,17 +27322,17 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
26880
27322
  );
26881
27323
  });
26882
27324
  }
26883
- const signature = (0, import_node_crypto23.createHash)("sha256").update(
27325
+ const signature2 = (0, import_node_crypto23.createHash)("sha256").update(
26884
27326
  JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
26885
27327
  );
26886
27328
  for (const file of inputFiles) {
26887
- signature.update(file);
27329
+ signature2.update(file);
26888
27330
  if (import_node_fs53.default.existsSync(file)) {
26889
27331
  const stat = import_node_fs53.default.statSync(file);
26890
- signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
26891
- } else signature.update("missing");
27332
+ signature2.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
27333
+ } else signature2.update("missing");
26892
27334
  }
26893
- const stamp = signature.digest("hex");
27335
+ const stamp = signature2.digest("hex");
26894
27336
  const key2 = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
26895
27337
  if (preparedSourcePhases.get(key2) === stamp && allOutputs.every((file) => import_node_fs53.default.existsSync(file))) {
26896
27338
  preparedXcodePhase(
@@ -26921,7 +27363,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
26921
27363
  str(phase.shellPath) ?? "/bin/sh",
26922
27364
  str(phase.shellScript) ?? ""
26923
27365
  );
26924
- (0, import_node_child_process29.execFileSync)(shell, args, {
27366
+ (0, import_node_child_process30.execFileSync)(shell, args, {
26925
27367
  cwd: project.projectDir,
26926
27368
  env,
26927
27369
  stdio: ["ignore", "pipe", "pipe"],
@@ -27029,7 +27471,7 @@ ${output2}`
27029
27471
  const families = settings("TARGETED_DEVICE_FAMILY").split(",").map((value) => value.trim());
27030
27472
  if (families.includes("1")) args.push("--target-device", "iphone");
27031
27473
  if (families.includes("2")) args.push("--target-device", "ipad");
27032
- (0, import_node_child_process29.execFileSync)("xcrun", args, {
27474
+ (0, import_node_child_process30.execFileSync)("xcrun", args, {
27033
27475
  cwd: project.projectDir,
27034
27476
  stdio: ["ignore", "pipe", "pipe"],
27035
27477
  timeout: runScriptTimeoutMs
@@ -27074,7 +27516,7 @@ ${output2}`
27074
27516
  args.push("-swiftVersion", settings("SWIFT_VERSION") || "5.0");
27075
27517
  if (settings("DEFINES_MODULE") === "YES")
27076
27518
  args.push("-moduleName", settings("PRODUCT_MODULE_NAME"));
27077
- (0, import_node_child_process29.execFileSync)("xcrun", args, {
27519
+ (0, import_node_child_process30.execFileSync)("xcrun", args, {
27078
27520
  cwd: project.projectDir,
27079
27521
  stdio: ["ignore", "pipe", "pipe"],
27080
27522
  timeout: runScriptTimeoutMs
@@ -27646,7 +28088,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
27646
28088
  languageMode: swiftVersion >= 6 ? 6 : 5,
27647
28089
  mainActorIsolation: settings2("SWIFT_DEFAULT_ACTOR_ISOLATION") === "MainActor",
27648
28090
  defines: compilationConditions(settings2),
27649
- iosDeploymentTarget: settings2("IPHONEOS_DEPLOYMENT_TARGET") || null,
28091
+ iosDeploymentTarget: settings2("IPHONEOS_DEPLOYMENT_TARGET") || XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
27650
28092
  assetSettings: {
27651
28093
  IPHONEOS_DEPLOYMENT_TARGET: XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET,
27652
28094
  ...Object.fromEntries(
@@ -27913,11 +28355,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
27913
28355
  info[key2.slice("INFOPLIST_KEY_".length)] = value === "YES" ? true : value === "NO" ? false : value;
27914
28356
  }
27915
28357
  if (settings("GENERATE_INFOPLIST_FILE") === "YES") {
27916
- const versions = {
28358
+ const generated = {
28359
+ CFBundleDevelopmentRegion: "DEVELOPMENT_LANGUAGE",
27917
28360
  CFBundleShortVersionString: "MARKETING_VERSION",
27918
28361
  CFBundleVersion: "CURRENT_PROJECT_VERSION"
27919
28362
  };
27920
- for (const [key2, setting] of Object.entries(versions)) {
28363
+ for (const [key2, setting] of Object.entries(generated)) {
27921
28364
  const value = settings(setting);
27922
28365
  if (info[key2] === void 0 && value) info[key2] = value;
27923
28366
  }
@@ -28276,12 +28719,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
28276
28719
  cocoapods
28277
28720
  };
28278
28721
  }
28279
- var import_node_child_process29, import_node_crypto23, import_node_fs53, import_node_path51, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
28722
+ var import_node_child_process30, import_node_crypto23, import_node_fs53, import_node_path51, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
28280
28723
  var init_xcode_project = __esm({
28281
28724
  "src/xcode-project.ts"() {
28282
28725
  "use strict";
28283
28726
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
28284
- import_node_child_process29 = require("node:child_process");
28727
+ import_node_child_process30 = require("node:child_process");
28285
28728
  import_node_crypto23 = require("node:crypto");
28286
28729
  import_node_fs53 = __toESM(require("node:fs"), 1);
28287
28730
  import_node_path51 = __toESM(require("node:path"), 1);
@@ -28428,7 +28871,7 @@ var init_swift_standin_digest = __esm({
28428
28871
  STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
28429
28872
  SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
28430
28873
  standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
28431
- STANDIN_SOURCE_DIGEST = true ? "967c1c2a3b66ac640e0162783ed9e21b09ff285f8e1f7d4327b70416699e14c8" : standinSourceDigest();
28874
+ STANDIN_SOURCE_DIGEST = true ? "c157dea0314bab3ba5af4145cc3ba5b8a4d824fa6677166162e49713afe384bb" : standinSourceDigest();
28432
28875
  }
28433
28876
  });
28434
28877
 
@@ -28755,7 +29198,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk, distribution) {
28755
29198
  sdk: sdk.wasmSdkId,
28756
29199
  sdkChecksum: sdk.wasmSdkChecksum,
28757
29200
  distribution,
28758
- target: "wasm32-wasip1",
29201
+ target: "wasm64-wasip1",
28759
29202
  features: "exception_handling"
28760
29203
  };
28761
29204
  return { name: recipe2.name, inputs, key: nativeEntryKey(inputs) };
@@ -28793,7 +29236,7 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
28793
29236
  import_node_fs66.default.mkdirSync(directory2, { recursive: true });
28794
29237
  const temporary = import_node_path64.default.join(directory2, `combined-${(0, import_node_crypto32.randomUUID)()}.a`);
28795
29238
  try {
28796
- (0, import_node_child_process33.execFileSync)(import_node_path64.default.join(toolchain.toolchainBin, "llvm-ar"), [
29239
+ (0, import_node_child_process34.execFileSync)(import_node_path64.default.join(toolchain.toolchainBin, "llvm-ar"), [
28797
29240
  "qcsDL",
28798
29241
  temporary,
28799
29242
  ...files2
@@ -28804,12 +29247,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
28804
29247
  }
28805
29248
  return archive;
28806
29249
  }
28807
- var import_node_child_process33, import_node_crypto32, import_node_fs66, import_node_path64, NATIVE_STATIC_LIBRARY_RECIPES;
29250
+ var import_node_child_process34, import_node_crypto32, import_node_fs66, import_node_path64, NATIVE_STATIC_LIBRARY_RECIPES;
28808
29251
  var init_native_static_libraries = __esm({
28809
29252
  "src/native-static-libraries.ts"() {
28810
29253
  "use strict";
28811
29254
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
28812
- import_node_child_process33 = require("node:child_process");
29255
+ import_node_child_process34 = require("node:child_process");
28813
29256
  import_node_crypto32 = require("node:crypto");
28814
29257
  import_node_fs66 = __toESM(require("node:fs"), 1);
28815
29258
  import_node_path64 = __toESM(require("node:path"), 1);
@@ -28824,7 +29267,7 @@ var init_native_static_libraries = __esm({
28824
29267
  name: "libsodium",
28825
29268
  nativeSha256: "4e5112bdb787a4305ddb8e464a129d4f002c2f0be5a62eb541b5122b769fc17a",
28826
29269
  upstream: "ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19",
28827
- recipe: "c164067cbb87998d0539ac88e73fea0bdacc81a9ac8f8e92ac577c957581f626",
29270
+ recipe: "0e5d450f381952394e6c2c4ec1126536150b18fd24576fc5303f0cb9e9bfc6bc",
28828
29271
  archive: "libsodium.a"
28829
29272
  },
28830
29273
  {
@@ -28832,7 +29275,7 @@ var init_native_static_libraries = __esm({
28832
29275
  nativeSha256: "474dff8315a8e4d3a6fdd9f89c7264c79c5f84a5b9acbfdfb9fb0ee68d8c801e",
28833
29276
  upstream: "520ba083085a14efcb77d701b35544f81d7b1acf",
28834
29277
  // updated with the native producer sources and port patches.
28835
- recipe: "83500b90e0e1dcfd4e1868c8e6a39e62222b108ac0e3b5937503b22d2c249d82",
29278
+ recipe: "06b6385b341b2eaf49c754ffb285ed18b6988a207a20ce89d3a9fa7782f1c7a6",
28836
29279
  archive: "libmoonshine_core.a"
28837
29280
  },
28838
29281
  {
@@ -28840,14 +29283,14 @@ var init_native_static_libraries = __esm({
28840
29283
  nativeSha256: "b91cd08892ebe0cdd39e1336594bb66cd79fc639a894303805792047d24f468b",
28841
29284
  upstream: "ed59cc48e37ac33ac15b252fc5ad7af4b9ecd51d",
28842
29285
  // updated with the native producer script and port patches.
28843
- recipe: "59bf4995e1fd81ee38f335684a322b7a677adc2da994dd54c6684b4625744c7d",
29286
+ recipe: "cea231f8139cf2b44a3f2b309ce8a99b9ee3e3ff52b5120780bc5969a22f8059",
28844
29287
  archive: "libessentia.a"
28845
29288
  },
28846
29289
  {
28847
29290
  name: "anydoc_mobile",
28848
29291
  nativeSha256: "03b721dd9e98ec2767f7952aa65cde57d0c33d7ec80c9aaf7ab5ba77e055a25c",
28849
29292
  upstream: "e41ad6375fd80b64c4183d1a3f901d1f640a7953",
28850
- recipe: "09b5250e9fab58843fc53361ffdf71dfc9a669149c8bdd4209215b297ff2f618",
29293
+ recipe: "9e451f5c558362620be86f7c6c4d52a0d7ed7194ccc9ea5a9d29dfd410f95057",
28851
29294
  archive: "libanydoc_mobile.a"
28852
29295
  },
28853
29296
  {
@@ -28855,14 +29298,14 @@ var init_native_static_libraries = __esm({
28855
29298
  nativeSha256: "8c41abcd8dd4e562e65cf5b88467a3493089c359d0863360dc65a5b88149e837",
28856
29299
  upstream: "a4296fa21cd40a56543602511bcf417014f4fee7cf5e1eaab58e0ac9610e3f63",
28857
29300
  // the unchanged source build, pinned Rust release and committed Cargo.lock.
28858
- recipe: "592c26605414202111c6efb9cb49f488e10dbad33b3a93b8336ed85dd0e955fe",
29301
+ recipe: "3923ea147f25e83a2688150afe1d26b6134e12833693b3fc1aca63033fcd1750",
28859
29302
  archive: "libratex_ffi.a"
28860
29303
  },
28861
29304
  {
28862
29305
  name: "ratex_ffi_0_1_14",
28863
29306
  nativeSha256: "bdd2bf679fcc981d98d36733b3bd083225a7397bb82bbd462c89088c6e0580a8",
28864
29307
  upstream: "2da907eb5dfcb464c7eef3b4c657fbdee144e3c6633e81efb1e56dcf1c76e01b",
28865
- recipe: "59ee230bd8bfde478605817c852c47e76f0c18d88d615bcc0a496b4accd69adf",
29308
+ recipe: "2a9ca604065f0e6908100835789eeecb1d5d7d750d3ec0ca288a01795642fa6f",
28866
29309
  archive: "libratex_ffi.a"
28867
29310
  },
28868
29311
  // react-native-skia 2.14.0 (apple-ios 154.0.0), then 3.8.0 (157): installed apps pin either.
@@ -28870,112 +29313,112 @@ var init_native_static_libraries = __esm({
28870
29313
  name: "skia",
28871
29314
  nativeSha256: "5312f2b194b1f6b6721388028bf919e56400278245b039f47136aa98f0582333",
28872
29315
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28873
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29316
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28874
29317
  archive: "libskia.a"
28875
29318
  },
28876
29319
  {
28877
29320
  name: "skia_svg",
28878
29321
  nativeSha256: "77adc498cff85db7850fb713c306681c6337f9b4ec42991b3764c8f3eff9d8d0",
28879
29322
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28880
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29323
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28881
29324
  archive: "libsvg.a"
28882
29325
  },
28883
29326
  {
28884
29327
  name: "skia_skshaper",
28885
29328
  nativeSha256: "830bcf260bd24fd79ee5d323e26ec667638795e3a0e555f1093371b8342c345c",
28886
29329
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28887
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29330
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28888
29331
  archive: "libskshaper.a"
28889
29332
  },
28890
29333
  {
28891
29334
  name: "skia_skparagraph",
28892
29335
  nativeSha256: "26afd4e5b11d46b0820a2cd7fd9918eb5a041946e1a1c0d4b91a5d54877e9dda",
28893
29336
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28894
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29337
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28895
29338
  archive: "libskparagraph.a"
28896
29339
  },
28897
29340
  {
28898
29341
  name: "skia_skunicode_core",
28899
29342
  nativeSha256: "629f58c4e81157d42e353b2b255bebb2fd94d1f31d8f8157e982fa4367710526",
28900
29343
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28901
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29344
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28902
29345
  archive: "libskunicode_core.a"
28903
29346
  },
28904
29347
  {
28905
29348
  name: "skia_skunicode_libgrapheme",
28906
29349
  nativeSha256: "047bd82306ba688453a3ff9dc02e203cdf16f2084551cca54f5d2b099baf1895",
28907
29350
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28908
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29351
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28909
29352
  archive: "libskunicode_libgrapheme.a"
28910
29353
  },
28911
29354
  {
28912
29355
  name: "skia_skottie",
28913
29356
  nativeSha256: "75c0dfd82a256e761cddc45475b8109ed8c9a442767cf3a8bf8720eef0dd4af7",
28914
29357
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28915
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29358
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28916
29359
  archive: "libskottie.a"
28917
29360
  },
28918
29361
  {
28919
29362
  name: "skia_sksg",
28920
29363
  nativeSha256: "df9652a46505d3c5c74d55b52295ef39218d2b5856e074117461fa2348312c8d",
28921
29364
  upstream: "9f9e6beb751091ef69163d2b4fdcd1e711b594ac",
28922
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29365
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28923
29366
  archive: "libsksg.a"
28924
29367
  },
28925
29368
  {
28926
29369
  name: "skia",
28927
29370
  nativeSha256: "c9b007c4da16f66d84b2f108af719b424ef91ee0759e58df0b76930bc6f82e31",
28928
29371
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28929
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29372
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28930
29373
  archive: "libskia.a"
28931
29374
  },
28932
29375
  {
28933
29376
  name: "skia_svg",
28934
29377
  nativeSha256: "159705737769610b60216b114a28ba833840aa1df7833424df99edec4405b86f",
28935
29378
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28936
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29379
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28937
29380
  archive: "libsvg.a"
28938
29381
  },
28939
29382
  {
28940
29383
  name: "skia_skshaper",
28941
29384
  nativeSha256: "934f3dbf3f38bca87b463b664a17c1588840f86ec89cf6961fb2a89b6336b35b",
28942
29385
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28943
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29386
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28944
29387
  archive: "libskshaper.a"
28945
29388
  },
28946
29389
  {
28947
29390
  name: "skia_skparagraph",
28948
29391
  nativeSha256: "29a48349fc9b75c252b22fc6ca5ade90636900f82beec58780f03fd66ab345b3",
28949
29392
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28950
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29393
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28951
29394
  archive: "libskparagraph.a"
28952
29395
  },
28953
29396
  {
28954
29397
  name: "skia_skunicode_core",
28955
29398
  nativeSha256: "096e5139c4de528dbba5a9605895f4c725853e48225503bdfa9c1d70241e5f58",
28956
29399
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28957
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29400
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28958
29401
  archive: "libskunicode_core.a"
28959
29402
  },
28960
29403
  {
28961
29404
  name: "skia_skunicode_libgrapheme",
28962
29405
  nativeSha256: "d1ec3c2d5ad6889eb4fbf4a6bab74f39946739501d40de903f7d8cb2181ac37d",
28963
29406
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28964
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29407
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28965
29408
  archive: "libskunicode_libgrapheme.a"
28966
29409
  },
28967
29410
  {
28968
29411
  name: "skia_skottie",
28969
29412
  nativeSha256: "52ea2e046f45f51df6027d783e923864e8c4ef94a1fe4fc5971e436574d8ae57",
28970
29413
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28971
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29414
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28972
29415
  archive: "libskottie.a"
28973
29416
  },
28974
29417
  {
28975
29418
  name: "skia_sksg",
28976
29419
  nativeSha256: "541a74d8f83dc411efe8eeac377486a5054fab4c7710afe406a20a27efe8f627",
28977
29420
  upstream: "b94213a11b3a2edadfae89f0c57a7f4ab72772c9",
28978
- recipe: "a2642115a5eeb04559c9f1daaa4b4cbe4b1c211533b4cc80cb8339a4477af205",
29421
+ recipe: "91591e98be98542547d3ea972803b7929675c3569d98c7a3d92d266896f84545",
28979
29422
  archive: "libsksg.a"
28980
29423
  },
28981
29424
  {
@@ -29466,7 +29909,7 @@ function resolveSwiftPackages(options) {
29466
29909
  const gap = options.binaryGaps?.get(name3);
29467
29910
  const unlowerable = unlowerableSources(files2, target, portableAssembly);
29468
29911
  const placeholder = placeholderPackage(pkg);
29469
- const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no wasm32 lowering: ${unlowerable.map((file) => import_node_path66.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
29912
+ const ownReason = target.type === "binary" ? `${name3} ${BINARY}${gap ? `; ${gap}` : ""}` : placeholder && gap ? `${name3} stands in as a placeholder (${placeholder}), and ${gap}` : target.type !== "regular" && target.type !== "system" ? `${name3} is a ${target.type} target` : unlowerable.length > 0 ? `${name3} has native sources with no wasm lowering: ${unlowerable.map((file) => import_node_path66.default.relative(pkg.manifest.dir, file)).join(", ")}${gap ? `; ${gap}` : ""}` : null;
29470
29913
  const reasons = target.dependencies.map((dependency) => {
29471
29914
  if (dependency.kind === "target") return resolveTarget(pkg, dependency.name);
29472
29915
  const nested = resolveDependencyProduct(pkg, dependency);
@@ -29841,17 +30284,17 @@ function resolveSwiftPackages(options) {
29841
30284
  result.nativeProducts.push({ name: name3, packageDir: manifest.dir, source });
29842
30285
  return result;
29843
30286
  }
29844
- var import_node_child_process34, import_node_crypto34, import_node_fs68, import_node_path66, import_promises7, import_node_util12, swiftBinaryOnDisk, SWIFT_PLACEHOLDER_PACKAGES, placeholderPackage, UNSUPPORTED_NATIVE, BINARY, blockers, verified, execFileAsync2, checkoutKey;
30287
+ var import_node_child_process35, import_node_crypto34, import_node_fs68, import_node_path66, import_promises7, import_node_util13, swiftBinaryOnDisk, SWIFT_PLACEHOLDER_PACKAGES, placeholderPackage, UNSUPPORTED_NATIVE, BINARY, blockers, verified, execFileAsync2, checkoutKey;
29845
30288
  var init_swift_packages = __esm({
29846
30289
  "src/swift-packages.ts"() {
29847
30290
  "use strict";
29848
30291
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
29849
- import_node_child_process34 = require("node:child_process");
30292
+ import_node_child_process35 = require("node:child_process");
29850
30293
  import_node_crypto34 = require("node:crypto");
29851
30294
  import_node_fs68 = __toESM(require("node:fs"), 1);
29852
30295
  import_node_path66 = __toESM(require("node:path"), 1);
29853
30296
  import_promises7 = require("node:timers/promises");
29854
- import_node_util12 = require("node:util");
30297
+ import_node_util13 = require("node:util");
29855
30298
  init_home_paths();
29856
30299
  init_native_git();
29857
30300
  init_numbered_lock();
@@ -29867,7 +30310,7 @@ var init_swift_packages = __esm({
29867
30310
  BINARY = "is a binary framework";
29868
30311
  blockers = (reasons) => [...new Set(reasons.flat())];
29869
30312
  verified = /* @__PURE__ */ new Set();
29870
- execFileAsync2 = (0, import_node_util12.promisify)(import_node_child_process34.execFile);
30313
+ execFileAsync2 = (0, import_node_util13.promisify)(import_node_child_process35.execFile);
29871
30314
  checkoutKey = (dir, pin2) => `${dir}\0${pin2.revision}`;
29872
30315
  }
29873
30316
  });
@@ -29878,11 +30321,12 @@ function nativeSliceEntry(recipe2, release, sdk) {
29878
30321
  library: recipe2.name,
29879
30322
  upstream: recipe2.upstream,
29880
30323
  recipe: recipe2.source,
30324
+ port: recipe2.port,
29881
30325
  zig: recipe2.zig,
29882
30326
  compiler: release,
29883
30327
  sdk: sdk.wasmSdkId,
29884
30328
  sdkChecksum: sdk.wasmSdkChecksum,
29885
- target: "wasm32-wasip1",
30329
+ target: "wasm64-wasip1",
29886
30330
  features: "generic+exception_handling"
29887
30331
  };
29888
30332
  return { name: recipe2.name, inputs, key: nativeEntryKey(inputs) };
@@ -29898,11 +30342,11 @@ var init_native_slices = __esm({
29898
30342
  name: "GhosttyKit",
29899
30343
  upstream: "cf8edc23f3a6a87a96e41a90013e89e987d34980",
29900
30344
  source: "da78a502b56fd20f349bf029df8e76ed7c458007",
30345
+ port: "f4f9162f713b9ab15e0e44499e6878608e48b23e75d7833012aecf0a61ac83ba",
29901
30346
  repository: "https://github.com/natew/ghostty.git",
29902
30347
  zig: "0.16.0",
29903
30348
  pinFile: "VERSION",
29904
30349
  archive: "libghostty.a",
29905
- buildScript: "./wasi/build.sh",
29906
30350
  output: "zig-out/lib/ghostty-internal.a"
29907
30351
  }
29908
30352
  };
@@ -29921,7 +30365,7 @@ function nativeSwiftSliceEntry(distribution, generator) {
29921
30365
  sdk: distribution.wasmSdkId,
29922
30366
  sdkChecksum: distribution.wasmSdkChecksum,
29923
30367
  distribution: distribution.id,
29924
- target: "wasm32-wasip1"
30368
+ target: "wasm64-wasip1"
29925
30369
  };
29926
30370
  return { name: SENTRY_SWIFT_SLICE.name, inputs, key: nativeEntryKey(inputs) };
29927
30371
  }
@@ -29937,7 +30381,7 @@ function privateSentrySlice(entry, moduleRoot) {
29937
30381
  const staging = import_node_fs69.default.mkdtempSync(import_node_path67.default.join(import_node_fs69.default.realpathSync(import_node_os15.default.tmpdir()), "sentry-slice-"));
29938
30382
  try {
29939
30383
  process.stderr.write("peach: building the Sentry slice for a private distribution\u2026\n");
29940
- (0, import_node_child_process35.execFileSync)("bun", [script, "--output", staging, "--module-root", moduleRoot], {
30384
+ (0, import_node_child_process36.execFileSync)("bun", [script, "--output", staging, "--module-root", moduleRoot], {
29941
30385
  stdio: ["ignore", 2, 2]
29942
30386
  });
29943
30387
  return installNativeEntry(
@@ -30008,12 +30452,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
30008
30452
  }
30009
30453
  };
30010
30454
  }
30011
- var import_node_child_process35, import_node_crypto35, import_node_fs69, import_node_os15, import_node_path67, SENTRY_SWIFT_SLICE;
30455
+ var import_node_child_process36, import_node_crypto35, import_node_fs69, import_node_os15, import_node_path67, SENTRY_SWIFT_SLICE;
30012
30456
  var init_native_swift_slices = __esm({
30013
30457
  "src/native-swift-slices.ts"() {
30014
30458
  "use strict";
30015
30459
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
30016
- import_node_child_process35 = require("node:child_process");
30460
+ import_node_child_process36 = require("node:child_process");
30017
30461
  import_node_crypto35 = require("node:crypto");
30018
30462
  import_node_fs69 = __toESM(require("node:fs"), 1);
30019
30463
  import_node_os15 = __toESM(require("node:os"), 1);
@@ -30029,7 +30473,7 @@ var init_native_swift_slices = __esm({
30029
30473
  checksum: "17b5cdca223d333f21609c59b97afe26b964eddba3b89186033386d7ba22024d",
30030
30474
  nativeSha256: "c0935ec6243f706cafa25666fe53267ae166e43d49771240d88ae9f5b0886671",
30031
30475
  url: "https://github.com/getsentry/sentry-cocoa/releases/download/9.8.0/Sentry.xcframework.zip",
30032
- recipe: "b93503e2cdaacc14076b45e0a1f72baccc1b117f138d4728acf46184e59f30c3"
30476
+ recipe: "498cf5669d04ec9dad226f4da3d929b58c842cf410de51601a4bb874969b9652"
30033
30477
  };
30034
30478
  }
30035
30479
  });
@@ -30299,7 +30743,7 @@ async function emitCxxStandin(input) {
30299
30743
  );
30300
30744
  const flags = [
30301
30745
  "-target",
30302
- "wasm32-unknown-wasip1",
30746
+ "wasm64-unknown-wasip1",
30303
30747
  "--sysroot",
30304
30748
  input.sysroot,
30305
30749
  ...WASI_EMULATION_FLAGS,
@@ -30307,7 +30751,7 @@ async function emitCxxStandin(input) {
30307
30751
  "-I",
30308
30752
  input.headers
30309
30753
  ];
30310
- const includes = (0, import_node_child_process36.spawnSync)(input.clang, [...flags, "-M", "-MT", "peach", probe], {
30754
+ const includes = (0, import_node_child_process37.spawnSync)(input.clang, [...flags, "-M", "-MT", "peach", probe], {
30311
30755
  encoding: "utf8",
30312
30756
  env: swiftEnvironment(),
30313
30757
  maxBuffer: 16 * 1024 * 1024
@@ -30327,7 +30771,7 @@ async function emitCxxStandin(input) {
30327
30771
  const output2 = import_node_fs72.default.openSync(ast, "w");
30328
30772
  let parsed;
30329
30773
  try {
30330
- parsed = (0, import_node_child_process36.spawnSync)(
30774
+ parsed = (0, import_node_child_process37.spawnSync)(
30331
30775
  input.clang,
30332
30776
  [...flags, "-fsyntax-only", "-Xclang", "-ast-dump=json", probe],
30333
30777
  { stdio: ["ignore", output2, "pipe"], encoding: "utf8", env: swiftEnvironment() }
@@ -30385,7 +30829,7 @@ async function emitCxxStandin(input) {
30385
30829
  sourceFile,
30386
30830
  [...prelude, ...live.map((item) => item.text)].join("\n") + "\n"
30387
30831
  );
30388
- const checked = (0, import_node_child_process36.spawnSync)(
30832
+ const checked = (0, import_node_child_process37.spawnSync)(
30389
30833
  input.clang,
30390
30834
  [
30391
30835
  ...flags,
@@ -30419,12 +30863,12 @@ async function emitCxxStandin(input) {
30419
30863
  excluded
30420
30864
  };
30421
30865
  }
30422
- var import_node_child_process36, import_node_fs72, import_node_path69, QUALIFIERS, UNNAMEABLE;
30866
+ var import_node_child_process37, import_node_fs72, import_node_path69, QUALIFIERS, UNNAMEABLE;
30423
30867
  var init_swift_cxx_standin = __esm({
30424
30868
  "src/swift-cxx-standin.ts"() {
30425
30869
  "use strict";
30426
30870
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
30427
- import_node_child_process36 = require("node:child_process");
30871
+ import_node_child_process37 = require("node:child_process");
30428
30872
  import_node_fs72 = __toESM(require("node:fs"), 1);
30429
30873
  import_node_path69 = __toESM(require("node:path"), 1);
30430
30874
  init_swift_cxx_declarations();
@@ -30677,7 +31121,7 @@ var init_swift_standin_builtin_behavior = __esm({
30677
31121
 
30678
31122
  // src/swift-standins.ts
30679
31123
  function exec(file, args, cwd) {
30680
- return (0, import_node_child_process37.execFileSync)(file, args, {
31124
+ return (0, import_node_child_process38.execFileSync)(file, args, {
30681
31125
  cwd,
30682
31126
  encoding: "utf8",
30683
31127
  env: swiftEnvironment(),
@@ -31361,7 +31805,7 @@ function placeholderStandin(surface, binary2, toolchain, work, behavior, sibling
31361
31805
  const out = import_node_path70.default.join(work, "graphs");
31362
31806
  import_node_fs73.default.mkdirSync(import_node_path70.default.join(work, "interface"), { recursive: true });
31363
31807
  import_node_fs73.default.mkdirSync(out, { recursive: true });
31364
- const extracted = (0, import_node_child_process37.spawnSync)(
31808
+ const extracted = (0, import_node_child_process38.spawnSync)(
31365
31809
  import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
31366
31810
  [
31367
31811
  "-emit-module",
@@ -31762,7 +32206,7 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
31762
32206
  );
31763
32207
  }
31764
32208
  import_node_fs73.default.writeFileSync(file, source + trailer);
31765
- const check2 = (0, import_node_child_process37.spawnSync)(
32209
+ const check2 = (0, import_node_child_process38.spawnSync)(
31766
32210
  import_node_path70.default.join(toolchain.toolchainBin, "swiftc"),
31767
32211
  // emitting the module runs the diagnostics a typecheck skips, such as
31768
32212
  // literal overflow, which the app's build of the stand-in reaches
@@ -31803,6 +32247,13 @@ function graphStandin(module2, graphs, values, wasm, binary2, toolchain, work, r
31803
32247
  unconformed.set(owner, /* @__PURE__ */ new Set([...unconformed.get(owner) ?? [], conformance]));
31804
32248
  continue;
31805
32249
  }
32250
+ const redundant = /^redundant conformance of '\w+' to protocol '(\w+)'$/.exec(
32251
+ match[3]
32252
+ )?.[1];
32253
+ if (owner && redundant) {
32254
+ unconformed.set(owner, /* @__PURE__ */ new Set([...unconformed.get(owner) ?? [], redundant]));
32255
+ continue;
32256
+ }
31806
32257
  if (owner && swiftPaths.has(owner))
31807
32258
  throw new Error(
31808
32259
  `Swift declaration ${module2}.${owner} does not typecheck: ${match[3]}`
@@ -32039,13 +32490,13 @@ ${roots.map((file) => ` header "${file}"
32039
32490
  group.forEach((declaration, index) => {
32040
32491
  if (seen.has(declaration.name)) return;
32041
32492
  seen.add(declaration.name);
32042
- const signature = withVoidPrototype(
32493
+ const signature2 = withVoidPrototype(
32043
32494
  declarators[index].trim(),
32044
32495
  declaration.name,
32045
32496
  declaration.parameterless
32046
32497
  );
32047
32498
  definitions.push(
32048
- `${signature} {
32499
+ `${signature2} {
32049
32500
  peach_standin_trap("${declaration.name}");
32050
32501
  }
32051
32502
  `
@@ -32123,7 +32574,7 @@ async function cxxStandin(surface, binary2, toolchain, work) {
32123
32574
  roots.map((root) => `#include ${JSON.stringify(root)}
32124
32575
  `).join("")
32125
32576
  );
32126
- const language = (0, import_node_child_process37.spawnSync)(
32577
+ const language = (0, import_node_child_process38.spawnSync)(
32127
32578
  import_node_path70.default.join(toolchain.toolchainBin, "clang"),
32128
32579
  [
32129
32580
  "-target",
@@ -32213,7 +32664,7 @@ function crateFor(root, name3) {
32213
32664
  };
32214
32665
  return walk3(root, 4);
32215
32666
  }
32216
- function crateSourceRoots(manifest) {
32667
+ function crateWorkspace(manifest) {
32217
32668
  let workspace = import_node_path70.default.dirname(manifest);
32218
32669
  while (!import_node_fs73.default.existsSync(import_node_path70.default.join(workspace, "Cargo.lock"))) {
32219
32670
  const parent = import_node_path70.default.dirname(workspace);
@@ -32221,8 +32672,13 @@ function crateSourceRoots(manifest) {
32221
32672
  throw new Error(`${manifest} has no Cargo.lock; the build runs --locked`);
32222
32673
  workspace = parent;
32223
32674
  }
32224
- const roots = [workspace];
32225
- const inside = (dir) => roots.some((root) => !import_node_path70.default.relative(root, dir).startsWith(".."));
32675
+ return workspace;
32676
+ }
32677
+ function crateSourceRoots(manifest, searchRoot) {
32678
+ const workspace = crateWorkspace(manifest);
32679
+ const root = import_node_path70.default.resolve(searchRoot);
32680
+ const roots = import_node_path70.default.relative(root, workspace).startsWith("..") ? [root, workspace] : [root];
32681
+ const inside = (dir) => roots.some((root2) => !import_node_path70.default.relative(root2, dir).startsWith(".."));
32226
32682
  const manifests = (dir) => import_node_fs73.default.readdirSync(dir, { withFileTypes: true }).flatMap(
32227
32683
  (entry) => entry.isDirectory() && !UNSEARCHED.has(entry.name) ? manifests(import_node_path70.default.join(dir, entry.name)) : entry.name === "Cargo.toml" ? [import_node_path70.default.join(dir, entry.name)] : []
32228
32684
  );
@@ -32236,7 +32692,7 @@ function crateSourceRoots(manifest) {
32236
32692
  }
32237
32693
  return roots;
32238
32694
  }
32239
- function crateSourceDigest(manifest) {
32695
+ function crateSourceDigest(manifest, searchRoot) {
32240
32696
  const hash = (0, import_node_crypto36.createHash)("sha256");
32241
32697
  const walk3 = (dir, root) => {
32242
32698
  for (const entry of import_node_fs73.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
@@ -32250,20 +32706,21 @@ function crateSourceDigest(manifest) {
32250
32706
  }
32251
32707
  }
32252
32708
  };
32253
- for (const root of crateSourceRoots(manifest)) {
32709
+ for (const root of crateSourceRoots(manifest, searchRoot)) {
32254
32710
  hash.update(`root\0`);
32255
32711
  walk3(root, root);
32256
32712
  }
32257
32713
  return hash.digest("hex");
32258
32714
  }
32259
- function rustCrateEntry(manifest, library) {
32715
+ function rustCrateEntry(manifest, library, moduleRoot, searchRoot) {
32260
32716
  const inputs = {
32261
32717
  crate: library,
32262
- source: crateSourceDigest(manifest),
32718
+ source: crateSourceDigest(manifest, searchRoot),
32263
32719
  target: RUST_TARGET,
32264
- build: "release locked",
32265
- rust: RUST_TOOLCHAIN,
32266
- rustflags: process.env.RUSTFLAGS ?? ""
32720
+ build: "release locked panic=abort",
32721
+ compiler: swiftModuleToolchain(moduleRoot).release,
32722
+ sdk: swiftModuleSdk(moduleRoot).wasmSdkChecksum,
32723
+ rust: RUST_TOOLCHAIN
32267
32724
  };
32268
32725
  return { name: library, inputs, key: nativeEntryKey(inputs) };
32269
32726
  }
@@ -32302,82 +32759,91 @@ function standinLibrary(binary2, searchRoot, toolchain) {
32302
32759
  }
32303
32760
  const manifest = crateFor(searchRoot, import_node_path70.default.basename(library, ".a").replace(/^lib/, ""));
32304
32761
  if (!manifest) return null;
32305
- const entry = rustCrateEntry(manifest, library);
32762
+ if (!toolchain) throw new Error("Rust native libraries need the Swift SDK");
32763
+ const entry = rustCrateEntry(manifest, library, toolchain.moduleRoot, searchRoot);
32306
32764
  const prebuilt = fetchNativeEntry("rust", entry.name, entry.key);
32307
32765
  if (prebuilt) return import_node_path70.default.join(prebuilt, library);
32308
- return buildRustCrate(manifest, library, searchRoot);
32766
+ return buildRustCrate(manifest, library, searchRoot, toolchain.moduleRoot, entry);
32309
32767
  }
32310
- function buildRustCrate(manifest, library, searchRoot) {
32311
- const crate = import_node_path70.default.relative(searchRoot, import_node_path70.default.dirname(manifest));
32312
- const rustup = (0, import_node_child_process37.spawnSync)(
32313
- // runner-toolchain-platform: darwin
32314
- "rustup",
32315
- [
32316
- "toolchain",
32317
- "install",
32318
- RUST_TOOLCHAIN,
32319
- "--profile",
32320
- "minimal",
32321
- "--target",
32322
- RUST_TARGET,
32323
- "--no-self-update"
32324
- ],
32325
- { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
32326
- );
32327
- if (!rustup.error && rustup.status !== 0)
32328
- throw new Error(
32329
- `rustup could not install Rust ${RUST_TOOLCHAIN} with ${RUST_TARGET} for ${crate}: ${failure(rustup)}`
32768
+ function buildRustCrate(manifest, library, searchRoot, moduleRoot, entry = rustCrateEntry(manifest, library, moduleRoot, searchRoot)) {
32769
+ const compiler = swiftModuleToolchain(moduleRoot);
32770
+ const sdk = swiftModuleSdk(moduleRoot);
32771
+ const sdkRoot = import_node_path70.default.dirname(swiftSdkPaths(moduleRoot, compiler.toolchainBin).sysroot);
32772
+ const runner = import_node_path70.default.join(sdkRoot, "rust/scripts/build-rust-wasm64.mjs");
32773
+ const work = import_node_path70.default.join(cacheDir4, "rust", entry.key);
32774
+ const release = tryAcquireNumberedLock(work + ".lock", manifest);
32775
+ if (!release) throw new Error("Rust native build already running: " + manifest);
32776
+ try {
32777
+ const roots = crateSourceRoots(manifest, searchRoot);
32778
+ let common = roots[0];
32779
+ while (roots.some((root) => {
32780
+ const relative3 = import_node_path70.default.relative(common, root);
32781
+ return relative3 === ".." || relative3.startsWith(".." + import_node_path70.default.sep);
32782
+ }))
32783
+ common = import_node_path70.default.dirname(common);
32784
+ const source = import_node_path70.default.join(work, "source");
32785
+ import_node_fs73.default.rmSync(source, { recursive: true, force: true });
32786
+ for (const root of roots)
32787
+ import_node_fs73.default.cpSync(root, import_node_path70.default.join(source, import_node_path70.default.relative(common, root)), {
32788
+ recursive: true,
32789
+ filter: (file) => !UNSEARCHED.has(import_node_path70.default.basename(file))
32790
+ });
32791
+ const privateManifest = import_node_path70.default.join(source, import_node_path70.default.relative(common, manifest));
32792
+ const lock = import_node_path70.default.join(
32793
+ source,
32794
+ import_node_path70.default.relative(common, crateWorkspace(manifest)),
32795
+ "Cargo.lock"
32330
32796
  );
32331
- const result = (0, import_node_child_process37.spawnSync)(
32332
- // runner-toolchain-platform: darwin
32333
- "cargo",
32334
- [
32335
- "build",
32336
- "--release",
32337
- "--locked",
32338
- "--target",
32339
- RUST_TARGET,
32340
- "--message-format=json-render-diagnostics",
32341
- "--manifest-path",
32342
- manifest,
32343
- "--target-dir",
32344
- import_node_path70.default.join(cacheDir4, "cargo", key(manifest))
32345
- ],
32346
- {
32347
- encoding: "utf8",
32348
- env: {
32349
- ...process.env,
32350
- RUSTUP_TOOLCHAIN: RUST_TOOLCHAIN,
32351
- CARGO_HOME: import_node_path70.default.join(cacheDir4, "cargo-home")
32352
- },
32353
- maxBuffer: 256 * 1024 * 1024,
32354
- stdio: ["ignore", "pipe", "pipe"]
32355
- }
32356
- );
32357
- if (result.error)
32358
- throw new Error(
32359
- `${crate} is a rust crate and cargo is not installed; install rust (https://rustup.rs), then run again`
32797
+ const result = (0, import_node_child_process38.spawnSync)(
32798
+ process.execPath,
32799
+ [
32800
+ runner,
32801
+ "--bin",
32802
+ compiler.toolchainBin,
32803
+ "--sdk",
32804
+ sdkRoot,
32805
+ "--sdk-checksum",
32806
+ sdk.wasmSdkChecksum,
32807
+ "--work",
32808
+ import_node_path70.default.join(work, "toolchain"),
32809
+ "--manifest",
32810
+ privateManifest,
32811
+ "--lock",
32812
+ lock,
32813
+ "--panic",
32814
+ "abort",
32815
+ "--cargo-arg=--locked",
32816
+ "--cargo-arg=--jobs",
32817
+ "--cargo-arg=" + (process.env.TM_EXEC_CPU_CORES ?? "1")
32818
+ ],
32819
+ {
32820
+ encoding: "utf8",
32821
+ env: { ...swiftEnvironment(), [PEACH_FORKED_SCRIPT_ENV]: "1" },
32822
+ maxBuffer: 256 * 1024 * 1024,
32823
+ stdio: ["ignore", "pipe", "pipe"]
32824
+ }
32360
32825
  );
32361
- if (result.status !== 0) {
32362
- if (/target may not be installed|can't find crate for `(core|std)`/.test(result.stderr))
32826
+ if (result.error) throw result.error;
32827
+ if (result.status !== 0)
32363
32828
  throw new Error(
32364
- `${crate} builds for ${RUST_TARGET}, which Rust ${RUST_TOOLCHAIN} lacks; run \`rustup target add --toolchain ${RUST_TOOLCHAIN} ${RUST_TARGET}\`, then run again`
32829
+ `Rust wasm64 could not build ${import_node_path70.default.relative(searchRoot, manifest)}: ${failure(result)}`
32830
+ );
32831
+ for (const line of result.stdout.split("\n")) {
32832
+ if (!line.startsWith("{")) continue;
32833
+ const message = JSON.parse(line);
32834
+ if (!message || typeof message !== "object" || !("filenames" in message) || !Array.isArray(message.filenames))
32835
+ continue;
32836
+ const archive = message.filenames.find(
32837
+ (file) => typeof file === "string" && import_node_path70.default.basename(file) === library
32365
32838
  );
32839
+ if (archive) return archive;
32840
+ }
32366
32841
  throw new Error(
32367
- `cargo could not build ${crate} for ${RUST_TARGET}: ${failure(result)}`
32842
+ `cargo built ${manifest} for ${RUST_TARGET} but reported no ${library}`
32368
32843
  );
32844
+ } finally {
32845
+ release();
32369
32846
  }
32370
- for (const line of result.stdout.split("\n")) {
32371
- if (!line.startsWith("{")) continue;
32372
- const message = JSON.parse(line);
32373
- if (!message || typeof message !== "object" || !("filenames" in message) || !Array.isArray(message.filenames))
32374
- continue;
32375
- const archive = message.filenames.find(
32376
- (file) => typeof file === "string" && import_node_path70.default.basename(file) === library
32377
- );
32378
- if (archive) return archive;
32379
- }
32380
- throw new Error(`cargo built ${crate} for ${RUST_TARGET} but reported no ${library}`);
32381
32847
  }
32382
32848
  async function sourceStandins(binaries, toolchain, provided, behavior) {
32383
32849
  const repo = import_node_path70.default.resolve(toolchain.moduleRoot, "../..");
@@ -32471,7 +32937,7 @@ async function sourceStandins(binaries, toolchain, provided, behavior) {
32471
32937
  })
32472
32938
  );
32473
32939
  const build = await new Promise((resolve3) => {
32474
- const child = (0, import_node_child_process37.spawn)(
32940
+ const child = (0, import_node_child_process38.spawn)(
32475
32941
  "bun",
32476
32942
  [
32477
32943
  import_node_path70.default.join(repo, "scripts/build/swift-standins-submit.ts"),
@@ -33001,24 +33467,27 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
33001
33467
  import_node_fs73.default.rmSync(modules, { recursive: true, force: true });
33002
33468
  }
33003
33469
  }
33004
- var import_node_child_process37, import_node_crypto36, import_node_fs73, import_node_path70, TRIPLE, cacheDir4, key, digests, isBinaryLibraryFile, REACH_STAGED_FRAMEWORKS, OBJC_IMPORT, files, OBJC, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
33470
+ var import_node_child_process38, import_node_crypto36, import_node_fs73, import_node_path70, TRIPLE, cacheDir4, key, digests, isBinaryLibraryFile, REACH_STAGED_FRAMEWORKS, OBJC_IMPORT, files, OBJC, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
33005
33471
  var init_swift_standins = __esm({
33006
33472
  "src/swift-standins.ts"() {
33007
33473
  "use strict";
33008
33474
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
33009
- import_node_child_process37 = require("node:child_process");
33475
+ import_node_child_process38 = require("node:child_process");
33010
33476
  import_node_crypto36 = require("node:crypto");
33011
33477
  import_node_fs73 = __toESM(require("node:fs"), 1);
33012
33478
  import_node_path70 = __toESM(require("node:path"), 1);
33479
+ init_forked_script_contract();
33013
33480
  init_home_paths();
33014
33481
  init_is_record();
33015
33482
  init_native_prebuilt();
33016
33483
  init_native_slices();
33017
33484
  init_native_static_libraries();
33018
33485
  init_native_swift_slices();
33486
+ init_numbered_lock();
33019
33487
  init_output_lock_stdio();
33020
33488
  init_swift_compile();
33021
33489
  init_swift_cxx_standin();
33490
+ init_swift_distribution();
33022
33491
  init_swift_objc_standin();
33023
33492
  init_swift_package();
33024
33493
  init_swift_packages();
@@ -33028,7 +33497,7 @@ var init_swift_standins = __esm({
33028
33497
  init_swift_standin_emit();
33029
33498
  init_swift_toolchain();
33030
33499
  init_swift_xcframework();
33031
- TRIPLE = "wasm32-unknown-wasip1";
33500
+ TRIPLE = "wasm64-unknown-wasip1";
33032
33501
  cacheDir4 = import_node_path70.default.join(cacheDir(), "swift-standins");
33033
33502
  key = (...parts) => (0, import_node_crypto36.createHash)("sha256").update(parts.join("\0")).digest("hex").slice(0, 32);
33034
33503
  digests = /* @__PURE__ */ new Map();
@@ -33044,7 +33513,7 @@ var init_swift_standins = __esm({
33044
33513
  OBJC_UNREPRESENTABLE = "cannot be marked '@objc' because its type cannot be represented in Objective-C";
33045
33514
  INERT_VALUE = /missing argument|cannot be constructed|has no member 'init'|no exact matches in call to initializer|cannot convert return expression|does not conform to '|extra argument|takes no arguments|could not be inferred|cannot infer/;
33046
33515
  identChar = (char) => char !== void 0 && /[\w$]/.test(char);
33047
- RUST_TARGET = "wasm32-wasip1";
33516
+ RUST_TARGET = "wasm64-wasip1";
33048
33517
  UNSEARCHED = /* @__PURE__ */ new Set([
33049
33518
  "node_modules",
33050
33519
  "Pods",
@@ -33248,7 +33717,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33248
33717
  resolved,
33249
33718
  Infinity
33250
33719
  );
33251
- const backport = DOUBLE_CONVERSION_WASM32_BACKPORT;
33720
+ const backport = DOUBLE_CONVERSION_WASM64_BACKPORT;
33252
33721
  if (import_node_path71.default.basename(file) !== "utils.h" || (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256) {
33253
33722
  sources.set(file, bytes);
33254
33723
  return;
@@ -33418,7 +33887,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33418
33887
  )
33419
33888
  ].map((file) => ({ file }));
33420
33889
  const includes = [...binaryHeaders, ...target.objc.headerSearchPaths];
33421
- const quoted = [...target.objc.userHeaderSearchPaths];
33890
+ const quoted2 = [...target.objc.userHeaderSearchPaths];
33422
33891
  const frameworks = [...frameworkSearchPaths];
33423
33892
  const flags = [
33424
33893
  ...target.objc.flags,
@@ -33442,7 +33911,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33442
33911
  if (flag.startsWith("-F") || flags[index - 1] === "-F" || flags[index - 1] === "-iframework")
33443
33912
  frameworks.push(absolute);
33444
33913
  else if (flag.startsWith("-iquote") || flags[index - 1] === "-iquote")
33445
- quoted.push(absolute);
33914
+ quoted2.push(absolute);
33446
33915
  else includes.push(absolute);
33447
33916
  }
33448
33917
  if (["-include", "-imacros"].includes(flags[index - 1] ?? ""))
@@ -33477,7 +33946,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33477
33946
  for (let index = 0; index < queue.length; index++) {
33478
33947
  if (++workCount % 64 === 0) yield;
33479
33948
  const { file } = queue[index];
33480
- const foundIn = queue[index].origin ?? [...quoted, ...includes].find(
33949
+ const foundIn = queue[index].origin ?? [...quoted2, ...includes].find(
33481
33950
  (directory2) => relativeInside(directory2, file) !== null
33482
33951
  );
33483
33952
  const visit3 = `${file}\0${foundIn ?? ""}`;
@@ -33520,7 +33989,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33520
33989
  scannedReferences.set(file, references);
33521
33990
  }
33522
33991
  for (const prefix of computedIncludes.get(file) ?? []) {
33523
- const directory2 = [import_node_path71.default.dirname(file), ...quoted, ...includes].filter((search) => !isSdkInclude(search)).map((search) => import_node_path71.default.join(search, prefix)).find(isDirectory2);
33992
+ const directory2 = [import_node_path71.default.dirname(file), ...quoted2, ...includes].filter((search) => !isSdkInclude(search)).map((search) => import_node_path71.default.join(search, prefix)).find(isDirectory2);
33524
33993
  if (!directory2 || computedDirectories.has(directory2)) continue;
33525
33994
  computedDirectories.add(directory2);
33526
33995
  yield* addHeaders(directory2);
@@ -33530,6 +33999,8 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33530
33999
  }
33531
34000
  for (const reference of references) {
33532
34001
  if (++workCount % 64 === 0) yield;
34002
+ if (import_node_path71.default.isAbsolute(reference.name) && /\.sdk\/(?:System|Developer)\/Library\/Frameworks\//.test(reference.name))
34003
+ continue;
33533
34004
  if (reference.quoted && !reference.next) {
33534
34005
  const local = availableHeader(import_node_path71.default.resolve(import_node_path71.default.dirname(file), reference.name));
33535
34006
  if (local !== null) {
@@ -33555,7 +34026,7 @@ function* xcodeObjCInputSteps(app, binaries, moduleRoot, products, sourceRoot =
33555
34026
  if (mapped && import_node_path71.default.isAbsolute(mapped))
33556
34027
  yield { path: mapped, directory: mapDirectory };
33557
34028
  if (reference.quoted)
33558
- for (const directory2 of quoted)
34029
+ for (const directory2 of quoted2)
33559
34030
  yield { path: import_node_path71.default.join(directory2, reference.name), directory: directory2 };
33560
34031
  for (const directory2 of includes)
33561
34032
  if (!isSdkInclude(directory2))
@@ -33726,7 +34197,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
33726
34197
  provided: [...providers.keys()]
33727
34198
  };
33728
34199
  try {
33729
- const lock = (0, import_node_child_process38.spawnSync)(
34200
+ const lock = (0, import_node_child_process39.spawnSync)(
33730
34201
  "perl",
33731
34202
  ["-e", 'open(my $f, ">&=", 3) or die $!; flock($f, 2) or die $!'],
33732
34203
  { stdio: ["ignore", "pipe", "pipe", descriptor], encoding: "utf8" }
@@ -33859,7 +34330,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
33859
34330
  const args = [
33860
34331
  ...provider ? ["-merge-modules", "-emit-module"] : ["-emit-object", "-whole-module-optimization", "-parse-as-library"],
33861
34332
  "-target",
33862
- "wasm32-unknown-wasip1",
34333
+ "wasm64-unknown-wasip1",
33863
34334
  "-sdk",
33864
34335
  sdk.sysroot,
33865
34336
  "-resource-dir",
@@ -33897,7 +34368,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
33897
34368
  import_node_path71.default.join(work, `${target.moduleName}.o`)
33898
34369
  ]
33899
34370
  ];
33900
- const result = (0, import_node_child_process38.spawnSync)(frontend, args, {
34371
+ const result = (0, import_node_child_process39.spawnSync)(frontend, args, {
33901
34372
  cwd: work,
33902
34373
  encoding: "utf8",
33903
34374
  env: swiftEnvironment(),
@@ -34017,7 +34488,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
34017
34488
  const work = import_node_path71.default.join(parent, key2);
34018
34489
  const descriptor = import_node_fs74.default.openSync(`${work}.lock`, "a");
34019
34490
  try {
34020
- const locked = (0, import_node_child_process38.spawnSync)(
34491
+ const locked = (0, import_node_child_process39.spawnSync)(
34021
34492
  "perl",
34022
34493
  ["-e", 'open(my $f, ">&=", 3) or die $!; flock($f, 2) or die $!'],
34023
34494
  { stdio: ["ignore", "pipe", "pipe", descriptor], encoding: "utf8" }
@@ -34227,7 +34698,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
34227
34698
  });
34228
34699
  const modules = flags.includes("-fmodules") && (!cxx || flags.lastIndexOf("-fno-cxx-modules") <= flags.lastIndexOf("-fcxx-modules"));
34229
34700
  const args = [
34230
- "--target=wasm32-unknown-wasip1",
34701
+ "--target=wasm64-unknown-wasip1",
34231
34702
  `--sysroot=${sdk.sysroot}`,
34232
34703
  "-fwasm-exceptions",
34233
34704
  "-fexceptions",
@@ -34265,7 +34736,7 @@ async function prepareXcodeObjCImplementations(app, binaries, moduleRoot) {
34265
34736
  ...dependencies ? ["-MD", "-MF", dependencies, "-H"] : []
34266
34737
  ];
34267
34738
  const result = await new Promise((resolve3) => {
34268
- const child = (0, import_node_child_process38.spawn)(
34739
+ const child = (0, import_node_child_process39.spawn)(
34269
34740
  import_node_path71.default.join(toolchain.toolchainBin, cxx ? "clang++" : "clang"),
34270
34741
  args,
34271
34742
  {
@@ -34346,12 +34817,12 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
34346
34817
  import_node_fs74.default.closeSync(descriptor);
34347
34818
  }
34348
34819
  }
34349
- var import_node_child_process38, import_node_crypto37, import_node_fs74, import_node_path71, SwiftObjCCompilationError, isDirectory2, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT;
34820
+ var import_node_child_process39, import_node_crypto37, import_node_fs74, import_node_path71, SwiftObjCCompilationError, isDirectory2, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT;
34350
34821
  var init_swift_objc_compile = __esm({
34351
34822
  "src/swift-objc-compile.ts"() {
34352
34823
  "use strict";
34353
34824
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
34354
- import_node_child_process38 = require("node:child_process");
34825
+ import_node_child_process39 = require("node:child_process");
34355
34826
  import_node_crypto37 = require("node:crypto");
34356
34827
  import_node_fs74 = __toESM(require("node:fs"), 1);
34357
34828
  import_node_path71 = __toESM(require("node:path"), 1);
@@ -34685,12 +35156,12 @@ function enumerateBundleSymbols(paths, readText, bundleForFile) {
34685
35156
  const box = pathBounds(d);
34686
35157
  const translateX = 12 - (box.minX + box.maxX) * em / 2;
34687
35158
  const translateY = 12 - (box.minY + box.maxY) * em / 2;
34688
- const wide = (box.maxX - box.minX) * em;
35159
+ const wide2 = (box.maxX - box.minX) * em;
34689
35160
  const tall = (box.maxY - box.minY) * em;
34690
35161
  const vector = {
34691
35162
  viewBox: "0 0 24 24",
34692
35163
  advance,
34693
- box: [12 - wide / 2, 12 - tall / 2, wide, tall],
35164
+ box: [12 - wide2 / 2, 12 - tall / 2, wide2, tall],
34694
35165
  ...customLayout ? { customLayout } : {},
34695
35166
  layers: d.map((path74) => ({
34696
35167
  d: (0, import_svgpath.default)(path74).abs().scale(em).translate(translateX, translateY).round(3).toString()
@@ -35955,9 +36426,9 @@ ${represented.module ? "\n" : `@objc(${represented.name})
35955
36426
  "extension " + represented.name + " {",
35956
36427
  ""
35957
36428
  ];
35958
- const add = (selector, signature) => lines.push(
36429
+ const add = (selector, signature2) => lines.push(
35959
36430
  ` @objc(${selector})`,
35960
- ` @NSManaged nonisolated public func ${signature}`,
36431
+ ` @NSManaged nonisolated public func ${signature2}`,
35961
36432
  ""
35962
36433
  );
35963
36434
  if (ordered) {
@@ -36227,7 +36698,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
36227
36698
  failed = captured.failed;
36228
36699
  reached = captured.reached;
36229
36700
  } else {
36230
- const result2 = (0, import_node_child_process39.spawnSync)(clang, [...cleaned, "-M", "-MT", "peach", "-H"], {
36701
+ const result2 = (0, import_node_child_process40.spawnSync)(clang, [...cleaned, "-M", "-MT", "peach", "-H"], {
36231
36702
  cwd: work,
36232
36703
  encoding: "utf8",
36233
36704
  env: swiftEnvironment(),
@@ -36350,12 +36821,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
36350
36821
  );
36351
36822
  return result;
36352
36823
  }
36353
- var import_node_child_process39, import_node_crypto38, import_node_fs77, import_node_path74, cachedInputs;
36824
+ var import_node_child_process40, import_node_crypto38, import_node_fs77, import_node_path74, cachedInputs;
36354
36825
  var init_swift_cxx_reachable = __esm({
36355
36826
  "src/swift-cxx-reachable.ts"() {
36356
36827
  "use strict";
36357
36828
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
36358
- import_node_child_process39 = require("node:child_process");
36829
+ import_node_child_process40 = require("node:child_process");
36359
36830
  import_node_crypto38 = require("node:crypto");
36360
36831
  import_node_fs77 = __toESM(require("node:fs"), 1);
36361
36832
  import_node_path74 = __toESM(require("node:path"), 1);
@@ -36455,7 +36926,7 @@ function rasterBinary(swift = RASTER_SWIFT, name3 = "swift-pdf-raster") {
36455
36926
  );
36456
36927
  import_node_fs79.default.writeFileSync(source, swift);
36457
36928
  try {
36458
- (0, import_node_child_process40.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
36929
+ (0, import_node_child_process41.execFileSync)("xcrun", ["swiftc", "-o", binary2, source], { stdio: "pipe" });
36459
36930
  } finally {
36460
36931
  import_node_fs79.default.rmSync(import_node_path76.default.dirname(source), { recursive: true, force: true });
36461
36932
  }
@@ -36480,10 +36951,10 @@ function rasterizePdfFile(diskPath, pdfSha256) {
36480
36951
  );
36481
36952
  try {
36482
36953
  if (process.platform === "darwin") {
36483
- (0, import_node_child_process40.execFileSync)(rasterBinary(), [diskPath, "3", out], { stdio: "pipe" });
36954
+ (0, import_node_child_process41.execFileSync)(rasterBinary(), [diskPath, "3", out], { stdio: "pipe" });
36484
36955
  } else {
36485
36956
  const { executable, prefixArgs } = rnxSelfInvocation();
36486
- (0, import_node_child_process40.execFileSync)(
36957
+ (0, import_node_child_process41.execFileSync)(
36487
36958
  executable,
36488
36959
  [
36489
36960
  ...prefixArgs,
@@ -36522,7 +36993,7 @@ function rasterizeSvgFile(diskPath, svgSha256) {
36522
36993
  "out.png"
36523
36994
  );
36524
36995
  try {
36525
- (0, import_node_child_process40.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
36996
+ (0, import_node_child_process41.execFileSync)(binary2, [diskPath, "3", out], { stdio: "pipe" });
36526
36997
  const bytes = import_node_fs79.default.readFileSync(out);
36527
36998
  import_node_fs79.default.mkdirSync(cacheDir(), { recursive: true });
36528
36999
  import_node_fs79.default.copyFileSync(out, cached2);
@@ -36535,12 +37006,12 @@ function rasterizeSvgFile(diskPath, svgSha256) {
36535
37006
  import_node_fs79.default.rmSync(import_node_path76.default.dirname(out), { recursive: true, force: true });
36536
37007
  }
36537
37008
  }
36538
- var import_node_child_process40, import_node_crypto39, import_node_fs79, import_node_os16, import_node_path76, RASTER_SWIFT, RASTER_SVG_SWIFT;
37009
+ var import_node_child_process41, import_node_crypto39, import_node_fs79, import_node_os16, import_node_path76, RASTER_SWIFT, RASTER_SVG_SWIFT;
36539
37010
  var init_swift_pdf_raster = __esm({
36540
37011
  "src/swift-pdf-raster.ts"() {
36541
37012
  "use strict";
36542
37013
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
36543
- import_node_child_process40 = require("node:child_process");
37014
+ import_node_child_process41 = require("node:child_process");
36544
37015
  import_node_crypto39 = require("node:crypto");
36545
37016
  import_node_fs79 = __toESM(require("node:fs"), 1);
36546
37017
  import_node_os16 = __toESM(require("node:os"), 1);
@@ -36760,7 +37231,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
36760
37231
  const known = emptyWasmAssembly.get(key2);
36761
37232
  if (known) return known;
36762
37233
  const result = new Promise(
36763
- (resolve3) => (0, import_node_child_process41.execFile)(
37234
+ (resolve3) => (0, import_node_child_process42.execFile)(
36764
37235
  clang,
36765
37236
  [
36766
37237
  "-target",
@@ -37205,12 +37676,17 @@ async function buildXcodeLayout(root) {
37205
37676
  (feature) => feature.configuration === null || feature.configuration === packageConfiguration
37206
37677
  ).map((feature) => feature.name),
37207
37678
  // the flat build gives every module one package; swiftpm names each
37208
- // module for its own package, which `@retroactive` and `package` read
37209
- swiftFlags: ["-package-name", swiftPackageIdentity(target.packageDir)].concat(
37210
- target.packageSwiftFlags.filter(
37679
+ // module for its own package, which `@retroactive` and `package` read.
37680
+ // xcode and swiftpm build a debug package testable, so sources may
37681
+ // `@testable import` it
37682
+ swiftFlags: [
37683
+ "-package-name",
37684
+ swiftPackageIdentity(target.packageDir),
37685
+ ...packageConfiguration === "debug" ? ["-enable-testing"] : [],
37686
+ ...target.packageSwiftFlags.filter(
37211
37687
  (setting) => setting.configuration === null || setting.configuration === packageConfiguration
37212
37688
  ).flatMap((setting) => setting.flags)
37213
- ),
37689
+ ],
37214
37690
  linkedLibraries: target.packageLibraries.filter(
37215
37691
  (library) => library.configuration === null || library.configuration === packageConfiguration
37216
37692
  ).map((library) => library.name),
@@ -37565,7 +38041,7 @@ function xcodeManifest(layout2) {
37565
38041
  return [
37566
38042
  "// swift-tools-version: 6.2",
37567
38043
  "import PackageDescription",
37568
- `let package = Package(name: "app", ${layout2.app.iosDeploymentTarget ? `platforms: [.iOS(${JSON.stringify(layout2.app.iosDeploymentTarget)})], ` : ""}dependencies: [${[...nativePaths].map(([name3, directory2]) => `.package(name: ${JSON.stringify(name3)}, path: ${JSON.stringify(directory2)})`).join(", ")}], targets: [`,
38044
+ `let package = Package(name: "app", platforms: [.iOS(${JSON.stringify(layout2.app.iosDeploymentTarget)})], dependencies: [${[...nativePaths].map(([name3, directory2]) => `.package(name: ${JSON.stringify(name3)}, path: ${JSON.stringify(directory2)})`).join(", ")}], targets: [`,
37569
38045
  ` .executableTarget(name: "${layout2.app.moduleName}", dependencies: [${[...appProducts, ...layout2.targets.map((target) => JSON.stringify(target.name)), ...sdkProducts].join(", ")}], path: "${XCODE_APP_DIR}", ${appSettings}),`,
37570
38046
  ...layout2.targets.map(
37571
38047
  (target) => target.systemLibrary ? ` .systemLibrary(name: "${target.name}", path: "${target.path}"),` : ` .target(name: "${target.name}", ${target.dependencies === void 0 ? "" : `dependencies: [${dependencies(target)}], `}path: "${target.path}", ${target.exclude.length > 0 ? `exclude: ${JSON.stringify(target.exclude)}, ` : ""}${target.sources === void 0 ? "" : `sources: ${JSON.stringify(target.sources)}, `}${target.resources ? "resources: [], " : ""}${target.publicHeadersPath === void 0 ? "" : `publicHeadersPath: ${JSON.stringify(target.publicHeadersPath)}, `}${clangSettings(target)}${swiftManifestSettings(target)}${libraries(target)}),`
@@ -38015,7 +38491,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs, resourceBundles) {
38015
38491
  };
38016
38492
  try {
38017
38493
  const [shell, ...args] = phase.command;
38018
- (0, import_node_child_process41.execFileSync)(shell, args, {
38494
+ (0, import_node_child_process42.execFileSync)(shell, args, {
38019
38495
  cwd: phase.directory,
38020
38496
  env,
38021
38497
  stdio: ["ignore", "pipe", "pipe"],
@@ -38601,16 +39077,16 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
38601
39077
  if (Number(response.headers.get("content-length")) > maxArtifactBytes || !response.body) {
38602
39078
  throw new Error("swift compile: artifact exceeds 64 MiB or has no body");
38603
39079
  }
38604
- const reader = response.body.getReader();
39080
+ const reader2 = response.body.getReader();
38605
39081
  const chunks = [];
38606
39082
  let total = 0;
38607
39083
  for (; ; ) {
38608
39084
  signal.throwIfAborted();
38609
- const next = await reader.read();
39085
+ const next = await reader2.read();
38610
39086
  if (next.done) break;
38611
39087
  total += next.value.byteLength;
38612
39088
  if (total > maxArtifactBytes) {
38613
- await reader.cancel();
39089
+ await reader2.cancel();
38614
39090
  throw new Error("swift compile: artifact exceeds 64 MiB");
38615
39091
  }
38616
39092
  chunks.push(next.value);
@@ -38695,13 +39171,13 @@ function scopedArtifact(project, entry, moduleRoot, signal) {
38695
39171
  project.building = { stamp, promise: fresh, signal };
38696
39172
  return fresh;
38697
39173
  }
38698
- var import_node_async_hooks, import_node_child_process41, import_node_crypto40, import_node_fs80, import_node_os17, import_node_path77, RESOURCE_PATH, ICU_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS;
39174
+ var import_node_async_hooks, import_node_child_process42, import_node_crypto40, import_node_fs80, import_node_os17, import_node_path77, RESOURCE_PATH, ICU_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS;
38699
39175
  var init_swift_host = __esm({
38700
39176
  "src/swift-host.ts"() {
38701
39177
  "use strict";
38702
39178
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
38703
39179
  import_node_async_hooks = require("node:async_hooks");
38704
- import_node_child_process41 = require("node:child_process");
39180
+ import_node_child_process42 = require("node:child_process");
38705
39181
  import_node_crypto40 = require("node:crypto");
38706
39182
  import_node_fs80 = __toESM(require("node:fs"), 1);
38707
39183
  import_node_os17 = __toESM(require("node:os"), 1);
@@ -40587,21 +41063,21 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
40587
41063
  files: hashTree(generatedRoot)
40588
41064
  };
40589
41065
  }
40590
- var import_node_child_process42, import_node_crypto41, import_node_fs82, import_node_module7, import_node_path79, import_node_util13, run6, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
41066
+ var import_node_child_process43, import_node_crypto41, import_node_fs82, import_node_module7, import_node_path79, import_node_util14, run6, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
40591
41067
  var init_turbo_codegen_intake = __esm({
40592
41068
  "src/turbo-codegen-intake.ts"() {
40593
41069
  "use strict";
40594
41070
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
40595
- import_node_child_process42 = require("node:child_process");
41071
+ import_node_child_process43 = require("node:child_process");
40596
41072
  import_node_crypto41 = require("node:crypto");
40597
41073
  import_node_fs82 = __toESM(require("node:fs"), 1);
40598
41074
  import_node_module7 = require("node:module");
40599
41075
  import_node_path79 = __toESM(require("node:path"), 1);
40600
- import_node_util13 = require("node:util");
41076
+ import_node_util14 = require("node:util");
40601
41077
  init_is_record();
40602
41078
  init_nitro_source();
40603
41079
  init_podspec_sources();
40604
- run6 = (0, import_node_util13.promisify)(import_node_child_process42.execFile);
41080
+ run6 = (0, import_node_util14.promisify)(import_node_child_process43.execFile);
40605
41081
  RENDERER_PODS = /* @__PURE__ */ new Set([
40606
41082
  "React-Fabric",
40607
41083
  "React-FabricComponents",
@@ -41424,8 +41900,8 @@ async function collectTurboSources(options) {
41424
41900
  };
41425
41901
  const podHeaders = /* @__PURE__ */ new Map();
41426
41902
  const podFileLists = /* @__PURE__ */ new Map();
41427
- const resolve3 = (from, include, quoted) => {
41428
- if (quoted) {
41903
+ const resolve3 = (from, include, quoted2) => {
41904
+ if (quoted2) {
41429
41905
  const relative3 = import_node_path80.default.posix.normalize(
41430
41906
  import_node_path80.default.posix.join(import_node_path80.default.posix.dirname(from.relative), include)
41431
41907
  );
@@ -41492,7 +41968,7 @@ async function collectTurboSources(options) {
41492
41968
  );
41493
41969
  return;
41494
41970
  }
41495
- if (quoted && from.root) {
41971
+ if (quoted2 && from.root) {
41496
41972
  let files2 = podFileLists.get(from.root);
41497
41973
  if (!files2) {
41498
41974
  files2 = /* @__PURE__ */ new Set();
@@ -41518,7 +41994,7 @@ async function collectTurboSources(options) {
41518
41994
  if ([...installedCodegenNames].some(
41519
41995
  (spec) => name3.startsWith(`${spec}/`) || name3 === `${spec}JSI.h`
41520
41996
  )) {
41521
- pendingCodegen.push({ from, include, quoted });
41997
+ pendingCodegen.push({ from, include, quoted: quoted2 });
41522
41998
  return;
41523
41999
  }
41524
42000
  }
@@ -41544,11 +42020,11 @@ async function collectTurboSources(options) {
41544
42020
  return;
41545
42021
  }
41546
42022
  const nativeReactMaps = pod?.reactHeaderMaps ?? [];
41547
- const mappedReact = (quoted ? [
42023
+ const mappedReact = (quoted2 ? [
41548
42024
  ...nativeReactMaps.filter(({ flag }) => flag === "-iquote"),
41549
42025
  ...nativeReactMaps.filter(({ flag }) => flag === "-I")
41550
42026
  ] : nativeReactMaps.filter(({ flag }) => flag === "-I")).map(({ headers }) => headers.get(include)).find((file) => file !== void 0);
41551
- const react = mappedReact ?? (quoted && !include.includes("/") ? reactHeaders().get(`React/${include}`) ?? reactHeaders().get(`bare/${include}`) : reactHeaders().get(include));
42027
+ const react = mappedReact ?? (quoted2 && !include.includes("/") ? reactHeaders().get(`React/${include}`) ?? reactHeaders().get(`bare/${include}`) : reactHeaders().get(include));
41552
42028
  if (react) {
41553
42029
  alias(
41554
42030
  `${core}/include/${include}`,
@@ -41556,7 +42032,7 @@ async function collectTurboSources(options) {
41556
42032
  );
41557
42033
  return;
41558
42034
  }
41559
- for (const map2 of quoted ? [
42035
+ for (const map2 of quoted2 ? [
41560
42036
  ...pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-iquote") ?? [],
41561
42037
  ...pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-I") ?? []
41562
42038
  ] : pod?.dependencyHeaderMaps.filter(({ flag }) => flag === "-I") ?? []) {
@@ -42330,7 +42806,7 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
42330
42806
  }
42331
42807
  if (pendingCodegen.length) {
42332
42808
  codegen ??= (await runInstalledTurboCodegen(options.appRoot, options.codegenDir)).generatedRoot;
42333
- for (const { from, include, quoted } of pendingCodegen) resolve3(from, include, quoted);
42809
+ for (const { from, include, quoted: quoted2 } of pendingCodegen) resolve3(from, include, quoted2);
42334
42810
  for (let next = pending.shift(); next; next = pending.shift())
42335
42811
  scanText(next, result.files[next.key]);
42336
42812
  }
@@ -42799,16 +43275,16 @@ ${moduleProviders ? " [found addObjectsFromArray:RCTModuleProviders.moduleProvi
42799
43275
  }
42800
43276
  `;
42801
43277
  }
42802
- var import_node_child_process43, import_node_crypto42, import_node_fs83, import_node_path80, import_node_util14, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2563, versionParts, iosOf, JS_CALL_INVOKER;
43278
+ var import_node_child_process44, import_node_crypto42, import_node_fs83, import_node_path80, import_node_util15, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2563, versionParts, iosOf, JS_CALL_INVOKER;
42803
43279
  var init_turbo_source = __esm({
42804
43280
  "src/turbo-source.ts"() {
42805
43281
  "use strict";
42806
43282
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
42807
- import_node_child_process43 = require("node:child_process");
43283
+ import_node_child_process44 = require("node:child_process");
42808
43284
  import_node_crypto42 = require("node:crypto");
42809
43285
  import_node_fs83 = __toESM(require("node:fs"), 1);
42810
43286
  import_node_path80 = __toESM(require("node:path"), 1);
42811
- import_node_util14 = require("node:util");
43287
+ import_node_util15 = require("node:util");
42812
43288
  init_home_paths();
42813
43289
  init_installed_native_libraries();
42814
43290
  init_answeredNativePackages();
@@ -42821,7 +43297,7 @@ var init_turbo_source = __esm({
42821
43297
  init_swift_submit();
42822
43298
  init_turbo_codegen_intake();
42823
43299
  init_xcode_project();
42824
- execFileAsync3 = (0, import_node_util14.promisify)(import_node_child_process43.execFile);
43300
+ execFileAsync3 = (0, import_node_util15.promisify)(import_node_child_process44.execFile);
42825
43301
  TURBO_CORE_TARGET = "TurboCore";
42826
43302
  TURBO_FMT_TARGET = "TurboFmt";
42827
43303
  TURBO_ENTRY_HEADER = "PeachTurboEntry.hpp";
@@ -43171,7 +43647,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
43171
43647
  buildRoot,
43172
43648
  intermediates: true
43173
43649
  });
43174
- const products = import_node_path82.default.join(buildRoot, ".build/wasm32-unknown-wasip1/release");
43650
+ const products = import_node_path82.default.join(buildRoot, ".build", WASM_TRIPLE, "release");
43175
43651
  const emitted = swiftManifestTargets(
43176
43652
  import_node_fs84.default.readFileSync(import_node_path82.default.join(buildRoot, "Package.swift"), "utf8")
43177
43653
  );
@@ -43189,7 +43665,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
43189
43665
  import_node_fs84.default.mkdirSync(members2, { recursive: true });
43190
43666
  const stripped2 = objects.map((file, index) => {
43191
43667
  const output2 = import_node_path82.default.join(members2, `${index}-${import_node_path82.default.basename(file)}`);
43192
- (0, import_node_child_process44.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-objcopy"), [
43668
+ (0, import_node_child_process45.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-objcopy"), [
43193
43669
  "--strip-debug",
43194
43670
  file,
43195
43671
  output2
@@ -43198,7 +43674,7 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
43198
43674
  });
43199
43675
  const archive = import_node_path82.default.join(work, `lib${target.name}.a`);
43200
43676
  import_node_fs84.default.rmSync(archive, { force: true });
43201
- (0, import_node_child_process44.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-ar"), [
43677
+ (0, import_node_child_process45.execFileSync)(import_node_path82.default.join(module2.toolchainBin, "llvm-ar"), [
43202
43678
  "rcsD",
43203
43679
  archive,
43204
43680
  ...stripped2
@@ -43251,12 +43727,12 @@ async function buildReactNativeCore(project, reactNativeRoot, mode, moduleRoot)
43251
43727
  return directory2;
43252
43728
  });
43253
43729
  }
43254
- var import_node_child_process44, import_node_fs84, import_node_path82;
43730
+ var import_node_child_process45, import_node_fs84, import_node_path82;
43255
43731
  var init_react_native_core_build = __esm({
43256
43732
  "src/react-native-core-build.ts"() {
43257
43733
  "use strict";
43258
43734
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
43259
- import_node_child_process44 = require("node:child_process");
43735
+ import_node_child_process45 = require("node:child_process");
43260
43736
  import_node_fs84 = __toESM(require("node:fs"), 1);
43261
43737
  import_node_path82 = __toESM(require("node:path"), 1);
43262
43738
  init_home_paths();
@@ -43365,14 +43841,14 @@ async function prebuiltReactNativeCore(project, reactNativeRoot, moduleRoot, mod
43365
43841
  const descriptor = JSON.parse(
43366
43842
  import_node_fs85.default.readFileSync(import_node_path83.default.join(dir, "descriptor.json"), "utf8")
43367
43843
  );
43368
- if (!(0, import_node_util15.isDeepStrictEqual)(
43844
+ if (!(0, import_node_util16.isDeepStrictEqual)(
43369
43845
  descriptor,
43370
43846
  describeNativeEntry("react-native", entry.name, entry.inputs, [file])
43371
43847
  ))
43372
43848
  throw new Error(`React Native core ${entry.key} does not match its descriptor`);
43373
43849
  return readReactNativeCore(JSON.parse(import_node_fs85.default.readFileSync(file, "utf8")));
43374
43850
  }
43375
- var import_node_crypto43, import_node_fs85, import_node_module8, import_node_path83, import_node_util15, recipe, strings4, building;
43851
+ var import_node_crypto43, import_node_fs85, import_node_module8, import_node_path83, import_node_util16, recipe, strings4, building;
43376
43852
  var init_react_native_core = __esm({
43377
43853
  "src/react-native-core.ts"() {
43378
43854
  "use strict";
@@ -43381,7 +43857,7 @@ var init_react_native_core = __esm({
43381
43857
  import_node_fs85 = __toESM(require("node:fs"), 1);
43382
43858
  import_node_module8 = require("node:module");
43383
43859
  import_node_path83 = __toESM(require("node:path"), 1);
43384
- import_node_util15 = require("node:util");
43860
+ import_node_util16 = require("node:util");
43385
43861
  init_home_paths();
43386
43862
  init_is_record();
43387
43863
  init_native_prebuilt();
@@ -43391,7 +43867,7 @@ var init_react_native_core = __esm({
43391
43867
  init_swift_distribution();
43392
43868
  init_swift_package();
43393
43869
  init_swiftContract();
43394
- recipe = true ? "8e528ab6025e0ef9a1d843edd9ac64987107baad01b3b9057421899e079d304d" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
43870
+ recipe = true ? "40319ffa0770ef7f50b8af9ee68004c6bbc55040f213eabcc9014005f24ef180" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
43395
43871
  strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
43396
43872
  building = /* @__PURE__ */ new Map();
43397
43873
  }
@@ -43408,14 +43884,14 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
43408
43884
  // src/expo-swift-host.ts
43409
43885
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
43410
43886
  var import_node_async_hooks2 = require("node:async_hooks");
43411
- var import_node_child_process45 = require("node:child_process");
43887
+ var import_node_child_process46 = require("node:child_process");
43412
43888
  var import_node_crypto44 = require("node:crypto");
43413
43889
  var import_node_fs86 = __toESM(require("node:fs"), 1);
43414
43890
  var import_node_module9 = require("node:module");
43415
43891
  var import_node_os18 = __toESM(require("node:os"), 1);
43416
43892
  var import_node_path84 = __toESM(require("node:path"), 1);
43417
43893
  var import_node_url6 = require("node:url");
43418
- var import_node_util16 = require("node:util");
43894
+ var import_node_util17 = require("node:util");
43419
43895
 
43420
43896
  // ../peach-compat/src/stubs/native-seams/expo-eager-seam-contract.ts
43421
43897
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -47252,12 +47728,12 @@ function getCliVersion() {
47252
47728
 
47253
47729
  // src/expo-native-workspace.ts
47254
47730
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
47255
- var import_node_child_process32 = require("node:child_process");
47731
+ var import_node_child_process33 = require("node:child_process");
47256
47732
  var import_node_crypto27 = require("node:crypto");
47257
47733
  var import_node_fs59 = __toESM(require("node:fs"), 1);
47258
47734
  var import_node_module4 = require("node:module");
47259
47735
  var import_node_path57 = __toESM(require("node:path"), 1);
47260
- var import_node_util10 = require("node:util");
47736
+ var import_node_util11 = require("node:util");
47261
47737
  init_admitted_mac_build();
47262
47738
 
47263
47739
  // src/expo-workspace-exclusion.ts
@@ -47460,7 +47936,7 @@ init_is_record();
47460
47936
 
47461
47937
  // src/native-firebase-config.ts
47462
47938
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
47463
- var import_node_child_process30 = require("node:child_process");
47939
+ var import_node_child_process31 = require("node:child_process");
47464
47940
  var import_node_fs54 = __toESM(require("node:fs"), 1);
47465
47941
  var import_node_os14 = __toESM(require("node:os"), 1);
47466
47942
  var import_node_path52 = __toESM(require("node:path"), 1);
@@ -47522,7 +47998,7 @@ async function readExpoConfigAsync(projectRoot) {
47522
47998
  const directory2 = resultDirectory();
47523
47999
  const resultPath = import_node_path52.default.join(directory2, "config.json");
47524
48000
  try {
47525
- const child = (0, import_node_child_process30.spawn)("node", expoConfigArgs(projectRoot, resultPath), {
48001
+ const child = (0, import_node_child_process31.spawn)("node", expoConfigArgs(projectRoot, resultPath), {
47526
48002
  cwd: projectRoot,
47527
48003
  stdio: ["ignore", "ignore", "pipe"],
47528
48004
  timeout: EXPO_CONFIG_TIMEOUT_MS
@@ -47581,13 +48057,13 @@ function portableInterfaceHash(directory2) {
47581
48057
 
47582
48058
  // src/prepared-native-inventory.ts
47583
48059
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
47584
- var import_node_child_process31 = require("node:child_process");
48060
+ var import_node_child_process32 = require("node:child_process");
47585
48061
  var import_node_crypto25 = require("node:crypto");
47586
48062
  var import_node_fs56 = __toESM(require("node:fs"), 1);
47587
48063
  var import_node_module3 = require("node:module");
47588
48064
  var import_node_path54 = __toESM(require("node:path"), 1);
47589
48065
  var import_promises5 = require("node:timers/promises");
47590
- var import_node_util9 = require("node:util");
48066
+ var import_node_util10 = require("node:util");
47591
48067
  init_expo_autolinking();
47592
48068
  init_is_record();
47593
48069
  init_nitro_source();
@@ -47600,7 +48076,7 @@ async function preparedNativeInventory(app, selected, signal) {
47600
48076
  paths: [import_node_path54.default.dirname(require2.resolve("expo/package.json"))]
47601
48077
  });
47602
48078
  const cli = import_node_path54.default.join(import_node_path54.default.dirname(expo), "bin/expo-modules-autolinking.js");
47603
- const searched = await (0, import_node_util9.promisify)(import_node_child_process31.execFile)(
48079
+ const searched = await (0, import_node_util10.promisify)(import_node_child_process32.execFile)(
47604
48080
  "node",
47605
48081
  [cli, "search", ...autolinkerAppleFlags(expo, app), "--json"],
47606
48082
  { cwd: app, signal, maxBuffer: 8 * 1024 * 1024 }
@@ -47940,7 +48416,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
47940
48416
  const mac = process.platform === "darwin" ? {
47941
48417
  podVersion: (() => {
47942
48418
  try {
47943
- return (0, import_node_child_process32.execFileSync)("pod", ["--version"], {
48419
+ return (0, import_node_child_process33.execFileSync)("pod", ["--version"], {
47944
48420
  encoding: "utf8",
47945
48421
  env: utf8Env
47946
48422
  });
@@ -47951,7 +48427,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
47951
48427
  }
47952
48428
  })(),
47953
48429
  // runner-toolchain-platform: darwin
47954
- xcode: (0, import_node_child_process32.execFileSync)("xcodebuild", ["-version"], {
48430
+ xcode: (0, import_node_child_process33.execFileSync)("xcodebuild", ["-version"], {
47955
48431
  encoding: "utf8",
47956
48432
  env: utf8Env
47957
48433
  })
@@ -47961,7 +48437,7 @@ async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, p
47961
48437
  preparation: 7,
47962
48438
  appRelative,
47963
48439
  ...mac,
47964
- node: (0, import_node_child_process32.execFileSync)(
48440
+ node: (0, import_node_child_process33.execFileSync)(
47965
48441
  pinnedNode ? "mise" : "node",
47966
48442
  pinnedNode ? ["exec", pinnedNode, "--", "node", "--version"] : ["--version"],
47967
48443
  { cwd: root, encoding: "utf8" }
@@ -48149,7 +48625,7 @@ async function copyInstalledWorkspace(root, destination, excluded) {
48149
48625
  const clone = async () => {
48150
48626
  const relative3 = entries.pop();
48151
48627
  if (relative3 === void 0) return;
48152
- await (0, import_node_util10.promisify)(import_node_child_process32.execFile)("cp", [
48628
+ await (0, import_node_util11.promisify)(import_node_child_process33.execFile)("cp", [
48153
48629
  // -c clones on a Mac, as gnu cp already does where the filesystem can
48154
48630
  ...process.platform === "darwin" ? ["-c"] : [],
48155
48631
  "-R",
@@ -48162,7 +48638,7 @@ async function copyInstalledWorkspace(root, destination, excluded) {
48162
48638
  await Promise.all(Array.from({ length: 8 }, clone));
48163
48639
  }
48164
48640
  function trackedSourceEntries(root, work) {
48165
- const listed = (0, import_node_child_process32.spawnSync)("git", ["ls-files", "--stage", "-z"], {
48641
+ const listed = (0, import_node_child_process33.spawnSync)("git", ["ls-files", "--stage", "-z"], {
48166
48642
  cwd: root,
48167
48643
  env: { ...process.env, ...isolatedGitEnv },
48168
48644
  maxBuffer: 256 * 1024 * 1024
@@ -48176,8 +48652,8 @@ function trackedSourceEntries(root, work) {
48176
48652
  function initializeWorkspaceGit(root, work) {
48177
48653
  requireNativeGit();
48178
48654
  const env = { ...process.env, ...isolatedGitEnv };
48179
- (0, import_node_child_process32.execFileSync)("git", ["init", "--quiet"], { cwd: work, env });
48180
- (0, import_node_child_process32.execFileSync)(
48655
+ (0, import_node_child_process33.execFileSync)("git", ["init", "--quiet"], { cwd: work, env });
48656
+ (0, import_node_child_process33.execFileSync)(
48181
48657
  "git",
48182
48658
  [
48183
48659
  "-c",
@@ -48197,7 +48673,7 @@ function initializeWorkspaceGit(root, work) {
48197
48673
  );
48198
48674
  const tracked = trackedSourceEntries(root, work);
48199
48675
  if (tracked.length > 0)
48200
- (0, import_node_child_process32.execFileSync)("git", ["update-index", "-z", "--index-info"], {
48676
+ (0, import_node_child_process33.execFileSync)("git", ["update-index", "-z", "--index-info"], {
48201
48677
  cwd: work,
48202
48678
  env,
48203
48679
  input: tracked.join("\0")
@@ -48253,7 +48729,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
48253
48729
  }
48254
48730
  const trustedConfigs = /* @__PURE__ */ new Set();
48255
48731
  for (const cwd of [root, app]) {
48256
- const result2 = (0, import_node_child_process32.spawnSync)("mise", ["config", "ls", "--json"], {
48732
+ const result2 = (0, import_node_child_process33.spawnSync)("mise", ["config", "ls", "--json"], {
48257
48733
  cwd,
48258
48734
  encoding: "utf8"
48259
48735
  });
@@ -48296,7 +48772,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
48296
48772
  const command = [...prefix, ...args];
48297
48773
  await run8(command[0], command.slice(1), cwd, env);
48298
48774
  };
48299
- const installedBun = manager.startsWith("bun@") ? (0, import_node_child_process32.spawnSync)(bunExecutable, ["--version"], { encoding: "utf8" }) : null;
48775
+ const installedBun = manager.startsWith("bun@") ? (0, import_node_child_process33.spawnSync)(bunExecutable, ["--version"], { encoding: "utf8" }) : null;
48300
48776
  if (manager.startsWith("bun@") && (installedBun?.status !== 0 || installedBun.stdout.trim() !== manager.slice(4)))
48301
48777
  await execute(
48302
48778
  [
@@ -48415,7 +48891,7 @@ function stageCachedQuickCryptoOpenSsl(app) {
48415
48891
  return;
48416
48892
  import_node_fs59.default.rmSync(opensslDir, { recursive: true, force: true });
48417
48893
  import_node_fs59.default.mkdirSync(opensslDir, { recursive: true });
48418
- (0, import_node_child_process32.execFileSync)("unzip", ["-q", "-o", archive, "-d", opensslDir]);
48894
+ (0, import_node_child_process33.execFileSync)("unzip", ["-q", "-o", archive, "-d", opensslDir]);
48419
48895
  }
48420
48896
  async function runAdmitted(lease, command, args, cwd, extraEnv) {
48421
48897
  const admitted = teamMachineInstalled();
@@ -48884,7 +49360,7 @@ var import_node_crypto31 = require("node:crypto");
48884
49360
  var import_node_fs64 = __toESM(require("node:fs"), 1);
48885
49361
  var import_node_module5 = require("node:module");
48886
49362
  var import_node_path62 = __toESM(require("node:path"), 1);
48887
- var import_node_util11 = require("node:util");
49363
+ var import_node_util12 = require("node:util");
48888
49364
  var import_plist5 = __toESM(require("plist"), 1);
48889
49365
  init_answeredNativePackages();
48890
49366
 
@@ -48965,7 +49441,7 @@ init_swift_native_pin();
48965
49441
  init_xcode_project();
48966
49442
  var EXPO_NATIVE_ENTRY_NAME = "ios";
48967
49443
  function expoNativeCompilerDigestValue() {
48968
- return true ? "963a611a48c6145fa72e127fa98e60722db74c1cc40fd8ed1fbd6e229bf4b5bf" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
49444
+ return true ? "52d8ecb0a37f0f7a5504161cecd2a17d59f6cff85fdc5cac0ae8f4353362ad1a" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
48969
49445
  }
48970
49446
  var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
48971
49447
  function readSources(value) {
@@ -49110,7 +49586,7 @@ async function lookup(appRoot) {
49110
49586
  const entry = await pending;
49111
49587
  if (!entry) return null;
49112
49588
  const digests2 = await expoNativePackageDigests(app.packages);
49113
- return (0, import_node_util11.isDeepStrictEqual)(digests2, entry.packages) ? entry : null;
49589
+ return (0, import_node_util12.isDeepStrictEqual)(digests2, entry.packages) ? entry : null;
49114
49590
  }
49115
49591
  function prebuiltExpoNative(appRoot, iosTarget) {
49116
49592
  if (iosTarget !== void 0) return Promise.resolve(null);
@@ -49259,9 +49735,9 @@ function macroArguments(source, open) {
49259
49735
  }
49260
49736
  return null;
49261
49737
  }
49262
- function definitionSelector(signature) {
49738
+ function definitionSelector(signature2) {
49263
49739
  let selector = "";
49264
- let rest = signature.trim();
49740
+ let rest = signature2.trim();
49265
49741
  for (; ; ) {
49266
49742
  const part = /^([A-Za-z_]\w*)?\s*(:)?\s*/.exec(rest);
49267
49743
  if (!part || !part[1] && !part[2]) break;
@@ -49784,7 +50260,7 @@ init_swift_standins();
49784
50260
  init_swift_submit();
49785
50261
  init_swift_toolchain();
49786
50262
  init_turbo_source();
49787
- var run7 = (0, import_node_util16.promisify)(import_node_child_process45.execFile);
50263
+ var run7 = (0, import_node_util17.promisify)(import_node_child_process46.execFile);
49788
50264
  var scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
49789
50265
  var EXPO_SWIFT_ENTRY = "Sources/PeachExpoApp/PeachExpoEntry.swift";
49790
50266
  var WITNESS_BATCH = 200;