peachsim 0.1.1808 → 0.1.1812

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 (236) hide show
  1. package/README.md +4 -2
  2. package/cli/app-bundle-resources.ts +15 -2
  3. package/cli/cloud-box-artifact.ts +115 -0
  4. package/cli/cloud-client.ts +148 -76
  5. package/cli/cloud-dispatch.ts +4 -4
  6. package/cli/cloud-session.ts +60 -22
  7. package/cli/commands/box.ts +8 -2
  8. package/cli/commands/compat.ts +7 -4
  9. package/cli/commands/control.ts +69 -3
  10. package/cli/commands/coverage.ts +14 -4
  11. package/cli/commands/daemon.ts +41 -0
  12. package/cli/commands/no-bridge-hint.ts +9 -0
  13. package/cli/commands/package.ts +31 -56
  14. package/cli/commands/platform.ts +71 -60
  15. package/cli/commands/preview.ts +73 -24
  16. package/cli/commands/record.ts +10 -2
  17. package/cli/commands/screenshot.ts +17 -60
  18. package/cli/commands/setup.ts +3 -1
  19. package/cli/commands/three-mode.ts +22 -12
  20. package/cli/commands/upload.ts +2 -1
  21. package/cli/desktop-companion.ts +6 -1
  22. package/cli/drivers/desktop.ts +4 -1
  23. package/cli/main.ts +12 -2
  24. package/cli/metro-bundle-assets.ts +14 -4
  25. package/cli/outbound-endpoints.ts +7 -3
  26. package/cli/output-redaction.ts +38 -0
  27. package/cli/privacy.ts +2 -2
  28. package/cli/recording-access.ts +5 -0
  29. package/cli/remote-project-bundle.ts +83 -0
  30. package/cli/shell-init.ts +7 -11
  31. package/cli/telemetry.ts +41 -4
  32. package/cli/usage-error.ts +3 -0
  33. package/cli/ws-bridge.ts +42 -6
  34. package/dist-lib/agent-daemon-client.cjs +1 -1
  35. package/dist-lib/agent-events.cjs +1 -1
  36. package/dist-lib/attached-projects.cjs +1 -1
  37. package/dist-lib/auth/shared-session.cjs +1 -1
  38. package/dist-lib/backend-origin.cjs +1 -1
  39. package/dist-lib/beta.cjs +1 -1
  40. package/dist-lib/beta.mjs +1 -1
  41. package/dist-lib/bridge-constants.cjs +1 -1
  42. package/dist-lib/bridge-contract-input.cjs +1 -1
  43. package/dist-lib/bridge-contract-input.mjs +1 -1
  44. package/dist-lib/bridge-contract.cjs +1 -1
  45. package/dist-lib/bridge-contract.mjs +1 -1
  46. package/dist-lib/bundle-channel.cjs +42897 -40755
  47. package/dist-lib/capture-contract.cjs +7 -8
  48. package/dist-lib/capture-contract.mjs +7 -8
  49. package/dist-lib/cloud-contract.cjs +1 -1
  50. package/dist-lib/cloud-contract.mjs +1 -1
  51. package/dist-lib/cloud-test-args.cjs +1 -1
  52. package/dist-lib/cloud-test-args.mjs +1 -1
  53. package/dist-lib/cloud.cjs +1 -1
  54. package/dist-lib/cloud.mjs +1 -1
  55. package/dist-lib/config.cjs +1 -1
  56. package/dist-lib/config.mjs +1 -1
  57. package/dist-lib/detox/index.cjs +13 -7
  58. package/dist-lib/dev-bundle-resolution.cjs +10 -4
  59. package/dist-lib/expo-swift-bundle.cjs +15889 -15553
  60. package/dist-lib/expo-swift-metadata.cjs +2 -1
  61. package/dist-lib/expo-swift-metadata.mjs +2 -1
  62. package/dist-lib/home-paths.cjs +2 -33
  63. package/dist-lib/host/bridge-host.cjs +20891 -18714
  64. package/dist-lib/host/fetch-proxy-handler.cjs +10 -11
  65. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  66. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  67. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  68. package/dist-lib/host/websocket-proxy.cjs +1 -1
  69. package/dist-lib/index.cjs +620 -553
  70. package/dist-lib/jump-to-source-babel.cjs +1 -1
  71. package/dist-lib/jump-to-source-native.cjs +1 -1
  72. package/dist-lib/kotlin-host.cjs +1 -1
  73. package/dist-lib/menu.cjs +1 -1
  74. package/dist-lib/menu.mjs +1 -1
  75. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  76. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  77. package/dist-lib/metro-production-bundle.cjs +1 -1
  78. package/dist-lib/metro-production-bundle.mjs +1 -1
  79. package/dist-lib/metro.cjs +57 -28
  80. package/dist-lib/native-app-identity-project.cjs +47 -14
  81. package/dist-lib/native-app-identity-project.mjs +55 -20
  82. package/dist-lib/native-app-identity.cjs +1 -1
  83. package/dist-lib/native-app-identity.mjs +1 -1
  84. package/dist-lib/native-firebase-metadata.cjs +1 -1
  85. package/dist-lib/native-firebase-metadata.mjs +1 -1
  86. package/dist-lib/pdfium-raster.cjs +1 -1
  87. package/dist-lib/pdfium-raster.mjs +1 -1
  88. package/dist-lib/plist.cjs +1 -1
  89. package/dist-lib/plist.mjs +1 -1
  90. package/dist-lib/profiles.cjs +1 -1
  91. package/dist-lib/public-brand.cjs +1 -1
  92. package/dist-lib/public-origins-lib-esm.json +27 -26
  93. package/dist-lib/public-origins-lib.json +104 -81
  94. package/dist-lib/react-native-host-modules.cjs +1 -1
  95. package/dist-lib/react-native-host-modules.mjs +1 -1
  96. package/dist-lib/reap-browser.cjs +1 -1
  97. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  98. package/dist-lib/sdk.cjs +1 -1
  99. package/dist-lib/sdk.mjs +1 -1
  100. package/dist-lib/skills.cjs +30700 -24410
  101. package/dist-lib/swift-compile.cjs +336 -222
  102. package/dist-lib/swift-compile.mjs +378 -263
  103. package/dist-lib/swift-package.cjs +19 -7
  104. package/dist-lib/swift-package.mjs +16 -6
  105. package/dist-lib/swift-submit.cjs +1 -1
  106. package/dist-lib/swift-submit.mjs +1 -1
  107. package/dist-lib/swift-toolchain.cjs +49 -1
  108. package/dist-lib/swift.cjs +1 -1
  109. package/dist-lib/vite-swift.cjs +19213 -18937
  110. package/dist-lib/vite.cjs +11 -12
  111. package/dist-lib/worklet-executable.cjs +1 -1
  112. package/dist-lib/worklet-executable.mjs +1 -1
  113. package/dist-types/packages/peach-engine/src/engine/animated.d.ts +4 -0
  114. package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
  115. package/dist-types/packages/peach-engine/src/engine/expo-manifest.d.ts +1 -0
  116. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
  117. package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -1
  119. package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +2 -1
  120. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  121. package/kotlin/sdk.tar.gz +0 -0
  122. package/package.json +1 -1
  123. package/runtime-companion.json +1 -1
  124. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +1 -1
  125. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +1 -1
  126. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +1 -1
  127. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +1 -1
  128. package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +1 -1
  129. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h +1 -1
  130. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h +1 -1
  131. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h +1 -1
  132. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVFoundation+MPNowPlayingInfoLanguageOptionAdditions.h +39 -0
  133. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVPlayerItem+MediaPlayerAdditions.h +26 -0
  134. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPContentItem.h +67 -0
  135. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPError.h +33 -0
  136. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaEntity.h +53 -0
  137. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h +346 -0
  138. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItemCollection.h +42 -0
  139. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaLibrary.h +76 -0
  140. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPickerController.h +64 -0
  141. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlayback.h +47 -0
  142. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlaylist.h +82 -0
  143. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuery.h +120 -0
  144. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuerySection.h +26 -0
  145. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerController.h +444 -0
  146. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerViewController.h +43 -0
  147. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerApplicationController.h +47 -0
  148. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerController.h +147 -0
  149. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerQueueDescriptor.h +75 -0
  150. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h +197 -0
  151. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoLanguageOption.h +107 -0
  152. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingSession.h +89 -0
  153. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDataSource.h +59 -0
  154. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDelegate.h +64 -0
  155. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManager.h +46 -0
  156. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManagerContext.h +32 -0
  157. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommand.h +143 -0
  158. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandCenter.h +66 -0
  159. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandEvent.h +128 -0
  160. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteControlTypes.h +27 -0
  161. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeSettings.h +20 -0
  162. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeView.h +82 -0
  163. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes +74 -0
  164. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.h +40 -0
  165. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayerDefines.h +84 -0
  166. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/NSUserActivity+MediaPlayerAdditions.h +20 -0
  167. package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Modules/module.modulemap +5 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h +2 -2
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h +1 -1
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundConfiguration.h +1 -1
  171. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIButtonConfiguration.h +1 -1
  172. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h +1 -1
  173. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +1 -1
  174. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
  175. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h +1 -1
  176. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +5 -5
  177. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISlider.h +1 -1
  178. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewController.h +12 -50
  179. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UISplitViewControllerLayoutEnvironment.h +2 -8
  180. package/sdk/ios/System/Library/Frameworks/UIKitTypes.framework/Headers/UIKitTypes.h +62 -0
  181. package/sdk/ios/usr/include/dispatch.modulemap +22 -0
  182. package/sdk/ios/usr/include/module.modulemap +8 -3
  183. package/sdk/ios/usr/include/net/if.h +24 -0
  184. package/sdk/ios/usr/include/sys/time.h +1 -1
  185. package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +265 -0
  186. package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
  187. package/sdk/ios/wasm/include/fcntl.h +2 -0
  188. package/sdk/ios/wasm/include/pthread.h +3 -0
  189. package/sdk/ios/wasm/include/stdlib.h +2 -0
  190. package/sdk/ios/wasm/include/unistd.h +2 -2
  191. package/skills/contrast/SKILL.md +2 -2
  192. package/src/bundle-channel.mjs +9 -72
  193. package/src/capture-contract.ts +12 -9
  194. package/src/desktop-host-delivery.ts +16 -2
  195. package/src/dev-bundle-resolution.ts +12 -3
  196. package/src/expo-native-workspace.ts +113 -46
  197. package/src/expo-swift-host.ts +17 -12
  198. package/src/expo-swift-ready.ts +4 -1
  199. package/src/expoSwiftContract.ts +1 -0
  200. package/src/home-paths.ts +4 -48
  201. package/src/host/bridge-host.ts +1 -0
  202. package/src/installed-native-libraries.ts +2 -8
  203. package/src/metro-project-root.ts +2 -1
  204. package/src/native-bundles.ts +122 -0
  205. package/src/native-static-libraries.ts +65 -8
  206. package/src/nitro-adapter.lock.json +272 -272
  207. package/src/nitro-bundle.ts +2 -2
  208. package/src/nitro-compile.ts +68 -28
  209. package/src/nitro-source.ts +24 -6
  210. package/src/nitro-superset.lock.json +94 -34
  211. package/src/nitroContract.ts +3 -0
  212. package/src/podspec-sources.ts +1966 -0
  213. package/src/storageSnapshotContract.ts +40 -0
  214. package/src/swift-compile.ts +77 -26
  215. package/src/swift-design-time.ts +18 -1
  216. package/src/swift-distribution.lock.json +12 -12
  217. package/src/swift-distribution.ts +9 -6
  218. package/src/swift-host.ts +1 -2
  219. package/src/swift-link-roots.ts +13 -2
  220. package/src/swift-objc-compile.ts +12 -0
  221. package/src/swift-objc-standin.ts +321 -114
  222. package/src/swift-package-manifest.ts +4 -3
  223. package/src/swift-package.ts +31 -4
  224. package/src/swift-root-lock.ts +11 -0
  225. package/src/swift-shared-sdk.ts +10 -9
  226. package/src/swift-source-pods.ts +2 -2
  227. package/src/swift-standins.ts +40 -143
  228. package/src/swift-toolchain.ts +59 -0
  229. package/src/swift-wasm-prune.ts +53 -21
  230. package/src/turbo-bundle.ts +4 -5
  231. package/src/turbo-codegen-intake.ts +111 -108
  232. package/src/turbo-compile.ts +63 -33
  233. package/src/turbo-runtime.lock.json +22 -22
  234. package/src/turbo-source.ts +171 -76
  235. package/src/wasm-optimize.ts +31 -2
  236. package/src/xcode-project.ts +65 -15
@@ -2,8 +2,7 @@ import { execFileSync } from 'node:child_process'
2
2
  import { createHash } from 'node:crypto'
3
3
  import fs, { readdirSync, readFileSync } from 'node:fs'
4
4
  import path from 'node:path'
5
- import { swiftCacheDir } from './home-paths'
6
- import { swiftEnvironment, swiftSdkOptions } from './swift-toolchain'
5
+ import { swiftCacheDir, swiftEnvironment, swiftSdkOptions } from './swift-toolchain'
7
6
 
8
7
  // records targets share the same native declarations as original c units.
9
8
  // storage overlays carry wasm scalar identities without changing wasi libc abi.
@@ -254,7 +253,7 @@ export function swiftSharedSdkViewOptions(
254
253
  .map((entry) => path.join(entry.parentPath, entry.name))
255
254
  .sort()
256
255
  const key = JSON.stringify([
257
- 'v10',
256
+ 'v11',
258
257
  toolchainBin,
259
258
  sdk,
260
259
  frameworks,
@@ -299,13 +298,15 @@ export function swiftSharedSdkViewOptions(
299
298
  // directory a second home for the same clang modules. mirror the whole sysroot as
300
299
  // real directories so ".." always stays in the view. the shared frameworks replace
301
300
  // the bundle's, and the shared MacTypes.h replaces the bundle's, which wins the
302
- // include search and predates the Fixed family the frameworks rely on.
303
- const overrides = new Map([
301
+ // include search and predates the Fixed family the frameworks rely on. the shared
302
+ // net/if.h replaces the bundle's for the same reason: the bundle's stub lacks the
303
+ // IFF_* flags and if_indextoname that native packages compile against.
304
+ const overrides = new Map<string, string>([
304
305
  [path.join(sysroot, 'darwin/System/Library/Frameworks'), frameworks],
305
- [
306
- path.join(sysroot, 'darwin/usr/include/MacTypes.h'),
307
- path.join(swiftSharedSdkRoot(moduleRoot, distribution), 'usr/include/MacTypes.h'),
308
- ],
306
+ ...['MacTypes.h', 'net/if.h'].map((header): [string, string] => [
307
+ path.join(sysroot, 'darwin/usr/include', header),
308
+ path.join(swiftSharedSdkRoot(moduleRoot, distribution), 'usr/include', header),
309
+ ]),
309
310
  ])
310
311
  // preserve bundle-only support headers while taking the shared darwin
311
312
  // overlays from the same owner as the framework declarations.
@@ -5,7 +5,7 @@ import yaml from 'yaml'
5
5
  import { cacheDir } from './home-paths'
6
6
  import { compileInput, withXcodeProject, prepareXcodeSwiftPackages } from './swift-host'
7
7
  import { swiftManifestTargets } from './swift-package'
8
- import { withSwiftRootLock } from './swift-root-lock'
8
+ import { withCocoaPodsCacheLock, withSwiftRootLock } from './swift-root-lock'
9
9
  import { readXcodeAppTarget } from './xcode-project'
10
10
  import type { SwiftCompileInput } from './swift-compile'
11
11
 
@@ -316,7 +316,7 @@ export async function collectSwiftSourcePods(
316
316
  fs.writeFileSync(path.join(work, `${APP}.xcodeproj/project.pbxproj`), project)
317
317
  fs.writeFileSync(path.join(work, 'main.swift'), 'import Foundation\n')
318
318
  fs.writeFileSync(path.join(work, 'Podfile'), podfile)
319
- await runPod(['install'])
319
+ await withCocoaPodsCacheLock(() => runPod(['install']))
320
320
  fs.writeFileSync(complete, key)
321
321
  }
322
322
  const actualLock: unknown = yaml.parse(fs.readFileSync(installed, 'utf8'))
@@ -13,7 +13,7 @@ import { execFileSync, spawn, spawnSync } from 'node:child_process'
13
13
  import { createHash } from 'node:crypto'
14
14
  import fs from 'node:fs'
15
15
  import path from 'node:path'
16
- import { cacheDir as peachCacheDir, swiftPackageCacheOptions } from './home-paths'
16
+ import { cacheDir as peachCacheDir } from './home-paths'
17
17
  import { isRecord } from './is-record'
18
18
  import { fetchNativeEntry, nativeEntryKey } from './native-prebuilt'
19
19
  import { nativeSliceEntry, NATIVE_SLICE_RECIPES } from './native-slices'
@@ -34,14 +34,10 @@ import {
34
34
  swiftSdkPaths,
35
35
  } from './swift-compile'
36
36
  import { emitCxxStandin } from './swift-cxx-standin'
37
- import { IOS_SDK_TARGET } from './swift-objc-sdk'
38
37
  import {
39
38
  IOS_SDK_ID,
40
- NATIVE_GRAPH_ID,
41
- pinnedNativeSdkReady,
42
39
  WASI_EMULATION,
43
40
  WASI_EMULATION_FLAGS,
44
- nativeInterfaceView,
45
41
  moduleMapHeaders,
46
42
  objcView,
47
43
  type ObjcSurface,
@@ -65,7 +61,11 @@ import {
65
61
  synthesizedInterfaceEnums,
66
62
  restoreSwiftInterfaceSPI,
67
63
  } from './swift-standin-emit'
68
- import { sourceSwiftCheckout, swiftEnvironment } from './swift-toolchain'
64
+ import {
65
+ sourceSwiftCheckout,
66
+ swiftEnvironment,
67
+ swiftPackageCacheOptions,
68
+ } from './swift-toolchain'
69
69
  import { simulatorStaticArchive } from './swift-xcframework'
70
70
  import type { SwiftPackageBinary } from './swift-packages'
71
71
 
@@ -663,15 +663,6 @@ function surfaces(
663
663
  return found
664
664
  }
665
665
 
666
- export function standinsNeedNativeSdk(binaries: readonly SwiftPackageBinary[]): boolean {
667
- return binaries.some(
668
- (binary) =>
669
- binary.publicHeaders === undefined &&
670
- binary.placeholder === undefined &&
671
- surfaces(xcframework(binary).dir).some((surface) => surface.kind === 'mixed'),
672
- )
673
- }
674
-
675
666
  // the peach modules an interface imports, compiled for wasm: a distribution
676
667
  // ships them; a checkout builds the ones named into its own build directory,
677
668
  // with the flags scripts/build.sh uses, so the two share one build.
@@ -734,11 +725,30 @@ function peachModuleDirs(
734
725
  // swiftpm generated in its build directory. a peach module re-exporting one
735
726
  // fails to load without it
736
727
  const release = path.join(moduleRoot, '.build', TRIPLE, 'release')
728
+ const declarations = swiftManifestDeclarations(
729
+ fs.readFileSync(path.join(moduleRoot, 'Package.swift'), 'utf8'),
730
+ )
731
+ const supplied = new Set(
732
+ declarations
733
+ .filter(
734
+ (target) =>
735
+ sdkIncludes.some((dir) =>
736
+ fs.existsSync(path.join(dir, target.name, 'module.modulemap')),
737
+ ) ||
738
+ fs.existsSync(
739
+ path.join(
740
+ moduleRoot,
741
+ target.path,
742
+ target.kind === 'systemLibrary' ? '' : 'include',
743
+ 'module.modulemap',
744
+ ),
745
+ ),
746
+ )
747
+ .map((target) => target.name),
748
+ )
737
749
  return [
738
750
  path.join(release, 'Modules'),
739
- ...swiftManifestDeclarations(
740
- fs.readFileSync(path.join(moduleRoot, 'Package.swift'), 'utf8'),
741
- )
751
+ ...declarations
742
752
  // the sdk already exposes some of these modules (DarwinRecords in its
743
753
  // sysroot, libxml2 in its darwin intake). adding the source copy of the
744
754
  // same module map redefines that module.
@@ -761,6 +771,7 @@ function peachModuleDirs(
761
771
  .filter(
762
772
  (name) =>
763
773
  name.endsWith('.build') &&
774
+ !supplied.has(name.slice(0, -'.build'.length)) &&
764
775
  fs.existsSync(path.join(release, name, 'module.modulemap')),
765
776
  )
766
777
  .sort()
@@ -1115,7 +1126,15 @@ function mixedStandin(
1115
1126
  frameworkDirs: readonly string[],
1116
1127
  siblings: ReadonlySet<string>,
1117
1128
  ): SwiftStandin {
1118
- const view = nativeInterfaceView(surface, frameworkDirs, work)
1129
+ const view = objcView(
1130
+ surface,
1131
+ toolchain.toolchainBin,
1132
+ path.join(toolchain.moduleRoot, 'ios-simulator-stdlib'),
1133
+ cacheDir,
1134
+ path.join(work, 'objc'),
1135
+ undefined,
1136
+ frameworkDirs,
1137
+ )
1119
1138
  const interfaceText = fs.readFileSync(surface.interface, 'utf8')
1120
1139
  restoreSwiftInterfaceSPI(interfaceText, surface.module, view.graphs)
1121
1140
  const values = new Map([
@@ -1166,116 +1185,13 @@ function mixedStandin(
1166
1185
  behavior,
1167
1186
  imports,
1168
1187
  true,
1169
- surface.kind === 'mixed'
1170
- ? nativeProtocolProperties(surface, view.graphs, frameworkDirs, work)
1171
- : new Map(),
1188
+ view.protocolProperties ?? new Map(),
1172
1189
  null,
1173
1190
  view.inheritedConformances,
1174
1191
  interfaceProjections(view.graphs, interfaceText),
1175
1192
  )
1176
1193
  }
1177
1194
 
1178
- // symbol graphs omit custom property accessors. clang reads those selectors
1179
- // from the same native headers before a referenced objc protocol is emitted.
1180
- function nativeProtocolProperties(
1181
- surface: Extract<Surface, { kind: 'mixed' }>,
1182
- graphs: SymbolGraph[],
1183
- frameworkDirs: readonly string[],
1184
- work: string,
1185
- ): Map<string, { getter: string; setter?: string }> {
1186
- const properties = new Map<string, { getter: string; setter?: string }>()
1187
- const protocols = objcProtocolsInSwiftSignatures(graphs)
1188
- if (protocols.size === 0) return properties
1189
- const headers = files(surface.headers, (name) => name.endsWith('.h')).map((name) => ({
1190
- file: path.join(surface.headers, name),
1191
- text: fs.readFileSync(path.join(surface.headers, name), 'utf8'),
1192
- }))
1193
- // runner-toolchain-platform: darwin
1194
- const sdk = exec('xcrun', ['--sdk', 'iphonesimulator', '--show-sdk-path']).trim()
1195
- // runner-toolchain-platform: darwin
1196
- const clang = exec('xcrun', ['--find', 'clang']).trim()
1197
- for (const id of protocols) {
1198
- const name = /^c:objc\(pl\)(\w+)$/.exec(id)?.[1]
1199
- if (!name) throw new Error(`unknown Objective-C protocol identity ${id}`)
1200
- const pattern = new RegExp(`@protocol\\s+${name}\\b(?!\\s*;)`)
1201
- const candidates = headers.filter((header) => pattern.test(header.text))
1202
- if (candidates.length === 0)
1203
- throw new Error(`native headers have no definition of Objective-C protocol ${name}`)
1204
- const probe = path.join(work, 'objc-protocol-properties.m')
1205
- fs.writeFileSync(
1206
- probe,
1207
- // the module's own roots first: a defining header may rely on the
1208
- // declarations its umbrella imports before it, as NS_ENUM does
1209
- [
1210
- ...moduleMapHeaders(surface.modulemap).map((file) =>
1211
- path.join(surface.headers, file),
1212
- ),
1213
- ...candidates.map(({ file }) => file),
1214
- ]
1215
- .map((file) => `#import ${JSON.stringify(file)}\n`)
1216
- .join(''),
1217
- )
1218
- const output = exec(clang, [
1219
- '-x',
1220
- 'objective-c',
1221
- '-fobjc-arc',
1222
- '-fblocks',
1223
- '-fmodules',
1224
- `-fmodule-name=${surface.module}`,
1225
- '-fsyntax-only',
1226
- '-target',
1227
- IOS_SDK_TARGET,
1228
- '-isysroot',
1229
- sdk,
1230
- ...frameworkDirs.flatMap((dir) => ['-F', dir]),
1231
- '-I',
1232
- surface.headers,
1233
- '-Xclang',
1234
- '-ast-dump-all=json',
1235
- '-Xclang',
1236
- '-ast-dump-filter',
1237
- '-Xclang',
1238
- name,
1239
- probe,
1240
- ])
1241
- let found = false
1242
- for (const chunk of output.split(/\n(?=\{\n)/).filter((part) => part.trim())) {
1243
- const declaration: unknown = JSON.parse(chunk)
1244
- if (
1245
- !isRecord(declaration) ||
1246
- declaration.kind !== 'ObjCProtocolDecl' ||
1247
- declaration.name !== name ||
1248
- !Array.isArray(declaration.inner)
1249
- )
1250
- continue
1251
- found = true
1252
- for (const child of declaration.inner) {
1253
- if (
1254
- !isRecord(child) ||
1255
- child.kind !== 'ObjCPropertyDecl' ||
1256
- typeof child.name !== 'string'
1257
- )
1258
- continue
1259
- const getter =
1260
- isRecord(child.getter) && typeof child.getter.name === 'string'
1261
- ? child.getter.name
1262
- : child.name
1263
- const setter =
1264
- isRecord(child.setter) && typeof child.setter.name === 'string'
1265
- ? child.setter.name
1266
- : `set${child.name[0]?.toUpperCase() ?? ''}${child.name.slice(1)}:`
1267
- properties.set(`${id}(py)${child.name}`, {
1268
- getter,
1269
- ...(child.readonly === true ? {} : { setter }),
1270
- })
1271
- }
1272
- }
1273
- if (!found)
1274
- throw new Error(`clang found no definition of Objective-C protocol ${name}`)
1275
- }
1276
- return properties
1277
- }
1278
-
1279
1195
  // the sdk toolset passes this to every swiftc compile; raw swiftc does not read the toolset,
1280
1196
  // and emitting a module aborts without it when the source reaches the wasm exception model.
1281
1197
  // swift-symbolgraph-extract has no -Xllvm.
@@ -2299,7 +2215,6 @@ async function sourceStandins(
2299
2215
  behavior,
2300
2216
  generation: preparedGeneration,
2301
2217
  release: toolchain.release,
2302
- native: standinsNeedNativeSdk(local),
2303
2218
  }),
2304
2219
  )
2305
2220
  // the submit waits on remote admission for minutes; it runs async so the
@@ -2508,11 +2423,6 @@ export function standinGenerationInputs(
2508
2423
  surfaces(xcframework(binary).dir).some((surface) => surface.kind === 'swift')
2509
2424
  )
2510
2425
  parts.push(`interface-emulation/${WASI_EMULATION.join(',')}`)
2511
- if (
2512
- binary.publicHeaders === undefined &&
2513
- surfaces(xcframework(binary).dir).some((surface) => surface.kind === 'mixed')
2514
- )
2515
- parts.push(`native-graph/${NATIVE_GRAPH_ID}`)
2516
2426
  parts.push(
2517
2427
  binary.target,
2518
2428
  binary.source,
@@ -2758,24 +2668,11 @@ export async function swiftStandins(
2758
2668
  ): Promise<SwiftStandins> {
2759
2669
  const requested = binaries.filter((binary) => !provided.has(binary.target))
2760
2670
  if (requested.length === 0) return { standins: [], gaps: new Map() }
2761
- // agent sessions set CI, which used to force every stand-in onto the local
2762
- // xcode. a mixed framework still has to be extracted where the pinned sdk
2763
- // is installed; an older selected sdk is not a stand-in.
2764
- const pinnedSdkMissing =
2765
- process.env.CI === 'true' &&
2766
- requested.some((binary) => {
2767
- try {
2768
- return standinsNeedNativeSdk([binary])
2769
- } catch {
2770
- return false
2771
- }
2772
- }) &&
2773
- !pinnedNativeSdkReady()
2774
2671
  if (
2775
2672
  process.platform === 'darwin' &&
2776
2673
  process.env.TM_EXEC_BUILD_PLATFORM !== 'mac' &&
2777
2674
  process.env.TM_SESSION &&
2778
- (process.env.CI !== 'true' || pinnedSdkMissing) &&
2675
+ process.env.CI !== 'true' &&
2779
2676
  toolchain.moduleRoot === sourceSwiftCheckout() &&
2780
2677
  !swiftDistributionAt(toolchain.moduleRoot)
2781
2678
  )
@@ -193,6 +193,23 @@ const compilerArchives: Record<
193
193
  },
194
194
  },
195
195
  },
196
+ 'swift-6.4.0-RELEASE-custom-a560ff35bf882b5c': {
197
+ identity: 'a560ff35bf882b5c',
198
+ hosts: {
199
+ 'darwin-arm64': {
200
+ checksum: 'ec20a41851ac558fe663d78def6b93d0d47c5a0cb69688ee270fd85de637a522',
201
+ manifest: '253e891527d2213f54eace768b902de89de5e9495a3c5f4018de1985516bd553',
202
+ },
203
+ 'linux-x64': {
204
+ checksum: 'f0126a2e63d275895036d02d75a901070da0343dbf03bf17342e10cb6f893dee',
205
+ manifest: '6f951cc4071dd0d6054d85711a7c5fe272273658847831b477a8b24be7254ca0',
206
+ },
207
+ 'linux-arm64': {
208
+ checksum: '315fa766559a6e69bfd10dcddf40e04c91155f0db3047d210d74ac87652fb7e6',
209
+ manifest: 'b6f62fca2ec37593e274ee5bac474f21ffc5db14cd82f492ccbc774f8e9b75d8',
210
+ },
211
+ },
212
+ },
196
213
  [SWIFT_HOST_COMPILER_RELEASE]: {
197
214
  identity: SWIFT_HOST_COMPILER_ID,
198
215
  hosts: {
@@ -452,6 +469,48 @@ function peachHome(): string {
452
469
  return override ? path.resolve(override) : path.join(os.homedir(), '.peach')
453
470
  }
454
471
 
472
+ export const BUILDERS_ROOT_ENV = 'CONTRAST_BUILDERS_ROOT'
473
+
474
+ // builder sessions export the resolved native build root (`<heavy>/builders`
475
+ // when machine policy configures heavy storage, else `~/builders`).
476
+ // remote.sh refuses before source transfer when a configured root is
477
+ // unavailable, so a set value is always usable and nothing here falls back to
478
+ // the internal disk: a missing directory fails at first write like the other
479
+ // heavy-root consumers.
480
+ function buildersRootEnv(): string | null {
481
+ const root = process.env[BUILDERS_ROOT_ENV]?.trim()
482
+ return root ? root : null
483
+ }
484
+
485
+ // machine-wide swift scratch and package caches, shared across lanes. keep
486
+ // their implementation with the compiler so daemon edits cannot cold-split
487
+ // the twin warm trees. the complete implementation remains a hashed input.
488
+ export function swiftCacheDir(): string {
489
+ const root = buildersRootEnv()
490
+ return root ? path.join(root, 'peach-cache') : path.join(peachHome(), 'cache')
491
+ }
492
+
493
+ // shared builder roots are serialized by the content key's existing lock;
494
+ // local checkouts keep their private source roots outside the artifact cache.
495
+ export function swiftProjectBuildsDir(checkoutRoot: string): string {
496
+ const root = buildersRootEnv()
497
+ return root
498
+ ? path.join(swiftCacheDir(), 'swift-project-builds')
499
+ : path.join(checkoutRoot, 'scripts', 'tmp', 'swift-projects')
500
+ }
501
+
502
+ // isolated swiftpm caches retain netrc and never prompt for a keychain.
503
+ export function swiftPackageCacheOptions(): string[] {
504
+ const root = path.join(swiftCacheDir(), 'swiftpm')
505
+ return [
506
+ ...['cache', 'config', 'security'].flatMap((name) => [
507
+ `--${name}-path`,
508
+ path.join(root, name),
509
+ ]),
510
+ '--disable-keychain',
511
+ ]
512
+ }
513
+
455
514
  let scratch: { directory: string; home: string } | undefined
456
515
  let linuxLibraryPath: string | undefined
457
516
  let linuxHostSdkRoot: string | undefined
@@ -676,15 +676,13 @@ function parseWasmObjectBytes(
676
676
  }
677
677
 
678
678
  const typePrefixesInObj = new Set<string>()
679
- if (isDist) {
680
- for (let i = 0; i < symKind.length; i++) {
681
- if (
682
- (symFlags[i]! & 0x10) === 0 &&
683
- symNames[i]!.startsWith('$s') &&
684
- symNames[i]!.endsWith('Mn')
685
- ) {
686
- typePrefixesInObj.add(symNames[i]!.slice(0, -2))
687
- }
679
+ for (let i = 0; i < symKind.length; i++) {
680
+ if (
681
+ (symFlags[i]! & 0x10) === 0 &&
682
+ symNames[i]!.startsWith('$s') &&
683
+ symNames[i]!.endsWith('Mn')
684
+ ) {
685
+ typePrefixesInObj.add(symNames[i]!.slice(0, -2))
688
686
  }
689
687
  }
690
688
 
@@ -1037,17 +1035,18 @@ export function pruneSwiftWasmLink(
1037
1035
  workQueue.push({ kind: 'datasym', obj, symIdx })
1038
1036
  }
1039
1037
 
1040
- // a conformance in one dist object for a type another dist object defines
1041
- // waits until that type is live: no value of a dead type can reach a cast.
1042
- const prunableTypes = new Set<string>()
1038
+ // foreign conformances wait for their type, including types defined in SDK
1039
+ // objects that the linker keeps whole. no value of a dead type can reach a cast.
1040
+ const knownTypes = new Set<string>()
1043
1041
  for (const o of distObjs.values())
1044
- for (const t of o.typePrefixesInObj) prunableTypes.add(t)
1042
+ for (const t of o.typePrefixesInObj) knownTypes.add(t)
1045
1043
  const globalLiveTypes = new Set<string>()
1046
1044
  const pendingConformances = new Map<string, { obj: ParsedObject; symIdx: number }[]>()
1045
+ const eagerConformanceObjects = new Set<ParsedObject>()
1047
1046
  const conformingType = (name: string): string | undefined => {
1048
1047
  for (let n = name.length - 1; n > 2; n--) {
1049
1048
  const prefix = name.slice(0, n)
1050
- if (prunableTypes.has(prefix)) return prefix
1049
+ if (knownTypes.has(prefix)) return prefix
1051
1050
  }
1052
1051
  return undefined
1053
1052
  }
@@ -1060,7 +1059,11 @@ export function pruneSwiftWasmLink(
1060
1059
  const waiting = pendingConformances.get(pref)
1061
1060
  if (waiting) {
1062
1061
  pendingConformances.delete(pref)
1063
- for (const w of waiting) activateSymbolInObj(w.obj, w.symIdx)
1062
+ for (const w of waiting) {
1063
+ eagerConformanceObjects.add(w.obj)
1064
+ extractObject(w.obj)
1065
+ activateSymbolInObj(w.obj, w.symIdx)
1066
+ }
1064
1067
  }
1065
1068
 
1066
1069
  const mnName = `${pref}Mn`
@@ -1089,7 +1092,7 @@ export function pruneSwiftWasmLink(
1089
1092
  }
1090
1093
 
1091
1094
  const checkTypeTrigger = (obj: ParsedObject, rawSymName: string) => {
1092
- if (!obj.isDist || !rawSymName) return
1095
+ if (!rawSymName) return
1093
1096
  const sName = rawSymName.startsWith('.Lgot.') ? rawSymName.slice(6) : rawSymName
1094
1097
  const objcPref = obj.objcClassSymToTypePrefix.get(sName)
1095
1098
  if (objcPref) {
@@ -1191,6 +1194,17 @@ export function pruneSwiftWasmLink(
1191
1194
  for (const fIdx of obj.rootFuncs) markFuncLive(obj, fIdx)
1192
1195
  for (const sIdx of obj.rootSegs) markSegLive(obj, sIdx)
1193
1196
 
1197
+ // the runtime sends +load to every loaded class whether or not anything
1198
+ // names it, and ld64 never dead-strips an objective-c class, so a class
1199
+ // with +load (`_c_<class>__load`) is a root like an initializer.
1200
+ for (const name of obj.symNames) {
1201
+ const loaded = name?.match(/^_c_(\w+)__load$/)?.[1]
1202
+ if (!loaded) continue
1203
+ const classSym = obj.symNames.indexOf(`._OBJC_CLASS_${loaded}`)
1204
+ if (classSym !== -1 && (obj.symFlags[classSym]! & 0x10) === 0)
1205
+ activateSymbolInObj(obj, classSym)
1206
+ }
1207
+
1194
1208
  if (obj.file.endsWith('libswiftCore__Swift.o')) {
1195
1209
  for (const pref of obj.typePrefixesInObj) {
1196
1210
  if (!pref.startsWith('$ss')) {
@@ -1216,11 +1230,6 @@ export function pruneSwiftWasmLink(
1216
1230
  const type = conformingType(mcName)
1217
1231
  if (type === undefined || globalLiveTypes.has(type))
1218
1232
  activateSymbolInObj(obj, r.rs)
1219
- else {
1220
- let list = pendingConformances.get(type)
1221
- if (!list) pendingConformances.set(type, (list = []))
1222
- list.push({ obj, symIdx: r.rs })
1223
- }
1224
1233
  }
1225
1234
  }
1226
1235
  }
@@ -1229,6 +1238,21 @@ export function pruneSwiftWasmLink(
1229
1238
  }
1230
1239
  }
1231
1240
 
1241
+ // a dynamic cast reaches foreign conformances without referencing a symbol
1242
+ // in their object. index them before extracting any provider so a live type
1243
+ // can extract its extensions as well as its own metadata.
1244
+ for (const obj of distObjs.values()) {
1245
+ if (!obj.isDist) continue
1246
+ for (const r of obj.dataRelocList) {
1247
+ if (obj.segNames[r.segIdx] !== 'swift5_protocol_conformances') continue
1248
+ const type = conformingType(obj.symNames[r.rs]!)
1249
+ if (type === undefined || obj.typePrefixesInObj.has(type)) continue
1250
+ let list = pendingConformances.get(type)
1251
+ if (!list) pendingConformances.set(type, (list = []))
1252
+ list.push({ obj, symIdx: r.rs })
1253
+ }
1254
+ }
1255
+
1232
1256
  let hasClangObjCEager = false
1233
1257
  const eagerBuildPrunable: ParsedObject[] = []
1234
1258
  for (const f of eagerFiles) {
@@ -1741,6 +1765,14 @@ export function pruneSwiftWasmLink(
1741
1765
  emittedPruned.add(ef)
1742
1766
  }
1743
1767
  }
1768
+ // these providers were reached through runtime type lookup, so no
1769
+ // undefined symbol would extract them from the following archive region.
1770
+ for (const obj of eagerConformanceObjects) {
1771
+ if (!emittedPruned.has(obj.file) && prunedMap.has(obj.file)) {
1772
+ outTokens.push(prunedMap.get(obj.file)!)
1773
+ emittedPruned.add(obj.file)
1774
+ }
1775
+ }
1744
1776
  outTokens.push('--start-lib')
1745
1777
  for (const rf of prunableCandidates) {
1746
1778
  if (emittedPruned.has(rf)) continue
@@ -1,7 +1,6 @@
1
1
  import { createRequire } from 'node:module'
2
2
  import path from 'node:path'
3
- import { prepareExpoNativeWorkspace } from './expo-native-workspace'
4
- import { readIosAppTarget } from './native-app-identity-project'
3
+ import { prepareNativeAppRoot } from './expo-native-workspace'
5
4
  import {
6
5
  compiledModuleAssets,
7
6
  compiledModuleRequestHandler,
@@ -36,9 +35,9 @@ export async function compileTurboApp(
36
35
  // the runtime archive is built against the published distribution, as the
37
36
  // Nitro adapter is
38
37
  const module = moduleRoot ?? (await swiftDistributionRoot())
39
- const projectRoot = readIosAppTarget(appRoot, iosTarget)
40
- ? appRoot
41
- : (await prepareExpoNativeWorkspace(appRoot)).app
38
+ // the app's own committed ios directory has no installed pods: the compile
39
+ // reads the prepared workspace, as the Nitro compile does
40
+ const projectRoot = await prepareNativeAppRoot(appRoot)
42
41
  const { artifact, collection } = await compileTurboModule({
43
42
  appRoot,
44
43
  reactNativeRoot: path.dirname(