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;
|
package/dist-lib/swift.cjs
CHANGED
|
@@ -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;
|
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -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;
|
|
@@ -10331,18 +10331,22 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
10331
10331
|
const [, r1] = readULEB2(buf, cp);
|
|
10332
10332
|
const [cnt, r2] = readULEB2(buf, r1);
|
|
10333
10333
|
let cur = r2;
|
|
10334
|
-
const
|
|
10334
|
+
const isData = name3 === "reloc.DATA";
|
|
10335
10335
|
for (let i = 0; i < cnt; i++) {
|
|
10336
10336
|
const rStart = cur;
|
|
10337
10337
|
const rType = buf[cur++];
|
|
10338
10338
|
const [ro, c2] = readULEB2(buf, cur);
|
|
10339
10339
|
const [rs, c3] = readULEB2(buf, c2);
|
|
10340
10340
|
cur = c3;
|
|
10341
|
+
let addend = 0;
|
|
10341
10342
|
if (HAS_ADDEND.has(rType)) {
|
|
10342
|
-
const [, c4] = readSLEB(buf, cur);
|
|
10343
|
+
const [val, c4] = readSLEB(buf, cur);
|
|
10344
|
+
addend = val;
|
|
10343
10345
|
cur = c4;
|
|
10344
10346
|
}
|
|
10345
|
-
|
|
10347
|
+
const rawBytes = new Uint8Array(buf.subarray(rStart, cur));
|
|
10348
|
+
if (isData) rawDataRelocs.push({ rawBytes, ro, rs, addend });
|
|
10349
|
+
else rawCodeRelocs.push({ rawBytes, ro, rs });
|
|
10346
10350
|
}
|
|
10347
10351
|
}
|
|
10348
10352
|
}
|
|
@@ -10496,6 +10500,80 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
10496
10500
|
rootSegs.push(i);
|
|
10497
10501
|
}
|
|
10498
10502
|
}
|
|
10503
|
+
const conformanceProtocols = /* @__PURE__ */ new Map();
|
|
10504
|
+
const objcCategoryTargets = [];
|
|
10505
|
+
if (isDist) {
|
|
10506
|
+
const relocAt = /* @__PURE__ */ new Map();
|
|
10507
|
+
for (const r of dataRelocList) {
|
|
10508
|
+
relocAt.set(`${r.segIdx}:${r.offInSeg}`, { rs: r.rs, addend: r.addend });
|
|
10509
|
+
}
|
|
10510
|
+
const confSegs = /* @__PURE__ */ new Set();
|
|
10511
|
+
let hasCatsSeg = false;
|
|
10512
|
+
for (let i = 0; i < segNames.length; i++) {
|
|
10513
|
+
if (segNames[i] === "swift5_protocol_conformances") confSegs.add(i);
|
|
10514
|
+
else if (segNames[i] === "__objc_cats") hasCatsSeg = true;
|
|
10515
|
+
}
|
|
10516
|
+
if (confSegs.size > 0) {
|
|
10517
|
+
const segOffToMpSym = /* @__PURE__ */ new Map();
|
|
10518
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
10519
|
+
if (symKind[i] === 1 && (symFlags[i] & 16) === 0 && symElemIdx[i] >= 0 && symNames[i].startsWith("$s") && symNames[i].endsWith("Mp")) {
|
|
10520
|
+
segOffToMpSym.set(`${symElemIdx[i]}:${symOff[i]}`, symNames[i]);
|
|
10521
|
+
}
|
|
10522
|
+
}
|
|
10523
|
+
const dv = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
10524
|
+
for (const r of dataRelocList) {
|
|
10525
|
+
if (!confSegs.has(r.segIdx)) continue;
|
|
10526
|
+
const mcIdx = r.rs;
|
|
10527
|
+
if (symKind[mcIdx] !== 1 || (symFlags[mcIdx] & 16) !== 0 || symElemIdx[mcIdx] < 0) {
|
|
10528
|
+
continue;
|
|
10529
|
+
}
|
|
10530
|
+
const mcSeg = symElemIdx[mcIdx];
|
|
10531
|
+
const mcOff = symOff[mcIdx];
|
|
10532
|
+
const pr = relocAt.get(`${mcSeg}:${mcOff}`);
|
|
10533
|
+
let mp = "";
|
|
10534
|
+
if (pr) {
|
|
10535
|
+
const raw2 = symNames[pr.rs];
|
|
10536
|
+
const stripped2 = raw2.startsWith(".Lgot.") ? raw2.slice(6) : raw2;
|
|
10537
|
+
if (stripped2.startsWith("$s") && stripped2.endsWith("Mp")) {
|
|
10538
|
+
mp = stripped2;
|
|
10539
|
+
} else if (symKind[pr.rs] === 3 || stripped2 === "") {
|
|
10540
|
+
mp = segOffToMpSym.get(`${mcSeg}:${pr.addend}`) ?? "";
|
|
10541
|
+
}
|
|
10542
|
+
} else {
|
|
10543
|
+
const fileOff = dataStart + sPayloadStarts[mcSeg] + mcOff;
|
|
10544
|
+
if (fileOff + 4 <= buf.length) {
|
|
10545
|
+
const delta = dv.getInt32(fileOff, true);
|
|
10546
|
+
mp = segOffToMpSym.get(`${mcSeg}:${mcOff + delta}`) ?? segOffToMpSym.get(`${mcSeg}:${mcOff + (delta & ~1)}`) ?? "";
|
|
10547
|
+
}
|
|
10548
|
+
}
|
|
10549
|
+
if (mp) conformanceProtocols.set(mcIdx, mp);
|
|
10550
|
+
}
|
|
10551
|
+
}
|
|
10552
|
+
if (hasCatsSeg) {
|
|
10553
|
+
const seenClasses = /* @__PURE__ */ new Set();
|
|
10554
|
+
for (let i = 0; i < symKind.length; i++) {
|
|
10555
|
+
if (symKind[i] !== 1 || (symFlags[i] & 16) !== 0 || symElemIdx[i] < 0 || segNames[symElemIdx[i]] !== "__objc_cats" || !symNames[i].startsWith(".objc_category_")) {
|
|
10556
|
+
continue;
|
|
10557
|
+
}
|
|
10558
|
+
const cSeg = symElemIdx[i];
|
|
10559
|
+
const cOff = symOff[i];
|
|
10560
|
+
const cr = relocAt.get(`${cSeg}:${cOff + 8}`);
|
|
10561
|
+
if (cr && symKind[cr.rs] === 1 && (symFlags[cr.rs] & 16) === 0 && symElemIdx[cr.rs] >= 0) {
|
|
10562
|
+
const tSeg = symElemIdx[cr.rs];
|
|
10563
|
+
const strOff = dataStart + sPayloadStarts[tSeg] + symOff[cr.rs] + cr.addend;
|
|
10564
|
+
let sEnd = strOff;
|
|
10565
|
+
while (sEnd < buf.length && buf[sEnd] !== 0) sEnd++;
|
|
10566
|
+
if (sEnd > strOff) {
|
|
10567
|
+
const clsName = Buffer.from(buf.subarray(strOff, sEnd)).toString("utf8");
|
|
10568
|
+
if (!seenClasses.has(clsName)) {
|
|
10569
|
+
seenClasses.add(clsName);
|
|
10570
|
+
objcCategoryTargets.push(clsName);
|
|
10571
|
+
}
|
|
10572
|
+
}
|
|
10573
|
+
}
|
|
10574
|
+
}
|
|
10575
|
+
}
|
|
10576
|
+
}
|
|
10499
10577
|
return {
|
|
10500
10578
|
file,
|
|
10501
10579
|
isDist,
|
|
@@ -10520,6 +10598,8 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
10520
10598
|
objcRegisterFuncToTypePrefix,
|
|
10521
10599
|
objcClassSymToTypePrefix,
|
|
10522
10600
|
typePrefixesInObj,
|
|
10601
|
+
conformanceProtocols,
|
|
10602
|
+
objcCategoryTargets,
|
|
10523
10603
|
rootFuncs,
|
|
10524
10604
|
rootSegs,
|
|
10525
10605
|
segPayloadRanges: sEnds.map((end, i) => [
|
|
@@ -10531,7 +10611,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
10531
10611
|
function parseWasmObjectCached(file, isDist, useCache) {
|
|
10532
10612
|
if (!useCache)
|
|
10533
10613
|
return parseWasmObjectBytes(file, new Uint8Array(import_node_fs10.default.readFileSync(file)), isDist);
|
|
10534
|
-
const key2 =
|
|
10614
|
+
const key2 = `v2:${isDist ? "1" : "0"}:${file}`;
|
|
10535
10615
|
const stat = import_node_fs10.default.statSync(file, { bigint: true });
|
|
10536
10616
|
const stamp = `${stat.ino}:${stat.size}:${stat.mtimeNs}:${stat.ctimeNs}`;
|
|
10537
10617
|
const hit = parsedObjectCache.get(key2);
|
|
@@ -10708,6 +10788,18 @@ function getModulePrefix(file) {
|
|
|
10708
10788
|
const dash = base.indexOf("-");
|
|
10709
10789
|
return dash > 0 ? base.slice(0, dash) : base;
|
|
10710
10790
|
}
|
|
10791
|
+
function moduleFamily(file) {
|
|
10792
|
+
const mod = getModulePrefix(file);
|
|
10793
|
+
if (mod === "Foundation" || mod === "PeachFoundation" || mod === "PeachObjC" || mod === "PeachObjCRuntime" || mod === "ObjectiveC" || mod === "Darwin" || mod === "libFoundation" || mod === "libObjectiveC" || mod === "libDarwin" || mod === "libswiftCore") {
|
|
10794
|
+
return "Foundation";
|
|
10795
|
+
}
|
|
10796
|
+
if (mod.startsWith("UIKit")) return "UIKit";
|
|
10797
|
+
if (mod === "CoreData" || mod === "CoreDataConstants") return "CoreData";
|
|
10798
|
+
if (mod === "AVFoundation" || mod === "AVFoundationConstants" || mod === "AVFAudio") {
|
|
10799
|
+
return "AVFoundation";
|
|
10800
|
+
}
|
|
10801
|
+
return mod;
|
|
10802
|
+
}
|
|
10711
10803
|
var SWIFTUI_WRAPPER_HOST_PROTOCOLS = new Set(
|
|
10712
10804
|
[
|
|
10713
10805
|
"View",
|
|
@@ -10801,11 +10893,7 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
10801
10893
|
}
|
|
10802
10894
|
if (t.endsWith(".o")) {
|
|
10803
10895
|
if (import_node_path10.default.resolve(t).startsWith(distDir + import_node_path10.default.sep)) {
|
|
10804
|
-
|
|
10805
|
-
(name3) => import_node_path10.default.basename(t) === `Foundation-${name3}.o`
|
|
10806
|
-
)) {
|
|
10807
|
-
distFiles.push(t);
|
|
10808
|
-
}
|
|
10896
|
+
distFiles.push(t);
|
|
10809
10897
|
if (!inStartLib) eagerFiles.push(t);
|
|
10810
10898
|
} else if (!inStartLib) {
|
|
10811
10899
|
if (t.endsWith("/swiftrt.o")) {
|
|
@@ -10874,6 +10962,9 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
10874
10962
|
}
|
|
10875
10963
|
const allSdkObjFiles = import_node_fs10.default.readdirSync(sdkObjsDir).filter((f) => f.endsWith(".o") || f.endsWith(".obj")).sort();
|
|
10876
10964
|
const sdkFiles = allSdkObjFiles.map((f) => import_node_path10.default.join(sdkObjsDir, f));
|
|
10965
|
+
const extraSdkObjs = allSdkObjFiles.filter(
|
|
10966
|
+
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
10967
|
+
).map((f) => import_node_path10.default.join(sdkObjsDir, f));
|
|
10877
10968
|
const distObjs = /* @__PURE__ */ new Map();
|
|
10878
10969
|
const lazyProviders = /* @__PURE__ */ new Map();
|
|
10879
10970
|
const registerLazyProvider = (obj) => {
|
|
@@ -10937,11 +11028,33 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
10937
11028
|
workQueue.push({ kind: "datasym", obj, symIdx });
|
|
10938
11029
|
};
|
|
10939
11030
|
const knownTypes2 = /* @__PURE__ */ new Set();
|
|
10940
|
-
|
|
11031
|
+
const knownProtocols = /* @__PURE__ */ new Set();
|
|
11032
|
+
const protoPrefixes = /* @__PURE__ */ new Set();
|
|
11033
|
+
for (const o of distObjs.values()) {
|
|
10941
11034
|
for (const t of o.typePrefixesInObj) knownTypes2.add(t);
|
|
11035
|
+
for (let i = 0; i < o.symNames.length; i++) {
|
|
11036
|
+
if (o.symKind[i] === 1 && (o.symFlags[i] & 16) === 0 && o.symNames[i].startsWith("$s") && o.symNames[i].endsWith("Mp")) {
|
|
11037
|
+
const mp = o.symNames[i];
|
|
11038
|
+
knownProtocols.add(mp);
|
|
11039
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
11040
|
+
}
|
|
11041
|
+
}
|
|
11042
|
+
for (const mp of o.conformanceProtocols.values()) {
|
|
11043
|
+
knownProtocols.add(mp);
|
|
11044
|
+
protoPrefixes.add(mp.slice(0, -2));
|
|
11045
|
+
}
|
|
11046
|
+
}
|
|
10942
11047
|
const globalLiveTypes = /* @__PURE__ */ new Set();
|
|
10943
|
-
const
|
|
11048
|
+
const liveProtocols = /* @__PURE__ */ new Set();
|
|
11049
|
+
const liveObjCClasses = /* @__PURE__ */ new Set();
|
|
11050
|
+
const liveModuleFamilies = /* @__PURE__ */ new Set();
|
|
11051
|
+
const categoryOnlyExtracted = /* @__PURE__ */ new Set();
|
|
10944
11052
|
const eagerDynamicObjects = /* @__PURE__ */ new Set();
|
|
11053
|
+
const pendingBySwiftType = /* @__PURE__ */ new Map();
|
|
11054
|
+
const pendingByObjcClass = /* @__PURE__ */ new Map();
|
|
11055
|
+
const pendingByProto = /* @__PURE__ */ new Map();
|
|
11056
|
+
const pendingCategoriesByClass = /* @__PURE__ */ new Map();
|
|
11057
|
+
const pendingCategoriesByFamily = /* @__PURE__ */ new Map();
|
|
10945
11058
|
const conformingType = (name3) => {
|
|
10946
11059
|
for (let n = name3.length - 1; n > 2; n--) {
|
|
10947
11060
|
const prefix = name3.slice(0, n);
|
|
@@ -10949,23 +11062,114 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
10949
11062
|
}
|
|
10950
11063
|
return void 0;
|
|
10951
11064
|
};
|
|
11065
|
+
const objcClassOfConformance = (name3) => {
|
|
11066
|
+
const m = /^\$sSo(\d+)([A-Za-z0-9_]+)/.exec(name3);
|
|
11067
|
+
if (!m) return void 0;
|
|
11068
|
+
const len = Number(m[1]);
|
|
11069
|
+
const rest = m[2];
|
|
11070
|
+
if (rest.length <= len || rest[len] !== "C") return void 0;
|
|
11071
|
+
const cls = rest.slice(0, len);
|
|
11072
|
+
return lazyProviders.has(`._OBJC_CLASS_${cls}`) ? cls : void 0;
|
|
11073
|
+
};
|
|
11074
|
+
const objcClassFamilyOf = (cls) => {
|
|
11075
|
+
const providers = lazyProviders.get(`._OBJC_CLASS_${cls}`);
|
|
11076
|
+
if (!providers || providers.length === 0) return void 0;
|
|
11077
|
+
return moduleFamily(providers[0].file);
|
|
11078
|
+
};
|
|
11079
|
+
const tryActivateConformance = (entry) => {
|
|
11080
|
+
if (entry.activated) return;
|
|
11081
|
+
const typeReady = entry.typeKey === null ? true : entry.typeKey.kind === "swift" ? globalLiveTypes.has(entry.typeKey.value) : liveObjCClasses.has(entry.typeKey.value);
|
|
11082
|
+
if (!typeReady) return;
|
|
11083
|
+
if (entry.proto !== void 0 && !liveProtocols.has(entry.proto)) return;
|
|
11084
|
+
if (entry.isForeign) {
|
|
11085
|
+
eagerDynamicObjects.add(entry.obj);
|
|
11086
|
+
extractObject(entry.obj);
|
|
11087
|
+
} else if (!extractedObjs.has(entry.obj)) {
|
|
11088
|
+
return;
|
|
11089
|
+
}
|
|
11090
|
+
entry.activated = true;
|
|
11091
|
+
activateSymbolInObj(entry.obj, entry.symIdx);
|
|
11092
|
+
};
|
|
11093
|
+
const tryActivateCategory = (entry) => {
|
|
11094
|
+
if (entry.activated || !liveObjCClasses.has(entry.cls)) return;
|
|
11095
|
+
const allowed = entry.catFamily === "Foundation" || entry.classFamily !== void 0 && entry.classFamily !== "Foundation" || liveModuleFamilies.has(entry.catFamily);
|
|
11096
|
+
if (!allowed) return;
|
|
11097
|
+
entry.activated = true;
|
|
11098
|
+
eagerDynamicObjects.add(entry.obj);
|
|
11099
|
+
extractObject(entry.obj, true);
|
|
11100
|
+
};
|
|
11101
|
+
const markModuleFamilyLive = (family) => {
|
|
11102
|
+
if (liveModuleFamilies.has(family)) return;
|
|
11103
|
+
liveModuleFamilies.add(family);
|
|
11104
|
+
const waiting = pendingCategoriesByFamily.get(family);
|
|
11105
|
+
if (waiting) {
|
|
11106
|
+
pendingCategoriesByFamily.delete(family);
|
|
11107
|
+
for (const entry of waiting) tryActivateCategory(entry);
|
|
11108
|
+
}
|
|
11109
|
+
};
|
|
11110
|
+
const markObjCClassLive = (cls) => {
|
|
11111
|
+
if (!cls || liveObjCClasses.has(cls)) return;
|
|
11112
|
+
liveObjCClasses.add(cls);
|
|
11113
|
+
const confs = pendingByObjcClass.get(cls);
|
|
11114
|
+
if (confs) {
|
|
11115
|
+
for (const entry of confs) tryActivateConformance(entry);
|
|
11116
|
+
}
|
|
11117
|
+
const cats = pendingCategoriesByClass.get(cls);
|
|
11118
|
+
if (cats) {
|
|
11119
|
+
for (const entry of cats) tryActivateCategory(entry);
|
|
11120
|
+
}
|
|
11121
|
+
};
|
|
11122
|
+
const markProtocolLive = (mpName) => {
|
|
11123
|
+
if (!mpName || liveProtocols.has(mpName)) return;
|
|
11124
|
+
liveProtocols.add(mpName);
|
|
11125
|
+
const waiting = pendingByProto.get(mpName);
|
|
11126
|
+
if (waiting) {
|
|
11127
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
11128
|
+
}
|
|
11129
|
+
};
|
|
11130
|
+
const checkProtocolTrigger = (rawSymName) => {
|
|
11131
|
+
if (!rawSymName) return;
|
|
11132
|
+
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
11133
|
+
if (knownProtocols.has(sName)) {
|
|
11134
|
+
markProtocolLive(sName);
|
|
11135
|
+
return;
|
|
11136
|
+
}
|
|
11137
|
+
if (!sName.startsWith("$s") || sName.endsWith("Mc")) return;
|
|
11138
|
+
if (sName.endsWith("TL")) {
|
|
11139
|
+
const mp = `${sName.slice(0, -2)}Mp`;
|
|
11140
|
+
if (knownProtocols.has(mp)) {
|
|
11141
|
+
markProtocolLive(mp);
|
|
11142
|
+
return;
|
|
11143
|
+
}
|
|
11144
|
+
}
|
|
11145
|
+
if (sName.startsWith("$sS") && sName.length > 4) {
|
|
11146
|
+
const pref = sName.slice(0, 4);
|
|
11147
|
+
if (protoPrefixes.has(pref)) {
|
|
11148
|
+
const ch = sName[4];
|
|
11149
|
+
if (ch >= "0" && ch <= "9" || ch === "s" || ch === "P") {
|
|
11150
|
+
markProtocolLive(`${pref}Mp`);
|
|
11151
|
+
return;
|
|
11152
|
+
}
|
|
11153
|
+
}
|
|
11154
|
+
}
|
|
11155
|
+
for (let n = 5; n < sName.length; n++) {
|
|
11156
|
+
if (sName[n] === "P") {
|
|
11157
|
+
const pref = sName.slice(0, n);
|
|
11158
|
+
if (protoPrefixes.has(pref)) {
|
|
11159
|
+
markProtocolLive(`${pref}Mp`);
|
|
11160
|
+
return;
|
|
11161
|
+
}
|
|
11162
|
+
}
|
|
11163
|
+
}
|
|
11164
|
+
};
|
|
10952
11165
|
const markTypeLive = (obj, pref) => {
|
|
10953
11166
|
const set = liveTypes.get(obj);
|
|
10954
11167
|
if (set.has(pref)) return;
|
|
10955
11168
|
set.add(pref);
|
|
10956
11169
|
globalLiveTypes.add(pref);
|
|
10957
|
-
const waiting =
|
|
11170
|
+
const waiting = pendingBySwiftType.get(pref);
|
|
10958
11171
|
if (waiting) {
|
|
10959
|
-
|
|
10960
|
-
for (const w of waiting) {
|
|
10961
|
-
eagerDynamicObjects.add(w.obj);
|
|
10962
|
-
extractObject(w.obj);
|
|
10963
|
-
activateSymbolInObj(w.obj, w.symIdx);
|
|
10964
|
-
}
|
|
10965
|
-
}
|
|
10966
|
-
for (let n = pref.length - 1; n > 2; n--) {
|
|
10967
|
-
const outer = pref.slice(0, n);
|
|
10968
|
-
if (obj.typePrefixesInObj.has(outer)) markTypeLive(obj, outer);
|
|
11172
|
+
for (const entry of waiting) tryActivateConformance(entry);
|
|
10969
11173
|
}
|
|
10970
11174
|
for (let n = pref.length - 1; n > 2; n--) {
|
|
10971
11175
|
const outer = pref.slice(0, n);
|
|
@@ -10982,22 +11186,20 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
10982
11186
|
markFuncLive(obj, lf);
|
|
10983
11187
|
}
|
|
10984
11188
|
}
|
|
10985
|
-
for (
|
|
10986
|
-
if (
|
|
10987
|
-
|
|
10988
|
-
if (r.segIdx === sIdx) {
|
|
10989
|
-
const mcName = obj.symNames[r.rs];
|
|
10990
|
-
if (mcName.startsWith(pref)) {
|
|
10991
|
-
activateSymbolInObj(obj, r.rs);
|
|
10992
|
-
}
|
|
10993
|
-
}
|
|
10994
|
-
}
|
|
11189
|
+
for (const [classSym, p] of obj.objcClassSymToTypePrefix) {
|
|
11190
|
+
if (p === pref && classSym.startsWith("._OBJC_CLASS_")) {
|
|
11191
|
+
markObjCClassLive(classSym.slice("._OBJC_CLASS_".length));
|
|
10995
11192
|
}
|
|
10996
11193
|
}
|
|
10997
11194
|
};
|
|
10998
11195
|
const checkTypeTrigger = (obj, rawSymName) => {
|
|
10999
11196
|
if (!rawSymName) return;
|
|
11000
11197
|
const sName = rawSymName.startsWith(".Lgot.") ? rawSymName.slice(6) : rawSymName;
|
|
11198
|
+
if (sName.startsWith("._OBJC_CLASS_")) {
|
|
11199
|
+
markObjCClassLive(sName.slice("._OBJC_CLASS_".length));
|
|
11200
|
+
} else if (sName.startsWith("._OBJC_METACLASS_")) {
|
|
11201
|
+
markObjCClassLive(sName.slice("._OBJC_METACLASS_".length));
|
|
11202
|
+
}
|
|
11001
11203
|
const objcPref = obj.objcClassSymToTypePrefix.get(sName);
|
|
11002
11204
|
if (objcPref) {
|
|
11003
11205
|
markTypeLive(obj, objcPref);
|
|
@@ -11024,6 +11226,7 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11024
11226
|
const activateGlobalName = (name3) => {
|
|
11025
11227
|
if (!name3) return;
|
|
11026
11228
|
if (!liveGlobalNames.has(name3)) liveGlobalNames.add(name3);
|
|
11229
|
+
checkProtocolTrigger(name3);
|
|
11027
11230
|
const defs = extractedSymbolDefs.get(name3);
|
|
11028
11231
|
if (defs) {
|
|
11029
11232
|
for (const d of defs) {
|
|
@@ -11038,7 +11241,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11038
11241
|
const fl = obj.symFlags[symIdx];
|
|
11039
11242
|
const isUndef = (fl & 16) !== 0;
|
|
11040
11243
|
const isLocal = (fl & 3) === 2;
|
|
11244
|
+
if (obj.isDist && categoryOnlyExtracted.has(obj)) {
|
|
11245
|
+
categoryOnlyExtracted.delete(obj);
|
|
11246
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
11247
|
+
}
|
|
11041
11248
|
checkTypeTrigger(obj, sName);
|
|
11249
|
+
checkProtocolTrigger(sName);
|
|
11042
11250
|
if (!isUndef && !isLocal && sName && !liveGlobalNames.has(sName)) {
|
|
11043
11251
|
activateGlobalName(sName);
|
|
11044
11252
|
}
|
|
@@ -11050,13 +11258,25 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11050
11258
|
markDataSymLive(obj, pIdx);
|
|
11051
11259
|
const parentName = obj.symNames[pIdx];
|
|
11052
11260
|
checkTypeTrigger(obj, parentName);
|
|
11261
|
+
checkProtocolTrigger(parentName);
|
|
11053
11262
|
}
|
|
11054
11263
|
markSegLive(obj, el);
|
|
11055
11264
|
}
|
|
11056
11265
|
}
|
|
11057
|
-
const extractObject = (obj) => {
|
|
11058
|
-
if (extractedObjs.has(obj))
|
|
11266
|
+
const extractObject = (obj, fromObjCCategory = false) => {
|
|
11267
|
+
if (extractedObjs.has(obj)) {
|
|
11268
|
+
if (!fromObjCCategory && categoryOnlyExtracted.has(obj)) {
|
|
11269
|
+
categoryOnlyExtracted.delete(obj);
|
|
11270
|
+
if (obj.isDist) markModuleFamilyLive(moduleFamily(obj.file));
|
|
11271
|
+
}
|
|
11272
|
+
return;
|
|
11273
|
+
}
|
|
11059
11274
|
extractedObjs.add(obj);
|
|
11275
|
+
if (fromObjCCategory && obj.isDist) {
|
|
11276
|
+
categoryOnlyExtracted.add(obj);
|
|
11277
|
+
} else if (obj.isDist) {
|
|
11278
|
+
markModuleFamilyLive(moduleFamily(obj.file));
|
|
11279
|
+
}
|
|
11060
11280
|
liveFuncs.set(obj, new Uint8Array(obj.numFuncs));
|
|
11061
11281
|
liveSegs.set(obj, new Uint8Array(obj.numSegments));
|
|
11062
11282
|
liveDataSyms.set(obj, /* @__PURE__ */ new Set());
|
|
@@ -11094,6 +11314,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11094
11314
|
if (classSym !== -1 && (obj.symFlags[classSym] & 16) === 0)
|
|
11095
11315
|
activateSymbolInObj(obj, classSym);
|
|
11096
11316
|
}
|
|
11317
|
+
if (!obj.isDist) {
|
|
11318
|
+
for (let i = 0; i < obj.symNames.length; i++) {
|
|
11319
|
+
checkTypeTrigger(obj, obj.symNames[i]);
|
|
11320
|
+
checkProtocolTrigger(obj.symNames[i]);
|
|
11321
|
+
}
|
|
11322
|
+
}
|
|
11097
11323
|
if (obj.isDist) {
|
|
11098
11324
|
const isBuildSwift = !obj.file.startsWith(distDir) && obj.file.endsWith(".swift.o");
|
|
11099
11325
|
for (const [classSym, pref] of obj.objcClassSymToTypePrefix)
|
|
@@ -11108,48 +11334,77 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11108
11334
|
}
|
|
11109
11335
|
}
|
|
11110
11336
|
if (obj.isDist) {
|
|
11111
|
-
for (
|
|
11112
|
-
|
|
11113
|
-
for (const r of obj.dataRelocList) {
|
|
11114
|
-
if (r.segIdx === sIdx) {
|
|
11115
|
-
const mcName = obj.symNames[r.rs];
|
|
11116
|
-
let matchesLocalType = false;
|
|
11117
|
-
for (const pref of obj.typePrefixesInObj) {
|
|
11118
|
-
if (mcName.startsWith(pref)) {
|
|
11119
|
-
matchesLocalType = true;
|
|
11120
|
-
break;
|
|
11121
|
-
}
|
|
11122
|
-
}
|
|
11123
|
-
if (!matchesLocalType) {
|
|
11124
|
-
const type = conformingType(mcName);
|
|
11125
|
-
if (type === void 0 || globalLiveTypes.has(type))
|
|
11126
|
-
activateSymbolInObj(obj, r.rs);
|
|
11127
|
-
}
|
|
11128
|
-
}
|
|
11129
|
-
}
|
|
11130
|
-
}
|
|
11337
|
+
for (const entries of pendingByObj.get(obj) ?? []) {
|
|
11338
|
+
tryActivateConformance(entries);
|
|
11131
11339
|
}
|
|
11132
11340
|
}
|
|
11133
11341
|
};
|
|
11342
|
+
const pendingByObj = /* @__PURE__ */ new Map();
|
|
11134
11343
|
for (const obj of distObjs.values()) {
|
|
11135
11344
|
if (!obj.isDist) continue;
|
|
11136
11345
|
for (const r of obj.dataRelocList) {
|
|
11137
11346
|
if (obj.segNames[r.segIdx] !== "swift5_protocol_conformances") continue;
|
|
11138
|
-
const
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11347
|
+
const mcIdx = r.rs;
|
|
11348
|
+
const mcName = obj.symNames[mcIdx];
|
|
11349
|
+
const swiftType = conformingType(mcName);
|
|
11350
|
+
const objcType = swiftType === void 0 ? objcClassOfConformance(mcName) : void 0;
|
|
11351
|
+
const typeKey = swiftType !== void 0 ? { kind: "swift", value: swiftType } : objcType !== void 0 ? { kind: "objc", value: objcType } : null;
|
|
11352
|
+
const proto = obj.conformanceProtocols.get(mcIdx);
|
|
11353
|
+
const isForeign = swiftType !== void 0 ? !obj.typePrefixesInObj.has(swiftType) : objcType !== void 0 ? !obj.symNames.some(
|
|
11354
|
+
(n, i) => n === `._OBJC_CLASS_${objcType}` && (obj.symFlags[i] & 16) === 0
|
|
11355
|
+
) : false;
|
|
11356
|
+
const entry = {
|
|
11357
|
+
obj,
|
|
11358
|
+
symIdx: mcIdx,
|
|
11359
|
+
typeKey,
|
|
11360
|
+
proto,
|
|
11361
|
+
isForeign,
|
|
11362
|
+
activated: false
|
|
11363
|
+
};
|
|
11364
|
+
let objList = pendingByObj.get(obj);
|
|
11365
|
+
if (!objList) pendingByObj.set(obj, objList = []);
|
|
11366
|
+
objList.push(entry);
|
|
11367
|
+
if (swiftType !== void 0) {
|
|
11368
|
+
let list2 = pendingBySwiftType.get(swiftType);
|
|
11369
|
+
if (!list2) pendingBySwiftType.set(swiftType, list2 = []);
|
|
11370
|
+
list2.push(entry);
|
|
11371
|
+
} else if (objcType !== void 0) {
|
|
11372
|
+
let list2 = pendingByObjcClass.get(objcType);
|
|
11373
|
+
if (!list2) pendingByObjcClass.set(objcType, list2 = []);
|
|
11374
|
+
list2.push(entry);
|
|
11375
|
+
}
|
|
11376
|
+
if (proto !== void 0) {
|
|
11377
|
+
let list2 = pendingByProto.get(proto);
|
|
11378
|
+
if (!list2) pendingByProto.set(proto, list2 = []);
|
|
11379
|
+
list2.push(entry);
|
|
11380
|
+
}
|
|
11381
|
+
}
|
|
11382
|
+
if (obj.objcCategoryTargets.length > 0) {
|
|
11383
|
+
const catFamily = moduleFamily(obj.file);
|
|
11384
|
+
for (const cls of obj.objcCategoryTargets) {
|
|
11385
|
+
const classFamily = objcClassFamilyOf(cls);
|
|
11386
|
+
const entry = {
|
|
11387
|
+
obj,
|
|
11388
|
+
cls,
|
|
11389
|
+
catFamily,
|
|
11390
|
+
classFamily,
|
|
11391
|
+
activated: false
|
|
11392
|
+
};
|
|
11393
|
+
let byCls = pendingCategoriesByClass.get(cls);
|
|
11394
|
+
if (!byCls) pendingCategoriesByClass.set(cls, byCls = []);
|
|
11395
|
+
byCls.push(entry);
|
|
11396
|
+
if (catFamily !== "Foundation" && (classFamily === void 0 || classFamily === "Foundation")) {
|
|
11397
|
+
let byFam = pendingCategoriesByFamily.get(catFamily);
|
|
11398
|
+
if (!byFam) pendingCategoriesByFamily.set(catFamily, byFam = []);
|
|
11399
|
+
byFam.push(entry);
|
|
11400
|
+
}
|
|
11401
|
+
}
|
|
11143
11402
|
}
|
|
11144
11403
|
}
|
|
11145
|
-
let hasClangObjCEager = false;
|
|
11146
11404
|
for (const f of eagerFiles) {
|
|
11147
11405
|
const isDist = f.startsWith(distDir);
|
|
11148
11406
|
const obj = distObjs.get(f) ?? parseWasmObjectCached(f, isDist, false);
|
|
11149
11407
|
extractObject(obj);
|
|
11150
|
-
if (!isDist && !hasClangObjCEager && obj.symNames.includes("__objc_load")) {
|
|
11151
|
-
hasClangObjCEager = true;
|
|
11152
|
-
}
|
|
11153
11408
|
if (isDist) {
|
|
11154
11409
|
const base = import_node_path10.default.basename(f);
|
|
11155
11410
|
if (base.startsWith("PeachFoundation-") || base.startsWith("PeachObjC-") || base.startsWith("PeachICU-") || base.startsWith("Darwin-")) {
|
|
@@ -11172,19 +11427,6 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11172
11427
|
activateSymbolInObj(provider, provider.symNames.indexOf(name3));
|
|
11173
11428
|
}
|
|
11174
11429
|
}
|
|
11175
|
-
const eagerSdkCategoryFiles = [];
|
|
11176
|
-
if (hasClangObjCEager) {
|
|
11177
|
-
for (const name3 of foundationCategoryObjects.map(
|
|
11178
|
-
(name4) => `libFoundation__${name4}.objc.o`
|
|
11179
|
-
)) {
|
|
11180
|
-
const sdkFile = import_node_path10.default.join(sdkObjsDir, name3);
|
|
11181
|
-
const obj = distObjs.get(sdkFile);
|
|
11182
|
-
if (obj) {
|
|
11183
|
-
extractObject(obj);
|
|
11184
|
-
eagerSdkCategoryFiles.push(sdkFile);
|
|
11185
|
-
}
|
|
11186
|
-
}
|
|
11187
|
-
}
|
|
11188
11430
|
for (const symName of ["_initialize", "__main_argc_argv", "main"]) {
|
|
11189
11431
|
const def = definedGlobalSyms.get(symName);
|
|
11190
11432
|
if (def) activateSymbolInObj(def.obj, def.symIdx);
|
|
@@ -11239,6 +11481,9 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11239
11481
|
}
|
|
11240
11482
|
for (const symIdx of relocs) {
|
|
11241
11483
|
if (obj.isDist && dropsReflection(obj, obj.symNames[symIdx])) continue;
|
|
11484
|
+
const symName = obj.symNames[symIdx];
|
|
11485
|
+
checkTypeTrigger(obj, symName);
|
|
11486
|
+
checkProtocolTrigger(symName);
|
|
11242
11487
|
const fl = obj.symFlags[symIdx];
|
|
11243
11488
|
const isUndef = (fl & 16) !== 0;
|
|
11244
11489
|
const isLocal = (fl & 3) === 2;
|
|
@@ -11578,21 +11823,12 @@ function pruneSwiftWasmLink(directory, toolchainBin, moduleRoot, staticClangTarg
|
|
|
11578
11823
|
writePrunedObject(o, outPath);
|
|
11579
11824
|
prunedMap.set(o.file, outPath);
|
|
11580
11825
|
}
|
|
11581
|
-
const extraSdkObjs = allSdkObjFiles.filter(
|
|
11582
|
-
(f) => f.startsWith("libDarwin__") || f.startsWith("libswiftCore__") && f !== "libswiftCore__Swift.o" || f.startsWith("libswift_Concurrency__") && f !== "libswift_Concurrency___Concurrency.o"
|
|
11583
|
-
).map((f) => import_node_path10.default.join(sdkObjsDir, f));
|
|
11584
11826
|
const outTokens = [];
|
|
11585
11827
|
const emittedPruned = /* @__PURE__ */ new Set();
|
|
11586
11828
|
inStartLib = false;
|
|
11587
11829
|
for (const t of tokens2) {
|
|
11588
11830
|
if (t === "--start-lib") {
|
|
11589
11831
|
inStartLib = true;
|
|
11590
|
-
for (const ef of eagerSdkCategoryFiles) {
|
|
11591
|
-
if (!emittedPruned.has(ef) && prunedMap.has(ef)) {
|
|
11592
|
-
outTokens.push(prunedMap.get(ef));
|
|
11593
|
-
emittedPruned.add(ef);
|
|
11594
|
-
}
|
|
11595
|
-
}
|
|
11596
11832
|
for (const obj of eagerDynamicObjects) {
|
|
11597
11833
|
if (!emittedPruned.has(obj.file) && prunedMap.has(obj.file)) {
|
|
11598
11834
|
outTokens.push(prunedMap.get(obj.file));
|
|
@@ -16381,10 +16617,6 @@ function swiftIcuPacked(icu) {
|
|
|
16381
16617
|
// src/swift-link-roots.ts
|
|
16382
16618
|
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
16383
16619
|
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
16384
|
-
var OBJC_SENTINELS = /* @__PURE__ */ new Map([
|
|
16385
|
-
["__objc_cats", ".objc_null_category"],
|
|
16386
|
-
["__objc_class_aliases", ".objc_null_class_alias"]
|
|
16387
|
-
]);
|
|
16388
16620
|
var leb = (bytes, at) => {
|
|
16389
16621
|
let value = 0;
|
|
16390
16622
|
let scale = 1;
|
|
@@ -16399,6 +16631,7 @@ function objcRootInfo(bytes) {
|
|
|
16399
16631
|
const at = { offset: 8 };
|
|
16400
16632
|
const names = [];
|
|
16401
16633
|
const dataSymbols = [];
|
|
16634
|
+
let hasNSObjectLoad = false;
|
|
16402
16635
|
let hasExportedSymbol = false;
|
|
16403
16636
|
while (at.offset < bytes.length) {
|
|
16404
16637
|
const id = bytes[at.offset++];
|
|
@@ -16435,6 +16668,12 @@ function objcRootInfo(bytes) {
|
|
|
16435
16668
|
leb(bytes, at);
|
|
16436
16669
|
if (!isUndef || isExplicitName) {
|
|
16437
16670
|
const sLen = leb(bytes, at);
|
|
16671
|
+
if (!isUndef && symKind === 0) {
|
|
16672
|
+
const name4 = Buffer.from(
|
|
16673
|
+
bytes.subarray(at.offset, at.offset + sLen)
|
|
16674
|
+
).toString();
|
|
16675
|
+
if (/^_c_NSObject_.*_load$/.test(name4)) hasNSObjectLoad = true;
|
|
16676
|
+
}
|
|
16438
16677
|
at.offset += sLen;
|
|
16439
16678
|
}
|
|
16440
16679
|
} else if (symKind === 1) {
|
|
@@ -16461,11 +16700,9 @@ function objcRootInfo(bytes) {
|
|
|
16461
16700
|
at.offset = end;
|
|
16462
16701
|
}
|
|
16463
16702
|
return {
|
|
16464
|
-
registration: dataSymbols.some(
|
|
16465
|
-
|
|
16466
|
-
|
|
16467
|
-
return sentinel !== void 0 && name3 !== sentinel;
|
|
16468
|
-
}),
|
|
16703
|
+
registration: hasNSObjectLoad || dataSymbols.some(
|
|
16704
|
+
({ segment, name: name3 }) => names[segment] === "__objc_class_aliases" && name3 !== ".objc_null_class_alias"
|
|
16705
|
+
),
|
|
16469
16706
|
exported: hasExportedSymbol
|
|
16470
16707
|
};
|
|
16471
16708
|
}
|
|
@@ -16478,9 +16715,7 @@ function swiftObjcRootObjects(id, root, objects) {
|
|
|
16478
16715
|
);
|
|
16479
16716
|
const roots = new Set(
|
|
16480
16717
|
measured.filter(
|
|
16481
|
-
([object4, info]) =>
|
|
16482
|
-
(name3) => object4 === `lib/Foundation-${name3}.o`
|
|
16483
|
-
) && object4 !== "lib/FoundationNetworking-Session.o" && object4 !== "lib/SwiftUI-MetalExecution.o" && object4 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
16718
|
+
([object4, info]) => object4 !== "lib/FoundationNetworking-Session.o" && object4 !== "lib/Metal-MetalExecution.o" && object4 !== "lib/PeachICU-icu.c.o" && object4 !== "lib/SwiftUI-MetalExecution.o" && object4 !== "lib/UIKitCore-NativeStub.o" && (info.registration || info.exported)
|
|
16484
16719
|
).map(([object4]) => object4)
|
|
16485
16720
|
);
|
|
16486
16721
|
rootsByDistribution.set(id, roots);
|
|
@@ -18003,7 +18238,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
18003
18238
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
18004
18239
|
var MULTI_MANIFEST_VERSION = 68;
|
|
18005
18240
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
18006
|
-
var compilerSourceDigest = true ? "
|
|
18241
|
+
var compilerSourceDigest = true ? "05dbb1273689060748700777894c639c73bea2e6da20eaf47e8040b26ff859cf" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
18007
18242
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
18008
18243
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
18009
18244
|
hash.update(`swift-compile
|
|
@@ -28010,7 +28245,11 @@ async function swiftDistributionRoot(signal) {
|
|
|
28010
28245
|
const endpoint = swiftEndpoint();
|
|
28011
28246
|
const lock = swiftNativePin().distribution;
|
|
28012
28247
|
await installSwiftToolchain(lock.release, lock, signal);
|
|
28013
|
-
const dir = import_node_path36.default.join(
|
|
28248
|
+
const dir = import_node_path36.default.join(
|
|
28249
|
+
swiftCacheDir(),
|
|
28250
|
+
"swift-distributions",
|
|
28251
|
+
`${lock.id}-${host2}-${lock.hosts[host2].sha256}`
|
|
28252
|
+
);
|
|
28014
28253
|
let pending = installs.get(dir);
|
|
28015
28254
|
if (pending?.controller.signal.aborted) pending = void 0;
|
|
28016
28255
|
if (!pending) {
|
|
@@ -32175,7 +32414,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
32175
32414
|
return hash.digest("hex");
|
|
32176
32415
|
}
|
|
32177
32416
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
32178
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
32417
|
+
var STANDIN_SOURCE_DIGEST = true ? "6a3e08e780371135330124e5f94797a59a8e181f890d0c3dab1f0fd155525e35" : standinSourceDigest();
|
|
32179
32418
|
|
|
32180
32419
|
// src/swift-standins.ts
|
|
32181
32420
|
var import_node_child_process31 = require("node:child_process");
|