peachsim 0.1.1814 → 0.1.1817

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 (115) hide show
  1. package/cli/commands/control.ts +5 -2
  2. package/cli/commands/inspect.ts +43 -385
  3. package/cli/commands/package.ts +88 -32
  4. package/cli/commands/runtime.ts +2 -2
  5. package/cli/outbound-endpoints.ts +2 -2
  6. package/cli/packaged-app-launcher.ts +6 -1
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +5186 -5881
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +100 -16
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +3949 -4535
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +3724 -4482
  37. package/dist-lib/host/fetch-proxy-handler.cjs +25 -14
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +26 -36
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +26 -36
  53. package/dist-lib/native-app-identity-project.cjs +4 -23
  54. package/dist-lib/native-app-identity-project.mjs +4 -23
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +87 -76
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +4265 -4982
  74. package/dist-lib/swift-compile.cjs +218 -243
  75. package/dist-lib/swift-compile.mjs +218 -243
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +274 -251
  83. package/dist-lib/vite.cjs +25 -14
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-engine/src/engine/nativeReplayContract.d.ts +2 -0
  87. package/package.json +1 -1
  88. package/runtime-companion.json +1 -1
  89. package/src/answeredNativePackages.ts +41 -0
  90. package/src/cli-runtime.ts +34 -13
  91. package/src/expo-discovery-cache.ts +2 -0
  92. package/src/expo-kotlin-host.ts +11 -9
  93. package/src/expo-swift-host.ts +10 -6
  94. package/src/expo-swift-ready.ts +16 -2
  95. package/src/installed-native-libraries.ts +79 -18
  96. package/src/nitro-adapter.lock.json +240 -240
  97. package/src/nitro-bundle.ts +8 -6
  98. package/src/nitro-compile.ts +6 -3
  99. package/src/nitro-compiler-digest.ts +2 -4
  100. package/src/nitro-dependencies.ts +8 -2
  101. package/src/nitro-source.ts +34 -3
  102. package/src/nitro-superset.lock.json +21 -253
  103. package/src/nitro-superset.ts +59 -63
  104. package/src/nitroContract.ts +26 -3
  105. package/src/react-native-bridge-modules.ts +2 -4
  106. package/src/runtime-delivery.ts +2 -2
  107. package/src/swift-compile.ts +260 -255
  108. package/src/swift-distribution.lock.json +9 -8
  109. package/src/swift-installed-targets.ts +13 -0
  110. package/src/swift-objc-standin.ts +10 -6
  111. package/src/swift-standins.ts +44 -14
  112. package/src/turbo-bundle.ts +20 -1
  113. package/src/turbo-compile.ts +6 -12
  114. package/src/turbo-runtime.lock.json +19 -19
  115. package/src/turbo-source.ts +18 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1814 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1817 | (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;
@@ -7333,9 +7333,12 @@ ${text4}`
7333
7333
  );
7334
7334
  return [...headers, ...overlays].sort(([a], [b]) => a < b ? -1 : 1);
7335
7335
  }
7336
- var IOS_SDK_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
7336
+ var sdkId;
7337
+ function iosSdkId() {
7338
+ return sdkId ??= (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
7339
+ }
7337
7340
  function materializeObjcSdk(cacheDir5) {
7338
- const sdk = import_node_path7.default.join(cacheDir5, "ios-sdk", IOS_SDK_ID);
7341
+ const sdk = import_node_path7.default.join(cacheDir5, "ios-sdk", iosSdkId());
7339
7342
  if (import_node_fs7.default.existsSync(sdk)) return sdk;
7340
7343
  import_node_fs7.default.mkdirSync(import_node_path7.default.dirname(sdk), { recursive: true });
7341
7344
  const staging = import_node_fs7.default.mkdtempSync(`${sdk}-`);
@@ -11751,7 +11754,8 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
11751
11754
  TOCropViewController: [],
11752
11755
  RiveRuntime: ["MetalKit"],
11753
11756
  MetalKit: ["ModelIO"],
11754
- DatadogCore: [],
11757
+ DatadogInternal: [],
11758
+ DatadogCore: ["DatadogInternal"],
11755
11759
  DatadogLogs: ["DatadogCore"],
11756
11760
  DatadogRUM: ["DatadogCore"],
11757
11761
  DatadogTrace: ["DatadogCore"],
@@ -12103,7 +12107,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
12103
12107
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
12104
12108
  var MULTI_MANIFEST_VERSION = 65;
12105
12109
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
12106
- var compilerSourceDigest = true ? "d62fae69578799a35cdf0157f54acf3e1a0c1688de92c4c991c69287b9e562bb" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
12110
+ var compilerSourceDigest = true ? "1519f1f37c446535792f7bb0c9ba9c5e59b0b0f87d7b5c849346abe684325aa7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
12107
12111
  function swiftArtifactHash(input, release, moduleRoot) {
12108
12112
  const hash = (0, import_node_crypto8.createHash)("sha256");
12109
12113
  hash.update(`swift-compile
@@ -15843,245 +15847,239 @@ function compileSwiftProjectUnit(input, options) {
15843
15847
  `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
15844
15848
  );
15845
15849
  }
15846
- return withSwiftRootLock(
15847
- swiftFrameworkScratch(frameworkKey),
15848
- async (frameworkLease) => {
15849
- const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
15850
- report("preparing compiler plugins");
15851
- const macroPlugins = await ensureMacroPlugins(
15852
- frameworkRoot,
15853
- options.toolchainBin,
15854
- options.release,
15855
- options.signal,
15856
- frameworkLease
15857
- );
15858
- const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId;
15859
- const icu = swiftIcuAsset(options.toolchainBin, sdk);
15860
- const buildOptions = {
15861
- env: {
15862
- ...options.project?.env ?? process.env,
15863
- // shipped host plugins resolve against the selected compiler's runtime.
15864
- ...process.platform === "linux" ? {
15865
- LD_LIBRARY_PATH: [
15866
- import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/linux"),
15867
- import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/host"),
15868
- process.env.LD_LIBRARY_PATH
15869
- ].filter(Boolean).join(":")
15870
- } : {},
15871
- ...input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: "1" } : {}
15872
- },
15873
- maxBuffer: 64 * 1024 * 1024,
15874
- timeout: options.timeoutMs,
15875
- signal: options.signal,
15876
- lease,
15877
- frameworkLease
15878
- };
15879
- let prebuilt;
15880
- if (!swiftDistributionAt(moduleRoot)) {
15881
- report("compiling framework products");
15882
- prebuilt = await compileFrameworkProducts({
15883
- moduleRoot: frameworkRoot,
15884
- frameworkKey,
15885
- input,
15886
- swift,
15887
- sdk,
15888
- toolchainBin: options.toolchainBin,
15889
- plugins: macroPlugins,
15890
- buildOptions
15891
- });
15892
- await pruneFrameworkScratches(frameworkKey);
15893
- }
15894
- if (options.project) removeProjectLinks(root);
15895
- if (retireStaleSwiftLink(
15896
- root,
15897
- swiftLinkStamp({
15898
- frameworkKey,
15899
- prebuilt
15900
- })
15901
- ))
15902
- report("framework revision changed; rebuilding the app link");
15903
- const preparation = writeSwiftProject(
15904
- layout,
15850
+ const frameworkScratch = swiftFrameworkScratch(frameworkKey);
15851
+ const withFrameworkLock = (work) => distribution ? work() : withSwiftRootLock(frameworkScratch, work, options.signal);
15852
+ return withFrameworkLock(async (frameworkLease) => {
15853
+ const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
15854
+ report("preparing compiler plugins");
15855
+ const pluginsFor = (pluginLease) => ensureMacroPlugins(
15856
+ frameworkRoot,
15857
+ options.toolchainBin,
15858
+ options.release,
15859
+ options.signal,
15860
+ pluginLease
15861
+ );
15862
+ const macroPlugins = distribution ? await withSwiftRootLock(frameworkScratch, pluginsFor, options.signal) : await pluginsFor(frameworkLease);
15863
+ const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId;
15864
+ const icu = swiftIcuAsset(options.toolchainBin, sdk);
15865
+ const buildOptions = {
15866
+ env: {
15867
+ ...options.project?.env ?? process.env,
15868
+ // shipped host plugins resolve against the selected compiler's runtime.
15869
+ ...process.platform === "linux" ? {
15870
+ LD_LIBRARY_PATH: [
15871
+ import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/linux"),
15872
+ import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/host"),
15873
+ process.env.LD_LIBRARY_PATH
15874
+ ].filter(Boolean).join(":")
15875
+ } : {},
15876
+ ...input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: "1" } : {}
15877
+ },
15878
+ maxBuffer: 64 * 1024 * 1024,
15879
+ timeout: options.timeoutMs,
15880
+ signal: options.signal,
15881
+ lease,
15882
+ frameworkLease
15883
+ };
15884
+ let prebuilt;
15885
+ if (!distribution) {
15886
+ report("compiling framework products");
15887
+ prebuilt = await compileFrameworkProducts({
15888
+ moduleRoot: frameworkRoot,
15889
+ frameworkKey,
15905
15890
  input,
15906
- frameworkRoot,
15891
+ swift,
15892
+ sdk,
15893
+ toolchainBin: options.toolchainBin,
15894
+ plugins: macroPlugins,
15895
+ buildOptions
15896
+ });
15897
+ await pruneFrameworkScratches(frameworkKey);
15898
+ }
15899
+ if (options.project) removeProjectLinks(root);
15900
+ if (retireStaleSwiftLink(
15901
+ root,
15902
+ swiftLinkStamp({
15903
+ frameworkKey,
15907
15904
  prebuilt
15905
+ })
15906
+ ))
15907
+ report("framework revision changed; rebuilding the app link");
15908
+ const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt);
15909
+ writeSwiftAutolinkLinker(root, options.toolchainBin);
15910
+ const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
15911
+ const appOptions = projectProcess ? {
15912
+ ...buildOptions,
15913
+ uid: projectProcess.uid,
15914
+ gid: projectProcess.gid,
15915
+ confined: projectProcess.env
15916
+ } : buildOptions;
15917
+ const unprepared = preparation.targetFailures.map(
15918
+ (failure2) => `error: target ${failure2}`
15919
+ );
15920
+ const forwarders = /* @__PURE__ */ new Map();
15921
+ for (const [file, text4] of Object.entries(input.files)) {
15922
+ const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text4)?.[1];
15923
+ if (!parents) continue;
15924
+ const directory = import_node_path19.default.posix.dirname(file);
15925
+ forwarders.set(
15926
+ `${import_node_path19.default.join(root, directory)}/${parents.slice(0, -1)}`,
15927
+ import_node_path19.default.posix.join("build", directory, parents).replace(/\/$/, "")
15908
15928
  );
15909
- writeSwiftAutolinkLinker(root, options.toolchainBin);
15910
- const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
15911
- const appOptions = projectProcess ? {
15912
- ...buildOptions,
15913
- uid: projectProcess.uid,
15914
- gid: projectProcess.gid,
15915
- confined: projectProcess.env
15916
- } : buildOptions;
15917
- const unprepared = preparation.targetFailures.map(
15918
- (failure2) => `error: target ${failure2}`
15919
- );
15920
- const forwarders = /* @__PURE__ */ new Map();
15921
- for (const [file, text4] of Object.entries(input.files)) {
15922
- const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text4)?.[1];
15923
- if (!parents) continue;
15924
- const directory = import_node_path19.default.posix.dirname(file);
15925
- forwarders.set(
15926
- `${import_node_path19.default.join(root, directory)}/${parents.slice(0, -1)}`,
15927
- import_node_path19.default.posix.join("build", directory, parents).replace(/\/$/, "")
15929
+ }
15930
+ const buildArgs = [
15931
+ "build",
15932
+ ...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
15933
+ "--build-system",
15934
+ "native",
15935
+ "-j",
15936
+ BUILD_JOBS,
15937
+ "--package-path",
15938
+ root,
15939
+ ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
15940
+ "--swift-sdk",
15941
+ sdk,
15942
+ ...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
15943
+ "-c",
15944
+ "release",
15945
+ "-Xswiftc",
15946
+ "-num-threads",
15947
+ "-Xswiftc",
15948
+ BUILD_JOBS,
15949
+ ...swiftReproducibleBuildFlags([
15950
+ [import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
15951
+ [frameworkRoot, "framework"],
15952
+ [root, "build"],
15953
+ ...forwarders
15954
+ ]),
15955
+ ...macroPlugins.libraries.flatMap((plugin) => [
15956
+ "-Xswiftc",
15957
+ "-load-plugin-library",
15958
+ "-Xswiftc",
15959
+ plugin
15960
+ ]),
15961
+ ...macroPlugins.executables.flatMap((plugin) => [
15962
+ "-Xswiftc",
15963
+ "-load-plugin-executable",
15964
+ "-Xswiftc",
15965
+ `${plugin}#ExpoModulesMacros`
15966
+ ])
15967
+ ];
15968
+ const linked = builtArtifact(layout);
15969
+ if (input.lazyDistribution) {
15970
+ (0, import_node_fs18.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
15971
+ if ((0, import_node_fs18.existsSync)(linked) && (0, import_node_fs18.statSync)(linked).size <= 8)
15972
+ (0, import_node_fs18.rmSync)(linked, { force: true });
15973
+ }
15974
+ report("compiling and linking Swift modules");
15975
+ try {
15976
+ const headerBuilds = preparation.headerProductTarget ? [
15977
+ ...Object.keys(preparation.nativeHeaderDeclarations),
15978
+ preparation.headerProductTarget
15979
+ ] : preparation.headerProducers;
15980
+ for (const build of headerBuilds) {
15981
+ await runCompiler(
15982
+ swift,
15983
+ [...buildArgs, "--target", build],
15984
+ appOptions,
15985
+ SWIFTPM_PROGRESS,
15986
+ SWIFTPM_NOISE
15928
15987
  );
15988
+ for (const producer of build === preparation.headerProductTarget ? preparation.headerProducers : [build]) {
15989
+ const emitted = import_node_path19.default.join(
15990
+ root,
15991
+ ".build",
15992
+ "peach-cxx-headers",
15993
+ `${producer}-Swift.h`
15994
+ );
15995
+ const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
15996
+ if ((0, import_node_fs18.existsSync)(original))
15997
+ writeBuildFile(
15998
+ emitted,
15999
+ withoutSwiftDeclarations(
16000
+ clangInterfaceHeader((0, import_node_fs18.readFileSync)(original, "utf8")),
16001
+ new Set(preparation.nativeHeaderDeclarations[producer]),
16002
+ `#import <${producer}/${producer}.h>`
16003
+ )
16004
+ );
16005
+ }
15929
16006
  }
15930
- const buildArgs = [
15931
- "build",
15932
- ...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
15933
- "--build-system",
15934
- "native",
15935
- "-j",
15936
- BUILD_JOBS,
15937
- "--package-path",
16007
+ await runCompiler(
16008
+ swift,
16009
+ buildArgs,
16010
+ appOptions,
16011
+ SWIFTPM_PROGRESS,
16012
+ SWIFTPM_NOISE
16013
+ );
16014
+ } catch (error) {
16015
+ const output3 = outputOf(error);
16016
+ const moduleCache = import_node_path19.default.join(
15938
16017
  root,
15939
- ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
15940
- "--swift-sdk",
15941
- sdk,
15942
- ...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
15943
- "-c",
16018
+ ".build",
16019
+ WASM_TRIPLE,
15944
16020
  "release",
15945
- "-Xswiftc",
15946
- "-num-threads",
15947
- "-Xswiftc",
15948
- BUILD_JOBS,
15949
- ...swiftReproducibleBuildFlags([
15950
- [import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
15951
- [frameworkRoot, "framework"],
15952
- [root, "build"],
15953
- ...forwarders
15954
- ]),
15955
- ...macroPlugins.libraries.flatMap((plugin) => [
15956
- "-Xswiftc",
15957
- "-load-plugin-library",
15958
- "-Xswiftc",
15959
- plugin
15960
- ]),
15961
- ...macroPlugins.executables.flatMap((plugin) => [
15962
- "-Xswiftc",
15963
- "-load-plugin-executable",
15964
- "-Xswiftc",
15965
- `${plugin}#ExpoModulesMacros`
15966
- ])
15967
- ];
15968
- const linked = builtArtifact(layout);
15969
- if (input.lazyDistribution) {
15970
- (0, import_node_fs18.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
15971
- if ((0, import_node_fs18.existsSync)(linked) && (0, import_node_fs18.statSync)(linked).size <= 8)
15972
- (0, import_node_fs18.rmSync)(linked, { force: true });
15973
- }
15974
- report("compiling and linking Swift modules");
15975
- try {
15976
- const headerBuilds = preparation.headerProductTarget ? [
15977
- ...Object.keys(preparation.nativeHeaderDeclarations),
15978
- preparation.headerProductTarget
15979
- ] : preparation.headerProducers;
15980
- for (const build of headerBuilds) {
16021
+ "ModuleCache"
16022
+ );
16023
+ if (output3.includes("was compiled with module cache path") && (0, import_node_fs18.existsSync)(moduleCache)) {
16024
+ (0, import_node_fs18.rmSync)(moduleCache, { recursive: true, force: true });
16025
+ try {
15981
16026
  await runCompiler(
15982
16027
  swift,
15983
- [...buildArgs, "--target", build],
16028
+ buildArgs,
15984
16029
  appOptions,
15985
16030
  SWIFTPM_PROGRESS,
15986
16031
  SWIFTPM_NOISE
15987
16032
  );
15988
- for (const producer of build === preparation.headerProductTarget ? preparation.headerProducers : [build]) {
15989
- const emitted = import_node_path19.default.join(
15990
- root,
15991
- ".build",
15992
- "peach-cxx-headers",
15993
- `${producer}-Swift.h`
15994
- );
15995
- const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
15996
- if ((0, import_node_fs18.existsSync)(original))
15997
- writeBuildFile(
15998
- emitted,
15999
- withoutSwiftDeclarations(
16000
- clangInterfaceHeader((0, import_node_fs18.readFileSync)(original, "utf8")),
16001
- new Set(preparation.nativeHeaderDeclarations[producer]),
16002
- `#import <${producer}/${producer}.h>`
16003
- )
16004
- );
16005
- }
16006
- }
16007
- await runCompiler(
16008
- swift,
16009
- buildArgs,
16010
- appOptions,
16011
- SWIFTPM_PROGRESS,
16012
- SWIFTPM_NOISE
16013
- );
16014
- } catch (error) {
16015
- const output3 = outputOf(error);
16016
- const moduleCache = import_node_path19.default.join(
16017
- root,
16018
- ".build",
16019
- WASM_TRIPLE,
16020
- "release",
16021
- "ModuleCache"
16022
- );
16023
- if (output3.includes("was compiled with module cache path") && (0, import_node_fs18.existsSync)(moduleCache)) {
16024
- (0, import_node_fs18.rmSync)(moduleCache, { recursive: true, force: true });
16025
- try {
16026
- await runCompiler(
16027
- swift,
16028
- buildArgs,
16029
- appOptions,
16030
- SWIFTPM_PROGRESS,
16031
- SWIFTPM_NOISE
16032
- );
16033
- } catch (retryError) {
16034
- throw new Error(
16035
- [
16036
- ...unprepared,
16037
- projectDiagnostic(outputOf(retryError), layout, input.files)
16038
- ].join("\n"),
16039
- { cause: retryError }
16040
- );
16041
- }
16042
- } else {
16033
+ } catch (retryError) {
16043
16034
  throw new Error(
16044
- [...unprepared, projectDiagnostic(output3, layout, input.files)].join(
16045
- "\n"
16046
- ),
16047
- { cause: error }
16035
+ [
16036
+ ...unprepared,
16037
+ projectDiagnostic(outputOf(retryError), layout, input.files)
16038
+ ].join("\n"),
16039
+ { cause: retryError }
16048
16040
  );
16049
16041
  }
16050
- } finally {
16051
- if (options.project) endSwiftProjectProcesses(options.project);
16052
- }
16053
- if (unprepared.length) throw new Error(unprepared.join("\n"));
16054
- if (!(0, import_node_fs18.existsSync)(linked)) {
16055
- const binDir = import_node_path19.default.dirname(linked);
16056
- const found = (0, import_node_fs18.existsSync)(binDir) ? (0, import_node_fs18.readdirSync)(binDir).filter((name3) => name3.endsWith(".wasm")).sort() : [];
16042
+ } else {
16057
16043
  throw new Error(
16058
- `swift-compile: the build produced no ${import_node_path19.default.basename(linked)} (found: ${found.join(", ") || "none"})`
16059
- );
16060
- }
16061
- if (options.project) removeProjectLinks(root);
16062
- const output2 = options.project ? projectOutputFile(root, linked, options.project) : linked;
16063
- const optimized = `${output2}.optimized`;
16064
- if (input.lazyDistribution) {
16065
- pruneSwiftWasmLink(
16066
- root,
16067
- options.toolchainBin,
16068
- frameworkRoot,
16069
- input.staticClangTargets
16044
+ [...unprepared, projectDiagnostic(output3, layout, input.files)].join(
16045
+ "\n"
16046
+ ),
16047
+ { cause: error }
16070
16048
  );
16071
- await optimizeWasm(output2, optimized);
16072
16049
  }
16073
- const artifact = {
16074
- hash,
16075
- bytes: (0, import_node_fs18.readFileSync)(input.lazyDistribution ? optimized : output2),
16076
- icu: await icu
16077
- };
16078
- if (!options.project) saveCompiledArtifact(root, artifact);
16079
- saveSharedArtifact(sharedRoot, artifact);
16080
- report("compiled artifact verified");
16081
- return retain(root, artifact);
16082
- },
16083
- options.signal
16084
- );
16050
+ } finally {
16051
+ if (options.project) endSwiftProjectProcesses(options.project);
16052
+ }
16053
+ if (unprepared.length) throw new Error(unprepared.join("\n"));
16054
+ if (!(0, import_node_fs18.existsSync)(linked)) {
16055
+ const binDir = import_node_path19.default.dirname(linked);
16056
+ const found = (0, import_node_fs18.existsSync)(binDir) ? (0, import_node_fs18.readdirSync)(binDir).filter((name3) => name3.endsWith(".wasm")).sort() : [];
16057
+ throw new Error(
16058
+ `swift-compile: the build produced no ${import_node_path19.default.basename(linked)} (found: ${found.join(", ") || "none"})`
16059
+ );
16060
+ }
16061
+ if (options.project) removeProjectLinks(root);
16062
+ const output2 = options.project ? projectOutputFile(root, linked, options.project) : linked;
16063
+ const optimized = `${output2}.optimized`;
16064
+ if (input.lazyDistribution) {
16065
+ pruneSwiftWasmLink(
16066
+ root,
16067
+ options.toolchainBin,
16068
+ frameworkRoot,
16069
+ input.staticClangTargets
16070
+ );
16071
+ await optimizeWasm(output2, optimized);
16072
+ }
16073
+ const artifact = {
16074
+ hash,
16075
+ bytes: (0, import_node_fs18.readFileSync)(input.lazyDistribution ? optimized : output2),
16076
+ icu: await icu
16077
+ };
16078
+ if (!options.project) saveCompiledArtifact(root, artifact);
16079
+ saveSharedArtifact(sharedRoot, artifact);
16080
+ report("compiled artifact verified");
16081
+ return retain(root, artifact);
16082
+ });
16085
16083
  },
16086
16084
  options.signal
16087
16085
  );
@@ -19085,7 +19083,7 @@ async function installVerifiedTarball(tarball) {
19085
19083
  }
19086
19084
  try {
19087
19085
  if (!presentAtStart && import_node_fs24.default.existsSync(import_node_path25.default.join(destDir, installedMarker))) {
19088
- tarball.verify?.(destDir);
19086
+ await tarball.verify?.(destDir);
19089
19087
  return;
19090
19088
  }
19091
19089
  await installVerifiedTarballLocked(tarball, presentAtStart);
@@ -19129,14 +19127,14 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
19129
19127
  if (!import_node_fs24.default.existsSync(import_node_path25.default.join(tmpDir, installedMarker))) {
19130
19128
  throw new Error(`extracted tarball for ${label} is missing ${installedMarker}`);
19131
19129
  }
19132
- tarball.verify?.(tmpDir);
19130
+ await tarball.verify?.(tmpDir);
19133
19131
  signal?.throwIfAborted();
19134
19132
  try {
19135
19133
  import_node_fs24.default.renameSync(tmpDir, destDir);
19136
19134
  } catch (err) {
19137
19135
  if (!isErrnoCode(err, "ENOTEMPTY", "EEXIST")) throw err;
19138
19136
  if (!presentAtStart && import_node_fs24.default.existsSync(import_node_path25.default.join(destDir, installedMarker))) {
19139
- tarball.verify?.(destDir);
19137
+ await tarball.verify?.(destDir);
19140
19138
  return;
19141
19139
  }
19142
19140
  const aside = `${tmpDir}-replaced`;
@@ -19151,7 +19149,7 @@ async function installVerifiedTarballLocked(tarball, presentAtStart) {
19151
19149
  if (!isErrnoCode(landErr, "ENOTEMPTY", "EEXIST") || !import_node_fs24.default.existsSync(import_node_path25.default.join(destDir, installedMarker))) {
19152
19150
  throw landErr;
19153
19151
  }
19154
- tarball.verify?.(destDir);
19152
+ await tarball.verify?.(destDir);
19155
19153
  } finally {
19156
19154
  import_node_fs24.default.rmSync(aside, { recursive: true, force: true });
19157
19155
  }
@@ -20777,12 +20775,12 @@ async function ensureLinuxBrowserLibraries(executablePath, browser) {
20777
20775
 
20778
20776
  // src/swift-distribution.lock.json
20779
20777
  var swift_distribution_lock_default = {
20780
- id: "6742aac7746a6ce9",
20778
+ id: "92d08dea86eafc17",
20781
20779
  release: "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
20782
20780
  wasmSdkId: "swift-6.4.0-RELEASE_wasm-peach-5d385b68",
20783
20781
  wasmSdkUrl: "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-5d385b68.artifactbundle.tar.gz",
20784
20782
  wasmSdkChecksum: "d91882af99821a296c3db4459896b46ceaef37e9a30caad14e5f24cf6b964ae9",
20785
- source: "af1852646c60b5cde579f3465df69967e16810b3",
20783
+ source: "e5fb86f09228f6a9802a802657fea000ed6a3118",
20786
20784
  targets: [
20787
20785
  "ImagePlayground",
20788
20786
  "QuickLookThumbnailing",
@@ -20916,6 +20914,7 @@ var swift_distribution_lock_default = {
20916
20914
  "ModelIOEnums",
20917
20915
  "ModelIO",
20918
20916
  "MetalKit",
20917
+ "DatadogInternal",
20919
20918
  "DatadogCore",
20920
20919
  "DatadogLogs",
20921
20920
  "DatadogRUM",
@@ -21008,16 +21007,16 @@ var swift_distribution_lock_default = {
21008
21007
  },
21009
21008
  hosts: {
21010
21009
  "darwin-arm64": {
21011
- sha256: "80c63bad6b21a02244c09832dd1344a1aa52894bf5ed391b94771b036f385d08",
21012
- size: 99101780
21010
+ sha256: "b97c1ef24c74d88fe5b03240ac21017959884861a7ab3d298bc4b97e74e1bd02",
21011
+ size: 98848007
21013
21012
  },
21014
21013
  "linux-x64": {
21015
- sha256: "9f58c786fa96313a3aefe564c7af5eadda21a22ac996df49d16bfdd2c73456be",
21016
- size: 101818987
21014
+ sha256: "2beb12ad379dc2e618029a69c36b92d55c8f1b43b78e9600d97c13f17a1dab8f",
21015
+ size: 101566420
21017
21016
  },
21018
21017
  "linux-arm64": {
21019
- sha256: "2174623c31e5909128486b5516976060004d80697bdfcf46198b6150f7de1cc8",
21020
- size: 101312935
21018
+ sha256: "5ea72a514d3f67aaf477babb848c14177b57b6cbc1671ea075075586a4c38d6a",
21019
+ size: 101056003
21021
21020
  }
21022
21021
  }
21023
21022
  };
@@ -24763,7 +24762,7 @@ function standinSourceDigest(srcDir = __sootsim_import_meta_dirname) {
24763
24762
  }
24764
24763
  return hash.digest("hex");
24765
24764
  }
24766
- var STANDIN_SOURCE_DIGEST = true ? "f61e678df21a92da7fd50325f04848c1ad55068f560f9431a8d1c4e40e27de89" : standinSourceDigest();
24765
+ var STANDIN_SOURCE_DIGEST = true ? "9c474de2879c74325a394ed35660b419de359a6c926f74e96eaf97639d7b2c65" : standinSourceDigest();
24767
24766
 
24768
24767
  // src/swift-standins.ts
24769
24768
  init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
@@ -25552,12 +25551,18 @@ var OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/
25552
25551
  function stageDeclaredFramework(framework, declared, imports2, sdkHeader, destination) {
25553
25552
  const name3 = import_node_path39.default.basename(framework, ".framework");
25554
25553
  const own = `${name3}-Swift.h`;
25555
- const modulemap = import_node_fs37.default.readFileSync(
25554
+ const declaration = import_node_fs37.default.readFileSync(
25556
25555
  import_node_path39.default.join(framework, "Modules/module.modulemap"),
25557
25556
  "utf8"
25558
25557
  );
25558
+ const modulemap = declaration.includes(`framework module ${name3}`) ? declaration : `framework module ${name3} {
25559
+ umbrella header "${name3}-umbrella.h"
25560
+ export *
25561
+ }
25562
+ `;
25559
25563
  const umbrella = /umbrella header "([^"]+)"/.exec(modulemap)?.[1];
25560
- if (!umbrella) throw new Error(`${name3} module map names no umbrella header`);
25564
+ if (!umbrella || !import_node_fs37.default.existsSync(import_node_path39.default.join(framework, "Headers", umbrella)))
25565
+ throw new Error(`${name3} module map names no umbrella header`);
25561
25566
  const headers = new Map(
25562
25567
  import_node_fs37.default.readdirSync(import_node_path39.default.join(framework, "Headers")).filter(
25563
25568
  (file) => file.endsWith(".h") && file !== umbrella && file !== own && file !== `${name3}.h`
@@ -25652,14 +25657,14 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
25652
25657
  const declaredDigest = (0, import_node_crypto20.createHash)("sha256");
25653
25658
  for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
25654
25659
  declaredDigest.update(import_node_path39.default.relative(artifact.dir, framework)).update([...names ?? []].sort().join("\0")).update("\n").update([...imports2].sort().join("\0")).update(sdkHeader ?? "");
25655
- const search = import_node_path39.default.join(
25660
+ const staging = import_node_path39.default.join(
25656
25661
  root,
25657
- "peach-binary-inputs",
25658
- STANDIN_SOURCE_DIGEST.slice(0, 32),
25662
+ "peach-binary-trees",
25659
25663
  declared.size ? `${artifact.digest.slice(0, 32)}-${declaredDigest.digest("hex").slice(0, 16)}` : artifact.digest.slice(0, 32)
25660
25664
  );
25661
- if (!import_node_fs37.default.existsSync(search)) {
25662
- const pending = `${search}.${process.pid}.tmp`;
25665
+ const revision = import_node_path39.default.join(staging, "revisions", STANDIN_SOURCE_DIGEST.slice(0, 32));
25666
+ const stageTree = () => {
25667
+ const pending = import_node_path39.default.join(staging, `pending.${process.pid}`);
25663
25668
  import_node_fs37.default.rmSync(pending, { recursive: true, force: true });
25664
25669
  for (const framework of frameworks) {
25665
25670
  const swift = declared.get(framework);
@@ -25689,13 +25694,29 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
25689
25694
  filter: (source) => import_node_fs37.default.statSync(source).isDirectory() ? import_node_path39.default.dirname(source) !== directory || !import_node_path39.default.basename(source).startsWith("ios-") : !isBinaryLibraryFile(source)
25690
25695
  } : {}
25691
25696
  });
25697
+ const contents = (0, import_node_crypto20.createHash)("sha256");
25698
+ for (const relative2 of import_node_fs37.default.readdirSync(pending, { recursive: true, encoding: "utf8" }).sort()) {
25699
+ const file = import_node_path39.default.join(pending, relative2);
25700
+ contents.update(`${relative2}\0`);
25701
+ if (import_node_fs37.default.statSync(file).isFile()) contents.update(import_node_fs37.default.readFileSync(file));
25702
+ }
25703
+ const name3 = contents.digest("hex").slice(0, 32);
25692
25704
  try {
25693
- import_node_fs37.default.renameSync(pending, search);
25705
+ import_node_fs37.default.renameSync(pending, import_node_path39.default.join(staging, name3));
25694
25706
  } catch (error) {
25695
25707
  import_node_fs37.default.rmSync(pending, { recursive: true, force: true });
25696
- if (!import_node_fs37.default.existsSync(search)) throw error;
25708
+ if (!import_node_fs37.default.existsSync(import_node_path39.default.join(staging, name3))) throw error;
25697
25709
  }
25698
- }
25710
+ import_node_fs37.default.mkdirSync(import_node_path39.default.dirname(revision), { recursive: true });
25711
+ const record2 = `${revision}.${process.pid}`;
25712
+ import_node_fs37.default.writeFileSync(record2, name3);
25713
+ import_node_fs37.default.renameSync(record2, revision);
25714
+ return name3;
25715
+ };
25716
+ const search = import_node_path39.default.join(
25717
+ staging,
25718
+ import_node_fs37.default.existsSync(revision) ? import_node_fs37.default.readFileSync(revision, "utf8") : stageTree()
25719
+ );
25699
25720
  for (const [framework, { header }] of declared) {
25700
25721
  if (header === null) continue;
25701
25722
  const name3 = import_node_path39.default.basename(framework, ".framework");
@@ -25706,8 +25727,10 @@ function binaryHeaderSearchPaths(binary, root, declaredFrameworks) {
25706
25727
  "Headers",
25707
25728
  `${name3}-Swift.h`
25708
25729
  );
25709
- if (!import_node_fs37.default.existsSync(staged) || import_node_fs37.default.readFileSync(staged, "utf8") !== header)
25710
- import_node_fs37.default.writeFileSync(staged, header);
25730
+ if (!import_node_fs37.default.existsSync(staged) || import_node_fs37.default.readFileSync(staged, "utf8") !== header) {
25731
+ import_node_fs37.default.writeFileSync(`${staged}.${process.pid}`, header);
25732
+ import_node_fs37.default.renameSync(`${staged}.${process.pid}`, staged);
25733
+ }
25711
25734
  }
25712
25735
  return {
25713
25736
  frameworks: frameworks.length ? [import_node_path39.default.join(search, "frameworks")] : [],
@@ -27118,7 +27141,7 @@ function standinGenerationInputs(binaries, toolchain, behavior = {}, sourceDir)
27118
27141
  sdk.wasmSdkChecksum,
27119
27142
  swiftModuleDigest(moduleRoot).toString("hex"),
27120
27143
  `sources/${digest}`,
27121
- `ios-sdk/${IOS_SDK_ID}`
27144
+ `ios-sdk/${iosSdkId()}`
27122
27145
  ];
27123
27146
  const modules = new Set(
27124
27147
  binaries.flatMap((binary) => {