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
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -5336,18 +5336,22 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
5336
5336
|
const [, r1] = readULEB2(buf, cp);
|
|
5337
5337
|
const [cnt, r2] = readULEB2(buf, r1);
|
|
5338
5338
|
let cur = r2;
|
|
5339
|
-
const
|
|
5339
|
+
const isData = name2 === "reloc.DATA";
|
|
5340
5340
|
for (let i = 0; i < cnt; i++) {
|
|
5341
5341
|
const rStart = cur;
|
|
5342
5342
|
const rType = buf[cur++];
|
|
5343
5343
|
const [ro, c2] = readULEB2(buf, cur);
|
|
5344
5344
|
const [rs, c3] = readULEB2(buf, c2);
|
|
5345
5345
|
cur = c3;
|
|
5346
|
+
let addend = 0;
|
|
5346
5347
|
if (HAS_ADDEND.has(rType)) {
|
|
5347
|
-
const [, c4] = readSLEB(buf, cur);
|
|
5348
|
+
const [val, c4] = readSLEB(buf, cur);
|
|
5349
|
+
addend = val;
|
|
5348
5350
|
cur = c4;
|
|
5349
5351
|
}
|
|
5350
|
-
|
|
5352
|
+
const rawBytes = new Uint8Array(buf.subarray(rStart, cur));
|
|
5353
|
+
if (isData) rawDataRelocs.push({ rawBytes, ro, rs, addend });
|
|
5354
|
+
else rawCodeRelocs.push({ rawBytes, ro, rs });
|
|
5351
5355
|
}
|
|
5352
5356
|
}
|
|
5353
5357
|
}
|
|
@@ -5501,6 +5505,80 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
5501
5505
|
rootSegs.push(i);
|
|
5502
5506
|
}
|
|
5503
5507
|
}
|
|
5508
|
+
const conformanceProtocols = /* @__PURE__ */ new Map();
|
|
5509
|
+
const objcCategoryTargets = [];
|
|
5510
|
+
if (isDist) {
|
|
5511
|
+
const relocAt = /* @__PURE__ */ new Map();
|
|
5512
|
+
for (const r of dataRelocList) {
|
|
5513
|
+
relocAt.set(`${r.segIdx}:${r.offInSeg}`, { rs: r.rs, addend: r.addend });
|
|
5514
|
+
}
|
|
5515
|
+
const confSegs = /* @__PURE__ */ new Set();
|
|
5516
|
+
let hasCatsSeg = false;
|
|
5517
|
+
for (let i = 0; i < segNames.length; i++) {
|
|
5518
|
+
if (segNames[i] === "swift5_protocol_conformances") confSegs.add(i);
|
|
5519
|
+
else if (segNames[i] === "__objc_cats") hasCatsSeg = true;
|
|
5520
|
+
}
|
|
5521
|
+
if (confSegs.size > 0) {
|
|
5522
|
+
const segOffToMpSym = /* @__PURE__ */ new Map();
|
|
5523
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
5524
|
+
if (symKind[i] === 1 && (symFlags[i] & 16) === 0 && symElemIdx[i] >= 0 && symNames[i].startsWith("$s") && symNames[i].endsWith("Mp")) {
|
|
5525
|
+
segOffToMpSym.set(`${symElemIdx[i]}:${symOff[i]}`, symNames[i]);
|
|
5526
|
+
}
|
|
5527
|
+
}
|
|
5528
|
+
const dv = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
5529
|
+
for (const r of dataRelocList) {
|
|
5530
|
+
if (!confSegs.has(r.segIdx)) continue;
|
|
5531
|
+
const mcIdx = r.rs;
|
|
5532
|
+
if (symKind[mcIdx] !== 1 || (symFlags[mcIdx] & 16) !== 0 || symElemIdx[mcIdx] < 0) {
|
|
5533
|
+
continue;
|
|
5534
|
+
}
|
|
5535
|
+
const mcSeg = symElemIdx[mcIdx];
|
|
5536
|
+
const mcOff = symOff[mcIdx];
|
|
5537
|
+
const pr = relocAt.get(`${mcSeg}:${mcOff}`);
|
|
5538
|
+
let mp = "";
|
|
5539
|
+
if (pr) {
|
|
5540
|
+
const raw2 = symNames[pr.rs];
|
|
5541
|
+
const stripped = raw2.startsWith(".Lgot.") ? raw2.slice(6) : raw2;
|
|
5542
|
+
if (stripped.startsWith("$s") && stripped.endsWith("Mp")) {
|
|
5543
|
+
mp = stripped;
|
|
5544
|
+
} else if (symKind[pr.rs] === 3 || stripped === "") {
|
|
5545
|
+
mp = segOffToMpSym.get(`${mcSeg}:${pr.addend}`) ?? "";
|
|
5546
|
+
}
|
|
5547
|
+
} else {
|
|
5548
|
+
const fileOff = dataStart + sPayloadStarts[mcSeg] + mcOff;
|
|
5549
|
+
if (fileOff + 4 <= buf.length) {
|
|
5550
|
+
const delta = dv.getInt32(fileOff, true);
|
|
5551
|
+
mp = segOffToMpSym.get(`${mcSeg}:${mcOff + delta}`) ?? segOffToMpSym.get(`${mcSeg}:${mcOff + (delta & ~1)}`) ?? "";
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
if (mp) conformanceProtocols.set(mcIdx, mp);
|
|
5555
|
+
}
|
|
5556
|
+
}
|
|
5557
|
+
if (hasCatsSeg) {
|
|
5558
|
+
const seenClasses = /* @__PURE__ */ new Set();
|
|
5559
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
5560
|
+
if (symKind[i] !== 1 || (symFlags[i] & 16) !== 0 || symElemIdx[i] < 0 || segNames[symElemIdx[i]] !== "__objc_cats" || !symNames[i].startsWith(".objc_category_")) {
|
|
5561
|
+
continue;
|
|
5562
|
+
}
|
|
5563
|
+
const cSeg = symElemIdx[i];
|
|
5564
|
+
const cOff = symOff[i];
|
|
5565
|
+
const cr = relocAt.get(`${cSeg}:${cOff + 8}`);
|
|
5566
|
+
if (cr && symKind[cr.rs] === 1 && (symFlags[cr.rs] & 16) === 0 && symElemIdx[cr.rs] >= 0) {
|
|
5567
|
+
const tSeg = symElemIdx[cr.rs];
|
|
5568
|
+
const strOff = dataStart + sPayloadStarts[tSeg] + symOff[cr.rs] + cr.addend;
|
|
5569
|
+
let sEnd = strOff;
|
|
5570
|
+
while (sEnd < buf.length && buf[sEnd] !== 0) sEnd++;
|
|
5571
|
+
if (sEnd > strOff) {
|
|
5572
|
+
const clsName = Buffer.from(buf.subarray(strOff, sEnd)).toString("utf8");
|
|
5573
|
+
if (!seenClasses.has(clsName)) {
|
|
5574
|
+
seenClasses.add(clsName);
|
|
5575
|
+
objcCategoryTargets.push(clsName);
|
|
5576
|
+
}
|
|
5577
|
+
}
|
|
5578
|
+
}
|
|
5579
|
+
}
|
|
5580
|
+
}
|
|
5581
|
+
}
|
|
5504
5582
|
return {
|
|
5505
5583
|
file,
|
|
5506
5584
|
isDist,
|
|
@@ -5525,6 +5603,8 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
5525
5603
|
objcRegisterFuncToTypePrefix,
|
|
5526
5604
|
objcClassSymToTypePrefix,
|
|
5527
5605
|
typePrefixesInObj,
|
|
5606
|
+
conformanceProtocols,
|
|
5607
|
+
objcCategoryTargets,
|
|
5528
5608
|
rootFuncs,
|
|
5529
5609
|
rootSegs,
|
|
5530
5610
|
segPayloadRanges: sEnds.map((end, i) => [
|
|
@@ -5536,7 +5616,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
5536
5616
|
function parseWasmObjectCached(file, isDist, useCache) {
|
|
5537
5617
|
if (!useCache)
|
|
5538
5618
|
return parseWasmObjectBytes(file, new Uint8Array(fs4.readFileSync(file)), isDist);
|
|
5539
|
-
const key =
|
|
5619
|
+
const key = `v2:${isDist ? "1" : "0"}:${file}`;
|
|
5540
5620
|
const stat = fs4.statSync(file, { bigint: true });
|
|
5541
5621
|
const stamp = `${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
|
|
5542
5622
|
const hit = parsedObjectCache.get(key);
|
|
@@ -5696,6 +5776,18 @@ function getModulePrefix(file) {
|
|
|
5696
5776
|
const dash = base.indexOf("-");
|
|
5697
5777
|
return dash > 0 ? base.slice(0, dash) : base;
|
|
5698
5778
|
}
|
|
5779
|
+
function moduleFamily(file) {
|
|
5780
|
+
const mod = getModulePrefix(file);
|
|
5781
|
+
if (mod === "Foundation" || mod === "PeachFoundation" || mod === "PeachObjC" || mod === "PeachObjCRuntime" || mod === "ObjectiveC" || mod === "Darwin" || mod === "libFoundation" || mod === "libObjectiveC" || mod === "libDarwin" || mod === "libswiftCore") {
|
|
5782
|
+
return "Foundation";
|
|
5783
|
+
}
|
|
5784
|
+
if (mod.startsWith("UIKit")) return "UIKit";
|
|
5785
|
+
if (mod === "CoreData" || mod === "CoreDataConstants") return "CoreData";
|
|
5786
|
+
if (mod === "AVFoundation" || mod === "AVFoundationConstants" || mod === "AVFAudio") {
|
|
5787
|
+
return "AVFoundation";
|
|
5788
|
+
}
|
|
5789
|
+
return mod;
|
|
5790
|
+
}
|
|
5699
5791
|
var SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
|
|
5700
5792
|
[
|
|
5701
5793
|
"View",
|
|
@@ -5789,11 +5881,7 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5789
5881
|
}
|
|
5790
5882
|
if (t.endsWith(".o")) {
|
|
5791
5883
|
if (path10.resolve(t).startsWith(distDir + path10.sep)) {
|
|
5792
|
-
|
|
5793
|
-
(name2) => path10.basename(t) === `Foundation-${name2}.o`
|
|
5794
|
-
)) {
|
|
5795
|
-
distFiles.push(t);
|
|
5796
|
-
}
|
|
5884
|
+
distFiles.push(t);
|
|
5797
5885
|
if (!inStartLib) eagerFiles.push(t);
|
|
5798
5886
|
} else if (!inStartLib) {
|
|
5799
5887
|
if (t.endsWith("/swiftrt.o")) {
|
|
@@ -5862,6 +5950,9 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5862
5950
|
}
|
|
5863
5951
|
const allSdkObjFiles = fs4.readdirSync(sdkObjsDir).filter((f) => f.endsWith(".o") || f.endsWith(".obj")).sort();
|
|
5864
5952
|
const sdkFiles = allSdkObjFiles.map((f) => path10.join(sdkObjsDir, f));
|
|
5953
|
+
const extraSdkObjs = allSdkObjFiles.filter(
|
|
5954
|
+
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
5955
|
+
).map((f) => path10.join(sdkObjsDir, f));
|
|
5865
5956
|
const distObjs = /* @__PURE__ */ new Map();
|
|
5866
5957
|
const lazyProviders = /* @__PURE__ */ new Map();
|
|
5867
5958
|
const registerLazyProvider = (obj) => {
|
|
@@ -5925,11 +6016,33 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5925
6016
|
workQueue.push({ kind: "datasym", obj, symIdx });
|
|
5926
6017
|
};
|
|
5927
6018
|
const knownTypes = /* @__PURE__ */ new Set();
|
|
5928
|
-
|
|
6019
|
+
const knownProtocols = /* @__PURE__ */ new Set();
|
|
6020
|
+
const protoPrefixes = /* @__PURE__ */ new Set();
|
|
6021
|
+
for (const o of distObjs.values()) {
|
|
5929
6022
|
for (const t of o.typePrefixesInObj) knownTypes.add(t);
|
|
6023
|
+
for (let i = 0; i < o.symNames.length; i++) {
|
|
6024
|
+
if (o.symKind[i] === 1 && (o.symFlags[i] & 16) === 0 && o.symNames[i].startsWith("$s") && o.symNames[i].endsWith("Mp")) {
|
|
6025
|
+
const mp = o.symNames[i];
|
|
6026
|
+
knownProtocols.add(mp);
|
|
6027
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
for (const mp of o.conformanceProtocols.values()) {
|
|
6031
|
+
knownProtocols.add(mp);
|
|
6032
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
6033
|
+
}
|
|
6034
|
+
}
|
|
5930
6035
|
const globalLiveTypes = /* @__PURE__ */ new Set();
|
|
5931
|
-
const
|
|
6036
|
+
const liveProtocols = /* @__PURE__ */ new Set();
|
|
6037
|
+
const liveObjCClasses = /* @__PURE__ */ new Set();
|
|
6038
|
+
const liveModuleFamilies = /* @__PURE__ */ new Set();
|
|
6039
|
+
const categoryOnlyExtracted = /* @__PURE__ */ new Set();
|
|
5932
6040
|
const eagerDynamicObjects = /* @__PURE__ */ new Set();
|
|
6041
|
+
const pendingBySwiftType = /* @__PURE__ */ new Map();
|
|
6042
|
+
const pendingByObjcClass = /* @__PURE__ */ new Map();
|
|
6043
|
+
const pendingByProto = /* @__PURE__ */ new Map();
|
|
6044
|
+
const pendingCategoriesByClass = /* @__PURE__ */ new Map();
|
|
6045
|
+
const pendingCategoriesByFamily = /* @__PURE__ */ new Map();
|
|
5933
6046
|
const conformingType = (name2) => {
|
|
5934
6047
|
for (let n = name2.length - 1; n > 2; n--) {
|
|
5935
6048
|
const prefix = name2.slice(0, n);
|
|
@@ -5937,23 +6050,114 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5937
6050
|
}
|
|
5938
6051
|
return void 0;
|
|
5939
6052
|
};
|
|
6053
|
+
const objcClassOfConformance = (name2) => {
|
|
6054
|
+
const m = /^\$sSo(\d+)([A-Za-z0-9_]+)/.exec(name2);
|
|
6055
|
+
if (!m) return void 0;
|
|
6056
|
+
const len = Number(m[1]);
|
|
6057
|
+
const rest = m[2];
|
|
6058
|
+
if (rest.length <= len || rest[len] !== "C") return void 0;
|
|
6059
|
+
const cls = rest.slice(0, len);
|
|
6060
|
+
return lazyProviders.has(`._OBJC_CLASS_${cls}`) ? cls : void 0;
|
|
6061
|
+
};
|
|
6062
|
+
const objcClassFamilyOf = (cls) => {
|
|
6063
|
+
const providers = lazyProviders.get(`._OBJC_CLASS_${cls}`);
|
|
6064
|
+
if (!providers || providers.length === 0) return void 0;
|
|
6065
|
+
return moduleFamily(providers[0].file);
|
|
6066
|
+
};
|
|
6067
|
+
const tryActivateConformance = (entry) => {
|
|
6068
|
+
if (entry.activated) return;
|
|
6069
|
+
const typeReady = entry.typeKey === null ? true : entry.typeKey.kind === "swift" ? globalLiveTypes.has(entry.typeKey.value) : liveObjCClasses.has(entry.typeKey.value);
|
|
6070
|
+
if (!typeReady) return;
|
|
6071
|
+
if (entry.proto !== void 0 && !liveProtocols.has(entry.proto)) return;
|
|
6072
|
+
if (entry.isForeign) {
|
|
6073
|
+
eagerDynamicObjects.add(entry.obj);
|
|
6074
|
+
extractObject(entry.obj);
|
|
6075
|
+
} else if (!extractedObjs.has(entry.obj)) {
|
|
6076
|
+
return;
|
|
6077
|
+
}
|
|
6078
|
+
entry.activated = true;
|
|
6079
|
+
activateSymbolInObj(entry.obj, entry.symIdx);
|
|
6080
|
+
};
|
|
6081
|
+
const tryActivateCategory = (entry) => {
|
|
6082
|
+
if (entry.activated || !liveObjCClasses.has(entry.cls)) return;
|
|
6083
|
+
const allowed = entry.catFamily === "Foundation" || entry.classFamily !== void 0 && entry.classFamily !== "Foundation" || liveModuleFamilies.has(entry.catFamily);
|
|
6084
|
+
if (!allowed) return;
|
|
6085
|
+
entry.activated = true;
|
|
6086
|
+
eagerDynamicObjects.add(entry.obj);
|
|
6087
|
+
extractObject(entry.obj, true);
|
|
6088
|
+
};
|
|
6089
|
+
const markModuleFamilyLive = (family) => {
|
|
6090
|
+
if (liveModuleFamilies.has(family)) return;
|
|
6091
|
+
liveModuleFamilies.add(family);
|
|
6092
|
+
const waiting = pendingCategoriesByFamily.get(family);
|
|
6093
|
+
if (waiting) {
|
|
6094
|
+
pendingCategoriesByFamily.delete(family);
|
|
6095
|
+
for (const entry of waiting) tryActivateCategory(entry);
|
|
6096
|
+
}
|
|
6097
|
+
};
|
|
6098
|
+
const markObjCClassLive = (cls) => {
|
|
6099
|
+
if (!cls || liveObjCClasses.has(cls)) return;
|
|
6100
|
+
liveObjCClasses.add(cls);
|
|
6101
|
+
const confs = pendingByObjcClass.get(cls);
|
|
6102
|
+
if (confs) {
|
|
6103
|
+
for (const entry of confs) tryActivateConformance(entry);
|
|
6104
|
+
}
|
|
6105
|
+
const cats = pendingCategoriesByClass.get(cls);
|
|
6106
|
+
if (cats) {
|
|
6107
|
+
for (const entry of cats) tryActivateCategory(entry);
|
|
6108
|
+
}
|
|
6109
|
+
};
|
|
6110
|
+
const markProtocolLive = (mpName) => {
|
|
6111
|
+
if (!mpName || liveProtocols.has(mpName)) return;
|
|
6112
|
+
liveProtocols.add(mpName);
|
|
6113
|
+
const waiting = pendingByProto.get(mpName);
|
|
6114
|
+
if (waiting) {
|
|
6115
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
6116
|
+
}
|
|
6117
|
+
};
|
|
6118
|
+
const checkProtocolTrigger = (rawSymName) => {
|
|
6119
|
+
if (!rawSymName) return;
|
|
6120
|
+
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
6121
|
+
if (knownProtocols.has(sName)) {
|
|
6122
|
+
markProtocolLive(sName);
|
|
6123
|
+
return;
|
|
6124
|
+
}
|
|
6125
|
+
if (!sName.startsWith("$s") || sName.endsWith("Mc")) return;
|
|
6126
|
+
if (sName.endsWith("TL")) {
|
|
6127
|
+
const mp = `${sName.slice(0, -2)}Mp`;
|
|
6128
|
+
if (knownProtocols.has(mp)) {
|
|
6129
|
+
markProtocolLive(mp);
|
|
6130
|
+
return;
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
if (sName.startsWith("$sS") && sName.length > 4) {
|
|
6134
|
+
const pref = sName.slice(0, 4);
|
|
6135
|
+
if (protoPrefixes.has(pref)) {
|
|
6136
|
+
const ch = sName[4];
|
|
6137
|
+
if (ch >= "0" && ch <= "9" || ch === "s" || ch === "P") {
|
|
6138
|
+
markProtocolLive(`${pref}Mp`);
|
|
6139
|
+
return;
|
|
6140
|
+
}
|
|
6141
|
+
}
|
|
6142
|
+
}
|
|
6143
|
+
for (let n = 5; n < sName.length; n++) {
|
|
6144
|
+
if (sName[n] === "P") {
|
|
6145
|
+
const pref = sName.slice(0, n);
|
|
6146
|
+
if (protoPrefixes.has(pref)) {
|
|
6147
|
+
markProtocolLive(`${pref}Mp`);
|
|
6148
|
+
return;
|
|
6149
|
+
}
|
|
6150
|
+
}
|
|
6151
|
+
}
|
|
6152
|
+
};
|
|
5940
6153
|
const markTypeLive = (obj, pref) => {
|
|
5941
6154
|
const set = liveTypes.get(obj);
|
|
5942
6155
|
if (set.has(pref)) return;
|
|
5943
6156
|
set.add(pref);
|
|
5944
6157
|
globalLiveTypes.add(pref);
|
|
5945
|
-
const waiting =
|
|
6158
|
+
const waiting = pendingBySwiftType.get(pref);
|
|
5946
6159
|
if (waiting) {
|
|
5947
|
-
|
|
5948
|
-
for (const w of waiting) {
|
|
5949
|
-
eagerDynamicObjects.add(w.obj);
|
|
5950
|
-
extractObject(w.obj);
|
|
5951
|
-
activateSymbolInObj(w.obj, w.symIdx);
|
|
5952
|
-
}
|
|
5953
|
-
}
|
|
5954
|
-
for (let n = pref.length - 1; n > 2; n--) {
|
|
5955
|
-
const outer = pref.slice(0, n);
|
|
5956
|
-
if (obj.typePrefixesInObj.has(outer)) markTypeLive(obj, outer);
|
|
6160
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
5957
6161
|
}
|
|
5958
6162
|
for (let n = pref.length - 1; n > 2; n--) {
|
|
5959
6163
|
const outer = pref.slice(0, n);
|
|
@@ -5970,22 +6174,20 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
5970
6174
|
markFuncLive(obj, lf);
|
|
5971
6175
|
}
|
|
5972
6176
|
}
|
|
5973
|
-
for (
|
|
5974
|
-
if (
|
|
5975
|
-
|
|
5976
|
-
if (r.segIdx === sIdx) {
|
|
5977
|
-
const mcName = obj.symNames[r.rs];
|
|
5978
|
-
if (mcName.startsWith(pref)) {
|
|
5979
|
-
activateSymbolInObj(obj, r.rs);
|
|
5980
|
-
}
|
|
5981
|
-
}
|
|
5982
|
-
}
|
|
6177
|
+
for (const [classSym, p] of obj.objcClassSymToTypePrefix) {
|
|
6178
|
+
if (p === pref && classSym.startsWith("._OBJC_CLASS_")) {
|
|
6179
|
+
markObjCClassLive(classSym.slice("._OBJC_CLASS_".length));
|
|
5983
6180
|
}
|
|
5984
6181
|
}
|
|
5985
6182
|
};
|
|
5986
6183
|
const checkTypeTrigger = (obj, rawSymName) => {
|
|
5987
6184
|
if (!rawSymName) return;
|
|
5988
6185
|
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
6186
|
+
if (sName.startsWith("._OBJC_CLASS_")) {
|
|
6187
|
+
markObjCClassLive(sName.slice("._OBJC_CLASS_".length));
|
|
6188
|
+
} else if (sName.startsWith("._OBJC_METACLASS_")) {
|
|
6189
|
+
markObjCClassLive(sName.slice("._OBJC_METACLASS_".length));
|
|
6190
|
+
}
|
|
5989
6191
|
const objcPref = obj.objcClassSymToTypePrefix.get(sName);
|
|
5990
6192
|
if (objcPref) {
|
|
5991
6193
|
markTypeLive(obj, objcPref);
|
|
@@ -6012,6 +6214,7 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6012
6214
|
const activateGlobalName = (name2) => {
|
|
6013
6215
|
if (!name2) return;
|
|
6014
6216
|
if (!liveGlobalNames.has(name2)) liveGlobalNames.add(name2);
|
|
6217
|
+
checkProtocolTrigger(name2);
|
|
6015
6218
|
const defs = extractedSymbolDefs.get(name2);
|
|
6016
6219
|
if (defs) {
|
|
6017
6220
|
for (const d of defs) {
|
|
@@ -6026,7 +6229,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6026
6229
|
const fl = obj.symFlags[symIdx];
|
|
6027
6230
|
const isUndef = (fl & 16) !== 0;
|
|
6028
6231
|
const isLocal = (fl & 3) === 2;
|
|
6232
|
+
if (obj.isDist && categoryOnlyExtracted.has(obj)) {
|
|
6233
|
+
categoryOnlyExtracted.delete(obj);
|
|
6234
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
6235
|
+
}
|
|
6029
6236
|
checkTypeTrigger(obj, sName);
|
|
6237
|
+
checkProtocolTrigger(sName);
|
|
6030
6238
|
if (!isUndef && !isLocal && sName && !liveGlobalNames.has(sName)) {
|
|
6031
6239
|
activateGlobalName(sName);
|
|
6032
6240
|
}
|
|
@@ -6038,13 +6246,25 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6038
6246
|
markDataSymLive(obj, pIdx);
|
|
6039
6247
|
const parentName = obj.symNames[pIdx];
|
|
6040
6248
|
checkTypeTrigger(obj, parentName);
|
|
6249
|
+
checkProtocolTrigger(parentName);
|
|
6041
6250
|
}
|
|
6042
6251
|
markSegLive(obj, el);
|
|
6043
6252
|
}
|
|
6044
6253
|
}
|
|
6045
|
-
const extractObject = (obj) => {
|
|
6046
|
-
if (extractedObjs.has(obj))
|
|
6254
|
+
const extractObject = (obj, fromObjCCategory = false) => {
|
|
6255
|
+
if (extractedObjs.has(obj)) {
|
|
6256
|
+
if (!fromObjCCategory && categoryOnlyExtracted.has(obj)) {
|
|
6257
|
+
categoryOnlyExtracted.delete(obj);
|
|
6258
|
+
if (obj.isDist) markModuleFamilyLive(moduleFamily(obj.file));
|
|
6259
|
+
}
|
|
6260
|
+
return;
|
|
6261
|
+
}
|
|
6047
6262
|
extractedObjs.add(obj);
|
|
6263
|
+
if (fromObjCCategory && obj.isDist) {
|
|
6264
|
+
categoryOnlyExtracted.add(obj);
|
|
6265
|
+
} else if (obj.isDist) {
|
|
6266
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
6267
|
+
}
|
|
6048
6268
|
liveFuncs.set(obj, new Uint8Array(obj.numFuncs));
|
|
6049
6269
|
liveSegs.set(obj, new Uint8Array(obj.numSegments));
|
|
6050
6270
|
liveDataSyms.set(obj, /* @__PURE__ */ new Set());
|
|
@@ -6082,6 +6302,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6082
6302
|
if (classSym !== -1 && (obj.symFlags[classSym] & 16) === 0)
|
|
6083
6303
|
activateSymbolInObj(obj, classSym);
|
|
6084
6304
|
}
|
|
6305
|
+
if (!obj.isDist) {
|
|
6306
|
+
for (let i = 0; i < obj.symNames.length; i++) {
|
|
6307
|
+
checkTypeTrigger(obj, obj.symNames[i]);
|
|
6308
|
+
checkProtocolTrigger(obj.symNames[i]);
|
|
6309
|
+
}
|
|
6310
|
+
}
|
|
6085
6311
|
if (obj.isDist) {
|
|
6086
6312
|
const isBuildSwift = !obj.file.startsWith(distDir) && obj.file.endsWith(".swift.o");
|
|
6087
6313
|
for (const [classSym, pref] of obj.objcClassSymToTypePrefix)
|
|
@@ -6096,48 +6322,77 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6096
6322
|
}
|
|
6097
6323
|
}
|
|
6098
6324
|
if (obj.isDist) {
|
|
6099
|
-
for (
|
|
6100
|
-
|
|
6101
|
-
for (const r of obj.dataRelocList) {
|
|
6102
|
-
if (r.segIdx === sIdx) {
|
|
6103
|
-
const mcName = obj.symNames[r.rs];
|
|
6104
|
-
let matchesLocalType = false;
|
|
6105
|
-
for (const pref of obj.typePrefixesInObj) {
|
|
6106
|
-
if (mcName.startsWith(pref)) {
|
|
6107
|
-
matchesLocalType = true;
|
|
6108
|
-
break;
|
|
6109
|
-
}
|
|
6110
|
-
}
|
|
6111
|
-
if (!matchesLocalType) {
|
|
6112
|
-
const type = conformingType(mcName);
|
|
6113
|
-
if (type === void 0 || globalLiveTypes.has(type))
|
|
6114
|
-
activateSymbolInObj(obj, r.rs);
|
|
6115
|
-
}
|
|
6116
|
-
}
|
|
6117
|
-
}
|
|
6118
|
-
}
|
|
6325
|
+
for (const entries of pendingByObj.get(obj) ?? []) {
|
|
6326
|
+
tryActivateConformance(entries);
|
|
6119
6327
|
}
|
|
6120
6328
|
}
|
|
6121
6329
|
};
|
|
6330
|
+
const pendingByObj = /* @__PURE__ */ new Map();
|
|
6122
6331
|
for (const obj of distObjs.values()) {
|
|
6123
6332
|
if (!obj.isDist) continue;
|
|
6124
6333
|
for (const r of obj.dataRelocList) {
|
|
6125
6334
|
if (obj.segNames[r.segIdx] !== "swift5_protocol_conformances") continue;
|
|
6126
|
-
const
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6335
|
+
const mcIdx = r.rs;
|
|
6336
|
+
const mcName = obj.symNames[mcIdx];
|
|
6337
|
+
const swiftType = conformingType(mcName);
|
|
6338
|
+
const objcType = swiftType === void 0 ? objcClassOfConformance(mcName) : void 0;
|
|
6339
|
+
const typeKey = swiftType !== void 0 ? { kind: "swift", value: swiftType } : objcType !== void 0 ? { kind: "objc", value: objcType } : null;
|
|
6340
|
+
const proto = obj.conformanceProtocols.get(mcIdx);
|
|
6341
|
+
const isForeign = swiftType !== void 0 ? !obj.typePrefixesInObj.has(swiftType) : objcType !== void 0 ? !obj.symNames.some(
|
|
6342
|
+
(n, i) => n === `._OBJC_CLASS_${objcType}` && (obj.symFlags[i] & 16) === 0
|
|
6343
|
+
) : false;
|
|
6344
|
+
const entry = {
|
|
6345
|
+
obj,
|
|
6346
|
+
symIdx: mcIdx,
|
|
6347
|
+
typeKey,
|
|
6348
|
+
proto,
|
|
6349
|
+
isForeign,
|
|
6350
|
+
activated: false
|
|
6351
|
+
};
|
|
6352
|
+
let objList = pendingByObj.get(obj);
|
|
6353
|
+
if (!objList) pendingByObj.set(obj, objList = []);
|
|
6354
|
+
objList.push(entry);
|
|
6355
|
+
if (swiftType !== void 0) {
|
|
6356
|
+
let list = pendingBySwiftType.get(swiftType);
|
|
6357
|
+
if (!list) pendingBySwiftType.set(swiftType, list = []);
|
|
6358
|
+
list.push(entry);
|
|
6359
|
+
} else if (objcType !== void 0) {
|
|
6360
|
+
let list = pendingByObjcClass.get(objcType);
|
|
6361
|
+
if (!list) pendingByObjcClass.set(objcType, list = []);
|
|
6362
|
+
list.push(entry);
|
|
6363
|
+
}
|
|
6364
|
+
if (proto !== void 0) {
|
|
6365
|
+
let list = pendingByProto.get(proto);
|
|
6366
|
+
if (!list) pendingByProto.set(proto, list = []);
|
|
6367
|
+
list.push(entry);
|
|
6368
|
+
}
|
|
6369
|
+
}
|
|
6370
|
+
if (obj.objcCategoryTargets.length > 0) {
|
|
6371
|
+
const catFamily = moduleFamily(obj.file);
|
|
6372
|
+
for (const cls of obj.objcCategoryTargets) {
|
|
6373
|
+
const classFamily = objcClassFamilyOf(cls);
|
|
6374
|
+
const entry = {
|
|
6375
|
+
obj,
|
|
6376
|
+
cls,
|
|
6377
|
+
catFamily,
|
|
6378
|
+
classFamily,
|
|
6379
|
+
activated: false
|
|
6380
|
+
};
|
|
6381
|
+
let byCls = pendingCategoriesByClass.get(cls);
|
|
6382
|
+
if (!byCls) pendingCategoriesByClass.set(cls, byCls = []);
|
|
6383
|
+
byCls.push(entry);
|
|
6384
|
+
if (catFamily !== "Foundation" && (classFamily === void 0 || classFamily === "Foundation")) {
|
|
6385
|
+
let byFam = pendingCategoriesByFamily.get(catFamily);
|
|
6386
|
+
if (!byFam) pendingCategoriesByFamily.set(catFamily, byFam = []);
|
|
6387
|
+
byFam.push(entry);
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6131
6390
|
}
|
|
6132
6391
|
}
|
|
6133
|
-
let hasClangObjCEager = false;
|
|
6134
6392
|
for (const f of eagerFiles) {
|
|
6135
6393
|
const isDist = f.startsWith(distDir);
|
|
6136
6394
|
const obj = distObjs.get(f) ?? parseWasmObjectCached(f, isDist, false);
|
|
6137
6395
|
extractObject(obj);
|
|
6138
|
-
if (!isDist && !hasClangObjCEager && obj.symNames.includes("__objc_load")) {
|
|
6139
|
-
hasClangObjCEager = true;
|
|
6140
|
-
}
|
|
6141
6396
|
if (isDist) {
|
|
6142
6397
|
const base = path10.basename(f);
|
|
6143
6398
|
if (base.startsWith("PeachFoundation-") || base.startsWith("PeachObjC-") || base.startsWith("PeachICU-") || base.startsWith("Darwin-")) {
|
|
@@ -6160,19 +6415,6 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6160
6415
|
activateSymbolInObj(provider, provider.symNames.indexOf(name2));
|
|
6161
6416
|
}
|
|
6162
6417
|
}
|
|
6163
|
-
const eagerSdkCategoryFiles = [];
|
|
6164
|
-
if (hasClangObjCEager) {
|
|
6165
|
-
for (const name2 of foundationCategoryObjects.map(
|
|
6166
|
-
(name3) => `libFoundation__${name3}.objc.o`
|
|
6167
|
-
)) {
|
|
6168
|
-
const sdkFile = path10.join(sdkObjsDir, name2);
|
|
6169
|
-
const obj = distObjs.get(sdkFile);
|
|
6170
|
-
if (obj) {
|
|
6171
|
-
extractObject(obj);
|
|
6172
|
-
eagerSdkCategoryFiles.push(sdkFile);
|
|
6173
|
-
}
|
|
6174
|
-
}
|
|
6175
|
-
}
|
|
6176
6418
|
for (const symName of ["_initialize", "__main_argc_argv", "main"]) {
|
|
6177
6419
|
const def = definedGlobalSyms.get(symName);
|
|
6178
6420
|
if (def) activateSymbolInObj(def.obj, def.symIdx);
|
|
@@ -6227,6 +6469,9 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6227
6469
|
}
|
|
6228
6470
|
for (const symIdx of relocs) {
|
|
6229
6471
|
if (obj.isDist && dropsReflection(obj, obj.symNames[symIdx])) continue;
|
|
6472
|
+
const symName = obj.symNames[symIdx];
|
|
6473
|
+
checkTypeTrigger(obj, symName);
|
|
6474
|
+
checkProtocolTrigger(symName);
|
|
6230
6475
|
const fl = obj.symFlags[symIdx];
|
|
6231
6476
|
const isUndef = (fl & 16) !== 0;
|
|
6232
6477
|
const isLocal = (fl & 3) === 2;
|
|
@@ -6566,21 +6811,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
6566
6811
|
writePrunedObject(o, outPath);
|
|
6567
6812
|
prunedMap.set(o.file, outPath);
|
|
6568
6813
|
}
|
|
6569
|
-
const extraSdkObjs = allSdkObjFiles.filter(
|
|
6570
|
-
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
6571
|
-
).map((f) => path10.join(sdkObjsDir, f));
|
|
6572
6814
|
const outTokens = [];
|
|
6573
6815
|
const emittedPruned = /* @__PURE__ */ new Set();
|
|
6574
6816
|
inStartLib = false;
|
|
6575
6817
|
for (const t of tokens) {
|
|
6576
6818
|
if (t === "--start-lib") {
|
|
6577
6819
|
inStartLib = true;
|
|
6578
|
-
for (const ef of eagerSdkCategoryFiles) {
|
|
6579
|
-
if (!emittedPruned.has(ef) && prunedMap.has(ef)) {
|
|
6580
|
-
outTokens.push(prunedMap.get(ef));
|
|
6581
|
-
emittedPruned.add(ef);
|
|
6582
|
-
}
|
|
6583
|
-
}
|
|
6584
6820
|
for (const obj of eagerDynamicObjects) {
|
|
6585
6821
|
if (!emittedPruned.has(obj.file) && prunedMap.has(obj.file)) {
|
|
6586
6822
|
outTokens.push(prunedMap.get(obj.file));
|
|
@@ -11372,10 +11608,6 @@ async function swiftIcuBundleAsset(icu) {
|
|
|
11372
11608
|
// src/swift-link-roots.ts
|
|
11373
11609
|
import fs9 from "node:fs";
|
|
11374
11610
|
import path21 from "node:path";
|
|
11375
|
-
var OBJC_SENTINELS = /* @__PURE__ */ new Map([
|
|
11376
|
-
["__objc_cats", ".objc_null_category"],
|
|
11377
|
-
["__objc_class_aliases", ".objc_null_class_alias"]
|
|
11378
|
-
]);
|
|
11379
11611
|
var leb = (bytes, at) => {
|
|
11380
11612
|
let value = 0;
|
|
11381
11613
|
let scale = 1;
|
|
@@ -11390,6 +11622,7 @@ function objcRootInfo(bytes) {
|
|
|
11390
11622
|
const at = { offset: 8 };
|
|
11391
11623
|
const names = [];
|
|
11392
11624
|
const dataSymbols = [];
|
|
11625
|
+
let hasNSObjectLoad = false;
|
|
11393
11626
|
let hasExportedSymbol = false;
|
|
11394
11627
|
while (at.offset < bytes.length) {
|
|
11395
11628
|
const id = bytes[at.offset++];
|
|
@@ -11426,6 +11659,12 @@ function objcRootInfo(bytes) {
|
|
|
11426
11659
|
leb(bytes, at);
|
|
11427
11660
|
if (!isUndef || isExplicitName) {
|
|
11428
11661
|
const sLen = leb(bytes, at);
|
|
11662
|
+
if (!isUndef && symKind === 0) {
|
|
11663
|
+
const name3 = Buffer.from(
|
|
11664
|
+
bytes.subarray(at.offset, at.offset + sLen)
|
|
11665
|
+
).toString();
|
|
11666
|
+
if (/^_c_NSObject_.*_load$/.test(name3)) hasNSObjectLoad = true;
|
|
11667
|
+
}
|
|
11429
11668
|
at.offset += sLen;
|
|
11430
11669
|
}
|
|
11431
11670
|
} else if (symKind === 1) {
|
|
@@ -11452,11 +11691,9 @@ function objcRootInfo(bytes) {
|
|
|
11452
11691
|
at.offset = end;
|
|
11453
11692
|
}
|
|
11454
11693
|
return {
|
|
11455
|
-
registration: dataSymbols.some(
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
return sentinel !== void 0 && name2 !== sentinel;
|
|
11459
|
-
}),
|
|
11694
|
+
registration: hasNSObjectLoad || dataSymbols.some(
|
|
11695
|
+
({ segment, name: name2 }) => names[segment] === "__objc_class_aliases" && name2 !== ".objc_null_class_alias"
|
|
11696
|
+
),
|
|
11460
11697
|
exported: hasExportedSymbol
|
|
11461
11698
|
};
|
|
11462
11699
|
}
|
|
@@ -11469,9 +11706,7 @@ function swiftObjcRootObjects(id, root, objects) {
|
|
|
11469
11706
|
);
|
|
11470
11707
|
const roots = new Set(
|
|
11471
11708
|
measured.filter(
|
|
11472
|
-
([object3, info]) =>
|
|
11473
|
-
(name2) => object3 === `lib/Foundation-${name2}.o`
|
|
11474
|
-
) && object3 !== "lib/FoundationNetworking-Session.o" && object3 !== "lib/SwiftUI-MetalExecution.o" && object3 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
11709
|
+
([object3, info]) => object3 !== "lib/FoundationNetworking-Session.o" && object3 !== "lib/Metal-MetalExecution.o" && object3 !== "lib/PeachICU-icu.c.o" && object3 !== "lib/SwiftUI-MetalExecution.o" && object3 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
11475
11710
|
).map(([object3]) => object3)
|
|
11476
11711
|
);
|
|
11477
11712
|
rootsByDistribution.set(id, roots);
|
|
@@ -13176,7 +13411,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
13176
13411
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
13177
13412
|
var MULTI_MANIFEST_VERSION = 68;
|
|
13178
13413
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
13179
|
-
var compilerSourceDigest = true ? "
|
|
13414
|
+
var compilerSourceDigest = true ? "05dbb1273689060748700777894c639c73bea2e6da20eaf47e8040b26ff859cf" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
13180
13415
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
13181
13416
|
const hash = createHash13("sha256");
|
|
13182
13417
|
hash.update(`swift-compile
|
|
@@ -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 __defProp = Object.defineProperty;
|
|
@@ -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 __defProp = Object.defineProperty;
|