peachsim 0.1.2681 → 0.1.2683
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 +7 -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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +505 -598
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +15 -5
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-PR2XQSSU.mjs → acorn-IKX32JM5.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-NET7R6JQ.mjs → chunk-2I4ZO225.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-KTGBQAWI.mjs → chunk-4QC7XPTA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LN55QJTY.mjs → chunk-5SA2UPEO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-J6HBVHOS.mjs → chunk-5SZETTJV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I7QX2CR7.mjs → chunk-73CUMN63.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YHFSPPEY.mjs → chunk-7LXBDQQH.mjs} +678 -790
- package/dist-lib/esm-chunks/{chunk-AN2MS7YE.mjs → chunk-AYSUZBC3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KZ6UAKVY.mjs → chunk-BC4OWNHZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4FLAV4CH.mjs → chunk-BXFBASQX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EULMEAZP.mjs → chunk-CQ4J5VV3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7E6FTDFH.mjs → chunk-DG7RT7A7.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-MCESDV7T.mjs → chunk-EZ64444V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-COZNDKTJ.mjs → chunk-HEN6NPXJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HHGF6SPD.mjs → chunk-HLISQIRP.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-VRIDWK4F.mjs → chunk-JTBC65YO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MIB25WM5.mjs → chunk-JVSMJ5IO.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-H6ZWWX3Q.mjs → chunk-LGV6BWY5.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-RICNI6K7.mjs → chunk-OGWPMZSB.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-AE55UVNN.mjs → chunk-OTWOI3OW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BMLK7CSL.mjs → chunk-QEV3YRKL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZIU5CFK4.mjs → chunk-RNZ65XZE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I6ET6AKV.mjs → chunk-S4OXEZXM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QZIWFRDI.mjs → chunk-UYWI2SM5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FETYD3YY.mjs → chunk-WBAH2CS4.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-IRQ5U7LT.mjs → metro-layout-parser-6IOBG67O.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-I3H6PNXA.mjs → swift-package-prebuilt-NBARV44W.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-GVKIKJFL.mjs → swift-sdk-app-module-5K76OLA6.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-SQUIDGQL.mjs → swift-sdk-image-WJMMMWZH.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-HTOOFVQH.mjs → swift-sdk-image-producer-M23OLZGS.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +495 -593
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +620 -715
- package/dist-lib/host/fetch-proxy-handler.cjs +22 -24
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +87 -87
- package/dist-lib/public-origins-lib.json +76 -76
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- 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 +8 -8
- package/dist-lib/skills.cjs +622 -717
- package/dist-lib/swift-compile.cjs +502 -618
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/engine/image-fetch.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/native-image-pipeline.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +3 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/native-bundles.ts +7 -1
- package/src/native-package-slice.ts +28 -12
- package/src/nitro-bundle.ts +1 -0
- package/src/nitro-compile.ts +8 -2
- package/src/nitroContract.ts +35 -14
- package/src/one-sdk-bundle.ts +2 -2
- package/src/swift-compile.ts +25 -131
- package/src/swift-guest-compile.ts +184 -218
- package/src/swift-host.ts +13 -23
- package/src/swift-submit.ts +0 -2
- package/src/turbo-bundle.ts +2 -2
- package/src/turbo-compile.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2683 | (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;
|
|
@@ -1297,7 +1297,7 @@ var init_src = __esm({
|
|
|
1297
1297
|
var runtime_companion_default;
|
|
1298
1298
|
var init_runtime_companion = __esm({
|
|
1299
1299
|
"runtime-companion.json"() {
|
|
1300
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
1300
|
+
runtime_companion_default = { abi: 1, sha256: "bb9524e625cd512d01d73897b153245e31293be34ceb91264e1524b688f9f844", file: "node/cli-bb9524e625cd512d01d73897b153245e31293be34ceb91264e1524b688f9f844.cjs" };
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
|
|
@@ -5610,6 +5610,23 @@ function readCompiledMetadata(label, value, readPackage, names) {
|
|
|
5610
5610
|
);
|
|
5611
5611
|
return { platform: "ios", packages, url, hash, icuUrl: icuUrl2, bundleFiles };
|
|
5612
5612
|
}
|
|
5613
|
+
function readSdkEntryMetadata(label, value) {
|
|
5614
|
+
const sdkUrl = Reflect.get(value, "sdkUrl");
|
|
5615
|
+
const sdkBindingUrl = Reflect.get(value, "sdkBindingUrl");
|
|
5616
|
+
if (sdkUrl === void 0 && sdkBindingUrl === void 0) return {};
|
|
5617
|
+
if (typeof sdkUrl === "string" && sdkUrl && typeof sdkBindingUrl === "string" && sdkBindingUrl)
|
|
5618
|
+
return { sdkUrl, sdkBindingUrl };
|
|
5619
|
+
throw new Error(`invalid ${label} SDK binding metadata`);
|
|
5620
|
+
}
|
|
5621
|
+
function readNitroMetadata(value) {
|
|
5622
|
+
const metadata = readCompiledMetadata(
|
|
5623
|
+
"Nitro",
|
|
5624
|
+
value,
|
|
5625
|
+
readNitroPackage,
|
|
5626
|
+
(entry) => entry.hybridObjects
|
|
5627
|
+
);
|
|
5628
|
+
return metadata && { ...metadata, ...readSdkEntryMetadata("Nitro", Object(value)) };
|
|
5629
|
+
}
|
|
5613
5630
|
function readTurboMetadata(value) {
|
|
5614
5631
|
if (value === null || value === void 0) return null;
|
|
5615
5632
|
if (typeof value !== "object" || Array.isArray(value) || Reflect.get(value, "platform") !== NITRO_GUEST_PLATFORM)
|
|
@@ -5643,9 +5660,11 @@ function readTurboMetadata(value) {
|
|
|
5643
5660
|
readCompiledPackage,
|
|
5644
5661
|
() => []
|
|
5645
5662
|
);
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5663
|
+
return metadata && {
|
|
5664
|
+
...metadata,
|
|
5665
|
+
...readSdkEntryMetadata("TurboModule", value),
|
|
5666
|
+
...unavailable2 ? { unavailable: unavailable2 } : {}
|
|
5667
|
+
};
|
|
5649
5668
|
}
|
|
5650
5669
|
function insertNitroFooter(source, metadata) {
|
|
5651
5670
|
readNitroMetadata(metadata);
|
|
@@ -5655,7 +5674,7 @@ function insertTurboFooter(source, metadata) {
|
|
|
5655
5674
|
readTurboMetadata(metadata);
|
|
5656
5675
|
return insertBundleMetadataFooter(source, "turbo", metadata);
|
|
5657
5676
|
}
|
|
5658
|
-
var NITRO_GUEST_PLATFORM
|
|
5677
|
+
var NITRO_GUEST_PLATFORM;
|
|
5659
5678
|
var init_nitroContract = __esm({
|
|
5660
5679
|
"src/nitroContract.ts"() {
|
|
5661
5680
|
"use strict";
|
|
@@ -5663,7 +5682,6 @@ var init_nitroContract = __esm({
|
|
|
5663
5682
|
init_is_record();
|
|
5664
5683
|
init_swiftContract();
|
|
5665
5684
|
NITRO_GUEST_PLATFORM = "ios";
|
|
5666
|
-
readNitroMetadata = (value) => readCompiledMetadata("Nitro", value, readNitroPackage, (entry) => entry.hybridObjects);
|
|
5667
5685
|
}
|
|
5668
5686
|
});
|
|
5669
5687
|
|
|
@@ -10018,9 +10036,6 @@ var init_retired_cache_directory = __esm({
|
|
|
10018
10036
|
});
|
|
10019
10037
|
|
|
10020
10038
|
// src/swift-compile-budget.ts
|
|
10021
|
-
function swiftBuilderHopTimeoutMs(compileTimeoutMs) {
|
|
10022
|
-
return SWIFT_LOCK_WAIT_TIMEOUT_MS + (compileTimeoutMs ?? SWIFT_COMPILE_TIMEOUT_MS) + SWIFT_TRANSPORT_MARGIN_MS;
|
|
10023
|
-
}
|
|
10024
10039
|
async function withSwiftCompileBudget(compileTimeoutMs, signal, work) {
|
|
10025
10040
|
const deadline = new AbortController();
|
|
10026
10041
|
const combined = signal ? AbortSignal.any([signal, deadline.signal]) : deadline.signal;
|
|
@@ -10060,13 +10075,12 @@ async function withSwiftCompileBudget(compileTimeoutMs, signal, work) {
|
|
|
10060
10075
|
clearTimeout(timer);
|
|
10061
10076
|
}
|
|
10062
10077
|
}
|
|
10063
|
-
var SWIFT_COMPILE_TIMEOUT_MS, SWIFT_LOCK_WAIT_TIMEOUT_MS
|
|
10078
|
+
var SWIFT_COMPILE_TIMEOUT_MS, SWIFT_LOCK_WAIT_TIMEOUT_MS;
|
|
10064
10079
|
var init_swift_compile_budget = __esm({
|
|
10065
10080
|
"src/swift-compile-budget.ts"() {
|
|
10066
10081
|
"use strict";
|
|
10067
10082
|
SWIFT_COMPILE_TIMEOUT_MS = 18e5;
|
|
10068
10083
|
SWIFT_LOCK_WAIT_TIMEOUT_MS = 36e5;
|
|
10069
|
-
SWIFT_TRANSPORT_MARGIN_MS = 3e5;
|
|
10070
10084
|
}
|
|
10071
10085
|
});
|
|
10072
10086
|
|
|
@@ -10091,7 +10105,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
10091
10105
|
|
|
10092
10106
|
// src/swift-compiler-digest.ts
|
|
10093
10107
|
function swiftArchiveCompilerDigestValue() {
|
|
10094
|
-
return true ? "
|
|
10108
|
+
return true ? "c304a2da11e2e676fe221d87209a1136a730fd7ea4bf5d094065fd377480ecef" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname, "archive");
|
|
10095
10109
|
}
|
|
10096
10110
|
var import_node_crypto9, import_node_fs20, import_node_path16, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
10097
10111
|
var init_swift_compiler_digest = __esm({
|
|
@@ -20319,281 +20333,6 @@ var init_swift_guest_archive = __esm({
|
|
|
20319
20333
|
}
|
|
20320
20334
|
});
|
|
20321
20335
|
|
|
20322
|
-
// ../peach-kit/src/nativeWasmContract.ts
|
|
20323
|
-
var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_SECTION, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_TABLE_RESERVE_SLOTS;
|
|
20324
|
-
var init_nativeWasmContract = __esm({
|
|
20325
|
-
"../peach-kit/src/nativeWasmContract.ts"() {
|
|
20326
|
-
"use strict";
|
|
20327
|
-
NATIVE_IMAGE_SECTION = "peach.native-image-v1";
|
|
20328
|
-
NATIVE_TABLE_ABI = "peach-native-table-v1";
|
|
20329
|
-
NATIVE_TABLE_IMPORT_MODULE = "peach_thread";
|
|
20330
|
-
NATIVE_DYLD_FUNCTION_IMPORT = "dyld_function";
|
|
20331
|
-
NATIVE_DYLD_PLACE_EXPORT = "__peach_dyld_place";
|
|
20332
|
-
NATIVE_LAZY_IMPORT_MODULE = "peach_lazy";
|
|
20333
|
-
NATIVE_SDK_IMPORT_MODULE = "peach_sdk";
|
|
20334
|
-
NATIVE_SDK_THUNK_SECTION = "peach.sdk-thunks";
|
|
20335
|
-
NATIVE_LAZY_SLOT_IMPORT = "load_slot";
|
|
20336
|
-
NATIVE_LAZY_SECTION = "peach.lazy-code-v2";
|
|
20337
|
-
NATIVE_LAZY_DIGEST_BYTES = 32;
|
|
20338
|
-
NATIVE_LAZY_PART_BYTES = NATIVE_LAZY_DIGEST_BYTES + 4;
|
|
20339
|
-
NATIVE_TABLE_RESERVE_SLOTS = 4096;
|
|
20340
|
-
}
|
|
20341
|
-
});
|
|
20342
|
-
|
|
20343
|
-
// src/swift-guest-dyld-functions.ts
|
|
20344
|
-
function skipValueType(r) {
|
|
20345
|
-
const type = r.byte();
|
|
20346
|
-
if (type === 99 || type === 100) r.s();
|
|
20347
|
-
}
|
|
20348
|
-
function readImports2(bytes, sections) {
|
|
20349
|
-
let functions = 0;
|
|
20350
|
-
let table64;
|
|
20351
|
-
const imports2 = sections.find((s) => s.id === 2);
|
|
20352
|
-
if (imports2) {
|
|
20353
|
-
const r = wasmReader(bytes, imports2.start);
|
|
20354
|
-
for (let n = r.u(); n > 0; n--) {
|
|
20355
|
-
r.name();
|
|
20356
|
-
r.name();
|
|
20357
|
-
const kind = r.byte();
|
|
20358
|
-
if (kind === 0) {
|
|
20359
|
-
functions++;
|
|
20360
|
-
r.u();
|
|
20361
|
-
} else if (kind === 1 || kind === 2) {
|
|
20362
|
-
if (kind === 1) skipValueType(r);
|
|
20363
|
-
const flags = r.u();
|
|
20364
|
-
r.u();
|
|
20365
|
-
if (flags & 1) r.u();
|
|
20366
|
-
if (kind === 1) table64 ??= (flags & 4) !== 0;
|
|
20367
|
-
} else if (kind === 3) {
|
|
20368
|
-
skipValueType(r);
|
|
20369
|
-
r.byte();
|
|
20370
|
-
} else if (kind === 4) {
|
|
20371
|
-
r.byte();
|
|
20372
|
-
r.u();
|
|
20373
|
-
} else throw new Error(`unsupported wasm import kind ${kind}`);
|
|
20374
|
-
}
|
|
20375
|
-
}
|
|
20376
|
-
const tables = sections.find((s) => s.id === 4);
|
|
20377
|
-
if (table64 === void 0 && tables) {
|
|
20378
|
-
const r = wasmReader(bytes, tables.start);
|
|
20379
|
-
if (r.u()) {
|
|
20380
|
-
skipValueType(r);
|
|
20381
|
-
table64 = (r.u() & 4) !== 0;
|
|
20382
|
-
}
|
|
20383
|
-
}
|
|
20384
|
-
return { functions, table64 };
|
|
20385
|
-
}
|
|
20386
|
-
function vectorSection(id, count, parts) {
|
|
20387
|
-
const body = Buffer.concat([Buffer.from(uleb2(count)), ...parts]);
|
|
20388
|
-
return Buffer.concat([Buffer.from([id, ...uleb2(body.length)]), body]);
|
|
20389
|
-
}
|
|
20390
|
-
function rewriteSections(bytes, sections, changes) {
|
|
20391
|
-
const out = [bytes.subarray(0, 8)];
|
|
20392
|
-
const pending2 = new Map(changes);
|
|
20393
|
-
const flushBefore = (id) => {
|
|
20394
|
-
for (const [missing2, section2] of pending2) {
|
|
20395
|
-
if (SECTION_ORDER.indexOf(missing2) >= SECTION_ORDER.indexOf(id)) continue;
|
|
20396
|
-
if (section2) out.push(section2);
|
|
20397
|
-
pending2.delete(missing2);
|
|
20398
|
-
}
|
|
20399
|
-
};
|
|
20400
|
-
for (const s of sections) {
|
|
20401
|
-
if (s.id !== 0) flushBefore(s.id);
|
|
20402
|
-
if (!pending2.has(s.id)) {
|
|
20403
|
-
out.push(bytes.subarray(s.offset, s.end));
|
|
20404
|
-
continue;
|
|
20405
|
-
}
|
|
20406
|
-
const section2 = pending2.get(s.id);
|
|
20407
|
-
pending2.delete(s.id);
|
|
20408
|
-
if (section2) out.push(section2);
|
|
20409
|
-
}
|
|
20410
|
-
for (const section2 of pending2.values()) if (section2) out.push(section2);
|
|
20411
|
-
return Buffer.concat(out);
|
|
20412
|
-
}
|
|
20413
|
-
function entries(bytes, section2, entry) {
|
|
20414
|
-
if (!section2) return [];
|
|
20415
|
-
const r = wasmReader(bytes, section2.start);
|
|
20416
|
-
const out = [];
|
|
20417
|
-
for (let n = r.u(); n > 0; n--) {
|
|
20418
|
-
const begin = r.at;
|
|
20419
|
-
entry(r);
|
|
20420
|
-
out.push(bytes.subarray(begin, r.at));
|
|
20421
|
-
}
|
|
20422
|
-
if (r.at !== section2.end) throw new Error(`invalid wasm section ${section2.id}`);
|
|
20423
|
-
return out;
|
|
20424
|
-
}
|
|
20425
|
-
function appendLazyPlacement(bytes, functions, table) {
|
|
20426
|
-
const sections = wasmSections(bytes);
|
|
20427
|
-
const section2 = (id) => sections.find((s) => s.id === id);
|
|
20428
|
-
const imports2 = readImports2(bytes, sections);
|
|
20429
|
-
const changes = /* @__PURE__ */ new Map();
|
|
20430
|
-
let table64 = imports2.table64;
|
|
20431
|
-
if (table64 === void 0) {
|
|
20432
|
-
if (!table) throw new Error("native image has no function table");
|
|
20433
|
-
table64 = table.table64;
|
|
20434
|
-
const found = section2(2);
|
|
20435
|
-
const header = found && wasmReader(bytes, found.start);
|
|
20436
|
-
const count = header ? header.u() : 0;
|
|
20437
|
-
const module2 = Buffer.from("primary");
|
|
20438
|
-
const name4 = Buffer.from(table.name);
|
|
20439
|
-
changes.set(
|
|
20440
|
-
2,
|
|
20441
|
-
vectorSection(2, count + 1, [
|
|
20442
|
-
found && header ? bytes.subarray(header.at, found.end) : new Uint8Array(),
|
|
20443
|
-
Buffer.from([
|
|
20444
|
-
...uleb2(module2.length),
|
|
20445
|
-
...module2,
|
|
20446
|
-
...uleb2(name4.length),
|
|
20447
|
-
...name4,
|
|
20448
|
-
1,
|
|
20449
|
-
112,
|
|
20450
|
-
table64 ? 4 : 0,
|
|
20451
|
-
0
|
|
20452
|
-
])
|
|
20453
|
-
])
|
|
20454
|
-
);
|
|
20455
|
-
}
|
|
20456
|
-
const types2 = entries(bytes, section2(1), (r) => {
|
|
20457
|
-
if (r.byte() !== 96) throw new Error("native image has a non-function type");
|
|
20458
|
-
for (let side = 0; side < 2; side++) for (let n = r.u(); n > 0; n--) skipValueType(r);
|
|
20459
|
-
});
|
|
20460
|
-
const declared = entries(bytes, section2(3), (r) => r.u());
|
|
20461
|
-
const bodies = entries(bytes, section2(10), (r) => r.skip(r.u()));
|
|
20462
|
-
const exports2 = entries(bytes, section2(7), readExport);
|
|
20463
|
-
const elements = entries(bytes, section2(9), skipElementSegment);
|
|
20464
|
-
const placementIndex = lastTableElement(elements) + 1;
|
|
20465
|
-
elements.splice(
|
|
20466
|
-
placementIndex,
|
|
20467
|
-
0,
|
|
20468
|
-
Buffer.from([1, 0, ...uleb2(functions.length), ...functions.flatMap(uleb2)])
|
|
20469
|
-
);
|
|
20470
|
-
const place2 = imports2.functions + declared.length;
|
|
20471
|
-
const instructions = [
|
|
20472
|
-
0,
|
|
20473
|
-
32,
|
|
20474
|
-
1,
|
|
20475
|
-
...table64 ? [173] : [],
|
|
20476
|
-
32,
|
|
20477
|
-
0,
|
|
20478
|
-
65,
|
|
20479
|
-
1,
|
|
20480
|
-
252,
|
|
20481
|
-
12,
|
|
20482
|
-
...uleb2(placementIndex),
|
|
20483
|
-
0,
|
|
20484
|
-
11
|
|
20485
|
-
];
|
|
20486
|
-
const name3 = Buffer.from(NATIVE_DYLD_PLACE_EXPORT);
|
|
20487
|
-
return rewriteSections(
|
|
20488
|
-
bytes,
|
|
20489
|
-
sections,
|
|
20490
|
-
new Map([
|
|
20491
|
-
...changes,
|
|
20492
|
-
[
|
|
20493
|
-
1,
|
|
20494
|
-
vectorSection(1, types2.length + 1, [
|
|
20495
|
-
...types2,
|
|
20496
|
-
Buffer.from([96, 2, 127, 127, 0])
|
|
20497
|
-
])
|
|
20498
|
-
],
|
|
20499
|
-
[
|
|
20500
|
-
3,
|
|
20501
|
-
vectorSection(3, declared.length + 1, [
|
|
20502
|
-
...declared,
|
|
20503
|
-
Buffer.from(uleb2(types2.length))
|
|
20504
|
-
])
|
|
20505
|
-
],
|
|
20506
|
-
[
|
|
20507
|
-
7,
|
|
20508
|
-
vectorSection(7, exports2.length + 1, [
|
|
20509
|
-
...exports2,
|
|
20510
|
-
Buffer.from([...uleb2(name3.length), ...name3, 0, ...uleb2(place2)])
|
|
20511
|
-
])
|
|
20512
|
-
],
|
|
20513
|
-
[9, vectorSection(9, elements.length, elements)],
|
|
20514
|
-
[
|
|
20515
|
-
10,
|
|
20516
|
-
vectorSection(10, bodies.length + 1, [
|
|
20517
|
-
...bodies,
|
|
20518
|
-
Buffer.from([...uleb2(instructions.length), ...instructions])
|
|
20519
|
-
])
|
|
20520
|
-
]
|
|
20521
|
-
])
|
|
20522
|
-
);
|
|
20523
|
-
}
|
|
20524
|
-
function skipConstant(r) {
|
|
20525
|
-
for (let op = r.byte(); op !== 11; op = r.byte()) {
|
|
20526
|
-
if (op === 65 || op === 66) r.s();
|
|
20527
|
-
else if (op === 35 || op === 210) r.u();
|
|
20528
|
-
else if (op === 208) r.s();
|
|
20529
|
-
else if (![106, 107, 108, 124, 125, 126].includes(op))
|
|
20530
|
-
throw new Error(`unsupported constant expression op ${op}`);
|
|
20531
|
-
}
|
|
20532
|
-
}
|
|
20533
|
-
function skipElementSegment(r) {
|
|
20534
|
-
const flags = r.u();
|
|
20535
|
-
if (flags > 7) throw new Error(`unsupported element segment flags ${flags}`);
|
|
20536
|
-
if ((flags & 3) === 2) r.u();
|
|
20537
|
-
if (!(flags & 1)) skipConstant(r);
|
|
20538
|
-
if (flags & 3) skipValueType(r);
|
|
20539
|
-
for (let count = r.u(); count > 0; count--)
|
|
20540
|
-
if (flags & 4) skipConstant(r);
|
|
20541
|
-
else r.u();
|
|
20542
|
-
}
|
|
20543
|
-
function placeGuestLazyFunctions(bytes, lazy) {
|
|
20544
|
-
const sections = wasmSections(bytes);
|
|
20545
|
-
const lazyIndex = new Map(lazy.map((name3, index) => [name3, index]));
|
|
20546
|
-
const functions = new Array(lazy.length);
|
|
20547
|
-
let found = 0;
|
|
20548
|
-
const kept = entries(
|
|
20549
|
-
bytes,
|
|
20550
|
-
sections.find((s) => s.id === 7),
|
|
20551
|
-
readExport
|
|
20552
|
-
).filter((entry) => {
|
|
20553
|
-
const r = wasmReader(entry, 0);
|
|
20554
|
-
const position = lazyIndex.get(r.name());
|
|
20555
|
-
const kind = r.byte();
|
|
20556
|
-
if (kind !== 0 || position === void 0) return true;
|
|
20557
|
-
functions[position] = r.u();
|
|
20558
|
-
found++;
|
|
20559
|
-
return false;
|
|
20560
|
-
});
|
|
20561
|
-
if (found !== lazy.length)
|
|
20562
|
-
throw new Error("guest link lost a lazy dlsym function export");
|
|
20563
|
-
return appendLazyPlacement(
|
|
20564
|
-
rewriteSections(bytes, sections, /* @__PURE__ */ new Map([[7, vectorSection(7, kept.length, kept)]])),
|
|
20565
|
-
functions
|
|
20566
|
-
);
|
|
20567
|
-
}
|
|
20568
|
-
function guestLazyExports(lazy) {
|
|
20569
|
-
return lazy.map((name3) => JSON.stringify(`--export=${name3}`)).join("\n");
|
|
20570
|
-
}
|
|
20571
|
-
var uleb2, SECTION_ORDER, readExport, lastTableElement;
|
|
20572
|
-
var init_swift_guest_dyld_functions = __esm({
|
|
20573
|
-
"src/swift-guest-dyld-functions.ts"() {
|
|
20574
|
-
"use strict";
|
|
20575
|
-
init_nativeWasmContract();
|
|
20576
|
-
init_swift_sdk_image_wasm();
|
|
20577
|
-
uleb2 = (value) => {
|
|
20578
|
-
const out = [];
|
|
20579
|
-
do {
|
|
20580
|
-
let byte = value % 128;
|
|
20581
|
-
value = Math.floor(value / 128);
|
|
20582
|
-
if (value) byte |= 128;
|
|
20583
|
-
out.push(byte);
|
|
20584
|
-
} while (value);
|
|
20585
|
-
return out;
|
|
20586
|
-
};
|
|
20587
|
-
SECTION_ORDER = [1, 2, 3, 4, 5, 13, 6, 7, 8, 9, 12, 10, 11];
|
|
20588
|
-
readExport = (r) => {
|
|
20589
|
-
r.name();
|
|
20590
|
-
r.byte();
|
|
20591
|
-
r.u();
|
|
20592
|
-
};
|
|
20593
|
-
lastTableElement = (segments) => segments.findLastIndex((segment3) => (segment3[0] & 3) !== 3);
|
|
20594
|
-
}
|
|
20595
|
-
});
|
|
20596
|
-
|
|
20597
20336
|
// ../peach-kit/src/nativeDyldTableContract.ts
|
|
20598
20337
|
function nativeDyldName(bytes) {
|
|
20599
20338
|
let name3 = "";
|
|
@@ -20644,6 +20383,27 @@ var init_nativeDyldTableContract = __esm({
|
|
|
20644
20383
|
}
|
|
20645
20384
|
});
|
|
20646
20385
|
|
|
20386
|
+
// ../peach-kit/src/nativeWasmContract.ts
|
|
20387
|
+
var NATIVE_IMAGE_SECTION, NATIVE_TABLE_ABI, NATIVE_TABLE_IMPORT_MODULE, NATIVE_DYLD_FUNCTION_IMPORT, NATIVE_DYLD_PLACE_EXPORT, NATIVE_LAZY_IMPORT_MODULE, NATIVE_SDK_IMPORT_MODULE, NATIVE_SDK_THUNK_SECTION, NATIVE_LAZY_SLOT_IMPORT, NATIVE_LAZY_SECTION, NATIVE_LAZY_DIGEST_BYTES, NATIVE_LAZY_PART_BYTES, NATIVE_TABLE_RESERVE_SLOTS;
|
|
20388
|
+
var init_nativeWasmContract = __esm({
|
|
20389
|
+
"../peach-kit/src/nativeWasmContract.ts"() {
|
|
20390
|
+
"use strict";
|
|
20391
|
+
NATIVE_IMAGE_SECTION = "peach.native-image-v1";
|
|
20392
|
+
NATIVE_TABLE_ABI = "peach-native-table-v1";
|
|
20393
|
+
NATIVE_TABLE_IMPORT_MODULE = "peach_thread";
|
|
20394
|
+
NATIVE_DYLD_FUNCTION_IMPORT = "dyld_function";
|
|
20395
|
+
NATIVE_DYLD_PLACE_EXPORT = "__peach_dyld_place";
|
|
20396
|
+
NATIVE_LAZY_IMPORT_MODULE = "peach_lazy";
|
|
20397
|
+
NATIVE_SDK_IMPORT_MODULE = "peach_sdk";
|
|
20398
|
+
NATIVE_SDK_THUNK_SECTION = "peach.sdk-thunks";
|
|
20399
|
+
NATIVE_LAZY_SLOT_IMPORT = "load_slot";
|
|
20400
|
+
NATIVE_LAZY_SECTION = "peach.lazy-code-v2";
|
|
20401
|
+
NATIVE_LAZY_DIGEST_BYTES = 32;
|
|
20402
|
+
NATIVE_LAZY_PART_BYTES = NATIVE_LAZY_DIGEST_BYTES + 4;
|
|
20403
|
+
NATIVE_TABLE_RESERVE_SLOTS = 4096;
|
|
20404
|
+
}
|
|
20405
|
+
});
|
|
20406
|
+
|
|
20647
20407
|
// src/swift-guest-image-ledger.ts
|
|
20648
20408
|
function readNumber(bytes, position) {
|
|
20649
20409
|
if (position < bytes.length) {
|
|
@@ -22323,7 +22083,7 @@ function sha256Hex2(bytes) {
|
|
|
22323
22083
|
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
22324
22084
|
return (0, import_node_crypto17.createHash)("sha256").update(bytes).digest("hex");
|
|
22325
22085
|
}
|
|
22326
|
-
function
|
|
22086
|
+
function uleb2(value) {
|
|
22327
22087
|
const bytes = [];
|
|
22328
22088
|
for (let rest = value; ; rest = Math.floor(rest / 128)) {
|
|
22329
22089
|
if (rest < 128) return [...bytes, rest];
|
|
@@ -22342,7 +22102,7 @@ function encodeGuestDyldTable(rows) {
|
|
|
22342
22102
|
value.writeBigUInt64LE(row.value);
|
|
22343
22103
|
const bytes = Buffer.concat([
|
|
22344
22104
|
row.bytes,
|
|
22345
|
-
Buffer.from([0, ...
|
|
22105
|
+
Buffer.from([0, ...uleb2(row.image), row.kind]),
|
|
22346
22106
|
value
|
|
22347
22107
|
]);
|
|
22348
22108
|
if (!current2.length) firsts.push(row.bytes);
|
|
@@ -22464,6 +22224,260 @@ var init_mapLimit = __esm({
|
|
|
22464
22224
|
}
|
|
22465
22225
|
});
|
|
22466
22226
|
|
|
22227
|
+
// src/swift-guest-dyld-functions.ts
|
|
22228
|
+
function skipValueType(r) {
|
|
22229
|
+
const type = r.byte();
|
|
22230
|
+
if (type === 99 || type === 100) r.s();
|
|
22231
|
+
}
|
|
22232
|
+
function readImports2(bytes, sections) {
|
|
22233
|
+
let functions = 0;
|
|
22234
|
+
let table64;
|
|
22235
|
+
const imports2 = sections.find((s) => s.id === 2);
|
|
22236
|
+
if (imports2) {
|
|
22237
|
+
const r = wasmReader(bytes, imports2.start);
|
|
22238
|
+
for (let n = r.u(); n > 0; n--) {
|
|
22239
|
+
r.name();
|
|
22240
|
+
r.name();
|
|
22241
|
+
const kind = r.byte();
|
|
22242
|
+
if (kind === 0) {
|
|
22243
|
+
functions++;
|
|
22244
|
+
r.u();
|
|
22245
|
+
} else if (kind === 1 || kind === 2) {
|
|
22246
|
+
if (kind === 1) skipValueType(r);
|
|
22247
|
+
const flags = r.u();
|
|
22248
|
+
r.u();
|
|
22249
|
+
if (flags & 1) r.u();
|
|
22250
|
+
if (kind === 1) table64 ??= (flags & 4) !== 0;
|
|
22251
|
+
} else if (kind === 3) {
|
|
22252
|
+
skipValueType(r);
|
|
22253
|
+
r.byte();
|
|
22254
|
+
} else if (kind === 4) {
|
|
22255
|
+
r.byte();
|
|
22256
|
+
r.u();
|
|
22257
|
+
} else throw new Error(`unsupported wasm import kind ${kind}`);
|
|
22258
|
+
}
|
|
22259
|
+
}
|
|
22260
|
+
const tables = sections.find((s) => s.id === 4);
|
|
22261
|
+
if (table64 === void 0 && tables) {
|
|
22262
|
+
const r = wasmReader(bytes, tables.start);
|
|
22263
|
+
if (r.u()) {
|
|
22264
|
+
skipValueType(r);
|
|
22265
|
+
table64 = (r.u() & 4) !== 0;
|
|
22266
|
+
}
|
|
22267
|
+
}
|
|
22268
|
+
return { functions, table64 };
|
|
22269
|
+
}
|
|
22270
|
+
function vectorSection(id, count, parts) {
|
|
22271
|
+
const body = Buffer.concat([Buffer.from(uleb3(count)), ...parts]);
|
|
22272
|
+
return Buffer.concat([Buffer.from([id, ...uleb3(body.length)]), body]);
|
|
22273
|
+
}
|
|
22274
|
+
function rewriteSections(bytes, sections, changes) {
|
|
22275
|
+
const out = [bytes.subarray(0, 8)];
|
|
22276
|
+
const pending2 = new Map(changes);
|
|
22277
|
+
const flushBefore = (id) => {
|
|
22278
|
+
for (const [missing2, section2] of pending2) {
|
|
22279
|
+
if (SECTION_ORDER.indexOf(missing2) >= SECTION_ORDER.indexOf(id)) continue;
|
|
22280
|
+
if (section2) out.push(section2);
|
|
22281
|
+
pending2.delete(missing2);
|
|
22282
|
+
}
|
|
22283
|
+
};
|
|
22284
|
+
for (const s of sections) {
|
|
22285
|
+
if (s.id !== 0) flushBefore(s.id);
|
|
22286
|
+
if (!pending2.has(s.id)) {
|
|
22287
|
+
out.push(bytes.subarray(s.offset, s.end));
|
|
22288
|
+
continue;
|
|
22289
|
+
}
|
|
22290
|
+
const section2 = pending2.get(s.id);
|
|
22291
|
+
pending2.delete(s.id);
|
|
22292
|
+
if (section2) out.push(section2);
|
|
22293
|
+
}
|
|
22294
|
+
for (const section2 of pending2.values()) if (section2) out.push(section2);
|
|
22295
|
+
return Buffer.concat(out);
|
|
22296
|
+
}
|
|
22297
|
+
function entries(bytes, section2, entry) {
|
|
22298
|
+
if (!section2) return [];
|
|
22299
|
+
const r = wasmReader(bytes, section2.start);
|
|
22300
|
+
const out = [];
|
|
22301
|
+
for (let n = r.u(); n > 0; n--) {
|
|
22302
|
+
const begin = r.at;
|
|
22303
|
+
entry(r);
|
|
22304
|
+
out.push(bytes.subarray(begin, r.at));
|
|
22305
|
+
}
|
|
22306
|
+
if (r.at !== section2.end) throw new Error(`invalid wasm section ${section2.id}`);
|
|
22307
|
+
return out;
|
|
22308
|
+
}
|
|
22309
|
+
function appendLazyPlacement(bytes, functions, table) {
|
|
22310
|
+
const sections = wasmSections(bytes);
|
|
22311
|
+
const section2 = (id) => sections.find((s) => s.id === id);
|
|
22312
|
+
const imports2 = readImports2(bytes, sections);
|
|
22313
|
+
const changes = /* @__PURE__ */ new Map();
|
|
22314
|
+
let table64 = imports2.table64;
|
|
22315
|
+
if (table64 === void 0) {
|
|
22316
|
+
if (!table) throw new Error("native image has no function table");
|
|
22317
|
+
table64 = table.table64;
|
|
22318
|
+
const found = section2(2);
|
|
22319
|
+
const header = found && wasmReader(bytes, found.start);
|
|
22320
|
+
const count = header ? header.u() : 0;
|
|
22321
|
+
const module2 = Buffer.from("primary");
|
|
22322
|
+
const name4 = Buffer.from(table.name);
|
|
22323
|
+
changes.set(
|
|
22324
|
+
2,
|
|
22325
|
+
vectorSection(2, count + 1, [
|
|
22326
|
+
found && header ? bytes.subarray(header.at, found.end) : new Uint8Array(),
|
|
22327
|
+
Buffer.from([
|
|
22328
|
+
...uleb3(module2.length),
|
|
22329
|
+
...module2,
|
|
22330
|
+
...uleb3(name4.length),
|
|
22331
|
+
...name4,
|
|
22332
|
+
1,
|
|
22333
|
+
112,
|
|
22334
|
+
table64 ? 4 : 0,
|
|
22335
|
+
0
|
|
22336
|
+
])
|
|
22337
|
+
])
|
|
22338
|
+
);
|
|
22339
|
+
}
|
|
22340
|
+
const types2 = entries(bytes, section2(1), (r) => {
|
|
22341
|
+
if (r.byte() !== 96) throw new Error("native image has a non-function type");
|
|
22342
|
+
for (let side = 0; side < 2; side++) for (let n = r.u(); n > 0; n--) skipValueType(r);
|
|
22343
|
+
});
|
|
22344
|
+
const declared = entries(bytes, section2(3), (r) => r.u());
|
|
22345
|
+
const bodies = entries(bytes, section2(10), (r) => r.skip(r.u()));
|
|
22346
|
+
const exports2 = entries(bytes, section2(7), readExport);
|
|
22347
|
+
const elements = entries(bytes, section2(9), skipElementSegment);
|
|
22348
|
+
const placementIndex = lastTableElement(elements) + 1;
|
|
22349
|
+
elements.splice(
|
|
22350
|
+
placementIndex,
|
|
22351
|
+
0,
|
|
22352
|
+
Buffer.from([1, 0, ...uleb3(functions.length), ...functions.flatMap(uleb3)])
|
|
22353
|
+
);
|
|
22354
|
+
const place2 = imports2.functions + declared.length;
|
|
22355
|
+
const instructions = [
|
|
22356
|
+
0,
|
|
22357
|
+
32,
|
|
22358
|
+
1,
|
|
22359
|
+
...table64 ? [173] : [],
|
|
22360
|
+
32,
|
|
22361
|
+
0,
|
|
22362
|
+
65,
|
|
22363
|
+
1,
|
|
22364
|
+
252,
|
|
22365
|
+
12,
|
|
22366
|
+
...uleb3(placementIndex),
|
|
22367
|
+
0,
|
|
22368
|
+
11
|
|
22369
|
+
];
|
|
22370
|
+
const name3 = Buffer.from(NATIVE_DYLD_PLACE_EXPORT);
|
|
22371
|
+
return rewriteSections(
|
|
22372
|
+
bytes,
|
|
22373
|
+
sections,
|
|
22374
|
+
new Map([
|
|
22375
|
+
...changes,
|
|
22376
|
+
[
|
|
22377
|
+
1,
|
|
22378
|
+
vectorSection(1, types2.length + 1, [
|
|
22379
|
+
...types2,
|
|
22380
|
+
Buffer.from([96, 2, 127, 127, 0])
|
|
22381
|
+
])
|
|
22382
|
+
],
|
|
22383
|
+
[
|
|
22384
|
+
3,
|
|
22385
|
+
vectorSection(3, declared.length + 1, [
|
|
22386
|
+
...declared,
|
|
22387
|
+
Buffer.from(uleb3(types2.length))
|
|
22388
|
+
])
|
|
22389
|
+
],
|
|
22390
|
+
[
|
|
22391
|
+
7,
|
|
22392
|
+
vectorSection(7, exports2.length + 1, [
|
|
22393
|
+
...exports2,
|
|
22394
|
+
Buffer.from([...uleb3(name3.length), ...name3, 0, ...uleb3(place2)])
|
|
22395
|
+
])
|
|
22396
|
+
],
|
|
22397
|
+
[9, vectorSection(9, elements.length, elements)],
|
|
22398
|
+
[
|
|
22399
|
+
10,
|
|
22400
|
+
vectorSection(10, bodies.length + 1, [
|
|
22401
|
+
...bodies,
|
|
22402
|
+
Buffer.from([...uleb3(instructions.length), ...instructions])
|
|
22403
|
+
])
|
|
22404
|
+
]
|
|
22405
|
+
])
|
|
22406
|
+
);
|
|
22407
|
+
}
|
|
22408
|
+
function skipConstant(r) {
|
|
22409
|
+
for (let op = r.byte(); op !== 11; op = r.byte()) {
|
|
22410
|
+
if (op === 65 || op === 66) r.s();
|
|
22411
|
+
else if (op === 35 || op === 210) r.u();
|
|
22412
|
+
else if (op === 208) r.s();
|
|
22413
|
+
else if (![106, 107, 108, 124, 125, 126].includes(op))
|
|
22414
|
+
throw new Error(`unsupported constant expression op ${op}`);
|
|
22415
|
+
}
|
|
22416
|
+
}
|
|
22417
|
+
function skipElementSegment(r) {
|
|
22418
|
+
const flags = r.u();
|
|
22419
|
+
if (flags > 7) throw new Error(`unsupported element segment flags ${flags}`);
|
|
22420
|
+
if ((flags & 3) === 2) r.u();
|
|
22421
|
+
if (!(flags & 1)) skipConstant(r);
|
|
22422
|
+
if (flags & 3) skipValueType(r);
|
|
22423
|
+
for (let count = r.u(); count > 0; count--)
|
|
22424
|
+
if (flags & 4) skipConstant(r);
|
|
22425
|
+
else r.u();
|
|
22426
|
+
}
|
|
22427
|
+
function placeGuestLazyFunctions(bytes, lazy) {
|
|
22428
|
+
const sections = wasmSections(bytes);
|
|
22429
|
+
const lazyIndex = new Map(lazy.map((name3, index) => [name3, index]));
|
|
22430
|
+
const functions = new Array(lazy.length);
|
|
22431
|
+
let found = 0;
|
|
22432
|
+
const kept = entries(
|
|
22433
|
+
bytes,
|
|
22434
|
+
sections.find((s) => s.id === 7),
|
|
22435
|
+
readExport
|
|
22436
|
+
).filter((entry) => {
|
|
22437
|
+
const r = wasmReader(entry, 0);
|
|
22438
|
+
const position = lazyIndex.get(r.name());
|
|
22439
|
+
const kind = r.byte();
|
|
22440
|
+
if (kind !== 0 || position === void 0) return true;
|
|
22441
|
+
functions[position] = r.u();
|
|
22442
|
+
found++;
|
|
22443
|
+
return false;
|
|
22444
|
+
});
|
|
22445
|
+
if (found !== lazy.length)
|
|
22446
|
+
throw new Error("guest link lost a lazy dlsym function export");
|
|
22447
|
+
return appendLazyPlacement(
|
|
22448
|
+
rewriteSections(bytes, sections, /* @__PURE__ */ new Map([[7, vectorSection(7, kept.length, kept)]])),
|
|
22449
|
+
functions
|
|
22450
|
+
);
|
|
22451
|
+
}
|
|
22452
|
+
function guestLazyExports(lazy) {
|
|
22453
|
+
return lazy.map((name3) => JSON.stringify(`--export=${name3}`)).join("\n");
|
|
22454
|
+
}
|
|
22455
|
+
var uleb3, SECTION_ORDER, readExport, lastTableElement;
|
|
22456
|
+
var init_swift_guest_dyld_functions = __esm({
|
|
22457
|
+
"src/swift-guest-dyld-functions.ts"() {
|
|
22458
|
+
"use strict";
|
|
22459
|
+
init_nativeWasmContract();
|
|
22460
|
+
init_swift_sdk_image_wasm();
|
|
22461
|
+
uleb3 = (value) => {
|
|
22462
|
+
const out = [];
|
|
22463
|
+
do {
|
|
22464
|
+
let byte = value % 128;
|
|
22465
|
+
value = Math.floor(value / 128);
|
|
22466
|
+
if (value) byte |= 128;
|
|
22467
|
+
out.push(byte);
|
|
22468
|
+
} while (value);
|
|
22469
|
+
return out;
|
|
22470
|
+
};
|
|
22471
|
+
SECTION_ORDER = [1, 2, 3, 4, 5, 13, 6, 7, 8, 9, 12, 10, 11];
|
|
22472
|
+
readExport = (r) => {
|
|
22473
|
+
r.name();
|
|
22474
|
+
r.byte();
|
|
22475
|
+
r.u();
|
|
22476
|
+
};
|
|
22477
|
+
lastTableElement = (segments) => segments.findLastIndex((segment3) => (segment3[0] & 3) !== 3);
|
|
22478
|
+
}
|
|
22479
|
+
});
|
|
22480
|
+
|
|
22467
22481
|
// src/swift-guest-link-plan.ts
|
|
22468
22482
|
function selectedGuestInputImage(artifact, member) {
|
|
22469
22483
|
if (artifact.kind === "object" !== (member === null))
|
|
@@ -33966,9 +33980,11 @@ async function compileGuestLink(options2) {
|
|
|
33966
33980
|
return [...source, ...runtime].sort((a, b) => a.image - b.image);
|
|
33967
33981
|
};
|
|
33968
33982
|
const sdk2 = options2.sdkImage;
|
|
33969
|
-
const sdkCallers = sdk2
|
|
33970
|
-
const sdkObjects =
|
|
33971
|
-
|
|
33983
|
+
const sdkCallers = sdk2.sdkInterface.guestCallers;
|
|
33984
|
+
const sdkObjects = (await Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))).readSwiftSdkManifestIndex(
|
|
33985
|
+
sdk2
|
|
33986
|
+
).guestObjects;
|
|
33987
|
+
if (!sdkCallers || !sdkObjects)
|
|
33972
33988
|
throw new Error("the SDK image has no guest link manifest");
|
|
33973
33989
|
const result = await linkPrunedGuestImages({
|
|
33974
33990
|
buildDirectory: options2.buildDirectory,
|
|
@@ -33981,14 +33997,14 @@ async function compileGuestLink(options2) {
|
|
|
33981
33997
|
ledgerDataImage: 0,
|
|
33982
33998
|
framework: catalogs.framework,
|
|
33983
33999
|
sdkProducts: null,
|
|
33984
|
-
sharedSdk:
|
|
34000
|
+
sharedSdk: {
|
|
33985
34001
|
callers: sdkCallers,
|
|
33986
34002
|
hasContainingObject: (identity2) => sdkObjects[sdkGuestObjectKey(identity2)] !== void 0
|
|
33987
|
-
}
|
|
33988
|
-
onSplitInputs:
|
|
34003
|
+
},
|
|
34004
|
+
onSplitInputs: (value) => {
|
|
33989
34005
|
splitInputs = value;
|
|
33990
|
-
}
|
|
33991
|
-
deferFinalLink:
|
|
34006
|
+
},
|
|
34007
|
+
deferFinalLink: true,
|
|
33992
34008
|
onDyldRows: (rows) => {
|
|
33993
34009
|
lazyFunctions = rows.lazyFunctions;
|
|
33994
34010
|
dyldSymbols = rows.dyldSymbols;
|
|
@@ -34256,191 +34272,165 @@ async function compileGuestLink(options2) {
|
|
|
34256
34272
|
}
|
|
34257
34273
|
});
|
|
34258
34274
|
if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
|
|
34259
|
-
|
|
34260
|
-
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34264
|
-
|
|
34265
|
-
|
|
34266
|
-
|
|
34267
|
-
|
|
34268
|
-
|
|
34269
|
-
|
|
34270
|
-
|
|
34271
|
-
|
|
34272
|
-
|
|
34273
|
-
|
|
34274
|
-
|
|
34275
|
-
|
|
34276
|
-
|
|
34277
|
-
|
|
34278
|
-
|
|
34279
|
-
|
|
34280
|
-
|
|
34281
|
-
|
|
34282
|
-
|
|
34283
|
-
|
|
34284
|
-
|
|
34285
|
-
|
|
34286
|
-
|
|
34287
|
-
|
|
34288
|
-
|
|
34289
|
-
|
|
34290
|
-
|
|
34291
|
-
|
|
34275
|
+
try {
|
|
34276
|
+
if (!splitInputs) throw new Error("guest link did not select shared SDK inputs");
|
|
34277
|
+
const {
|
|
34278
|
+
createSwiftSdkBinding: createSwiftSdkBinding2,
|
|
34279
|
+
linkSwiftAppModule: linkSwiftAppModule2,
|
|
34280
|
+
readSwiftSdkUsage: readSwiftSdkUsage2,
|
|
34281
|
+
swiftAppModuleThunkSection: swiftAppModuleThunkSection2,
|
|
34282
|
+
swiftSdkProjectionSpans: swiftSdkProjectionSpans2
|
|
34283
|
+
} = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
34284
|
+
const project2 = options2.project;
|
|
34285
|
+
const work = project2 ? (0, import_node_fs47.mkdtempSync)(import_node_path45.default.join(directory2, "app-module-")) : import_node_path45.default.join(directory2, "app-module");
|
|
34286
|
+
if (project2) (0, import_node_fs47.chownSync)(work, project2.uid, project2.gid);
|
|
34287
|
+
else (0, import_node_fs47.mkdirSync)(work, { recursive: true });
|
|
34288
|
+
const layoutMap = import_node_path45.default.join(work, "app.map");
|
|
34289
|
+
let appProjectionObject = projectionObject;
|
|
34290
|
+
const owners = new Map(splitInputs.appObjects).set(appProjectionObject, 0);
|
|
34291
|
+
const sdkObjectKeys = /* @__PURE__ */ new Map();
|
|
34292
|
+
const sdkObjectImages = /* @__PURE__ */ new Map();
|
|
34293
|
+
const sdkProductImages = new Map(prepared?.sdkProducts.images);
|
|
34294
|
+
for (const [file, { image, product, identity: identity2 }] of splitInputs.sdkObjects) {
|
|
34295
|
+
const key2 = sdkGuestObjectKey(identity2);
|
|
34296
|
+
sdkObjectKeys.set(file, key2);
|
|
34297
|
+
sdkObjectImages.set(key2, image);
|
|
34298
|
+
const priorImage = sdkProductImages.get(product);
|
|
34299
|
+
if (priorImage !== void 0 && priorImage !== image)
|
|
34300
|
+
throw new Error(`SDK product ${product} has several guest images`);
|
|
34301
|
+
sdkProductImages.set(product, image);
|
|
34302
|
+
}
|
|
34303
|
+
const linkedModule = import_node_path45.default.join(work, "app.wasm");
|
|
34304
|
+
const sdkSpans = swiftSdkProjectionSpans2(
|
|
34305
|
+
sdk2,
|
|
34306
|
+
(object8, product) => sdkObjectImages.get(object8) ?? sdkProductImages.get(product)
|
|
34307
|
+
);
|
|
34308
|
+
const compileAppProjection = (source) => {
|
|
34309
|
+
const projectionSource = import_node_path45.default.join(work, "projection.c");
|
|
34310
|
+
const nextObject = import_node_path45.default.join(work, "projection.o");
|
|
34311
|
+
(0, import_node_fs47.writeFileSync)(projectionSource, source);
|
|
34312
|
+
(0, import_node_child_process30.execFileSync)(
|
|
34313
|
+
import_node_path45.default.join(options2.toolchainBin, "clang"),
|
|
34314
|
+
[...clangOptions, "-c", projectionSource, "-o", nextObject],
|
|
34315
|
+
{ stdio: "pipe" }
|
|
34292
34316
|
);
|
|
34293
|
-
|
|
34294
|
-
|
|
34295
|
-
|
|
34296
|
-
|
|
34297
|
-
|
|
34298
|
-
|
|
34299
|
-
|
|
34300
|
-
|
|
34301
|
-
|
|
34302
|
-
|
|
34303
|
-
|
|
34304
|
-
|
|
34305
|
-
|
|
34317
|
+
if (nextObject !== appProjectionObject) {
|
|
34318
|
+
owners.delete(appProjectionObject);
|
|
34319
|
+
appProjectionObject = nextObject;
|
|
34320
|
+
owners.set(appProjectionObject, 0);
|
|
34321
|
+
}
|
|
34322
|
+
};
|
|
34323
|
+
let storage = reserved2;
|
|
34324
|
+
if (sdkSpans.length > 0) {
|
|
34325
|
+
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
34326
|
+
storage = reserveGuestProjectionStorage(
|
|
34327
|
+
storage.images,
|
|
34328
|
+
storage.capacities.map((capacity, index) => ({
|
|
34329
|
+
...capacity,
|
|
34330
|
+
regions: capacity.regions + sdkCounts[index] + 16
|
|
34331
|
+
}))
|
|
34332
|
+
);
|
|
34333
|
+
compileAppProjection(storage.source);
|
|
34334
|
+
}
|
|
34335
|
+
let precomputedSymbols;
|
|
34336
|
+
if (splitInputs.appReferencedSymbols && splitInputs.appDefinedSymbols) {
|
|
34337
|
+
const referenced = new Set(splitInputs.appReferencedSymbols);
|
|
34338
|
+
const defined = new Set(splitInputs.appDefinedSymbols);
|
|
34339
|
+
const projSyms = guestWasmSymbols((0, import_node_fs47.readFileSync)(appProjectionObject));
|
|
34340
|
+
for (const name3 of projSyms.undefined) referenced.add(name3);
|
|
34341
|
+
for (const name3 of projSyms.defined) defined.add(name3);
|
|
34342
|
+
precomputedSymbols = { referenced, defined };
|
|
34343
|
+
}
|
|
34344
|
+
for (; ; ) {
|
|
34345
|
+
const link = await linkSwiftAppModule2({
|
|
34346
|
+
objects: [...owners.keys()],
|
|
34347
|
+
lazyFunctions: splitInputs.lazyFunctions,
|
|
34348
|
+
toolchainBin: options2.toolchainBin,
|
|
34349
|
+
sdk: sdk2,
|
|
34350
|
+
work,
|
|
34351
|
+
output: options2.optimized,
|
|
34352
|
+
optimize: options2.optimize,
|
|
34353
|
+
layoutMap,
|
|
34354
|
+
project: project2,
|
|
34355
|
+
precomputedSymbols,
|
|
34356
|
+
loweringCache: project2 ? void 0 : {
|
|
34357
|
+
file: import_node_path45.default.join(
|
|
34358
|
+
options2.buildDirectory,
|
|
34359
|
+
".build",
|
|
34360
|
+
"peach-app-module-lowered.wasm"
|
|
34361
|
+
),
|
|
34362
|
+
compilerDigest: options2.compilerDigest
|
|
34306
34363
|
}
|
|
34307
|
-
};
|
|
34308
|
-
|
|
34309
|
-
|
|
34310
|
-
|
|
34364
|
+
});
|
|
34365
|
+
const map2 = (0, import_node_fs47.readFileSync)(
|
|
34366
|
+
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
34367
|
+
"utf8"
|
|
34368
|
+
);
|
|
34369
|
+
const values = guestDyldValueRange(map2);
|
|
34370
|
+
const bindingRows = /* @__PURE__ */ new Map();
|
|
34371
|
+
const data = [];
|
|
34372
|
+
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
34373
|
+
const address = link.linkage.data[at];
|
|
34374
|
+
const size2 = link.linkage.data[at + 1];
|
|
34375
|
+
const value = link.linkage.data[at + 2];
|
|
34376
|
+
if (values && address >= values.address && address < values.address + values.length) {
|
|
34377
|
+
if (size2 !== 8 || (address - values.address) % 8)
|
|
34378
|
+
throw new Error("sdk binding splits a dyld value");
|
|
34379
|
+
bindingRows.set((address - values.address) / 8, value);
|
|
34380
|
+
} else data.push(address, size2, value);
|
|
34381
|
+
}
|
|
34382
|
+
const linked = (0, import_node_fs47.readFileSync)(
|
|
34383
|
+
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
34384
|
+
);
|
|
34385
|
+
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
34386
|
+
...guestLinkedSpans(map2, linked, linked, owners, splitInputs.appSections, true),
|
|
34387
|
+
...sdkSpans
|
|
34388
|
+
]);
|
|
34389
|
+
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
34311
34390
|
storage = reserveGuestProjectionStorage(
|
|
34312
34391
|
storage.images,
|
|
34313
|
-
storage.capacities.map((capacity, index) =>
|
|
34314
|
-
|
|
34315
|
-
regions: capacity.regions
|
|
34316
|
-
})
|
|
34392
|
+
storage.capacities.map((capacity, index) => {
|
|
34393
|
+
const count = required[index];
|
|
34394
|
+
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
34395
|
+
})
|
|
34317
34396
|
);
|
|
34318
34397
|
compileAppProjection(storage.source);
|
|
34398
|
+
continue;
|
|
34319
34399
|
}
|
|
34320
|
-
|
|
34321
|
-
|
|
34322
|
-
|
|
34323
|
-
|
|
34324
|
-
|
|
34325
|
-
|
|
34326
|
-
|
|
34327
|
-
|
|
34328
|
-
}
|
|
34329
|
-
|
|
34330
|
-
|
|
34331
|
-
objects: [...owners.keys()],
|
|
34332
|
-
lazyFunctions: splitInputs.lazyFunctions,
|
|
34333
|
-
toolchainBin: options2.toolchainBin,
|
|
34334
|
-
sdk: sdk2,
|
|
34335
|
-
work,
|
|
34336
|
-
output: options2.optimized,
|
|
34337
|
-
optimize: options2.optimize,
|
|
34338
|
-
layoutMap,
|
|
34339
|
-
project: project2,
|
|
34340
|
-
precomputedSymbols,
|
|
34341
|
-
loweringCache: project2 ? void 0 : {
|
|
34342
|
-
file: import_node_path45.default.join(
|
|
34343
|
-
options2.buildDirectory,
|
|
34344
|
-
".build",
|
|
34345
|
-
"peach-app-module-lowered.wasm"
|
|
34346
|
-
),
|
|
34347
|
-
compilerDigest: options2.compilerDigest
|
|
34348
|
-
}
|
|
34349
|
-
});
|
|
34350
|
-
const map3 = (0, import_node_fs47.readFileSync)(
|
|
34351
|
-
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
34352
|
-
"utf8"
|
|
34353
|
-
);
|
|
34354
|
-
const values = guestDyldValueRange(map3);
|
|
34355
|
-
const bindingRows = /* @__PURE__ */ new Map();
|
|
34356
|
-
const data = [];
|
|
34357
|
-
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
34358
|
-
const address = link.linkage.data[at];
|
|
34359
|
-
const size2 = link.linkage.data[at + 1];
|
|
34360
|
-
const value = link.linkage.data[at + 2];
|
|
34361
|
-
if (values && address >= values.address && address < values.address + values.length) {
|
|
34362
|
-
if (size2 !== 8 || (address - values.address) % 8)
|
|
34363
|
-
throw new Error("sdk binding splits a dyld value");
|
|
34364
|
-
bindingRows.set((address - values.address) / 8, value);
|
|
34365
|
-
} else data.push(address, size2, value);
|
|
34366
|
-
}
|
|
34367
|
-
const linked = (0, import_node_fs47.readFileSync)(
|
|
34368
|
-
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
34369
|
-
);
|
|
34370
|
-
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
34371
|
-
...guestLinkedSpans(map3, linked, linked, owners, splitInputs.appSections, true),
|
|
34372
|
-
...sdkSpans
|
|
34373
|
-
]);
|
|
34374
|
-
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
34375
|
-
storage = reserveGuestProjectionStorage(
|
|
34376
|
-
storage.images,
|
|
34377
|
-
storage.capacities.map((capacity, index) => {
|
|
34378
|
-
const count = required[index];
|
|
34379
|
-
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
34380
|
-
})
|
|
34381
|
-
);
|
|
34382
|
-
compileAppProjection(storage.source);
|
|
34383
|
-
continue;
|
|
34384
|
-
}
|
|
34385
|
-
options2.onStage("lowering the app image");
|
|
34386
|
-
const lowerPromise = link.lower();
|
|
34387
|
-
await new Promise((resolve4) => setImmediate(resolve4));
|
|
34388
|
-
let binding;
|
|
34389
|
-
try {
|
|
34390
|
-
if (result.finalLinkDone) await result.finalLinkDone;
|
|
34391
|
-
const usage = readSwiftSdkUsage2(result.mapPath, options2.output, sdkObjectKeys);
|
|
34392
|
-
binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk2, usage);
|
|
34393
|
-
} catch (error) {
|
|
34394
|
-
await Promise.allSettled([lowerPromise]);
|
|
34395
|
-
throw error;
|
|
34396
|
-
}
|
|
34397
|
-
await lowerPromise;
|
|
34398
|
-
const finalized = finalizeGuestProjectionStorage({
|
|
34399
|
-
map: map3,
|
|
34400
|
-
linked,
|
|
34401
|
-
optimized: (0, import_node_fs47.readFileSync)(options2.optimized),
|
|
34402
|
-
owners,
|
|
34403
|
-
sectionOwners: splitInputs.appSections,
|
|
34404
|
-
projectionObject: appProjectionObject,
|
|
34405
|
-
reserved: storage,
|
|
34406
|
-
sdkSpans
|
|
34407
|
-
});
|
|
34408
|
-
(0, import_node_fs47.writeFileSync)(
|
|
34409
|
-
options2.optimized,
|
|
34410
|
-
moveGuestDyldTable(map3, finalized.wasm, splitInputs.dyldSymbols, bindingRows, [
|
|
34411
|
-
swiftAppModuleThunkSection2(finalized.wasm)
|
|
34412
|
-
])
|
|
34413
|
-
);
|
|
34414
|
-
return binding;
|
|
34400
|
+
options2.onStage("lowering the app image");
|
|
34401
|
+
const lowerPromise = link.lower();
|
|
34402
|
+
await new Promise((resolve4) => setImmediate(resolve4));
|
|
34403
|
+
let binding;
|
|
34404
|
+
try {
|
|
34405
|
+
if (result.finalLinkDone) await result.finalLinkDone;
|
|
34406
|
+
const usage = readSwiftSdkUsage2(result.mapPath, options2.output, sdkObjectKeys);
|
|
34407
|
+
binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk2, usage);
|
|
34408
|
+
} catch (error) {
|
|
34409
|
+
await Promise.allSettled([lowerPromise]);
|
|
34410
|
+
throw error;
|
|
34415
34411
|
}
|
|
34416
|
-
|
|
34417
|
-
|
|
34412
|
+
await lowerPromise;
|
|
34413
|
+
const finalized = finalizeGuestProjectionStorage({
|
|
34414
|
+
map: map2,
|
|
34415
|
+
linked,
|
|
34416
|
+
optimized: (0, import_node_fs47.readFileSync)(options2.optimized),
|
|
34417
|
+
owners,
|
|
34418
|
+
sectionOwners: splitInputs.appSections,
|
|
34419
|
+
projectionObject: appProjectionObject,
|
|
34420
|
+
reserved: storage,
|
|
34421
|
+
sdkSpans
|
|
34422
|
+
});
|
|
34423
|
+
(0, import_node_fs47.writeFileSync)(
|
|
34424
|
+
options2.optimized,
|
|
34425
|
+
moveGuestDyldTable(map2, finalized.wasm, splitInputs.dyldSymbols, bindingRows, [
|
|
34426
|
+
swiftAppModuleThunkSection2(finalized.wasm)
|
|
34427
|
+
])
|
|
34428
|
+
);
|
|
34429
|
+
return binding;
|
|
34418
34430
|
}
|
|
34431
|
+
} finally {
|
|
34432
|
+
if (result.finalLinkDone) await Promise.allSettled([result.finalLinkDone]);
|
|
34419
34433
|
}
|
|
34420
|
-
options2.onStage("lowering the app image");
|
|
34421
|
-
await lowerWasm(options2.output, options2.optimized, {
|
|
34422
|
-
optimize: options2.optimize,
|
|
34423
|
-
skipPasses: ["duplicate-function-elimination"],
|
|
34424
|
-
wideExports: lazyFunctions
|
|
34425
|
-
});
|
|
34426
|
-
if (lazyFunctions.length)
|
|
34427
|
-
(0, import_node_fs47.writeFileSync)(
|
|
34428
|
-
options2.optimized,
|
|
34429
|
-
placeGuestLazyFunctions((0, import_node_fs47.readFileSync)(options2.optimized), lazyFunctions)
|
|
34430
|
-
);
|
|
34431
|
-
const map2 = (0, import_node_fs47.readFileSync)(result.mapPath, "utf8");
|
|
34432
|
-
let optimized = (0, import_node_fs47.readFileSync)(options2.optimized);
|
|
34433
|
-
if (/ __peach_guest_images$/m.test(map2))
|
|
34434
|
-
optimized = finalizeGuestProjectionStorage({
|
|
34435
|
-
map: map2,
|
|
34436
|
-
linked: (0, import_node_fs47.readFileSync)(options2.output),
|
|
34437
|
-
optimized,
|
|
34438
|
-
owners: result.owners,
|
|
34439
|
-
sectionOwners: result.generatedSectionOwners,
|
|
34440
|
-
projectionObject,
|
|
34441
|
-
reserved: reserved2
|
|
34442
|
-
}).wasm;
|
|
34443
|
-
(0, import_node_fs47.writeFileSync)(options2.optimized, moveGuestDyldTable(map2, optimized, dyldSymbols));
|
|
34444
34434
|
}
|
|
34445
34435
|
var import_node_child_process30, import_node_fs47, import_node_path45;
|
|
34446
34436
|
var init_swift_guest_compile = __esm({
|
|
@@ -34450,7 +34440,6 @@ var init_swift_guest_compile = __esm({
|
|
|
34450
34440
|
import_node_fs47 = require("node:fs");
|
|
34451
34441
|
import_node_path45 = __toESM(require("node:path"), 1);
|
|
34452
34442
|
init_swift_guest_archive();
|
|
34453
|
-
init_swift_guest_dyld_functions();
|
|
34454
34443
|
init_swift_guest_dyld_table();
|
|
34455
34444
|
init_swift_guest_link();
|
|
34456
34445
|
init_swift_guest_linked_spans();
|
|
@@ -34464,7 +34453,6 @@ var init_swift_guest_compile = __esm({
|
|
|
34464
34453
|
init_swift_toolchain();
|
|
34465
34454
|
init_swift_wasm_prune();
|
|
34466
34455
|
init_swiftTargetContract();
|
|
34467
|
-
init_wasm_optimize();
|
|
34468
34456
|
}
|
|
34469
34457
|
});
|
|
34470
34458
|
|
|
@@ -39444,20 +39432,17 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
39444
39432
|
const gzip2 = (0, import_node_fs55.readFileSync)(import_node_path55.default.join(directory2, "icu.gz"));
|
|
39445
39433
|
if ((0, import_node_crypto35.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto35.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
39446
39434
|
return null;
|
|
39447
|
-
|
|
39448
|
-
|
|
39449
|
-
|
|
39450
|
-
|
|
39451
|
-
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
|
|
39455
|
-
|
|
39456
|
-
|
|
39457
|
-
|
|
39458
|
-
binding: { bytes: binding, sha256: image.binding }
|
|
39459
|
-
};
|
|
39460
|
-
}
|
|
39435
|
+
if (!("sdk" in receipt)) return null;
|
|
39436
|
+
const image = receipt.sdk;
|
|
39437
|
+
if (!isRecord(image) || typeof image.key !== "string" || typeof image.sha256 !== "string" || typeof image.binding !== "string")
|
|
39438
|
+
return null;
|
|
39439
|
+
const binding = (0, import_node_fs55.readFileSync)(import_node_path55.default.join(directory2, "sdk-binding.bin"));
|
|
39440
|
+
if ((0, import_node_crypto35.createHash)("sha256").update(binding).digest("hex") !== image.binding) return null;
|
|
39441
|
+
const sdk2 = {
|
|
39442
|
+
key: image.key,
|
|
39443
|
+
sha256: image.sha256,
|
|
39444
|
+
binding: { bytes: binding, sha256: image.binding }
|
|
39445
|
+
};
|
|
39461
39446
|
return { hash, bytes, icu: { sha256: receipt.icu, gzip: gzip2 }, sdk: sdk2 };
|
|
39462
39447
|
} catch (error) {
|
|
39463
39448
|
if (error instanceof SyntaxError || error instanceof Error && "code" in error && error.code === "ENOENT")
|
|
@@ -40388,13 +40373,12 @@ async function compileSwiftProjectOnce(sources, options2) {
|
|
|
40388
40373
|
sources: import_node_path55.default.join(root, "Sources", "App"),
|
|
40389
40374
|
multi: compileTargets(input).length > 0
|
|
40390
40375
|
};
|
|
40391
|
-
const
|
|
40392
|
-
const sdkImage = sdkModule ? await (await Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))).buildSwiftSdkImage(
|
|
40376
|
+
const sdkImage = options2.linkOnly ? void 0 : await (await Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))).buildSwiftSdkImage(
|
|
40393
40377
|
moduleRoot,
|
|
40394
40378
|
!!guestGraph,
|
|
40395
40379
|
distribution ? [] : linkedFrameworkTargets(moduleRoot, input).imports,
|
|
40396
40380
|
{ signal: options2.signal }
|
|
40397
|
-
)
|
|
40381
|
+
);
|
|
40398
40382
|
const inputHash = swiftCompileInputHash(input, options2.release);
|
|
40399
40383
|
const moduleDigest = swiftModuleDigest(moduleRoot);
|
|
40400
40384
|
const sourceHash = inputHash.copy().update(moduleDigest).digest("hex");
|
|
@@ -40425,79 +40409,10 @@ sdk module ${sdkImage.key}`).digest("hex") : sourceHash;
|
|
|
40425
40409
|
return retain(root, previous);
|
|
40426
40410
|
}
|
|
40427
40411
|
}
|
|
40428
|
-
if (!options2.intermediates && !sdkImage && process.platform === "darwin" && process.env.TM_SESSION && !windowAdmission() && process.env.CI !== "true" && moduleRoot === sourceSwiftCheckout() && !swiftDistributionAt(moduleRoot)) {
|
|
40429
|
-
const requestRoot = (0, import_node_fs55.mkdtempSync)(`${root}.builder-request-`);
|
|
40430
|
-
const output = import_node_path55.default.join(requestRoot, "output");
|
|
40431
|
-
const request = import_node_path55.default.join(requestRoot, "request.json");
|
|
40432
|
-
(0, import_node_fs55.writeFileSync)(
|
|
40433
|
-
request,
|
|
40434
|
-
JSON.stringify({
|
|
40435
|
-
input,
|
|
40436
|
-
hash,
|
|
40437
|
-
release: options2.release,
|
|
40438
|
-
timeoutMs: options2.timeoutMs,
|
|
40439
|
-
// framework sources and compiler inputs own the shared object tree;
|
|
40440
|
-
// unrelated app edits reuse it without retaining stale private ABI.
|
|
40441
|
-
buildKey: frameworkKey
|
|
40442
|
-
})
|
|
40443
|
-
);
|
|
40444
|
-
try {
|
|
40445
|
-
const repo = import_node_path55.default.resolve(moduleRoot, "../..");
|
|
40446
|
-
const timeout = swiftBuilderHopTimeoutMs(options2.timeoutMs);
|
|
40447
|
-
report("requesting builder admission or cached result");
|
|
40448
|
-
await runCompiler(
|
|
40449
|
-
"bun",
|
|
40450
|
-
[
|
|
40451
|
-
import_node_path55.default.join(repo, "scripts/build/swift-project.ts"),
|
|
40452
|
-
"--request",
|
|
40453
|
-
request,
|
|
40454
|
-
"--output",
|
|
40455
|
-
output
|
|
40456
|
-
],
|
|
40457
|
-
{
|
|
40458
|
-
cwd: repo,
|
|
40459
|
-
timeout,
|
|
40460
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
40461
|
-
signal: options2.signal
|
|
40462
|
-
},
|
|
40463
|
-
true
|
|
40464
|
-
).catch((error) => {
|
|
40465
|
-
if (options2.signal?.aborted) throw error;
|
|
40466
|
-
const output2 = outputOf(error);
|
|
40467
|
-
if (!(error instanceof Error) || Reflect.get(error, "exitCode") !== 124)
|
|
40468
|
-
throw new Error(output2, { cause: error });
|
|
40469
|
-
const prefix = `[swift-project ${hash.slice(0, 16)}] `;
|
|
40470
|
-
const lines = output2.split("\n");
|
|
40471
|
-
const stage = lines.findLast((line) => line.startsWith(prefix))?.slice(prefix.length);
|
|
40472
|
-
const cap = lines.find(
|
|
40473
|
-
(line) => line.startsWith("[remote] outer deadline leaves ")
|
|
40474
|
-
);
|
|
40475
|
-
const deadline = cap ? `
|
|
40476
|
-
${cap}` : "";
|
|
40477
|
-
throw new Error(
|
|
40478
|
-
`Swift builder deadline expired during ${stage ?? "builder preparation"} (requested ${Math.ceil(timeout / 1e3)}s for the builder hop).${deadline}`,
|
|
40479
|
-
{ cause: error }
|
|
40480
|
-
);
|
|
40481
|
-
});
|
|
40482
|
-
const artifact = readCompiledArtifact(output, hash);
|
|
40483
|
-
if (!artifact) {
|
|
40484
|
-
throw new Error(
|
|
40485
|
-
"swift-compile: builder artifact source, digest or wasm header is invalid"
|
|
40486
|
-
);
|
|
40487
|
-
}
|
|
40488
|
-
saveCompiledArtifact(root, artifact);
|
|
40489
|
-
saveSharedArtifact(sharedRoot, artifact);
|
|
40490
|
-
report("builder artifact verified");
|
|
40491
|
-
return retain(root, artifact);
|
|
40492
|
-
} finally {
|
|
40493
|
-
(0, import_node_fs55.rmSync)(requestRoot, { recursive: true, force: true });
|
|
40494
|
-
}
|
|
40495
|
-
}
|
|
40496
40412
|
const baseRoot = root;
|
|
40497
40413
|
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path55.default.basename(import_node_path55.default.dirname(baseRoot)) === "swift-builds";
|
|
40498
40414
|
const compatShapeParts = canPoolBuildRoot ? [
|
|
40499
40415
|
frameworkKey,
|
|
40500
|
-
Boolean(sdkImage),
|
|
40501
40416
|
compileTargets(input).map((target) => target.name).sort(),
|
|
40502
40417
|
input.oneModule === true,
|
|
40503
40418
|
input.optimize === true,
|
|
@@ -41135,7 +41050,8 @@ ${compatShape}` : "";
|
|
|
41135
41050
|
}
|
|
41136
41051
|
const output = options2.project ? projectOutputFile(root2, linked, options2.project) : linked;
|
|
41137
41052
|
const optimized = `${output}.optimized`;
|
|
41138
|
-
if (sdkImage
|
|
41053
|
+
if (!sdkImage) throw new Error("swift-compile: missing shared SDK image");
|
|
41054
|
+
if (options2.project) (0, import_node_fs55.rmSync)(optimized, { force: true });
|
|
41139
41055
|
let sdkAsset;
|
|
41140
41056
|
stage("linking the app image");
|
|
41141
41057
|
if (guestGraph) {
|
|
@@ -41164,9 +41080,8 @@ ${compatShape}` : "";
|
|
|
41164
41080
|
jobs: swiftBuildJobs(),
|
|
41165
41081
|
onStage: stage
|
|
41166
41082
|
});
|
|
41167
|
-
|
|
41168
|
-
|
|
41169
|
-
} else if (sdkImage) {
|
|
41083
|
+
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
41084
|
+
} else {
|
|
41170
41085
|
const { buildSwiftAppModule: buildSwiftAppModule2 } = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
41171
41086
|
const binding = await buildSwiftAppModule2({
|
|
41172
41087
|
buildRoot: root2,
|
|
@@ -41184,19 +41099,7 @@ ${compatShape}` : "";
|
|
|
41184
41099
|
}
|
|
41185
41100
|
});
|
|
41186
41101
|
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
41187
|
-
} else {
|
|
41188
|
-
const bytes = (0, import_node_fs55.readFileSync)(output);
|
|
41189
|
-
const ordered = orderObjCConstructors(bytes);
|
|
41190
|
-
if (ordered !== bytes) (0, import_node_fs55.writeFileSync)(output, ordered);
|
|
41191
|
-
stage("lowering the app image");
|
|
41192
|
-
await lowerWasm(output, optimized, { optimize: input.optimize === true });
|
|
41193
41102
|
}
|
|
41194
|
-
if (!sdkImage)
|
|
41195
|
-
await runCompiler(
|
|
41196
|
-
import_node_path55.default.join(options2.toolchainBin, "llvm-objcopy"),
|
|
41197
|
-
["--remove-section=.swift1_autolink_entries", optimized],
|
|
41198
|
-
buildOptions
|
|
41199
|
-
);
|
|
41200
41103
|
const artifact = {
|
|
41201
41104
|
hash,
|
|
41202
41105
|
bytes: (0, import_node_fs55.readFileSync)(optimized),
|
|
@@ -41256,7 +41159,6 @@ var init_swift_compile = __esm({
|
|
|
41256
41159
|
init_swift_project_user();
|
|
41257
41160
|
init_swift_reproducible();
|
|
41258
41161
|
init_swift_root_lock();
|
|
41259
|
-
init_swift_sdk_image_wasm();
|
|
41260
41162
|
init_swift_sdk_surface();
|
|
41261
41163
|
init_swift_shared_sdk();
|
|
41262
41164
|
init_swift_source_closure();
|
|
@@ -41451,7 +41353,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
41451
41353
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
41452
41354
|
MULTI_MANIFEST_VERSION = 76;
|
|
41453
41355
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
41454
|
-
compilerSourceDigest = true ? "
|
|
41356
|
+
compilerSourceDigest = true ? "dcd0189f8bf1a7fc415f2c92825f8b3bbc2089ae9697ffcb50cc9a7e65e99990" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
41455
41357
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
41456
41358
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
41457
41359
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -97698,7 +97600,6 @@ function linkedModuleRoots(packagePath) {
|
|
|
97698
97600
|
return [...roots].sort();
|
|
97699
97601
|
}
|
|
97700
97602
|
function updateSwiftConfigStamp(hash, packagePath) {
|
|
97701
|
-
if (projects().get(packagePath)?.standalone) hash.update("standalone");
|
|
97702
97603
|
const config = xcodeProjects().get(packagePath);
|
|
97703
97604
|
hash.update(JSON.stringify(config?.behavior ?? {}));
|
|
97704
97605
|
const gates = config?.swiftWasm64?.platformGates;
|
|
@@ -97775,9 +97676,9 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
97775
97676
|
}
|
|
97776
97677
|
return hash.digest("hex");
|
|
97777
97678
|
}
|
|
97778
|
-
function otherInputs(input
|
|
97679
|
+
function otherInputs(input) {
|
|
97779
97680
|
const { files: _files, ...rest } = input;
|
|
97780
|
-
return (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(
|
|
97681
|
+
return (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
|
|
97781
97682
|
}
|
|
97782
97683
|
function icuUrl(origin, artifact) {
|
|
97783
97684
|
return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
|
|
@@ -97981,7 +97882,6 @@ async function packageSnapshot(project2, entry, moduleRoot) {
|
|
|
97981
97882
|
return {
|
|
97982
97883
|
files: files2,
|
|
97983
97884
|
oneModule: project2.oneModule,
|
|
97984
|
-
standalone: project2.standalone === true,
|
|
97985
97885
|
binaryModules: {
|
|
97986
97886
|
...project2.binaryModules,
|
|
97987
97887
|
...Object.fromEntries(
|
|
@@ -98193,7 +98093,7 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
98193
98093
|
const input = snapshotCompileInput(snapshot);
|
|
98194
98094
|
const compiled = {
|
|
98195
98095
|
files: input.files,
|
|
98196
|
-
inputs: otherInputs(input
|
|
98096
|
+
inputs: otherInputs(input),
|
|
98197
98097
|
module: moduleStamp(packagePath, moduleRootOverride, false)
|
|
98198
98098
|
};
|
|
98199
98099
|
const parsed2 = compileTargets(input);
|
|
@@ -98241,8 +98141,6 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
98241
98141
|
buildRoot: swiftBuildRoot(packagePath, moduleRoot),
|
|
98242
98142
|
moduleRoot,
|
|
98243
98143
|
...toolchain,
|
|
98244
|
-
// the preview loads an app module beside the shared sdk image
|
|
98245
|
-
sdkModule: !snapshot.standalone && (input.sourceLinkGraph !== void 0 || swiftApplicationEntry(input.entry, input.files[input.entry] ?? "")),
|
|
98246
98144
|
signal
|
|
98247
98145
|
}).catch((error) => {
|
|
98248
98146
|
const report = error instanceof Error ? swiftApiGapReport(error.message) : null;
|
|
@@ -98391,8 +98289,7 @@ async function compileRemote(packagePath, snapshot, hosted, ownerSignal) {
|
|
|
98391
98289
|
resources: snapshot.bundleFiles.files,
|
|
98392
98290
|
images: snapshot.resources.images,
|
|
98393
98291
|
entry: snapshot.entry,
|
|
98394
|
-
packageId: descriptor?.packageId ?? swiftPackageId(packagePath)
|
|
98395
|
-
sdkModule: !snapshot.standalone
|
|
98292
|
+
packageId: descriptor?.packageId ?? swiftPackageId(packagePath)
|
|
98396
98293
|
},
|
|
98397
98294
|
origin,
|
|
98398
98295
|
signal,
|
|
@@ -98484,7 +98381,7 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
98484
98381
|
const compiled = project2.artifact?.compiled;
|
|
98485
98382
|
if (project2.artifact && compiled && compiled.module === moduleStamp(project2.packagePath, moduleRoot, false)) {
|
|
98486
98383
|
const input = snapshotCompileInput(snapshot);
|
|
98487
|
-
const values = otherInputs(input
|
|
98384
|
+
const values = otherInputs(input) === compiled.inputs ? designTimeValues(compiled.files, input.files) : null;
|
|
98488
98385
|
if (values) return { ...project2.artifact, stamp, designTimeValues: values };
|
|
98489
98386
|
}
|
|
98490
98387
|
return compile(
|
|
@@ -104812,7 +104709,6 @@ async function compileTurboModule(options2) {
|
|
|
104812
104709
|
);
|
|
104813
104710
|
const project2 = projectFor(packagePath);
|
|
104814
104711
|
project2.oneModule = false;
|
|
104815
|
-
project2.standalone = true;
|
|
104816
104712
|
project2.libraries = input.libraries;
|
|
104817
104713
|
project2.binaryModules = input.binaryModules;
|
|
104818
104714
|
project2.optimize = input.optimize;
|
|
@@ -105168,7 +105064,7 @@ var init_react_native_core = __esm({
|
|
|
105168
105064
|
init_swift_distribution();
|
|
105169
105065
|
init_swift_package();
|
|
105170
105066
|
init_swiftContract();
|
|
105171
|
-
recipe = true ? "
|
|
105067
|
+
recipe = true ? "d4161f11b10bfff3f21f57ca2352bf31c30f364e15fd7e1c385311c10033fa89" : reactNativeCoreDigest(__sootsim_import_meta_dirname);
|
|
105172
105068
|
strings3 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
105173
105069
|
building = /* @__PURE__ */ new Map();
|
|
105174
105070
|
}
|
|
@@ -105526,7 +105422,12 @@ function collectNitroCompileInput(collection, adapter, dependencies, iosDeployme
|
|
|
105526
105422
|
].join("\n") : [
|
|
105527
105423
|
...swift ? ["@_spi(Peach) import PeachFoundation"] : [],
|
|
105528
105424
|
...imports2.map((name3) => `import ${name3}`),
|
|
105529
|
-
...swift ? [
|
|
105425
|
+
...swift ? [
|
|
105426
|
+
'@_expose(wasm, "peach_nitro_swift_host")',
|
|
105427
|
+
'@_cdecl("peach_nitro_swift_host")',
|
|
105428
|
+
"public func _peachNitroSwiftHost() {}",
|
|
105429
|
+
"PeachHostDriver.installExecutor()"
|
|
105430
|
+
] : [],
|
|
105530
105431
|
...register,
|
|
105531
105432
|
""
|
|
105532
105433
|
].join("\n");
|
|
@@ -106097,7 +105998,6 @@ async function compileNitroModule(options2) {
|
|
|
106097
105998
|
);
|
|
106098
105999
|
const project2 = projectFor(packagePath);
|
|
106099
106000
|
project2.oneModule = false;
|
|
106100
|
-
project2.standalone = true;
|
|
106101
106001
|
project2.libraries = input.libraries;
|
|
106102
106002
|
project2.binaryModules = input.binaryModules;
|
|
106103
106003
|
project2.optimize = input.optimize;
|
|
@@ -106387,7 +106287,7 @@ var init_nitro_superset = __esm({
|
|
|
106387
106287
|
init_nitroContract();
|
|
106388
106288
|
init_swift_standin_digest();
|
|
106389
106289
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
106390
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
106290
|
+
NITRO_COMPILER_DIGEST = true ? "9303a53709842e0a9107912bfca87f4a1731cfc09b9d252fac03c156eabf3836" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
106391
106291
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
106392
106292
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
106393
106293
|
published = /* @__PURE__ */ new Map();
|
|
@@ -106458,6 +106358,7 @@ async function compileNitroApp(appRoot, origin, configure, moduleRoot, shared =
|
|
|
106458
106358
|
views
|
|
106459
106359
|
})),
|
|
106460
106360
|
url: `${origin}/__peach/swift/${artifact.hash}.wasm`,
|
|
106361
|
+
...await prepareSwiftSdkEntryAssets(origin, artifact),
|
|
106461
106362
|
hash: artifact.hash,
|
|
106462
106363
|
icuUrl: icuUrl(origin, artifact),
|
|
106463
106364
|
bundleFiles: artifact.package.bundleFiles.files
|
|
@@ -107298,12 +107199,12 @@ let package = Package(name: "OneSDKGuest", targets: [
|
|
|
107298
107199
|
);
|
|
107299
107200
|
const project2 = projectFor(packagePath);
|
|
107300
107201
|
project2.oneModule = false;
|
|
107301
|
-
project2.standalone = true;
|
|
107302
107202
|
project2.optimize = optimize;
|
|
107303
107203
|
project2.unoptimized = !optimize;
|
|
107304
107204
|
const artifact = await artifactFor(project2, "Sources/App/App.swift", moduleRoot);
|
|
107305
107205
|
const metadata = {
|
|
107306
107206
|
url: `${origin}/__peach/swift/${artifact.hash}.wasm`,
|
|
107207
|
+
...await prepareSwiftSdkEntryAssets(origin, artifact),
|
|
107307
107208
|
hash: artifact.hash,
|
|
107308
107209
|
icuUrl: icuUrl(origin, artifact),
|
|
107309
107210
|
rootId: `one-sdk-${artifact.hash.slice(0, 16)}`,
|
|
@@ -107366,7 +107267,7 @@ var init_expo_eager_seam_contract = __esm({
|
|
|
107366
107267
|
|
|
107367
107268
|
// src/expo-native-compiler-digest.ts
|
|
107368
107269
|
function expoNativeCompilerDigestValue() {
|
|
107369
|
-
return true ? "
|
|
107270
|
+
return true ? "13d332cac87de68ec66d60f9bb7b02f5fbfb1cf35a281ec222570bd0562878cd" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
107370
107271
|
}
|
|
107371
107272
|
var import_node_crypto81;
|
|
107372
107273
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -111493,7 +111394,7 @@ async function compileTurboApp(appRoot, origin, moduleRoot, iosTarget, prepareRe
|
|
|
111493
111394
|
url: `${origin}/__peach/swift/${artifact.hash}.wasm`,
|
|
111494
111395
|
hash: artifact.hash,
|
|
111495
111396
|
icuUrl: icuUrl(origin, artifact),
|
|
111496
|
-
...
|
|
111397
|
+
...await prepareSwiftSdkEntryAssets(origin, artifact),
|
|
111497
111398
|
bundleFiles: artifact.package.bundleFiles.files,
|
|
111498
111399
|
...unavailable2.length > 0 ? { unavailable: unavailable2 } : {}
|
|
111499
111400
|
}
|
|
@@ -115548,7 +115449,13 @@ function insertNativeBundleFooters(source, natives, locate) {
|
|
|
115548
115449
|
}
|
|
115549
115450
|
if (natives.nitro) {
|
|
115550
115451
|
const nitro = natives.nitro.metadata;
|
|
115551
|
-
metadata.nitro = {
|
|
115452
|
+
metadata.nitro = {
|
|
115453
|
+
...nitro,
|
|
115454
|
+
url: served(nitro.url),
|
|
115455
|
+
icuUrl: served(nitro.icuUrl),
|
|
115456
|
+
...nitro.sdkUrl ? { sdkUrl: served(nitro.sdkUrl) } : {},
|
|
115457
|
+
...nitro.sdkBindingUrl ? { sdkBindingUrl: served(nitro.sdkBindingUrl) } : {}
|
|
115458
|
+
};
|
|
115552
115459
|
source = insertNitroFooter(source, metadata.nitro);
|
|
115553
115460
|
}
|
|
115554
115461
|
if (natives.turbo) {
|