peachsim 0.1.2255 → 0.1.2258
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/bridge-flow-runner.ts +41 -0
- package/cli/commands/control.ts +8 -2
- package/cli/commands/flow.ts +9 -0
- package/cli/commands/swift.ts +5 -0
- package/cli/current-sim.ts +23 -15
- package/cli/outbound-endpoints.ts +0 -2
- package/cli/secure-file.ts +8 -2
- 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 +418 -143
- 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 +16 -12
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +359 -116
- 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 +939 -595
- package/dist-lib/host/fetch-proxy-handler.cjs +3607 -1627
- 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 +12611 -11232
- 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 +5 -4
- 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 +9700 -8326
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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 +606 -228
- 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 +1192 -797
- package/dist-lib/swift-compile.cjs +334 -99
- package/dist-lib/swift-compile.mjs +334 -99
- 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 +340 -101
- package/dist-lib/vite.cjs +4729 -2900
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +0 -6
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/appLifecycleBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/transitions/screen-transition-math.d.ts +6 -0
- package/java-platform/licenses/android.txt +183 -0
- package/java-platform/licenses/arm-optimized-routines.txt +256 -0
- package/java-platform/licenses/fdlibm.txt +72 -0
- package/java-platform/licenses/icu.txt +50 -0
- package/java-platform/licenses/openjdk.txt +395 -0
- package/java-platform/licenses/teavm.txt +182 -0
- package/java-platform/licenses/threeten-backport.txt +29 -0
- package/kotlin/README.md +1 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/src/expo-autolinking.ts +47 -4
- package/src/expo-native-workspace.ts +4 -1
- package/src/expo-pod-prebuilt.ts +96 -9
- package/src/expo-swift-host.ts +29 -9
- package/src/kotlin-host.ts +3 -2
- package/src/kotlinSdkContract.ts +1 -0
- package/src/native-package-slice-build.ts +386 -0
- package/src/native-package-slice.ts +835 -0
- package/src/native-prebuilt.ts +4 -0
- package/src/native-seam-manifest.ts +0 -8
- package/src/nitro-adapter.lock.json +255 -255
- package/src/nitro-compile.ts +37 -13
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-distribution.ts +7 -2
- package/src/swift-link-roots.ts +23 -22
- package/src/swift-wasm-prune.ts +436 -105
- package/src/turbo-compile.ts +22 -7
- package/src/turbo-runtime.lock.json +23 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2258 | (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;
|
|
@@ -3266,6 +3266,7 @@ var init_expo_autolinking = __esm({
|
|
|
3266
3266
|
import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
3267
3267
|
import_node_util4 = require("node:util");
|
|
3268
3268
|
init_forked_script_contract();
|
|
3269
|
+
init_is_record();
|
|
3269
3270
|
run4 = (0, import_node_util4.promisify)(import_node_child_process7.execFile);
|
|
3270
3271
|
}
|
|
3271
3272
|
});
|
|
@@ -13294,18 +13295,22 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
13294
13295
|
const [, r1] = readULEB2(buf, cp);
|
|
13295
13296
|
const [cnt, r2] = readULEB2(buf, r1);
|
|
13296
13297
|
let cur = r2;
|
|
13297
|
-
const
|
|
13298
|
+
const isData = name3 === "reloc.DATA";
|
|
13298
13299
|
for (let i = 0; i < cnt; i++) {
|
|
13299
13300
|
const rStart = cur;
|
|
13300
13301
|
const rType = buf[cur++];
|
|
13301
13302
|
const [ro, c2] = readULEB2(buf, cur);
|
|
13302
13303
|
const [rs, c3] = readULEB2(buf, c2);
|
|
13303
13304
|
cur = c3;
|
|
13305
|
+
let addend = 0;
|
|
13304
13306
|
if (HAS_ADDEND.has(rType)) {
|
|
13305
|
-
const [, c4] = readSLEB(buf, cur);
|
|
13307
|
+
const [val, c4] = readSLEB(buf, cur);
|
|
13308
|
+
addend = val;
|
|
13306
13309
|
cur = c4;
|
|
13307
13310
|
}
|
|
13308
|
-
|
|
13311
|
+
const rawBytes = new Uint8Array(buf.subarray(rStart, cur));
|
|
13312
|
+
if (isData) rawDataRelocs.push({ rawBytes, ro, rs, addend });
|
|
13313
|
+
else rawCodeRelocs.push({ rawBytes, ro, rs });
|
|
13309
13314
|
}
|
|
13310
13315
|
}
|
|
13311
13316
|
}
|
|
@@ -13459,6 +13464,80 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
13459
13464
|
rootSegs.push(i);
|
|
13460
13465
|
}
|
|
13461
13466
|
}
|
|
13467
|
+
const conformanceProtocols = /* @__PURE__ */ new Map();
|
|
13468
|
+
const objcCategoryTargets = [];
|
|
13469
|
+
if (isDist) {
|
|
13470
|
+
const relocAt = /* @__PURE__ */ new Map();
|
|
13471
|
+
for (const r of dataRelocList) {
|
|
13472
|
+
relocAt.set(`${r.segIdx}:${r.offInSeg}`, { rs: r.rs, addend: r.addend });
|
|
13473
|
+
}
|
|
13474
|
+
const confSegs = /* @__PURE__ */ new Set();
|
|
13475
|
+
let hasCatsSeg = false;
|
|
13476
|
+
for (let i = 0; i < segNames.length; i++) {
|
|
13477
|
+
if (segNames[i] === "swift5_protocol_conformances") confSegs.add(i);
|
|
13478
|
+
else if (segNames[i] === "__objc_cats") hasCatsSeg = true;
|
|
13479
|
+
}
|
|
13480
|
+
if (confSegs.size > 0) {
|
|
13481
|
+
const segOffToMpSym = /* @__PURE__ */ new Map();
|
|
13482
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
13483
|
+
if (symKind[i] === 1 && (symFlags[i] & 16) === 0 && symElemIdx[i] >= 0 && symNames[i].startsWith("$s") && symNames[i].endsWith("Mp")) {
|
|
13484
|
+
segOffToMpSym.set(`${symElemIdx[i]}:${symOff[i]}`, symNames[i]);
|
|
13485
|
+
}
|
|
13486
|
+
}
|
|
13487
|
+
const dv = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
13488
|
+
for (const r of dataRelocList) {
|
|
13489
|
+
if (!confSegs.has(r.segIdx)) continue;
|
|
13490
|
+
const mcIdx = r.rs;
|
|
13491
|
+
if (symKind[mcIdx] !== 1 || (symFlags[mcIdx] & 16) !== 0 || symElemIdx[mcIdx] < 0) {
|
|
13492
|
+
continue;
|
|
13493
|
+
}
|
|
13494
|
+
const mcSeg = symElemIdx[mcIdx];
|
|
13495
|
+
const mcOff = symOff[mcIdx];
|
|
13496
|
+
const pr = relocAt.get(`${mcSeg}:${mcOff}`);
|
|
13497
|
+
let mp = "";
|
|
13498
|
+
if (pr) {
|
|
13499
|
+
const raw2 = symNames[pr.rs];
|
|
13500
|
+
const stripped2 = raw2.startsWith(".Lgot.") ? raw2.slice(6) : raw2;
|
|
13501
|
+
if (stripped2.startsWith("$s") && stripped2.endsWith("Mp")) {
|
|
13502
|
+
mp = stripped2;
|
|
13503
|
+
} else if (symKind[pr.rs] === 3 || stripped2 === "") {
|
|
13504
|
+
mp = segOffToMpSym.get(`${mcSeg}:${pr.addend}`) ?? "";
|
|
13505
|
+
}
|
|
13506
|
+
} else {
|
|
13507
|
+
const fileOff = dataStart + sPayloadStarts[mcSeg] + mcOff;
|
|
13508
|
+
if (fileOff + 4 <= buf.length) {
|
|
13509
|
+
const delta = dv.getInt32(fileOff, true);
|
|
13510
|
+
mp = segOffToMpSym.get(`${mcSeg}:${mcOff + delta}`) ?? segOffToMpSym.get(`${mcSeg}:${mcOff + (delta & ~1)}`) ?? "";
|
|
13511
|
+
}
|
|
13512
|
+
}
|
|
13513
|
+
if (mp) conformanceProtocols.set(mcIdx, mp);
|
|
13514
|
+
}
|
|
13515
|
+
}
|
|
13516
|
+
if (hasCatsSeg) {
|
|
13517
|
+
const seenClasses = /* @__PURE__ */ new Set();
|
|
13518
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
13519
|
+
if (symKind[i] !== 1 || (symFlags[i] & 16) !== 0 || symElemIdx[i] < 0 || segNames[symElemIdx[i]] !== "__objc_cats" || !symNames[i].startsWith(".objc_category_")) {
|
|
13520
|
+
continue;
|
|
13521
|
+
}
|
|
13522
|
+
const cSeg = symElemIdx[i];
|
|
13523
|
+
const cOff = symOff[i];
|
|
13524
|
+
const cr = relocAt.get(`${cSeg}:${cOff + 8}`);
|
|
13525
|
+
if (cr && symKind[cr.rs] === 1 && (symFlags[cr.rs] & 16) === 0 && symElemIdx[cr.rs] >= 0) {
|
|
13526
|
+
const tSeg = symElemIdx[cr.rs];
|
|
13527
|
+
const strOff = dataStart + sPayloadStarts[tSeg] + symOff[cr.rs] + cr.addend;
|
|
13528
|
+
let sEnd = strOff;
|
|
13529
|
+
while (sEnd < buf.length && buf[sEnd] !== 0) sEnd++;
|
|
13530
|
+
if (sEnd > strOff) {
|
|
13531
|
+
const clsName = Buffer.from(buf.subarray(strOff, sEnd)).toString("utf8");
|
|
13532
|
+
if (!seenClasses.has(clsName)) {
|
|
13533
|
+
seenClasses.add(clsName);
|
|
13534
|
+
objcCategoryTargets.push(clsName);
|
|
13535
|
+
}
|
|
13536
|
+
}
|
|
13537
|
+
}
|
|
13538
|
+
}
|
|
13539
|
+
}
|
|
13540
|
+
}
|
|
13462
13541
|
return {
|
|
13463
13542
|
file,
|
|
13464
13543
|
isDist,
|
|
@@ -13483,6 +13562,8 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
13483
13562
|
objcRegisterFuncToTypePrefix,
|
|
13484
13563
|
objcClassSymToTypePrefix,
|
|
13485
13564
|
typePrefixesInObj,
|
|
13565
|
+
conformanceProtocols,
|
|
13566
|
+
objcCategoryTargets,
|
|
13486
13567
|
rootFuncs,
|
|
13487
13568
|
rootSegs,
|
|
13488
13569
|
segPayloadRanges: sEnds.map((end, i) => [
|
|
@@ -13494,7 +13575,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
13494
13575
|
function parseWasmObjectCached(file, isDist, useCache) {
|
|
13495
13576
|
if (!useCache)
|
|
13496
13577
|
return parseWasmObjectBytes(file, new Uint8Array(import_node_fs34.default.readFileSync(file)), isDist);
|
|
13497
|
-
const key2 =
|
|
13578
|
+
const key2 = `v2:${isDist ? "1" : "0"}:${file}`;
|
|
13498
13579
|
const stat = import_node_fs34.default.statSync(file, { bigint: true });
|
|
13499
13580
|
const stamp = `${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
|
|
13500
13581
|
const hit = parsedObjectCache.get(key2);
|
|
@@ -13671,6 +13752,18 @@ function getModulePrefix(file) {
|
|
|
13671
13752
|
const dash = base.indexOf("-");
|
|
13672
13753
|
return dash > 0 ? base.slice(0, dash) : base;
|
|
13673
13754
|
}
|
|
13755
|
+
function moduleFamily(file) {
|
|
13756
|
+
const mod = getModulePrefix(file);
|
|
13757
|
+
if (mod === "Foundation" || mod === "PeachFoundation" || mod === "PeachObjC" || mod === "PeachObjCRuntime" || mod === "ObjectiveC" || mod === "Darwin" || mod === "libFoundation" || mod === "libObjectiveC" || mod === "libDarwin" || mod === "libswiftCore") {
|
|
13758
|
+
return "Foundation";
|
|
13759
|
+
}
|
|
13760
|
+
if (mod.startsWith("UIKit")) return "UIKit";
|
|
13761
|
+
if (mod === "CoreData" || mod === "CoreDataConstants") return "CoreData";
|
|
13762
|
+
if (mod === "AVFoundation" || mod === "AVFoundationConstants" || mod === "AVFAudio") {
|
|
13763
|
+
return "AVFoundation";
|
|
13764
|
+
}
|
|
13765
|
+
return mod;
|
|
13766
|
+
}
|
|
13674
13767
|
function keepsSwiftUIReflection(file, undefinedSymbols) {
|
|
13675
13768
|
if (/^(SwiftUI|Combine|_[A-Za-z0-9]+_SwiftUI)-/.test(import_node_path31.default.basename(file))) return true;
|
|
13676
13769
|
for (const name3 of undefinedSymbols) {
|
|
@@ -13752,11 +13845,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13752
13845
|
}
|
|
13753
13846
|
if (t.endsWith(".o")) {
|
|
13754
13847
|
if (import_node_path31.default.resolve(t).startsWith(distDir + import_node_path31.default.sep)) {
|
|
13755
|
-
|
|
13756
|
-
(name3) => import_node_path31.default.basename(t) === `Foundation-${name3}.o`
|
|
13757
|
-
)) {
|
|
13758
|
-
distFiles.push(t);
|
|
13759
|
-
}
|
|
13848
|
+
distFiles.push(t);
|
|
13760
13849
|
if (!inStartLib) eagerFiles.push(t);
|
|
13761
13850
|
} else if (!inStartLib) {
|
|
13762
13851
|
if (t.endsWith("/swiftrt.o")) {
|
|
@@ -13825,6 +13914,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13825
13914
|
}
|
|
13826
13915
|
const allSdkObjFiles = import_node_fs34.default.readdirSync(sdkObjsDir).filter((f) => f.endsWith(".o") || f.endsWith(".obj")).sort();
|
|
13827
13916
|
const sdkFiles = allSdkObjFiles.map((f) => import_node_path31.default.join(sdkObjsDir, f));
|
|
13917
|
+
const extraSdkObjs = allSdkObjFiles.filter(
|
|
13918
|
+
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
13919
|
+
).map((f) => import_node_path31.default.join(sdkObjsDir, f));
|
|
13828
13920
|
const distObjs = /* @__PURE__ */ new Map();
|
|
13829
13921
|
const lazyProviders = /* @__PURE__ */ new Map();
|
|
13830
13922
|
const registerLazyProvider = (obj) => {
|
|
@@ -13888,11 +13980,33 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13888
13980
|
workQueue.push({ kind: "datasym", obj, symIdx });
|
|
13889
13981
|
};
|
|
13890
13982
|
const knownTypes2 = /* @__PURE__ */ new Set();
|
|
13891
|
-
|
|
13983
|
+
const knownProtocols = /* @__PURE__ */ new Set();
|
|
13984
|
+
const protoPrefixes = /* @__PURE__ */ new Set();
|
|
13985
|
+
for (const o of distObjs.values()) {
|
|
13892
13986
|
for (const t of o.typePrefixesInObj) knownTypes2.add(t);
|
|
13987
|
+
for (let i = 0; i < o.symNames.length; i++) {
|
|
13988
|
+
if (o.symKind[i] === 1 && (o.symFlags[i] & 16) === 0 && o.symNames[i].startsWith("$s") && o.symNames[i].endsWith("Mp")) {
|
|
13989
|
+
const mp = o.symNames[i];
|
|
13990
|
+
knownProtocols.add(mp);
|
|
13991
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
13992
|
+
}
|
|
13993
|
+
}
|
|
13994
|
+
for (const mp of o.conformanceProtocols.values()) {
|
|
13995
|
+
knownProtocols.add(mp);
|
|
13996
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
13997
|
+
}
|
|
13998
|
+
}
|
|
13893
13999
|
const globalLiveTypes = /* @__PURE__ */ new Set();
|
|
13894
|
-
const
|
|
14000
|
+
const liveProtocols = /* @__PURE__ */ new Set();
|
|
14001
|
+
const liveObjCClasses = /* @__PURE__ */ new Set();
|
|
14002
|
+
const liveModuleFamilies = /* @__PURE__ */ new Set();
|
|
14003
|
+
const categoryOnlyExtracted = /* @__PURE__ */ new Set();
|
|
13895
14004
|
const eagerDynamicObjects = /* @__PURE__ */ new Set();
|
|
14005
|
+
const pendingBySwiftType = /* @__PURE__ */ new Map();
|
|
14006
|
+
const pendingByObjcClass = /* @__PURE__ */ new Map();
|
|
14007
|
+
const pendingByProto = /* @__PURE__ */ new Map();
|
|
14008
|
+
const pendingCategoriesByClass = /* @__PURE__ */ new Map();
|
|
14009
|
+
const pendingCategoriesByFamily = /* @__PURE__ */ new Map();
|
|
13896
14010
|
const conformingType = (name3) => {
|
|
13897
14011
|
for (let n = name3.length - 1; n > 2; n--) {
|
|
13898
14012
|
const prefix = name3.slice(0, n);
|
|
@@ -13900,23 +14014,114 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13900
14014
|
}
|
|
13901
14015
|
return void 0;
|
|
13902
14016
|
};
|
|
14017
|
+
const objcClassOfConformance = (name3) => {
|
|
14018
|
+
const m = /^\$sSo(\d+)([A-Za-z0-9_]+)/.exec(name3);
|
|
14019
|
+
if (!m) return void 0;
|
|
14020
|
+
const len = Number(m[1]);
|
|
14021
|
+
const rest = m[2];
|
|
14022
|
+
if (rest.length <= len || rest[len] !== "C") return void 0;
|
|
14023
|
+
const cls = rest.slice(0, len);
|
|
14024
|
+
return lazyProviders.has(`._OBJC_CLASS_${cls}`) ? cls : void 0;
|
|
14025
|
+
};
|
|
14026
|
+
const objcClassFamilyOf = (cls) => {
|
|
14027
|
+
const providers = lazyProviders.get(`._OBJC_CLASS_${cls}`);
|
|
14028
|
+
if (!providers || providers.length === 0) return void 0;
|
|
14029
|
+
return moduleFamily(providers[0].file);
|
|
14030
|
+
};
|
|
14031
|
+
const tryActivateConformance = (entry) => {
|
|
14032
|
+
if (entry.activated) return;
|
|
14033
|
+
const typeReady = entry.typeKey === null ? true : entry.typeKey.kind === "swift" ? globalLiveTypes.has(entry.typeKey.value) : liveObjCClasses.has(entry.typeKey.value);
|
|
14034
|
+
if (!typeReady) return;
|
|
14035
|
+
if (entry.proto !== void 0 && !liveProtocols.has(entry.proto)) return;
|
|
14036
|
+
if (entry.isForeign) {
|
|
14037
|
+
eagerDynamicObjects.add(entry.obj);
|
|
14038
|
+
extractObject(entry.obj);
|
|
14039
|
+
} else if (!extractedObjs.has(entry.obj)) {
|
|
14040
|
+
return;
|
|
14041
|
+
}
|
|
14042
|
+
entry.activated = true;
|
|
14043
|
+
activateSymbolInObj(entry.obj, entry.symIdx);
|
|
14044
|
+
};
|
|
14045
|
+
const tryActivateCategory = (entry) => {
|
|
14046
|
+
if (entry.activated || !liveObjCClasses.has(entry.cls)) return;
|
|
14047
|
+
const allowed = entry.catFamily === "Foundation" || entry.classFamily !== void 0 && entry.classFamily !== "Foundation" || liveModuleFamilies.has(entry.catFamily);
|
|
14048
|
+
if (!allowed) return;
|
|
14049
|
+
entry.activated = true;
|
|
14050
|
+
eagerDynamicObjects.add(entry.obj);
|
|
14051
|
+
extractObject(entry.obj, true);
|
|
14052
|
+
};
|
|
14053
|
+
const markModuleFamilyLive = (family) => {
|
|
14054
|
+
if (liveModuleFamilies.has(family)) return;
|
|
14055
|
+
liveModuleFamilies.add(family);
|
|
14056
|
+
const waiting = pendingCategoriesByFamily.get(family);
|
|
14057
|
+
if (waiting) {
|
|
14058
|
+
pendingCategoriesByFamily.delete(family);
|
|
14059
|
+
for (const entry of waiting) tryActivateCategory(entry);
|
|
14060
|
+
}
|
|
14061
|
+
};
|
|
14062
|
+
const markObjCClassLive = (cls) => {
|
|
14063
|
+
if (!cls || liveObjCClasses.has(cls)) return;
|
|
14064
|
+
liveObjCClasses.add(cls);
|
|
14065
|
+
const confs = pendingByObjcClass.get(cls);
|
|
14066
|
+
if (confs) {
|
|
14067
|
+
for (const entry of confs) tryActivateConformance(entry);
|
|
14068
|
+
}
|
|
14069
|
+
const cats = pendingCategoriesByClass.get(cls);
|
|
14070
|
+
if (cats) {
|
|
14071
|
+
for (const entry of cats) tryActivateCategory(entry);
|
|
14072
|
+
}
|
|
14073
|
+
};
|
|
14074
|
+
const markProtocolLive = (mpName) => {
|
|
14075
|
+
if (!mpName || liveProtocols.has(mpName)) return;
|
|
14076
|
+
liveProtocols.add(mpName);
|
|
14077
|
+
const waiting = pendingByProto.get(mpName);
|
|
14078
|
+
if (waiting) {
|
|
14079
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
14080
|
+
}
|
|
14081
|
+
};
|
|
14082
|
+
const checkProtocolTrigger = (rawSymName) => {
|
|
14083
|
+
if (!rawSymName) return;
|
|
14084
|
+
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
14085
|
+
if (knownProtocols.has(sName)) {
|
|
14086
|
+
markProtocolLive(sName);
|
|
14087
|
+
return;
|
|
14088
|
+
}
|
|
14089
|
+
if (!sName.startsWith("$s") || sName.endsWith("Mc")) return;
|
|
14090
|
+
if (sName.endsWith("TL")) {
|
|
14091
|
+
const mp = `${sName.slice(0, -2)}Mp`;
|
|
14092
|
+
if (knownProtocols.has(mp)) {
|
|
14093
|
+
markProtocolLive(mp);
|
|
14094
|
+
return;
|
|
14095
|
+
}
|
|
14096
|
+
}
|
|
14097
|
+
if (sName.startsWith("$sS") && sName.length > 4) {
|
|
14098
|
+
const pref = sName.slice(0, 4);
|
|
14099
|
+
if (protoPrefixes.has(pref)) {
|
|
14100
|
+
const ch = sName[4];
|
|
14101
|
+
if (ch >= "0" && ch <= "9" || ch === "s" || ch === "P") {
|
|
14102
|
+
markProtocolLive(`${pref}Mp`);
|
|
14103
|
+
return;
|
|
14104
|
+
}
|
|
14105
|
+
}
|
|
14106
|
+
}
|
|
14107
|
+
for (let n = 5; n < sName.length; n++) {
|
|
14108
|
+
if (sName[n] === "P") {
|
|
14109
|
+
const pref = sName.slice(0, n);
|
|
14110
|
+
if (protoPrefixes.has(pref)) {
|
|
14111
|
+
markProtocolLive(`${pref}Mp`);
|
|
14112
|
+
return;
|
|
14113
|
+
}
|
|
14114
|
+
}
|
|
14115
|
+
}
|
|
14116
|
+
};
|
|
13903
14117
|
const markTypeLive = (obj, pref) => {
|
|
13904
14118
|
const set2 = liveTypes.get(obj);
|
|
13905
14119
|
if (set2.has(pref)) return;
|
|
13906
14120
|
set2.add(pref);
|
|
13907
14121
|
globalLiveTypes.add(pref);
|
|
13908
|
-
const waiting =
|
|
14122
|
+
const waiting = pendingBySwiftType.get(pref);
|
|
13909
14123
|
if (waiting) {
|
|
13910
|
-
|
|
13911
|
-
for (const w of waiting) {
|
|
13912
|
-
eagerDynamicObjects.add(w.obj);
|
|
13913
|
-
extractObject(w.obj);
|
|
13914
|
-
activateSymbolInObj(w.obj, w.symIdx);
|
|
13915
|
-
}
|
|
13916
|
-
}
|
|
13917
|
-
for (let n = pref.length - 1; n > 2; n--) {
|
|
13918
|
-
const outer = pref.slice(0, n);
|
|
13919
|
-
if (obj.typePrefixesInObj.has(outer)) markTypeLive(obj, outer);
|
|
14124
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
13920
14125
|
}
|
|
13921
14126
|
for (let n = pref.length - 1; n > 2; n--) {
|
|
13922
14127
|
const outer = pref.slice(0, n);
|
|
@@ -13933,22 +14138,20 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13933
14138
|
markFuncLive(obj, lf);
|
|
13934
14139
|
}
|
|
13935
14140
|
}
|
|
13936
|
-
for (
|
|
13937
|
-
if (
|
|
13938
|
-
|
|
13939
|
-
if (r.segIdx === sIdx) {
|
|
13940
|
-
const mcName = obj.symNames[r.rs];
|
|
13941
|
-
if (mcName.startsWith(pref)) {
|
|
13942
|
-
activateSymbolInObj(obj, r.rs);
|
|
13943
|
-
}
|
|
13944
|
-
}
|
|
13945
|
-
}
|
|
14141
|
+
for (const [classSym, p] of obj.objcClassSymToTypePrefix) {
|
|
14142
|
+
if (p === pref && classSym.startsWith("._OBJC_CLASS_")) {
|
|
14143
|
+
markObjCClassLive(classSym.slice("._OBJC_CLASS_".length));
|
|
13946
14144
|
}
|
|
13947
14145
|
}
|
|
13948
14146
|
};
|
|
13949
14147
|
const checkTypeTrigger = (obj, rawSymName) => {
|
|
13950
14148
|
if (!rawSymName) return;
|
|
13951
14149
|
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
14150
|
+
if (sName.startsWith("._OBJC_CLASS_")) {
|
|
14151
|
+
markObjCClassLive(sName.slice("._OBJC_CLASS_".length));
|
|
14152
|
+
} else if (sName.startsWith("._OBJC_METACLASS_")) {
|
|
14153
|
+
markObjCClassLive(sName.slice("._OBJC_METACLASS_".length));
|
|
14154
|
+
}
|
|
13952
14155
|
const objcPref = obj.objcClassSymToTypePrefix.get(sName);
|
|
13953
14156
|
if (objcPref) {
|
|
13954
14157
|
markTypeLive(obj, objcPref);
|
|
@@ -13975,6 +14178,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13975
14178
|
const activateGlobalName = (name3) => {
|
|
13976
14179
|
if (!name3) return;
|
|
13977
14180
|
if (!liveGlobalNames.has(name3)) liveGlobalNames.add(name3);
|
|
14181
|
+
checkProtocolTrigger(name3);
|
|
13978
14182
|
const defs = extractedSymbolDefs.get(name3);
|
|
13979
14183
|
if (defs) {
|
|
13980
14184
|
for (const d of defs) {
|
|
@@ -13989,7 +14193,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
13989
14193
|
const fl = obj.symFlags[symIdx];
|
|
13990
14194
|
const isUndef = (fl & 16) !== 0;
|
|
13991
14195
|
const isLocal = (fl & 3) === 2;
|
|
14196
|
+
if (obj.isDist && categoryOnlyExtracted.has(obj)) {
|
|
14197
|
+
categoryOnlyExtracted.delete(obj);
|
|
14198
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
14199
|
+
}
|
|
13992
14200
|
checkTypeTrigger(obj, sName);
|
|
14201
|
+
checkProtocolTrigger(sName);
|
|
13993
14202
|
if (!isUndef && !isLocal && sName && !liveGlobalNames.has(sName)) {
|
|
13994
14203
|
activateGlobalName(sName);
|
|
13995
14204
|
}
|
|
@@ -14001,13 +14210,25 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14001
14210
|
markDataSymLive(obj, pIdx);
|
|
14002
14211
|
const parentName = obj.symNames[pIdx];
|
|
14003
14212
|
checkTypeTrigger(obj, parentName);
|
|
14213
|
+
checkProtocolTrigger(parentName);
|
|
14004
14214
|
}
|
|
14005
14215
|
markSegLive(obj, el);
|
|
14006
14216
|
}
|
|
14007
14217
|
}
|
|
14008
|
-
const extractObject = (obj) => {
|
|
14009
|
-
if (extractedObjs.has(obj))
|
|
14218
|
+
const extractObject = (obj, fromObjCCategory = false) => {
|
|
14219
|
+
if (extractedObjs.has(obj)) {
|
|
14220
|
+
if (!fromObjCCategory && categoryOnlyExtracted.has(obj)) {
|
|
14221
|
+
categoryOnlyExtracted.delete(obj);
|
|
14222
|
+
if (obj.isDist) markModuleFamilyLive(moduleFamily(obj.file));
|
|
14223
|
+
}
|
|
14224
|
+
return;
|
|
14225
|
+
}
|
|
14010
14226
|
extractedObjs.add(obj);
|
|
14227
|
+
if (fromObjCCategory && obj.isDist) {
|
|
14228
|
+
categoryOnlyExtracted.add(obj);
|
|
14229
|
+
} else if (obj.isDist) {
|
|
14230
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
14231
|
+
}
|
|
14011
14232
|
liveFuncs.set(obj, new Uint8Array(obj.numFuncs));
|
|
14012
14233
|
liveSegs.set(obj, new Uint8Array(obj.numSegments));
|
|
14013
14234
|
liveDataSyms.set(obj, /* @__PURE__ */ new Set());
|
|
@@ -14045,6 +14266,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14045
14266
|
if (classSym !== -1 && (obj.symFlags[classSym] & 16) === 0)
|
|
14046
14267
|
activateSymbolInObj(obj, classSym);
|
|
14047
14268
|
}
|
|
14269
|
+
if (!obj.isDist) {
|
|
14270
|
+
for (let i = 0; i < obj.symNames.length; i++) {
|
|
14271
|
+
checkTypeTrigger(obj, obj.symNames[i]);
|
|
14272
|
+
checkProtocolTrigger(obj.symNames[i]);
|
|
14273
|
+
}
|
|
14274
|
+
}
|
|
14048
14275
|
if (obj.isDist) {
|
|
14049
14276
|
const isBuildSwift = !obj.file.startsWith(distDir) && obj.file.endsWith(".swift.o");
|
|
14050
14277
|
for (const [classSym, pref] of obj.objcClassSymToTypePrefix)
|
|
@@ -14059,48 +14286,77 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14059
14286
|
}
|
|
14060
14287
|
}
|
|
14061
14288
|
if (obj.isDist) {
|
|
14062
|
-
for (
|
|
14063
|
-
|
|
14064
|
-
for (const r of obj.dataRelocList) {
|
|
14065
|
-
if (r.segIdx === sIdx) {
|
|
14066
|
-
const mcName = obj.symNames[r.rs];
|
|
14067
|
-
let matchesLocalType = false;
|
|
14068
|
-
for (const pref of obj.typePrefixesInObj) {
|
|
14069
|
-
if (mcName.startsWith(pref)) {
|
|
14070
|
-
matchesLocalType = true;
|
|
14071
|
-
break;
|
|
14072
|
-
}
|
|
14073
|
-
}
|
|
14074
|
-
if (!matchesLocalType) {
|
|
14075
|
-
const type = conformingType(mcName);
|
|
14076
|
-
if (type === void 0 || globalLiveTypes.has(type))
|
|
14077
|
-
activateSymbolInObj(obj, r.rs);
|
|
14078
|
-
}
|
|
14079
|
-
}
|
|
14080
|
-
}
|
|
14081
|
-
}
|
|
14289
|
+
for (const entries of pendingByObj.get(obj) ?? []) {
|
|
14290
|
+
tryActivateConformance(entries);
|
|
14082
14291
|
}
|
|
14083
14292
|
}
|
|
14084
14293
|
};
|
|
14294
|
+
const pendingByObj = /* @__PURE__ */ new Map();
|
|
14085
14295
|
for (const obj of distObjs.values()) {
|
|
14086
14296
|
if (!obj.isDist) continue;
|
|
14087
14297
|
for (const r of obj.dataRelocList) {
|
|
14088
14298
|
if (obj.segNames[r.segIdx] !== "swift5_protocol_conformances") continue;
|
|
14089
|
-
const
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14299
|
+
const mcIdx = r.rs;
|
|
14300
|
+
const mcName = obj.symNames[mcIdx];
|
|
14301
|
+
const swiftType = conformingType(mcName);
|
|
14302
|
+
const objcType = swiftType === void 0 ? objcClassOfConformance(mcName) : void 0;
|
|
14303
|
+
const typeKey = swiftType !== void 0 ? { kind: "swift", value: swiftType } : objcType !== void 0 ? { kind: "objc", value: objcType } : null;
|
|
14304
|
+
const proto = obj.conformanceProtocols.get(mcIdx);
|
|
14305
|
+
const isForeign = swiftType !== void 0 ? !obj.typePrefixesInObj.has(swiftType) : objcType !== void 0 ? !obj.symNames.some(
|
|
14306
|
+
(n, i) => n === `._OBJC_CLASS_${objcType}` && (obj.symFlags[i] & 16) === 0
|
|
14307
|
+
) : false;
|
|
14308
|
+
const entry = {
|
|
14309
|
+
obj,
|
|
14310
|
+
symIdx: mcIdx,
|
|
14311
|
+
typeKey,
|
|
14312
|
+
proto,
|
|
14313
|
+
isForeign,
|
|
14314
|
+
activated: false
|
|
14315
|
+
};
|
|
14316
|
+
let objList = pendingByObj.get(obj);
|
|
14317
|
+
if (!objList) pendingByObj.set(obj, objList = []);
|
|
14318
|
+
objList.push(entry);
|
|
14319
|
+
if (swiftType !== void 0) {
|
|
14320
|
+
let list2 = pendingBySwiftType.get(swiftType);
|
|
14321
|
+
if (!list2) pendingBySwiftType.set(swiftType, list2 = []);
|
|
14322
|
+
list2.push(entry);
|
|
14323
|
+
} else if (objcType !== void 0) {
|
|
14324
|
+
let list2 = pendingByObjcClass.get(objcType);
|
|
14325
|
+
if (!list2) pendingByObjcClass.set(objcType, list2 = []);
|
|
14326
|
+
list2.push(entry);
|
|
14327
|
+
}
|
|
14328
|
+
if (proto !== void 0) {
|
|
14329
|
+
let list2 = pendingByProto.get(proto);
|
|
14330
|
+
if (!list2) pendingByProto.set(proto, list2 = []);
|
|
14331
|
+
list2.push(entry);
|
|
14332
|
+
}
|
|
14333
|
+
}
|
|
14334
|
+
if (obj.objcCategoryTargets.length > 0) {
|
|
14335
|
+
const catFamily = moduleFamily(obj.file);
|
|
14336
|
+
for (const cls of obj.objcCategoryTargets) {
|
|
14337
|
+
const classFamily = objcClassFamilyOf(cls);
|
|
14338
|
+
const entry = {
|
|
14339
|
+
obj,
|
|
14340
|
+
cls,
|
|
14341
|
+
catFamily,
|
|
14342
|
+
classFamily,
|
|
14343
|
+
activated: false
|
|
14344
|
+
};
|
|
14345
|
+
let byCls = pendingCategoriesByClass.get(cls);
|
|
14346
|
+
if (!byCls) pendingCategoriesByClass.set(cls, byCls = []);
|
|
14347
|
+
byCls.push(entry);
|
|
14348
|
+
if (catFamily !== "Foundation" && (classFamily === void 0 || classFamily === "Foundation")) {
|
|
14349
|
+
let byFam = pendingCategoriesByFamily.get(catFamily);
|
|
14350
|
+
if (!byFam) pendingCategoriesByFamily.set(catFamily, byFam = []);
|
|
14351
|
+
byFam.push(entry);
|
|
14352
|
+
}
|
|
14353
|
+
}
|
|
14094
14354
|
}
|
|
14095
14355
|
}
|
|
14096
|
-
let hasClangObjCEager = false;
|
|
14097
14356
|
for (const f of eagerFiles) {
|
|
14098
14357
|
const isDist = f.startsWith(distDir);
|
|
14099
14358
|
const obj = distObjs.get(f) ?? parseWasmObjectCached(f, isDist, false);
|
|
14100
14359
|
extractObject(obj);
|
|
14101
|
-
if (!isDist && !hasClangObjCEager && obj.symNames.includes("__objc_load")) {
|
|
14102
|
-
hasClangObjCEager = true;
|
|
14103
|
-
}
|
|
14104
14360
|
if (isDist) {
|
|
14105
14361
|
const base = import_node_path31.default.basename(f);
|
|
14106
14362
|
if (base.startsWith("PeachFoundation-") || base.startsWith("PeachObjC-") || base.startsWith("PeachICU-") || base.startsWith("Darwin-")) {
|
|
@@ -14123,19 +14379,6 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14123
14379
|
activateSymbolInObj(provider, provider.symNames.indexOf(name3));
|
|
14124
14380
|
}
|
|
14125
14381
|
}
|
|
14126
|
-
const eagerSdkCategoryFiles = [];
|
|
14127
|
-
if (hasClangObjCEager) {
|
|
14128
|
-
for (const name3 of foundationCategoryObjects.map(
|
|
14129
|
-
(name4) => `libFoundation__${name4}.objc.o`
|
|
14130
|
-
)) {
|
|
14131
|
-
const sdkFile = import_node_path31.default.join(sdkObjsDir, name3);
|
|
14132
|
-
const obj = distObjs.get(sdkFile);
|
|
14133
|
-
if (obj) {
|
|
14134
|
-
extractObject(obj);
|
|
14135
|
-
eagerSdkCategoryFiles.push(sdkFile);
|
|
14136
|
-
}
|
|
14137
|
-
}
|
|
14138
|
-
}
|
|
14139
14382
|
for (const symName of ["_initialize", "__main_argc_argv", "main"]) {
|
|
14140
14383
|
const def = definedGlobalSyms.get(symName);
|
|
14141
14384
|
if (def) activateSymbolInObj(def.obj, def.symIdx);
|
|
@@ -14190,6 +14433,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14190
14433
|
}
|
|
14191
14434
|
for (const symIdx of relocs) {
|
|
14192
14435
|
if (obj.isDist && dropsReflection(obj, obj.symNames[symIdx])) continue;
|
|
14436
|
+
const symName = obj.symNames[symIdx];
|
|
14437
|
+
checkTypeTrigger(obj, symName);
|
|
14438
|
+
checkProtocolTrigger(symName);
|
|
14193
14439
|
const fl = obj.symFlags[symIdx];
|
|
14194
14440
|
const isUndef = (fl & 16) !== 0;
|
|
14195
14441
|
const isLocal = (fl & 3) === 2;
|
|
@@ -14529,21 +14775,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
14529
14775
|
writePrunedObject(o, outPath);
|
|
14530
14776
|
prunedMap.set(o.file, outPath);
|
|
14531
14777
|
}
|
|
14532
|
-
const extraSdkObjs = allSdkObjFiles.filter(
|
|
14533
|
-
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
14534
|
-
).map((f) => import_node_path31.default.join(sdkObjsDir, f));
|
|
14535
14778
|
const outTokens = [];
|
|
14536
14779
|
const emittedPruned = /* @__PURE__ */ new Set();
|
|
14537
14780
|
inStartLib = false;
|
|
14538
14781
|
for (const t of tokens2) {
|
|
14539
14782
|
if (t === "--start-lib") {
|
|
14540
14783
|
inStartLib = true;
|
|
14541
|
-
for (const ef of eagerSdkCategoryFiles) {
|
|
14542
|
-
if (!emittedPruned.has(ef) && prunedMap.has(ef)) {
|
|
14543
|
-
outTokens.push(prunedMap.get(ef));
|
|
14544
|
-
emittedPruned.add(ef);
|
|
14545
|
-
}
|
|
14546
|
-
}
|
|
14547
14784
|
for (const obj of eagerDynamicObjects) {
|
|
14548
14785
|
if (!emittedPruned.has(obj.file) && prunedMap.has(obj.file)) {
|
|
14549
14786
|
outTokens.push(prunedMap.get(obj.file));
|
|
@@ -14615,7 +14852,6 @@ var init_swift_wasm_prune = __esm({
|
|
|
14615
14852
|
import_node_fs34 = __toESM(require("node:fs"), 1);
|
|
14616
14853
|
import_node_path31 = __toESM(require("node:path"), 1);
|
|
14617
14854
|
v2 = __toESM(require("valibot"), 1);
|
|
14618
|
-
init_swift_foundation();
|
|
14619
14855
|
init_swift_toolchain();
|
|
14620
14856
|
init_swiftRuntimeProductContract();
|
|
14621
14857
|
HAS_ADDEND = /* @__PURE__ */ new Set([3, 4, 5, 8, 9, 11, 14, 15, 16, 17, 21, 22, 23, 25]);
|
|
@@ -19242,6 +19478,7 @@ function objcRootInfo(bytes) {
|
|
|
19242
19478
|
const at = { offset: 8 };
|
|
19243
19479
|
const names = [];
|
|
19244
19480
|
const dataSymbols = [];
|
|
19481
|
+
let hasNSObjectLoad = false;
|
|
19245
19482
|
let hasExportedSymbol = false;
|
|
19246
19483
|
while (at.offset < bytes.length) {
|
|
19247
19484
|
const id = bytes[at.offset++];
|
|
@@ -19278,6 +19515,12 @@ function objcRootInfo(bytes) {
|
|
|
19278
19515
|
leb(bytes, at);
|
|
19279
19516
|
if (!isUndef || isExplicitName) {
|
|
19280
19517
|
const sLen = leb(bytes, at);
|
|
19518
|
+
if (!isUndef && symKind === 0) {
|
|
19519
|
+
const name4 = Buffer.from(
|
|
19520
|
+
bytes.subarray(at.offset, at.offset + sLen)
|
|
19521
|
+
).toString();
|
|
19522
|
+
if (/^_c_NSObject_.*_load$/.test(name4)) hasNSObjectLoad = true;
|
|
19523
|
+
}
|
|
19281
19524
|
at.offset += sLen;
|
|
19282
19525
|
}
|
|
19283
19526
|
} else if (symKind === 1) {
|
|
@@ -19304,11 +19547,9 @@ function objcRootInfo(bytes) {
|
|
|
19304
19547
|
at.offset = end;
|
|
19305
19548
|
}
|
|
19306
19549
|
return {
|
|
19307
|
-
registration: dataSymbols.some(
|
|
19308
|
-
|
|
19309
|
-
|
|
19310
|
-
return sentinel !== void 0 && name3 !== sentinel;
|
|
19311
|
-
}),
|
|
19550
|
+
registration: hasNSObjectLoad || dataSymbols.some(
|
|
19551
|
+
({ segment, name: name3 }) => names[segment] === "__objc_class_aliases" && name3 !== ".objc_null_class_alias"
|
|
19552
|
+
),
|
|
19312
19553
|
exported: hasExportedSymbol
|
|
19313
19554
|
};
|
|
19314
19555
|
}
|
|
@@ -19320,25 +19561,18 @@ function swiftObjcRootObjects(id, root, objects) {
|
|
|
19320
19561
|
);
|
|
19321
19562
|
const roots = new Set(
|
|
19322
19563
|
measured.filter(
|
|
19323
|
-
([object6, info]) =>
|
|
19324
|
-
(name3) => object6 === `lib/Foundation-${name3}.o`
|
|
19325
|
-
) && object6 !== "lib/FoundationNetworking-Session.o" && object6 !== "lib/SwiftUI-MetalExecution.o" && object6 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
19564
|
+
([object6, info]) => object6 !== "lib/FoundationNetworking-Session.o" && object6 !== "lib/Metal-MetalExecution.o" && object6 !== "lib/PeachICU-icu.c.o" && object6 !== "lib/SwiftUI-MetalExecution.o" && object6 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
19326
19565
|
).map(([object6]) => object6)
|
|
19327
19566
|
);
|
|
19328
19567
|
rootsByDistribution.set(id, roots);
|
|
19329
19568
|
return roots;
|
|
19330
19569
|
}
|
|
19331
|
-
var import_node_fs43, import_node_path40,
|
|
19570
|
+
var import_node_fs43, import_node_path40, leb, rootsByDistribution;
|
|
19332
19571
|
var init_swift_link_roots = __esm({
|
|
19333
19572
|
"src/swift-link-roots.ts"() {
|
|
19334
19573
|
"use strict";
|
|
19335
19574
|
import_node_fs43 = __toESM(require("node:fs"), 1);
|
|
19336
19575
|
import_node_path40 = __toESM(require("node:path"), 1);
|
|
19337
|
-
init_swift_foundation();
|
|
19338
|
-
OBJC_SENTINELS = /* @__PURE__ */ new Map([
|
|
19339
|
-
["__objc_cats", ".objc_null_category"],
|
|
19340
|
-
["__objc_class_aliases", ".objc_null_class_alias"]
|
|
19341
|
-
]);
|
|
19342
19576
|
leb = (bytes, at) => {
|
|
19343
19577
|
let value = 0;
|
|
19344
19578
|
let scale = 1;
|
|
@@ -24904,7 +25138,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
24904
25138
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
24905
25139
|
MULTI_MANIFEST_VERSION = 68;
|
|
24906
25140
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
24907
|
-
compilerSourceDigest = true ? "
|
|
25141
|
+
compilerSourceDigest = true ? "05dbb1273689060748700777894c639c73bea2e6da20eaf47e8040b26ff859cf" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
24908
25142
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
24909
25143
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
24910
25144
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -25666,7 +25900,11 @@ async function swiftDistributionRoot(signal) {
|
|
|
25666
25900
|
const endpoint = swiftEndpoint();
|
|
25667
25901
|
const lock = swiftNativePin().distribution;
|
|
25668
25902
|
await installSwiftToolchain(lock.release, lock, signal);
|
|
25669
|
-
const dir = import_node_path47.default.join(
|
|
25903
|
+
const dir = import_node_path47.default.join(
|
|
25904
|
+
swiftCacheDir(),
|
|
25905
|
+
"swift-distributions",
|
|
25906
|
+
`${lock.id}-${host2}-${lock.hosts[host2].sha256}`
|
|
25907
|
+
);
|
|
25670
25908
|
let pending = installs.get(dir);
|
|
25671
25909
|
if (pending?.controller.signal.aborted) pending = void 0;
|
|
25672
25910
|
if (!pending) {
|
|
@@ -29035,7 +29273,7 @@ var init_swift_standin_digest = __esm({
|
|
|
29035
29273
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
29036
29274
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
29037
29275
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
29038
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
29276
|
+
STANDIN_SOURCE_DIGEST = true ? "6a3e08e780371135330124e5f94797a59a8e181f890d0c3dab1f0fd155525e35" : standinSourceDigest();
|
|
29039
29277
|
}
|
|
29040
29278
|
});
|
|
29041
29279
|
|
|
@@ -44715,7 +44953,7 @@ var init_react_native_core = __esm({
|
|
|
44715
44953
|
init_swift_distribution();
|
|
44716
44954
|
init_swift_package();
|
|
44717
44955
|
init_swiftContract();
|
|
44718
|
-
recipe = true ? "
|
|
44956
|
+
recipe = true ? "6b67c6a71d4bea968d2b12089709b9f559c04bdd32fd1b13d97069d439205d8e" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
|
|
44719
44957
|
strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
44720
44958
|
building = /* @__PURE__ */ new Map();
|
|
44721
44959
|
}
|
|
@@ -49269,7 +49507,7 @@ async function copyInstalledWorkspace(root, destination, excluded) {
|
|
|
49269
49507
|
return [];
|
|
49270
49508
|
}
|
|
49271
49509
|
import_node_fs58.default.mkdirSync(import_node_path56.default.join(destination, relative3));
|
|
49272
|
-
return import_node_fs58.default.readdirSync(source).map((name3) => import_node_path56.default.join(relative3, name3));
|
|
49510
|
+
return import_node_fs58.default.readdirSync(source).filter((name3) => name3 !== ".cache").map((name3) => import_node_path56.default.join(relative3, name3));
|
|
49273
49511
|
});
|
|
49274
49512
|
const clone = async () => {
|
|
49275
49513
|
const relative3 = entries.pop();
|
|
@@ -50086,7 +50324,7 @@ init_swift_native_pin();
|
|
|
50086
50324
|
init_xcode_project();
|
|
50087
50325
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
50088
50326
|
function expoNativeCompilerDigestValue() {
|
|
50089
|
-
return true ? "
|
|
50327
|
+
return true ? "7d73f99bba5ca35b02940fff1bd30347e91d5720ca490fd381923db942126173" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
50090
50328
|
}
|
|
50091
50329
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
50092
50330
|
function readSources(value) {
|
|
@@ -52021,11 +52259,7 @@ async function collectExpoSwiftSourcesUncached(appRoot, signal, installedWorkspa
|
|
|
52021
52259
|
fileCount++;
|
|
52022
52260
|
if (!installedWorkspace && (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES))
|
|
52023
52261
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
52024
|
-
files2[`Sources/${namespace}/${import_node_path84.default.relative(ios, file).split(import_node_path84.default.sep).join("/")}`] =
|
|
52025
|
-
// through the underlying module; these source units have no clang pod.
|
|
52026
|
-
`import UIKit
|
|
52027
|
-
#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
52028
|
-
${import_node_fs86.default.readFileSync(source, "utf8")}`;
|
|
52262
|
+
files2[`Sources/${namespace}/${import_node_path84.default.relative(ios, file).split(import_node_path84.default.sep).join("/")}`] = expoSwiftSourceWithPrelude(file, import_node_fs86.default.readFileSync(source, "utf8"));
|
|
52029
52263
|
}
|
|
52030
52264
|
};
|
|
52031
52265
|
const walkFrameworks = (dir) => {
|
|
@@ -52239,9 +52473,7 @@ ${import_node_fs86.default.readFileSync(source, "utf8")}`;
|
|
|
52239
52473
|
fileCount++;
|
|
52240
52474
|
if (fileCount > MAX_SWIFT_COMPILE_FILES - 2 || bytes > MAX_SWIFT_COMPILE_SOURCE_BYTES)
|
|
52241
52475
|
throw new Error("Expo Swift sources exceed compile service caps");
|
|
52242
|
-
appFiles[`Sources/PeachExpoApp/Inline/${relative3.split(import_node_path84.default.sep).join("/")}`] =
|
|
52243
|
-
#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
52244
|
-
${import_node_fs86.default.readFileSync(file, "utf8")}`;
|
|
52476
|
+
appFiles[`Sources/PeachExpoApp/Inline/${relative3.split(import_node_path84.default.sep).join("/")}`] = expoSwiftSourceWithPrelude(file, import_node_fs86.default.readFileSync(file, "utf8"));
|
|
52245
52477
|
}
|
|
52246
52478
|
if (Object.keys(appFiles).length > 0) {
|
|
52247
52479
|
const inlineUnit = {
|
|
@@ -52421,6 +52653,12 @@ function oneSDKStamp(oneSDK) {
|
|
|
52421
52653
|
hash.update(`${name3}\0${source}\0`);
|
|
52422
52654
|
return hash.digest("hex");
|
|
52423
52655
|
}
|
|
52656
|
+
function expoSwiftSourceWithPrelude(file, rawSource) {
|
|
52657
|
+
const extraImport = /\bUIImageWriteToSavedPhotosAlbum\b/.test(rawSource) ? "import func SwiftUI.UIImageWriteToSavedPhotosAlbum\n" : "";
|
|
52658
|
+
return `import UIKit
|
|
52659
|
+
${extraImport}#sourceLocation(file: ${JSON.stringify(file)}, line: 1)
|
|
52660
|
+
${rawSource}`;
|
|
52661
|
+
}
|
|
52424
52662
|
function expoEntry(units, oneSDK = false) {
|
|
52425
52663
|
const namespaces = [...new Set(units.map((unit2) => unit2.namespace))].filter((namespace) => namespace !== "PeachExpoApp").filter(
|
|
52426
52664
|
(namespace) => units.some(
|
|
@@ -52431,7 +52669,12 @@ function expoEntry(units, oneSDK = false) {
|
|
|
52431
52669
|
const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
|
|
52432
52670
|
const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
|
|
52433
52671
|
const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";
|
|
52434
|
-
const
|
|
52672
|
+
const hasViews = oneSDK || units.some(
|
|
52673
|
+
(unit2) => Object.entries(unit2.files).some(
|
|
52674
|
+
([file, source]) => file.endsWith(".swift") && /\bView\s*\(|\bExpoView\b|\bUIViewRepresentable\b|\bExpoSwiftUI\b/.test(source)
|
|
52675
|
+
)
|
|
52676
|
+
);
|
|
52677
|
+
const view = oneSDK ? '@ViewBuilder func view(props: JSON) -> some View {\n if props["oneSDKHost"] != nil { OneSDKUIKitHost(props: props) } else { PeachExpoNativeView(props: props) }\n }' : hasViews ? "func view(props: JSON) -> PeachExpoNativeView { PeachExpoNativeView(props: props) }" : "func view(props: JSON) -> EmptyView { EmptyView() }";
|
|
52435
52678
|
return `import SwiftUI
|
|
52436
52679
|
internal import ExpoModulesCore
|
|
52437
52680
|
${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport OneSDKBindings\n" : ""}${namespaces.map((namespace) => `import ${namespace}`).join("\n")}
|