peachsim 0.1.2412 → 0.1.2421

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 (140) hide show
  1. package/README.md +1 -1
  2. package/cli/catalog/content.ts +6 -3
  3. package/cli/catalog/meta.ts +63 -17
  4. package/cli/catalog/routes.ts +4 -0
  5. package/cli/cloud-box-artifact.ts +45 -24
  6. package/cli/cloud-client.ts +6 -2
  7. package/cli/command-registry.ts +3 -1
  8. package/cli/commands/control.ts +74 -55
  9. package/cli/commands/desktop.ts +3 -3
  10. package/cli/commands/electron.ts +7 -5
  11. package/cli/commands/kotlin.ts +8 -1
  12. package/cli/commands/platform.ts +5 -7
  13. package/cli/commands/profile.ts +2 -2
  14. package/cli/commands/settings.ts +90 -0
  15. package/cli/commands/shell-url.ts +18 -10
  16. package/cli/commands/swift.ts +3 -1
  17. package/cli/main.ts +6 -0
  18. package/cli/outbound-endpoints.ts +17 -15
  19. package/cli/settings-flags.ts +115 -0
  20. package/dist-lib/agent-daemon-client.cjs +1 -1
  21. package/dist-lib/agent-events.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +1 -1
  28. package/dist-lib/bridge-contract-input.cjs +1 -1
  29. package/dist-lib/bridge-contract-input.mjs +1 -1
  30. package/dist-lib/bridge-contract.cjs +1 -1
  31. package/dist-lib/bridge-contract.mjs +1 -1
  32. package/dist-lib/bundle-channel.cjs +3606 -1815
  33. package/dist-lib/capture-contract.cjs +1 -1
  34. package/dist-lib/capture-contract.mjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +1 -1
  36. package/dist-lib/cloud-contract.mjs +1 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +1 -1
  40. package/dist-lib/cloud.mjs +1 -1
  41. package/dist-lib/config.cjs +3 -7
  42. package/dist-lib/config.mjs +3 -7
  43. package/dist-lib/detox/index.cjs +4 -4
  44. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  45. package/dist-lib/expo-swift-bundle.cjs +17049 -15297
  46. package/dist-lib/expo-swift-metadata.cjs +1 -1
  47. package/dist-lib/expo-swift-metadata.mjs +1 -1
  48. package/dist-lib/home-paths.cjs +1 -1
  49. package/dist-lib/host/bridge-host.cjs +63367 -62445
  50. package/dist-lib/host/fetch-proxy-handler.cjs +1598 -211
  51. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  52. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  53. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  54. package/dist-lib/host/websocket-proxy.cjs +1 -1
  55. package/dist-lib/index.cjs +2704 -1213
  56. package/dist-lib/jump-to-source-babel.cjs +1 -1
  57. package/dist-lib/jump-to-source-native.cjs +1 -1
  58. package/dist-lib/kotlin-host.cjs +972 -246
  59. package/dist-lib/menu.cjs +1 -1
  60. package/dist-lib/menu.mjs +1 -1
  61. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  62. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  63. package/dist-lib/metro-production-bundle.cjs +1 -1
  64. package/dist-lib/metro-production-bundle.mjs +1 -1
  65. package/dist-lib/metro.cjs +1737 -246
  66. package/dist-lib/native-app-identity-project.cjs +35 -203
  67. package/dist-lib/native-app-identity-project.mjs +35 -203
  68. package/dist-lib/native-app-identity.cjs +1 -1
  69. package/dist-lib/native-app-identity.mjs +1 -1
  70. package/dist-lib/native-firebase-metadata.cjs +1 -1
  71. package/dist-lib/native-firebase-metadata.mjs +1 -1
  72. package/dist-lib/pdfium-raster.cjs +1 -1
  73. package/dist-lib/pdfium-raster.mjs +1 -1
  74. package/dist-lib/plist.cjs +1 -1
  75. package/dist-lib/plist.mjs +1 -1
  76. package/dist-lib/profiles.cjs +1 -1
  77. package/dist-lib/public-brand.cjs +1 -1
  78. package/dist-lib/public-origins-lib-esm.json +26 -24
  79. package/dist-lib/public-origins-lib.json +198 -117
  80. package/dist-lib/react-native-host-modules.cjs +1 -1
  81. package/dist-lib/react-native-host-modules.mjs +1 -1
  82. package/dist-lib/reap-browser.cjs +1 -1
  83. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  84. package/dist-lib/sdk.cjs +1 -1
  85. package/dist-lib/sdk.mjs +1 -1
  86. package/dist-lib/skills.cjs +21665 -20508
  87. package/dist-lib/swift-compile.cjs +48 -228
  88. package/dist-lib/swift-compile.mjs +48 -228
  89. package/dist-lib/swift-package.cjs +1 -1
  90. package/dist-lib/swift-package.mjs +1 -1
  91. package/dist-lib/swift-submit.cjs +1 -1
  92. package/dist-lib/swift-submit.mjs +1 -1
  93. package/dist-lib/swift-toolchain.cjs +1 -199
  94. package/dist-lib/swift.cjs +1 -1
  95. package/dist-lib/vite-swift.cjs +126 -247
  96. package/dist-lib/vite.cjs +5240 -3788
  97. package/dist-lib/worklet-executable.cjs +1 -1
  98. package/dist-lib/worklet-executable.mjs +1 -1
  99. package/dist-types/packages/peach-engine/src/config.d.ts +1 -4
  100. package/kotlin/README.md +4 -3
  101. package/kotlin/sdk.tar.gz +0 -0
  102. package/kotlin/toolchain.json +3 -6
  103. package/package.json +1 -1
  104. package/runtime-companion.json +1 -1
  105. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1 -43
  106. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayerContents.h +55 -0
  107. package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Modules/module.modulemap +3 -3
  108. package/sdk/ios/usr/include/ObjectiveC.apinotes +0 -24
  109. package/sdk/ios/usr/include/grp.h +93 -0
  110. package/sdk/ios/usr/include/netinet/tcp.h +299 -0
  111. package/sdk/ios/wasm/include/netinet/tcp.h +6 -0
  112. package/sdk/ios/wasm/include/stdlib.h +1 -0
  113. package/sdk/ios/wasm/include/unistd.h +2 -0
  114. package/skills/contrast/SKILL.md +1 -0
  115. package/skills/peach-setup/SKILL.md +11 -1
  116. package/src/android-bridge-dependencies.ts +1 -1
  117. package/src/app-config.ts +7 -0
  118. package/src/binaryen.lock.json +21 -0
  119. package/src/cocoapods-trunk.ts +52 -0
  120. package/src/config.ts +21 -31
  121. package/src/kotlin-host.ts +1 -1
  122. package/src/kotlin-sdk.ts +7 -7
  123. package/src/kotlin-toolchain.ts +28 -24
  124. package/src/kotlinSdkContract.ts +2 -2
  125. package/src/native-bundles.ts +5 -2
  126. package/src/native-static-libraries.ts +38 -5
  127. package/src/podfile-cocoapods.ts +1473 -0
  128. package/src/podspec-cocoapods.ts +331 -106
  129. package/src/podspec-ruby-stdlib.ts +134 -19
  130. package/src/podspec-ruby.ts +199 -46
  131. package/src/settingsContract.ts +74 -0
  132. package/src/swift-compile.ts +1 -1
  133. package/src/swift-compiler-digest.ts +1 -0
  134. package/src/swift-host.ts +32 -7
  135. package/src/swift-packages.ts +35 -6
  136. package/src/swift-shared-sdk.ts +19 -0
  137. package/src/swift-toolchain.ts +2 -201
  138. package/src/turbo-source.ts +7 -37
  139. package/src/wasm-optimize.ts +4 -27
  140. package/src/xcode-project.ts +6 -1
package/src/swift-host.ts CHANGED
@@ -886,15 +886,22 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
886
886
  )
887
887
  const sourceFrameworks = new Map(
888
888
  packages.sourceFrameworks.map(
889
- ({ packageTarget, project, target, configuration, machOType }) => {
889
+ ({
890
+ packageTarget,
891
+ project,
892
+ target,
893
+ module,
894
+ configuration,
895
+ machOType,
896
+ settings,
897
+ }) => {
890
898
  const framework = readXcodeAppTarget(project, target, configuration, {
891
899
  prepareGeneratedSources: true,
892
900
  frameworkMachOType: machOType,
901
+ frameworkBuildSettings: settings,
893
902
  })
894
- if (framework.moduleName !== target || framework.allSources.length === 0)
895
- throw new Error(
896
- `${project}: ${target} did not produce its declared source module`,
897
- )
903
+ if (framework.moduleName !== module || framework.allSources.length === 0)
904
+ throw new Error(`${project}: ${target} did not produce source module ${module}`)
898
905
  if (
899
906
  framework.linkedProducts.length > 0 ||
900
907
  framework.binaryFrameworks.some(({ path }) => path)
@@ -907,10 +914,28 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
907
914
  ),
908
915
  )
909
916
  const frameworkTargets = [...sourceFrameworks.values()]
917
+ const packageFrameworkSearchPaths = frameworkTargets.flatMap(
918
+ ({ objc }) => objc?.frameworkSearchPaths.slice(0, 1) ?? [],
919
+ )
920
+ const withPackageFrameworks = <T extends XcodeModuleTarget>(target: T): T =>
921
+ target.objc && packageFrameworkSearchPaths.length > 0
922
+ ? {
923
+ ...target,
924
+ objc: {
925
+ ...target.objc,
926
+ frameworkSearchPaths: [
927
+ ...new Set([
928
+ ...target.objc.frameworkSearchPaths,
929
+ ...packageFrameworkSearchPaths,
930
+ ]),
931
+ ],
932
+ },
933
+ }
934
+ : target
910
935
  const app = {
911
- ...appTarget,
936
+ ...withPackageFrameworks(appTarget),
912
937
  frameworks: [
913
- ...appTarget.frameworks,
938
+ ...appTarget.frameworks.map(withPackageFrameworks),
914
939
  ...frameworkTargets.flatMap((framework) => [...framework.frameworks, framework]),
915
940
  ],
916
941
  projectFiles: [
@@ -102,8 +102,10 @@ export interface SwiftPackages {
102
102
  packageTarget: string
103
103
  project: string
104
104
  target: string
105
+ module: string
105
106
  configuration: string
106
107
  machOType: 'staticlib' | 'mh_dylib'
108
+ settings?: Readonly<Record<string, string>>
107
109
  }[]
108
110
  /** linked products peach cannot compile. */
109
111
  unavailable: Map<string, SwiftPackageGap>
@@ -175,18 +177,43 @@ export const SWIFT_PLACEHOLDER_PACKAGES: ReadonlyMap<string, string> = new Map<
175
177
  const placeholderPackage = (pkg: LoadedPackage) =>
176
178
  SWIFT_PLACEHOLDER_PACKAGES.get(swiftPackageIdentity(pkg.manifest.dir))
177
179
 
178
- // sentry's release script builds the static archive with this xcode target.
179
- const sourceFrameworkRecipes = new Map([
180
+ // each archive is bound to the source revision and xcode target used by its release.
181
+ const sourceFrameworkRecipes = new Map<
182
+ string,
183
+ Omit<SwiftPackages['sourceFrameworks'][number], 'packageTarget'> & { revision: string }
184
+ >([
180
185
  [
181
186
  '438de2c5afb7dde20b640af35dd841961aa2aa4d2719e40c92d48bd2aa5dca56',
182
187
  {
183
188
  revision: 'a49e7c2148ac9e38bd35ef4f13bc9d6ea3ff0b81',
184
189
  project: 'Sentry.xcodeproj',
185
190
  target: 'Sentry',
191
+ module: 'Sentry',
186
192
  configuration: 'Release',
187
193
  machOType: 'staticlib',
188
- } satisfies Omit<SwiftPackages['sourceFrameworks'][number], 'packageTarget'> & {
189
- revision: string
194
+ },
195
+ ],
196
+ [
197
+ '780558374b95d370e8b604097f9ccb2cac328fdd18c4b8542a58ece83d2548d2',
198
+ {
199
+ revision: '5421f94cc859eb65f5ae3866165a053aa634431e',
200
+ project: 'Sentry.xcodeproj',
201
+ target: 'Sentry',
202
+ module: 'Sentry',
203
+ configuration: 'Release',
204
+ machOType: 'staticlib',
205
+ settings: { CARTHAGE: 'YES' },
206
+ },
207
+ ],
208
+ [
209
+ '159842b63ab14ed1615fcace752c57b2633b3d3be6fadd4f643a1c8323b70e48',
210
+ {
211
+ revision: '5561a15a4836efe5d068a366b60599b7b794af70',
212
+ project: 'Simperium.xcodeproj',
213
+ target: 'Simperium_iOS',
214
+ module: 'Simperium',
215
+ configuration: 'Release',
216
+ machOType: 'mh_dylib',
190
217
  },
191
218
  ],
192
219
  ])
@@ -870,13 +897,15 @@ export function resolveSwiftPackages(options: {
870
897
  const recipe = target.checksum
871
898
  ? sourceFrameworkRecipes.get(target.checksum)
872
899
  : undefined
873
- if (recipe && pkg.revision === recipe.revision && name === recipe.target) {
900
+ if (recipe && pkg.revision === recipe.revision && name === recipe.module) {
874
901
  sourceFrameworks.set(key, {
875
902
  packageTarget: path.join(pkg.manifest.dir, '#target', name),
876
903
  project: path.join(pkg.manifest.dir, recipe.project),
877
- target: name,
904
+ target: recipe.target,
905
+ module: recipe.module,
878
906
  configuration: recipe.configuration,
879
907
  machOType: recipe.machOType,
908
+ settings: recipe.settings,
880
909
  })
881
910
  providedTargets.delete(name)
882
911
  return true
@@ -261,6 +261,7 @@ export function swiftSharedSdkViewOptions(
261
261
  .filter((entry) => entry.isFile())
262
262
  .map((entry) => path.join(entry.parentPath, entry.name))
263
263
  .sort()
264
+ const hasDarwinTcp = overlayFiles.includes(path.join(overlay, 'netinet/tcp.h'))
264
265
  const key = JSON.stringify([
265
266
  // bump the recipe when the transformation changes; bundling changes function text.
266
267
  'v25',
@@ -270,6 +271,7 @@ export function swiftSharedSdkViewOptions(
270
271
  frameworks,
271
272
  overlayFiles,
272
273
  swiftSdkOptions(),
274
+ ...(hasDarwinTcp ? ['darwin-tcp-module'] : []),
273
275
  ])
274
276
  const cached = sdkViews.get(key)
275
277
  if (cached && fs.existsSync(cached.manifest)) return touchSdkView(cached.options)
@@ -390,6 +392,23 @@ export function swiftSharedSdkViewOptions(
390
392
  fs.mkdirSync(path.dirname(destination), { recursive: true })
391
393
  fs.symlinkSync(shared, destination)
392
394
  }
395
+ if (hasDarwinTcp) {
396
+ // older sdk maps load musl's incompatible tcphdr into SwiftWASILibc.
397
+ const moduleMap = path.join(
398
+ staging,
399
+ path.relative(realRoot, sysroot),
400
+ 'darwin/wasm/include/module.modulemap',
401
+ )
402
+ const original = fs.readFileSync(moduleMap, 'utf8')
403
+ const updated = original.replace(
404
+ '"../../../include/wasm64-wasip1/netinet/tcp.h"',
405
+ '"netinet/tcp.h"',
406
+ )
407
+ if (updated !== original) {
408
+ fs.unlinkSync(moduleMap)
409
+ fs.writeFileSync(moduleMap, updated)
410
+ }
411
+ }
393
412
  const foundationArchive = path.join(
394
413
  path.dirname(sysroot),
395
414
  'swift.xctoolchain/usr/lib/swift_static/wasi/libFoundation.a',
@@ -46,9 +46,8 @@ export interface SwiftHostCompilerPin {
46
46
  hosts: Record<string, { checksum: string; manifest: string }>
47
47
  }
48
48
 
49
- // retain qualification for the published distribution while source builds
50
- // advance. an installed CLI adds the compiler its runtime pins
51
- // (registerSwiftHostCompiler).
49
+ // keep the checkout, distribution lock, and live canary index compilers.
50
+ // installed CLIs register the compiler carried by their own runtime.
52
51
  const compilerArchives: Record<string, SwiftHostCompilerPin> = {
53
52
  'swift-6.4.0-RELEASE-custom-cbd9cef4b408cc96': {
54
53
  identity: 'cbd9cef4b408cc96',
@@ -86,24 +85,6 @@ const compilerArchives: Record<string, SwiftHostCompilerPin> = {
86
85
  },
87
86
  },
88
87
  },
89
- 'swift-6.4.0-RELEASE-custom-44ecd25f163bb359': {
90
- identity: '44ecd25f163bb359',
91
- archive: 'tar.zst',
92
- hosts: {
93
- 'darwin-arm64': {
94
- checksum: 'd06dda4435f99d8376179cc7a3804907aa7305513135ece6288fd8e6d4695ae6',
95
- manifest: 'bc0d8b955f923f096dda2aa8bbb1d56176a73f3d4a4df4cc9a1f59d31417061a',
96
- },
97
- 'linux-x64': {
98
- checksum: 'f95b56440693c5de7995f10ea14c57fc7e659a161018a17f17a74b61a98e88a4',
99
- manifest: 'c18a60b14d5c89a8b2e1dbb2b4b52342c5fb92c7f3069fdc55c985bce61683a7',
100
- },
101
- 'linux-arm64': {
102
- checksum: 'afb74ae60df2b5bd7792bfbcf29bcea03675a5c814b758dd6cb91a760c220cd2',
103
- manifest: 'ac037f6b0fdc4a6ae582eebc22bcf811fa2becdc30d083057137fc857f3c456a',
104
- },
105
- },
106
- },
107
88
  'swift-6.4.0-RELEASE-custom-11345d60dca47496': {
108
89
  identity: '11345d60dca47496',
109
90
  archive: 'tar.zst',
@@ -122,186 +103,6 @@ const compilerArchives: Record<string, SwiftHostCompilerPin> = {
122
103
  },
123
104
  },
124
105
  },
125
- 'swift-6.4.0-RELEASE-custom-45bb46301c86fe73': {
126
- identity: '45bb46301c86fe73',
127
- archive: 'tar.gz',
128
- hosts: {
129
- 'darwin-arm64': {
130
- checksum: '102dfbbb7b451be0685763b7a427284b75a8078874543f091b1c4b3db86e6565',
131
- manifest: 'fb6c4d75ef6f4b3c094ae5a4d5d1e6bdfd85431f3fe25d514f3e7a0b4add60ef',
132
- },
133
- 'linux-x64': {
134
- checksum: 'd3c040e042e12ff787b64bfde1d85238254365036ce093f3b20ff86e8ff996f0',
135
- manifest: '7c7144be591692e563396fe3c987c5aa56fbaea4faacaad62283c0c6e5c04ae2',
136
- },
137
- 'linux-arm64': {
138
- checksum: '604e6fc5fc0f5a93cee3ca6dfa9616244a2a49ef517caa3155a12ae4a0ecf72b',
139
- manifest: '075fd53d03ecf099954f1d023bb4bb67a5c5ee946537466d6c105022bdf8ecde',
140
- },
141
- },
142
- },
143
- 'swift-6.4.0-RELEASE-custom-0b2d0a9011c88e66': {
144
- identity: '0b2d0a9011c88e66',
145
- archive: 'tar.gz',
146
- hosts: {
147
- 'darwin-arm64': {
148
- checksum: 'dc6a494227297ea657e8e5f7c5b4a861cb5e142bdbcfcb028ace2aeb19db90cc',
149
- manifest: 'd8e9eee0fb9b847f1e9350525d6c68606df46101745f553332309ed026b3c26a',
150
- },
151
- 'linux-x64': {
152
- checksum: '85c04b4496aea1657c21a47f448e01d6ccc1c7920d130a566db37fb8350a7be2',
153
- manifest: '8451659e74235ad53b700c1afbe293512197900eb98cb1f79e36df2f5c85d511',
154
- },
155
- 'linux-arm64': {
156
- checksum: '196606ed62c5c926d18e6ef0769cb1ab21c9943f9084070ddf14a7bc696768b8',
157
- manifest: '85fb8d5b6527bd75003a6dbd25b68b22540665cf9df9b13f41f82e5d8acdbf1d',
158
- },
159
- },
160
- },
161
- 'swift-6.4.0-RELEASE-custom-f7c03c3f59ec5d83': {
162
- identity: 'f7c03c3f59ec5d83',
163
- archive: 'tar.gz',
164
- hosts: {
165
- 'darwin-arm64': {
166
- checksum: '8946a2d4716d3b0784cef7a85a35f66537bd319c4c5a48c63457d607260df5c5',
167
- manifest: '2a7754e6e365bf71ae6b6aefbbd810123795c73d43fb902a8a972d009d72790f',
168
- },
169
- 'linux-x64': {
170
- checksum: '5ffa3b54d54583c1d6a38b708693072db4d088ba4bf5966b17014c068b2db641',
171
- manifest: '1b23ea52c5570de4697481a54bd0b0a0bcd6b54feccb7b0bb940d3643dec82cb',
172
- },
173
- 'linux-arm64': {
174
- checksum: '29b0b97b7b0db4475dbe55f7011e57f493fed9f3482a6705becebd8b68c90bab',
175
- manifest: '3fdab1132715f5899de1bb1d7ddcd52cf540295ab86586c72f49502f37a403a1',
176
- },
177
- },
178
- },
179
- 'swift-6.4.0-RELEASE-custom-3e3dca8fd1d82975': {
180
- identity: '3e3dca8fd1d82975',
181
- archive: 'tar.gz',
182
- hosts: {
183
- 'darwin-arm64': {
184
- checksum: 'dfad56454f5e1e465071ff708bf485be65b438cf55d02b04d26d17d26df9f54a',
185
- manifest: '82c35e43ed81101bea500100356a555d8266e1987d5ca7605aaa4df747c38f81',
186
- },
187
- 'linux-x64': {
188
- checksum: 'd3f5908d097fdc1337ff979114e605bcc758052e32f9d5d760574153d58ce6db',
189
- manifest: 'a03caf181177f3d68a45b5246d0f0a26d8a5fa9ff33cf44c44e6942b73363bae',
190
- },
191
- 'linux-arm64': {
192
- checksum: '8fceafca152dd0692aa6bb51236fc362a4caeeef37fc22cb5ef6aa3d0d5b3df3',
193
- manifest: '3115bc496fd8e907a16992dfc5c85b3e0798d3b58ddf1d6dace63842aed8e53b',
194
- },
195
- },
196
- },
197
- 'swift-6.4.0-RELEASE-custom-b082ac5437336790': {
198
- identity: 'b082ac5437336790',
199
- archive: 'tar.gz',
200
- hosts: {
201
- 'darwin-arm64': {
202
- checksum: '85e601982321d3a6f81f05928bc9bbe7a61bc75b27ce24508e79f6b5b537254d',
203
- manifest: 'c889a70c6bba48eb0e5e218a5c0077eb557082fed5c5c58d10f07a941975080e',
204
- },
205
- 'linux-x64': {
206
- checksum: '54c7988622d201e4ba6c83ca75e7b28c658b39cf1ea8b95ea88807afe33aa465',
207
- manifest: 'bfd725c3b07a3624bb44c8e3a1b7ddf1eddde4fc9565e23740a9cee832c94583',
208
- },
209
- 'linux-arm64': {
210
- checksum: 'bd729fd73dc9953306eafd87eda79462b836b3cb127c73108327d7256b15f501',
211
- manifest: 'e7f8827cca0f249a5b4a4750f6324f75633b374985fa0b93e650ee8bfcabeb39',
212
- },
213
- },
214
- },
215
- 'swift-6.4.0-RELEASE-custom-9cdaffdb6b37fb47': {
216
- identity: '9cdaffdb6b37fb47',
217
- archive: 'tar.gz',
218
- hosts: {
219
- 'darwin-arm64': {
220
- checksum: 'fdd3f88cf76a8dc2083275d4253255030068a25b5ba68acbf59e0407c45677dd',
221
- manifest: 'f50c68faf91f7d2a6ea5bcd4da4573a49dd00ad9f334b27d3f9ddb08b65e46cc',
222
- },
223
- 'linux-x64': {
224
- checksum: 'f29f9efc598b17f33d802467676ba282441a8c3c6fa67e307c4a1e6130509d73',
225
- manifest: 'f907727c5a4af58ccad7ccbb043a21289d7eb37d166536a90b3c3848f95df816',
226
- },
227
- 'linux-arm64': {
228
- checksum: '7d4a8a1f90dd6c86804ceb43f8b9cf680b9778d4640a2eb6da5cb333a599f23a',
229
- manifest: 'a3224cd5c09a92f66cacd0395058b2c43fa103a92bb168280132bbd0febd1575',
230
- },
231
- },
232
- },
233
- 'swift-6.4.0-RELEASE-custom-bd49e2f77434e7b1': {
234
- identity: 'bd49e2f77434e7b1',
235
- archive: 'tar.gz',
236
- hosts: {
237
- 'darwin-arm64': {
238
- checksum: 'e815b06394566e8125475afc8f1807f7f465318c845549c5831043cdc28eca64',
239
- manifest: '6e3ae00102c67f2f9761b1462aab63580f2ca010469300a7c4a620765573e4e0',
240
- },
241
- 'linux-x64': {
242
- checksum: '9336e0b0aefaa0171799d4b5d4215c711a24c79ac9e91baa362ba100fc22534f',
243
- manifest: '3802c631f593eda1d79dc4af55a8667356eece954d2ea59b62b1f8f981fa538e',
244
- },
245
- 'linux-arm64': {
246
- checksum: '851b5a756472ad53d833e8f0ab3ae55c05d3e6b49871bb982c977b7582cc117f',
247
- manifest: '4162656192a2881e5ccc763e3e66ce46646a84ff42cdf2de50bd6424ebac5e34',
248
- },
249
- },
250
- },
251
- 'swift-6.4.0-RELEASE-custom-13450179a7e01c81': {
252
- identity: '13450179a7e01c81',
253
- archive: 'tar.gz',
254
- hosts: {
255
- 'darwin-arm64': {
256
- checksum: 'a29be6b722f15c7aafac26ba5703a7392f49ce7ea5e1c56548846b7e458290f7',
257
- manifest: '9d89bc39d80d13c8bdb93ad5c306bb87e83bac34090f9bcec57476fd90a6a115',
258
- },
259
- 'linux-x64': {
260
- checksum: 'b9e9e3ed855f6a8c85f5fe24016b83792a0088e2d0ea632482426c4dc6031b98',
261
- manifest: '5de3bb6bf131e68862539195fbb4fce9d4de2b528fa882495b27fd4bdd02e5ab',
262
- },
263
- 'linux-arm64': {
264
- checksum: '844f5ead2854d4ac2d1fc9fb13c366450a2ed4b8fa641719822d74f9150575b4',
265
- manifest: '1fcfb353679186a3e631b83085e5e8c3dde8cb32d25052b3c8b7896339a4378b',
266
- },
267
- },
268
- },
269
- 'swift-6.4.0-RELEASE-custom-f6868fa6054e83d6': {
270
- identity: 'f6868fa6054e83d6',
271
- archive: 'tar.gz',
272
- hosts: {
273
- 'darwin-arm64': {
274
- checksum: 'bd80c2f35864ec29883dd22001d0165821e80d78002fc12f92406c3c708694a4',
275
- manifest: 'daad0da2a296084307769b59719dbe83e45755871438fad129b20421b111657b',
276
- },
277
- 'linux-x64': {
278
- checksum: '39707ef599835ae2d9ce5aea026b7a96d43e51b4c4dcd2ca62d5fc11c520e871',
279
- manifest: '065405edd9b02a84ce01c09e68531834dbe190232e6387b056a481354c44fe81',
280
- },
281
- 'linux-arm64': {
282
- checksum: 'a91f2947d560b49b56334938d0efdcb22286557da63d65389129030b2a4e146d',
283
- manifest: '4dfbc167c96f30c7de19cc280948786fb79a888b666ca200b0788803902361ce',
284
- },
285
- },
286
- },
287
- 'swift-6.4.0-RELEASE-custom-a560ff35bf882b5c': {
288
- identity: 'a560ff35bf882b5c',
289
- archive: 'tar.zst',
290
- hosts: {
291
- 'darwin-arm64': {
292
- checksum: '36c50bcdfba88a4c0989af0bd60371497eb4403aa7b80644b479fa509a2187a9',
293
- manifest: '253e891527d2213f54eace768b902de89de5e9495a3c5f4018de1985516bd553',
294
- },
295
- 'linux-x64': {
296
- checksum: 'ba25da9182314fc7b7dd2fc041280e1c7b409f80a1fbccdfa5c342669d164c8e',
297
- manifest: '6f951cc4071dd0d6054d85711a7c5fe272273658847831b477a8b24be7254ca0',
298
- },
299
- 'linux-arm64': {
300
- checksum: '5f0f4456e9fe22b5486025db9f679c865841660797d71761245291c2c6811c20',
301
- manifest: 'b6f62fca2ec37593e274ee5bac474f21ffc5db14cd82f492ccbc774f8e9b75d8',
302
- },
303
- },
304
- },
305
106
  [SWIFT_HOST_COMPILER_RELEASE]: {
306
107
  identity: SWIFT_HOST_COMPILER_ID,
307
108
  archive: 'tar.gz',
@@ -12,6 +12,7 @@ import { createHash } from 'node:crypto'
12
12
  import fs from 'node:fs'
13
13
  import path from 'node:path'
14
14
  import { promisify } from 'node:util'
15
+ import { trunkSpecificationFile, trunkVersions } from './cocoapods-trunk'
15
16
  import { rnxHomeDir } from './home-paths'
16
17
  import { installedNativeSources } from './installed-native-libraries'
17
18
 
@@ -534,7 +535,6 @@ async function resolveExternalTurboPod(
534
535
  /** the pod's own GCC_PREPROCESSOR_DEFINITIONS, which CocoaPods builds it with */
535
536
  defines: string[]
536
537
  } | null> {
537
- const shard = createHash('md5').update(name).digest('hex').slice(0, 3).split('')
538
538
  const baseDir = path.join(rnxHomeDir(), 'turbo-pods')
539
539
  const [only] = requirements
540
540
  let version =
@@ -543,44 +543,14 @@ async function resolveExternalTurboPod(
543
543
  ? only!.trim()
544
544
  : undefined
545
545
  if (!version) {
546
- const versionsFile = path.join(baseDir, 'versions', `${shard.join('_')}.txt`)
547
- let versionsText: string
548
- if (fs.existsSync(versionsFile)) {
549
- versionsText = fs.readFileSync(versionsFile, 'utf8')
550
- } else {
551
- const res = await fetch(
552
- `https://cdn.cocoapods.org/all_pods_versions_${shard.join('_')}.txt`,
553
- )
554
- if (!res.ok) return null
555
- versionsText = await res.text()
556
- fs.mkdirSync(path.dirname(versionsFile), { recursive: true })
557
- fs.writeFileSync(versionsFile, versionsText)
558
- }
559
- const line = versionsText.split('\n').find((entry) => entry.startsWith(`${name}/`))
560
- if (!line) return null
561
- version = satisfyingPodVersion(
562
- line
563
- .slice(name.length + 1)
564
- .split('/')
565
- .filter(Boolean),
566
- requirements,
567
- )
546
+ const published = await trunkVersions(name)
547
+ if (!published) return null
548
+ version = satisfyingPodVersion(published, requirements)
568
549
  if (!version) return null
569
550
  }
570
- const specFile = path.join(baseDir, 'specs', `${name}-${version}.podspec.json`)
571
- let specText: string
572
- if (fs.existsSync(specFile)) {
573
- specText = fs.readFileSync(specFile, 'utf8')
574
- } else {
575
- const res = await fetch(
576
- `https://cdn.cocoapods.org/Specs/${shard.join('/')}/${name}/${version}/${name}.podspec.json`,
577
- )
578
- if (!res.ok) return null
579
- specText = await res.text()
580
- fs.mkdirSync(path.dirname(specFile), { recursive: true })
581
- fs.writeFileSync(specFile, specText)
582
- }
583
- const spec: unknown = JSON.parse(specText)
551
+ const spec: unknown = JSON.parse(
552
+ fs.readFileSync(await trunkSpecificationFile(name, version), 'utf8'),
553
+ )
584
554
  if (!object(spec)) return null
585
555
  const source = object(spec.source) ? spec.source : null
586
556
  const gitUrl = typeof source?.git === 'string' ? source.git : null
@@ -4,6 +4,7 @@ import { dirname, join } from 'node:path'
4
4
  import { promisify } from 'node:util'
5
5
  import { installVerifiedTarball } from '@contrast/runtime-delivery'
6
6
  import { windowAdmission } from './admitted-mac-build'
7
+ import binaryenLock from './binaryen.lock.json' with { type: 'json' }
7
8
  import { rnxHomeDir } from './home-paths'
8
9
  import {
9
10
  dropBoundaryExports,
@@ -35,36 +36,13 @@ const FEATURES = [
35
36
  export const KEEP_WASM_NAMES = process.env.PEACH_SWIFT_NAMES === '1'
36
37
 
37
38
  const LOWERING = ['--memory64-lowering', '--table64-lowering']
38
- const BINARYEN_VERSION = '132'
39
+ const BINARYEN_VERSION = binaryenLock.version
39
40
  const runBinaryen = promisify(execFile)
40
41
 
41
42
  /** feeds the artifact hash: a new optimizer or flag set is a new artifact. */
42
43
  export const WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(' ')} ${FEATURES.join(',')} unoptimized-names`
43
44
 
44
- // the sha256 of each supported Binaryen release archive
45
- const BINARYEN_RELEASES = new Map([
46
- [
47
- 'linux-x64',
48
- {
49
- asset: 'x86_64-linux',
50
- sha256: '195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572',
51
- },
52
- ],
53
- [
54
- 'linux-arm64',
55
- {
56
- asset: 'aarch64-linux',
57
- sha256: 'c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f',
58
- },
59
- ],
60
- [
61
- 'darwin-arm64',
62
- {
63
- asset: 'arm64-macos',
64
- sha256: '98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa',
65
- },
66
- ],
67
- ])
45
+ const BINARYEN_RELEASES = new Map(Object.entries(binaryenLock.platforms))
68
46
 
69
47
  // skipPasses names Binaryen passes to leave out. a guest link with several images
70
48
  // skips duplicate-function-elimination, which would merge identical functions
@@ -142,11 +120,10 @@ async function installWasmOpt(): Promise<string> {
142
120
  const binary = join(destDir, 'bin', 'wasm-opt')
143
121
  if (!existsSync(binary))
144
122
  await installVerifiedTarball({
145
- url: `https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-${release.asset}.tar.gz`,
123
+ url: `https://r2.rnxsim.com/peach/binaryen/${release.sha256}/${platform}.tar.gz`,
146
124
  digest: { algorithm: 'sha256', encoding: 'hex', value: release.sha256 },
147
125
  destDir,
148
126
  installedMarker: 'bin/wasm-opt',
149
- stripComponents: 1,
150
127
  label: `Binaryen ${BINARYEN_VERSION}`,
151
128
  })
152
129
  return binary
@@ -1998,6 +1998,7 @@ export function readXcodeAppTarget(
1998
1998
  nativeModules?: readonly string[]
1999
1999
  /** select the original framework target that builds a package's archive. */
2000
2000
  frameworkMachOType?: 'staticlib' | 'mh_dylib'
2001
+ frameworkBuildSettings?: Readonly<Record<string, string>>
2001
2002
  /**
2002
2003
  * throw when the project has remote packages and no lock. a read that
2003
2004
  * compiles sets it; one that only reads metadata leaves the graph empty.
@@ -2378,7 +2379,11 @@ export function readXcodeAppTarget(
2378
2379
  },
2379
2380
  options,
2380
2381
  ref === app && options.frameworkMachOType
2381
- ? { ...workspaceBuild, MACH_O_TYPE: options.frameworkMachOType }
2382
+ ? {
2383
+ ...workspaceBuild,
2384
+ ...options.frameworkBuildSettings,
2385
+ MACH_O_TYPE: options.frameworkMachOType,
2386
+ }
2382
2387
  : workspaceBuild,
2383
2388
  )
2384
2389
  for (const file of read) xcconfigs.add(file)