peachsim 0.1.1815 → 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/package.ts +82 -31
- package/cli/outbound-endpoints.ts +1 -1
- 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 +4418 -5235
- 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 +12 -3
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3932 -4526
- 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 +3289 -4175
- package/dist-lib/host/fetch-proxy-handler.cjs +12 -3
- 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 +13 -24
- 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 +13 -24
- package/dist-lib/native-app-identity-project.cjs +2 -22
- package/dist-lib/native-app-identity-project.mjs +2 -22
- 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 +74 -66
- 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 +3793 -4671
- package/dist-lib/swift-compile.cjs +216 -242
- package/dist-lib/swift-compile.mjs +216 -242
- 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 +251 -236
- package/dist-lib/vite.cjs +12 -3
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/answeredNativePackages.ts +41 -0
- package/src/cli-runtime.ts +2 -9
- 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/nitro-bundle.ts +8 -6
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-superset.lock.json +19 -251
- package/src/nitro-superset.ts +59 -63
- package/src/react-native-bridge-modules.ts +2 -4
- package/src/swift-compile.ts +258 -254
- package/src/swift-objc-standin.ts +10 -6
- package/src/swift-standins.ts +36 -12
- package/src/turbo-source.ts +2 -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),
|
|
@@ -7853,7 +7833,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
7853
7833
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
7854
7834
|
var MULTI_MANIFEST_VERSION = 65;
|
|
7855
7835
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
7856
|
-
var compilerSourceDigest = true ? "
|
|
7836
|
+
var compilerSourceDigest = true ? "1519f1f37c446535792f7bb0c9ba9c5e59b0b0f87d7b5c849346abe684325aa7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
7857
7837
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
7858
7838
|
const hash = (0, import_node_crypto8.createHash)("sha256");
|
|
7859
7839
|
hash.update(`swift-compile
|
|
@@ -11668,245 +11648,239 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
11668
11648
|
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
|
|
11669
11649
|
);
|
|
11670
11650
|
}
|
|
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
|
-
|
|
11711
|
-
swift,
|
|
11712
|
-
sdk,
|
|
11713
|
-
toolchainBin: options.toolchainBin,
|
|
11714
|
-
plugins: macroPlugins,
|
|
11715
|
-
buildOptions
|
|
11716
|
-
});
|
|
11717
|
-
await pruneFrameworkScratches(frameworkKey);
|
|
11718
|
-
}
|
|
11719
|
-
if (options.project) removeProjectLinks(root);
|
|
11720
|
-
if (retireStaleSwiftLink(
|
|
11721
|
-
root,
|
|
11722
|
-
swiftLinkStamp({
|
|
11723
|
-
frameworkKey,
|
|
11724
|
-
prebuilt
|
|
11725
|
-
})
|
|
11726
|
-
))
|
|
11727
|
-
report("framework revision changed; rebuilding the app link");
|
|
11728
|
-
const preparation = writeSwiftProject(
|
|
11729
|
-
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,
|
|
11730
11691
|
input,
|
|
11731
|
-
|
|
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,
|
|
11732
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(/\/$/, "")
|
|
11733
11729
|
);
|
|
11734
|
-
|
|
11735
|
-
|
|
11736
|
-
|
|
11737
|
-
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11742
|
-
|
|
11743
|
-
|
|
11744
|
-
)
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11748
|
-
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
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
|
|
11753
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
|
+
}
|
|
11754
11807
|
}
|
|
11755
|
-
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
11760
|
-
|
|
11761
|
-
|
|
11762
|
-
|
|
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(
|
|
11763
11818
|
root,
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
sdk,
|
|
11767
|
-
...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
|
|
11768
|
-
"-c",
|
|
11819
|
+
".build",
|
|
11820
|
+
WASM_TRIPLE,
|
|
11769
11821
|
"release",
|
|
11770
|
-
"
|
|
11771
|
-
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
[import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
|
|
11776
|
-
[frameworkRoot, "framework"],
|
|
11777
|
-
[root, "build"],
|
|
11778
|
-
...forwarders
|
|
11779
|
-
]),
|
|
11780
|
-
...macroPlugins.libraries.flatMap((plugin) => [
|
|
11781
|
-
"-Xswiftc",
|
|
11782
|
-
"-load-plugin-library",
|
|
11783
|
-
"-Xswiftc",
|
|
11784
|
-
plugin
|
|
11785
|
-
]),
|
|
11786
|
-
...macroPlugins.executables.flatMap((plugin) => [
|
|
11787
|
-
"-Xswiftc",
|
|
11788
|
-
"-load-plugin-executable",
|
|
11789
|
-
"-Xswiftc",
|
|
11790
|
-
`${plugin}#ExpoModulesMacros`
|
|
11791
|
-
])
|
|
11792
|
-
];
|
|
11793
|
-
const linked = builtArtifact(layout);
|
|
11794
|
-
if (input.lazyDistribution) {
|
|
11795
|
-
(0, import_node_fs17.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
|
|
11796
|
-
if ((0, import_node_fs17.existsSync)(linked) && (0, import_node_fs17.statSync)(linked).size <= 8)
|
|
11797
|
-
(0, import_node_fs17.rmSync)(linked, { force: true });
|
|
11798
|
-
}
|
|
11799
|
-
report("compiling and linking Swift modules");
|
|
11800
|
-
try {
|
|
11801
|
-
const headerBuilds = preparation.headerProductTarget ? [
|
|
11802
|
-
...Object.keys(preparation.nativeHeaderDeclarations),
|
|
11803
|
-
preparation.headerProductTarget
|
|
11804
|
-
] : preparation.headerProducers;
|
|
11805
|
-
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 {
|
|
11806
11827
|
await runCompiler(
|
|
11807
11828
|
swift,
|
|
11808
|
-
|
|
11829
|
+
buildArgs,
|
|
11809
11830
|
appOptions,
|
|
11810
11831
|
SWIFTPM_PROGRESS,
|
|
11811
11832
|
SWIFTPM_NOISE
|
|
11812
11833
|
);
|
|
11813
|
-
|
|
11814
|
-
const emitted = import_node_path19.default.join(
|
|
11815
|
-
root,
|
|
11816
|
-
".build",
|
|
11817
|
-
"peach-cxx-headers",
|
|
11818
|
-
`${producer}-Swift.h`
|
|
11819
|
-
);
|
|
11820
|
-
const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
|
|
11821
|
-
if ((0, import_node_fs17.existsSync)(original))
|
|
11822
|
-
writeBuildFile(
|
|
11823
|
-
emitted,
|
|
11824
|
-
withoutSwiftDeclarations(
|
|
11825
|
-
clangInterfaceHeader((0, import_node_fs17.readFileSync)(original, "utf8")),
|
|
11826
|
-
new Set(preparation.nativeHeaderDeclarations[producer]),
|
|
11827
|
-
`#import <${producer}/${producer}.h>`
|
|
11828
|
-
)
|
|
11829
|
-
);
|
|
11830
|
-
}
|
|
11831
|
-
}
|
|
11832
|
-
await runCompiler(
|
|
11833
|
-
swift,
|
|
11834
|
-
buildArgs,
|
|
11835
|
-
appOptions,
|
|
11836
|
-
SWIFTPM_PROGRESS,
|
|
11837
|
-
SWIFTPM_NOISE
|
|
11838
|
-
);
|
|
11839
|
-
} catch (error) {
|
|
11840
|
-
const output2 = outputOf(error);
|
|
11841
|
-
const moduleCache = import_node_path19.default.join(
|
|
11842
|
-
root,
|
|
11843
|
-
".build",
|
|
11844
|
-
WASM_TRIPLE,
|
|
11845
|
-
"release",
|
|
11846
|
-
"ModuleCache"
|
|
11847
|
-
);
|
|
11848
|
-
if (output2.includes("was compiled with module cache path") && (0, import_node_fs17.existsSync)(moduleCache)) {
|
|
11849
|
-
(0, import_node_fs17.rmSync)(moduleCache, { recursive: true, force: true });
|
|
11850
|
-
try {
|
|
11851
|
-
await runCompiler(
|
|
11852
|
-
swift,
|
|
11853
|
-
buildArgs,
|
|
11854
|
-
appOptions,
|
|
11855
|
-
SWIFTPM_PROGRESS,
|
|
11856
|
-
SWIFTPM_NOISE
|
|
11857
|
-
);
|
|
11858
|
-
} catch (retryError) {
|
|
11859
|
-
throw new Error(
|
|
11860
|
-
[
|
|
11861
|
-
...unprepared,
|
|
11862
|
-
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
11863
|
-
].join("\n"),
|
|
11864
|
-
{ cause: retryError }
|
|
11865
|
-
);
|
|
11866
|
-
}
|
|
11867
|
-
} else {
|
|
11834
|
+
} catch (retryError) {
|
|
11868
11835
|
throw new Error(
|
|
11869
|
-
[
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11836
|
+
[
|
|
11837
|
+
...unprepared,
|
|
11838
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
11839
|
+
].join("\n"),
|
|
11840
|
+
{ cause: retryError }
|
|
11873
11841
|
);
|
|
11874
11842
|
}
|
|
11875
|
-
}
|
|
11876
|
-
if (options.project) endSwiftProjectProcesses(options.project);
|
|
11877
|
-
}
|
|
11878
|
-
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
11879
|
-
if (!(0, import_node_fs17.existsSync)(linked)) {
|
|
11880
|
-
const binDir = import_node_path19.default.dirname(linked);
|
|
11881
|
-
const found = (0, import_node_fs17.existsSync)(binDir) ? (0, import_node_fs17.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
|
|
11843
|
+
} else {
|
|
11882
11844
|
throw new Error(
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
const output = options.project ? projectOutputFile(root, linked, options.project) : linked;
|
|
11888
|
-
const optimized = `${output}.optimized`;
|
|
11889
|
-
if (input.lazyDistribution) {
|
|
11890
|
-
pruneSwiftWasmLink(
|
|
11891
|
-
root,
|
|
11892
|
-
options.toolchainBin,
|
|
11893
|
-
frameworkRoot,
|
|
11894
|
-
input.staticClangTargets
|
|
11845
|
+
[...unprepared, projectDiagnostic(output2, layout, input.files)].join(
|
|
11846
|
+
"\n"
|
|
11847
|
+
),
|
|
11848
|
+
{ cause: error }
|
|
11895
11849
|
);
|
|
11896
|
-
await optimizeWasm(output, optimized);
|
|
11897
11850
|
}
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
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
|
+
});
|
|
11910
11884
|
},
|
|
11911
11885
|
options.signal
|
|
11912
11886
|
);
|