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.
- package/cli/commands/control.ts +5 -2
- package/cli/commands/inspect.ts +43 -385
- package/cli/commands/package.ts +88 -32
- package/cli/commands/runtime.ts +2 -2
- package/cli/outbound-endpoints.ts +2 -2
- package/cli/packaged-app-launcher.ts +6 -1
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +5186 -5881
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +100 -16
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3949 -4535
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +3724 -4482
- package/dist-lib/host/fetch-proxy-handler.cjs +25 -14
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +26 -36
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +26 -36
- package/dist-lib/native-app-identity-project.cjs +4 -23
- package/dist-lib/native-app-identity-project.mjs +4 -23
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +87 -76
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +4265 -4982
- package/dist-lib/swift-compile.cjs +218 -243
- package/dist-lib/swift-compile.mjs +218 -243
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +274 -251
- package/dist-lib/vite.cjs +25 -14
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/nativeReplayContract.d.ts +2 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/answeredNativePackages.ts +41 -0
- package/src/cli-runtime.ts +34 -13
- package/src/expo-discovery-cache.ts +2 -0
- package/src/expo-kotlin-host.ts +11 -9
- package/src/expo-swift-host.ts +10 -6
- package/src/expo-swift-ready.ts +16 -2
- package/src/installed-native-libraries.ts +79 -18
- package/src/nitro-adapter.lock.json +240 -240
- package/src/nitro-bundle.ts +8 -6
- package/src/nitro-compile.ts +6 -3
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-dependencies.ts +8 -2
- package/src/nitro-source.ts +34 -3
- package/src/nitro-superset.lock.json +21 -253
- package/src/nitro-superset.ts +59 -63
- package/src/nitroContract.ts +26 -3
- package/src/react-native-bridge-modules.ts +2 -4
- package/src/runtime-delivery.ts +2 -2
- package/src/swift-compile.ts +260 -255
- package/src/swift-distribution.lock.json +9 -8
- package/src/swift-installed-targets.ts +13 -0
- package/src/swift-objc-standin.ts +10 -6
- package/src/swift-standins.ts +44 -14
- package/src/turbo-bundle.ts +20 -1
- package/src/turbo-compile.ts +6 -12
- package/src/turbo-runtime.lock.json +19 -19
- package/src/turbo-source.ts +18 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
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;
|
|
@@ -3796,26 +3796,6 @@ var NATIVE_GRAPH_INPUTS = {
|
|
|
3796
3796
|
target: IOS_SDK_TARGET
|
|
3797
3797
|
};
|
|
3798
3798
|
var NATIVE_GRAPH_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
3799
|
-
function stripExternalSourceMarks(text2) {
|
|
3800
|
-
return text2.split("\n").map(
|
|
3801
|
-
(line) => line.startsWith("#define PEACH_SWIFT_CLASS(") ? line : line.replace(/PEACH_SWIFT_CLASS\(\w+\)\s*/g, "")
|
|
3802
|
-
).join("\n");
|
|
3803
|
-
}
|
|
3804
|
-
function iosSdkEntries() {
|
|
3805
|
-
const overlays = Object.entries(IOS_SDK_OVERLAYS).map(
|
|
3806
|
-
([module2, text2]) => [
|
|
3807
|
-
`usr/lib/swift/${module2}.swiftmodule/arm64-apple-ios-simulator.swiftinterface`,
|
|
3808
|
-
`// swift-interface-format-version: 1.0
|
|
3809
|
-
// swift-module-flags: -target ${IOS_SDK_TARGET} -enable-objc-interop -enable-library-evolution -module-name ${module2}
|
|
3810
|
-
${text2}`
|
|
3811
|
-
]
|
|
3812
|
-
);
|
|
3813
|
-
const headers = Object.entries(IOS_SDK_HEADERS).map(
|
|
3814
|
-
([file, text2]) => [file, stripExternalSourceMarks(text2)]
|
|
3815
|
-
);
|
|
3816
|
-
return [...headers, ...overlays].sort(([a], [b]) => a < b ? -1 : 1);
|
|
3817
|
-
}
|
|
3818
|
-
var IOS_SDK_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
|
|
3819
3799
|
function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
|
|
3820
3800
|
return [
|
|
3821
3801
|
...swiftObjCPlatformFlags(toolchainBin, minimum),
|
|
@@ -7500,7 +7480,8 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
|
|
|
7500
7480
|
TOCropViewController: [],
|
|
7501
7481
|
RiveRuntime: ["MetalKit"],
|
|
7502
7482
|
MetalKit: ["ModelIO"],
|
|
7503
|
-
|
|
7483
|
+
DatadogInternal: [],
|
|
7484
|
+
DatadogCore: ["DatadogInternal"],
|
|
7504
7485
|
DatadogLogs: ["DatadogCore"],
|
|
7505
7486
|
DatadogRUM: ["DatadogCore"],
|
|
7506
7487
|
DatadogTrace: ["DatadogCore"],
|
|
@@ -7852,7 +7833,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
7852
7833
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
7853
7834
|
var MULTI_MANIFEST_VERSION = 65;
|
|
7854
7835
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
7855
|
-
var compilerSourceDigest = true ? "
|
|
7836
|
+
var compilerSourceDigest = true ? "1519f1f37c446535792f7bb0c9ba9c5e59b0b0f87d7b5c849346abe684325aa7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
7856
7837
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
7857
7838
|
const hash = (0, import_node_crypto8.createHash)("sha256");
|
|
7858
7839
|
hash.update(`swift-compile
|
|
@@ -11667,245 +11648,239 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
11667
11648
|
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
|
|
11668
11649
|
);
|
|
11669
11650
|
}
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
|
|
11673
|
-
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
}
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
swift,
|
|
11711
|
-
sdk,
|
|
11712
|
-
toolchainBin: options.toolchainBin,
|
|
11713
|
-
plugins: macroPlugins,
|
|
11714
|
-
buildOptions
|
|
11715
|
-
});
|
|
11716
|
-
await pruneFrameworkScratches(frameworkKey);
|
|
11717
|
-
}
|
|
11718
|
-
if (options.project) removeProjectLinks(root);
|
|
11719
|
-
if (retireStaleSwiftLink(
|
|
11720
|
-
root,
|
|
11721
|
-
swiftLinkStamp({
|
|
11722
|
-
frameworkKey,
|
|
11723
|
-
prebuilt
|
|
11724
|
-
})
|
|
11725
|
-
))
|
|
11726
|
-
report("framework revision changed; rebuilding the app link");
|
|
11727
|
-
const preparation = writeSwiftProject(
|
|
11728
|
-
layout,
|
|
11651
|
+
const frameworkScratch = swiftFrameworkScratch(frameworkKey);
|
|
11652
|
+
const withFrameworkLock = (work) => distribution ? work() : withSwiftRootLock(frameworkScratch, work, options.signal);
|
|
11653
|
+
return withFrameworkLock(async (frameworkLease) => {
|
|
11654
|
+
const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
|
|
11655
|
+
report("preparing compiler plugins");
|
|
11656
|
+
const pluginsFor = (pluginLease) => ensureMacroPlugins(
|
|
11657
|
+
frameworkRoot,
|
|
11658
|
+
options.toolchainBin,
|
|
11659
|
+
options.release,
|
|
11660
|
+
options.signal,
|
|
11661
|
+
pluginLease
|
|
11662
|
+
);
|
|
11663
|
+
const macroPlugins = distribution ? await withSwiftRootLock(frameworkScratch, pluginsFor, options.signal) : await pluginsFor(frameworkLease);
|
|
11664
|
+
const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId;
|
|
11665
|
+
const icu = swiftIcuAsset(options.toolchainBin, sdk);
|
|
11666
|
+
const buildOptions = {
|
|
11667
|
+
env: {
|
|
11668
|
+
...options.project?.env ?? process.env,
|
|
11669
|
+
// shipped host plugins resolve against the selected compiler's runtime.
|
|
11670
|
+
...process.platform === "linux" ? {
|
|
11671
|
+
LD_LIBRARY_PATH: [
|
|
11672
|
+
import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/linux"),
|
|
11673
|
+
import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/host"),
|
|
11674
|
+
process.env.LD_LIBRARY_PATH
|
|
11675
|
+
].filter(Boolean).join(":")
|
|
11676
|
+
} : {},
|
|
11677
|
+
...input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: "1" } : {}
|
|
11678
|
+
},
|
|
11679
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
11680
|
+
timeout: options.timeoutMs,
|
|
11681
|
+
signal: options.signal,
|
|
11682
|
+
lease,
|
|
11683
|
+
frameworkLease
|
|
11684
|
+
};
|
|
11685
|
+
let prebuilt;
|
|
11686
|
+
if (!distribution) {
|
|
11687
|
+
report("compiling framework products");
|
|
11688
|
+
prebuilt = await compileFrameworkProducts({
|
|
11689
|
+
moduleRoot: frameworkRoot,
|
|
11690
|
+
frameworkKey,
|
|
11729
11691
|
input,
|
|
11730
|
-
|
|
11692
|
+
swift,
|
|
11693
|
+
sdk,
|
|
11694
|
+
toolchainBin: options.toolchainBin,
|
|
11695
|
+
plugins: macroPlugins,
|
|
11696
|
+
buildOptions
|
|
11697
|
+
});
|
|
11698
|
+
await pruneFrameworkScratches(frameworkKey);
|
|
11699
|
+
}
|
|
11700
|
+
if (options.project) removeProjectLinks(root);
|
|
11701
|
+
if (retireStaleSwiftLink(
|
|
11702
|
+
root,
|
|
11703
|
+
swiftLinkStamp({
|
|
11704
|
+
frameworkKey,
|
|
11731
11705
|
prebuilt
|
|
11706
|
+
})
|
|
11707
|
+
))
|
|
11708
|
+
report("framework revision changed; rebuilding the app link");
|
|
11709
|
+
const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt);
|
|
11710
|
+
writeSwiftAutolinkLinker(root, options.toolchainBin);
|
|
11711
|
+
const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
|
|
11712
|
+
const appOptions = projectProcess ? {
|
|
11713
|
+
...buildOptions,
|
|
11714
|
+
uid: projectProcess.uid,
|
|
11715
|
+
gid: projectProcess.gid,
|
|
11716
|
+
confined: projectProcess.env
|
|
11717
|
+
} : buildOptions;
|
|
11718
|
+
const unprepared = preparation.targetFailures.map(
|
|
11719
|
+
(failure) => `error: target ${failure}`
|
|
11720
|
+
);
|
|
11721
|
+
const forwarders = /* @__PURE__ */ new Map();
|
|
11722
|
+
for (const [file, text2] of Object.entries(input.files)) {
|
|
11723
|
+
const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text2)?.[1];
|
|
11724
|
+
if (!parents) continue;
|
|
11725
|
+
const directory = import_node_path19.default.posix.dirname(file);
|
|
11726
|
+
forwarders.set(
|
|
11727
|
+
`${import_node_path19.default.join(root, directory)}/${parents.slice(0, -1)}`,
|
|
11728
|
+
import_node_path19.default.posix.join("build", directory, parents).replace(/\/$/, "")
|
|
11732
11729
|
);
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
)
|
|
11744
|
-
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11730
|
+
}
|
|
11731
|
+
const buildArgs = [
|
|
11732
|
+
"build",
|
|
11733
|
+
...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
|
|
11734
|
+
"--build-system",
|
|
11735
|
+
"native",
|
|
11736
|
+
"-j",
|
|
11737
|
+
BUILD_JOBS,
|
|
11738
|
+
"--package-path",
|
|
11739
|
+
root,
|
|
11740
|
+
...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
11741
|
+
"--swift-sdk",
|
|
11742
|
+
sdk,
|
|
11743
|
+
...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
|
|
11744
|
+
"-c",
|
|
11745
|
+
"release",
|
|
11746
|
+
"-Xswiftc",
|
|
11747
|
+
"-num-threads",
|
|
11748
|
+
"-Xswiftc",
|
|
11749
|
+
BUILD_JOBS,
|
|
11750
|
+
...swiftReproducibleBuildFlags([
|
|
11751
|
+
[import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
|
|
11752
|
+
[frameworkRoot, "framework"],
|
|
11753
|
+
[root, "build"],
|
|
11754
|
+
...forwarders
|
|
11755
|
+
]),
|
|
11756
|
+
...macroPlugins.libraries.flatMap((plugin) => [
|
|
11757
|
+
"-Xswiftc",
|
|
11758
|
+
"-load-plugin-library",
|
|
11759
|
+
"-Xswiftc",
|
|
11760
|
+
plugin
|
|
11761
|
+
]),
|
|
11762
|
+
...macroPlugins.executables.flatMap((plugin) => [
|
|
11763
|
+
"-Xswiftc",
|
|
11764
|
+
"-load-plugin-executable",
|
|
11765
|
+
"-Xswiftc",
|
|
11766
|
+
`${plugin}#ExpoModulesMacros`
|
|
11767
|
+
])
|
|
11768
|
+
];
|
|
11769
|
+
const linked = builtArtifact(layout);
|
|
11770
|
+
if (input.lazyDistribution) {
|
|
11771
|
+
(0, import_node_fs17.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
|
|
11772
|
+
if ((0, import_node_fs17.existsSync)(linked) && (0, import_node_fs17.statSync)(linked).size <= 8)
|
|
11773
|
+
(0, import_node_fs17.rmSync)(linked, { force: true });
|
|
11774
|
+
}
|
|
11775
|
+
report("compiling and linking Swift modules");
|
|
11776
|
+
try {
|
|
11777
|
+
const headerBuilds = preparation.headerProductTarget ? [
|
|
11778
|
+
...Object.keys(preparation.nativeHeaderDeclarations),
|
|
11779
|
+
preparation.headerProductTarget
|
|
11780
|
+
] : preparation.headerProducers;
|
|
11781
|
+
for (const build of headerBuilds) {
|
|
11782
|
+
await runCompiler(
|
|
11783
|
+
swift,
|
|
11784
|
+
[...buildArgs, "--target", build],
|
|
11785
|
+
appOptions,
|
|
11786
|
+
SWIFTPM_PROGRESS,
|
|
11787
|
+
SWIFTPM_NOISE
|
|
11752
11788
|
);
|
|
11789
|
+
for (const producer of build === preparation.headerProductTarget ? preparation.headerProducers : [build]) {
|
|
11790
|
+
const emitted = import_node_path19.default.join(
|
|
11791
|
+
root,
|
|
11792
|
+
".build",
|
|
11793
|
+
"peach-cxx-headers",
|
|
11794
|
+
`${producer}-Swift.h`
|
|
11795
|
+
);
|
|
11796
|
+
const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
|
|
11797
|
+
if ((0, import_node_fs17.existsSync)(original))
|
|
11798
|
+
writeBuildFile(
|
|
11799
|
+
emitted,
|
|
11800
|
+
withoutSwiftDeclarations(
|
|
11801
|
+
clangInterfaceHeader((0, import_node_fs17.readFileSync)(original, "utf8")),
|
|
11802
|
+
new Set(preparation.nativeHeaderDeclarations[producer]),
|
|
11803
|
+
`#import <${producer}/${producer}.h>`
|
|
11804
|
+
)
|
|
11805
|
+
);
|
|
11806
|
+
}
|
|
11753
11807
|
}
|
|
11754
|
-
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11808
|
+
await runCompiler(
|
|
11809
|
+
swift,
|
|
11810
|
+
buildArgs,
|
|
11811
|
+
appOptions,
|
|
11812
|
+
SWIFTPM_PROGRESS,
|
|
11813
|
+
SWIFTPM_NOISE
|
|
11814
|
+
);
|
|
11815
|
+
} catch (error) {
|
|
11816
|
+
const output2 = outputOf(error);
|
|
11817
|
+
const moduleCache = import_node_path19.default.join(
|
|
11762
11818
|
root,
|
|
11763
|
-
|
|
11764
|
-
|
|
11765
|
-
sdk,
|
|
11766
|
-
...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
|
|
11767
|
-
"-c",
|
|
11819
|
+
".build",
|
|
11820
|
+
WASM_TRIPLE,
|
|
11768
11821
|
"release",
|
|
11769
|
-
"
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
[import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
|
|
11775
|
-
[frameworkRoot, "framework"],
|
|
11776
|
-
[root, "build"],
|
|
11777
|
-
...forwarders
|
|
11778
|
-
]),
|
|
11779
|
-
...macroPlugins.libraries.flatMap((plugin) => [
|
|
11780
|
-
"-Xswiftc",
|
|
11781
|
-
"-load-plugin-library",
|
|
11782
|
-
"-Xswiftc",
|
|
11783
|
-
plugin
|
|
11784
|
-
]),
|
|
11785
|
-
...macroPlugins.executables.flatMap((plugin) => [
|
|
11786
|
-
"-Xswiftc",
|
|
11787
|
-
"-load-plugin-executable",
|
|
11788
|
-
"-Xswiftc",
|
|
11789
|
-
`${plugin}#ExpoModulesMacros`
|
|
11790
|
-
])
|
|
11791
|
-
];
|
|
11792
|
-
const linked = builtArtifact(layout);
|
|
11793
|
-
if (input.lazyDistribution) {
|
|
11794
|
-
(0, import_node_fs17.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
|
|
11795
|
-
if ((0, import_node_fs17.existsSync)(linked) && (0, import_node_fs17.statSync)(linked).size <= 8)
|
|
11796
|
-
(0, import_node_fs17.rmSync)(linked, { force: true });
|
|
11797
|
-
}
|
|
11798
|
-
report("compiling and linking Swift modules");
|
|
11799
|
-
try {
|
|
11800
|
-
const headerBuilds = preparation.headerProductTarget ? [
|
|
11801
|
-
...Object.keys(preparation.nativeHeaderDeclarations),
|
|
11802
|
-
preparation.headerProductTarget
|
|
11803
|
-
] : preparation.headerProducers;
|
|
11804
|
-
for (const build of headerBuilds) {
|
|
11822
|
+
"ModuleCache"
|
|
11823
|
+
);
|
|
11824
|
+
if (output2.includes("was compiled with module cache path") && (0, import_node_fs17.existsSync)(moduleCache)) {
|
|
11825
|
+
(0, import_node_fs17.rmSync)(moduleCache, { recursive: true, force: true });
|
|
11826
|
+
try {
|
|
11805
11827
|
await runCompiler(
|
|
11806
11828
|
swift,
|
|
11807
|
-
|
|
11829
|
+
buildArgs,
|
|
11808
11830
|
appOptions,
|
|
11809
11831
|
SWIFTPM_PROGRESS,
|
|
11810
11832
|
SWIFTPM_NOISE
|
|
11811
11833
|
);
|
|
11812
|
-
|
|
11813
|
-
const emitted = import_node_path19.default.join(
|
|
11814
|
-
root,
|
|
11815
|
-
".build",
|
|
11816
|
-
"peach-cxx-headers",
|
|
11817
|
-
`${producer}-Swift.h`
|
|
11818
|
-
);
|
|
11819
|
-
const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
|
|
11820
|
-
if ((0, import_node_fs17.existsSync)(original))
|
|
11821
|
-
writeBuildFile(
|
|
11822
|
-
emitted,
|
|
11823
|
-
withoutSwiftDeclarations(
|
|
11824
|
-
clangInterfaceHeader((0, import_node_fs17.readFileSync)(original, "utf8")),
|
|
11825
|
-
new Set(preparation.nativeHeaderDeclarations[producer]),
|
|
11826
|
-
`#import <${producer}/${producer}.h>`
|
|
11827
|
-
)
|
|
11828
|
-
);
|
|
11829
|
-
}
|
|
11830
|
-
}
|
|
11831
|
-
await runCompiler(
|
|
11832
|
-
swift,
|
|
11833
|
-
buildArgs,
|
|
11834
|
-
appOptions,
|
|
11835
|
-
SWIFTPM_PROGRESS,
|
|
11836
|
-
SWIFTPM_NOISE
|
|
11837
|
-
);
|
|
11838
|
-
} catch (error) {
|
|
11839
|
-
const output2 = outputOf(error);
|
|
11840
|
-
const moduleCache = import_node_path19.default.join(
|
|
11841
|
-
root,
|
|
11842
|
-
".build",
|
|
11843
|
-
WASM_TRIPLE,
|
|
11844
|
-
"release",
|
|
11845
|
-
"ModuleCache"
|
|
11846
|
-
);
|
|
11847
|
-
if (output2.includes("was compiled with module cache path") && (0, import_node_fs17.existsSync)(moduleCache)) {
|
|
11848
|
-
(0, import_node_fs17.rmSync)(moduleCache, { recursive: true, force: true });
|
|
11849
|
-
try {
|
|
11850
|
-
await runCompiler(
|
|
11851
|
-
swift,
|
|
11852
|
-
buildArgs,
|
|
11853
|
-
appOptions,
|
|
11854
|
-
SWIFTPM_PROGRESS,
|
|
11855
|
-
SWIFTPM_NOISE
|
|
11856
|
-
);
|
|
11857
|
-
} catch (retryError) {
|
|
11858
|
-
throw new Error(
|
|
11859
|
-
[
|
|
11860
|
-
...unprepared,
|
|
11861
|
-
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
11862
|
-
].join("\n"),
|
|
11863
|
-
{ cause: retryError }
|
|
11864
|
-
);
|
|
11865
|
-
}
|
|
11866
|
-
} else {
|
|
11834
|
+
} catch (retryError) {
|
|
11867
11835
|
throw new Error(
|
|
11868
|
-
[
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11836
|
+
[
|
|
11837
|
+
...unprepared,
|
|
11838
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
11839
|
+
].join("\n"),
|
|
11840
|
+
{ cause: retryError }
|
|
11872
11841
|
);
|
|
11873
11842
|
}
|
|
11874
|
-
}
|
|
11875
|
-
if (options.project) endSwiftProjectProcesses(options.project);
|
|
11876
|
-
}
|
|
11877
|
-
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
11878
|
-
if (!(0, import_node_fs17.existsSync)(linked)) {
|
|
11879
|
-
const binDir = import_node_path19.default.dirname(linked);
|
|
11880
|
-
const found = (0, import_node_fs17.existsSync)(binDir) ? (0, import_node_fs17.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
|
|
11843
|
+
} else {
|
|
11881
11844
|
throw new Error(
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
const output = options.project ? projectOutputFile(root, linked, options.project) : linked;
|
|
11887
|
-
const optimized = `${output}.optimized`;
|
|
11888
|
-
if (input.lazyDistribution) {
|
|
11889
|
-
pruneSwiftWasmLink(
|
|
11890
|
-
root,
|
|
11891
|
-
options.toolchainBin,
|
|
11892
|
-
frameworkRoot,
|
|
11893
|
-
input.staticClangTargets
|
|
11845
|
+
[...unprepared, projectDiagnostic(output2, layout, input.files)].join(
|
|
11846
|
+
"\n"
|
|
11847
|
+
),
|
|
11848
|
+
{ cause: error }
|
|
11894
11849
|
);
|
|
11895
|
-
await optimizeWasm(output, optimized);
|
|
11896
11850
|
}
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11851
|
+
} finally {
|
|
11852
|
+
if (options.project) endSwiftProjectProcesses(options.project);
|
|
11853
|
+
}
|
|
11854
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
11855
|
+
if (!(0, import_node_fs17.existsSync)(linked)) {
|
|
11856
|
+
const binDir = import_node_path19.default.dirname(linked);
|
|
11857
|
+
const found = (0, import_node_fs17.existsSync)(binDir) ? (0, import_node_fs17.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
|
|
11858
|
+
throw new Error(
|
|
11859
|
+
`swift-compile: the build produced no ${import_node_path19.default.basename(linked)} (found: ${found.join(", ") || "none"})`
|
|
11860
|
+
);
|
|
11861
|
+
}
|
|
11862
|
+
if (options.project) removeProjectLinks(root);
|
|
11863
|
+
const output = options.project ? projectOutputFile(root, linked, options.project) : linked;
|
|
11864
|
+
const optimized = `${output}.optimized`;
|
|
11865
|
+
if (input.lazyDistribution) {
|
|
11866
|
+
pruneSwiftWasmLink(
|
|
11867
|
+
root,
|
|
11868
|
+
options.toolchainBin,
|
|
11869
|
+
frameworkRoot,
|
|
11870
|
+
input.staticClangTargets
|
|
11871
|
+
);
|
|
11872
|
+
await optimizeWasm(output, optimized);
|
|
11873
|
+
}
|
|
11874
|
+
const artifact = {
|
|
11875
|
+
hash,
|
|
11876
|
+
bytes: (0, import_node_fs17.readFileSync)(input.lazyDistribution ? optimized : output),
|
|
11877
|
+
icu: await icu
|
|
11878
|
+
};
|
|
11879
|
+
if (!options.project) saveCompiledArtifact(root, artifact);
|
|
11880
|
+
saveSharedArtifact(sharedRoot, artifact);
|
|
11881
|
+
report("compiled artifact verified");
|
|
11882
|
+
return retain(root, artifact);
|
|
11883
|
+
});
|
|
11909
11884
|
},
|
|
11910
11885
|
options.signal
|
|
11911
11886
|
);
|