peachsim 0.1.2592 → 0.1.2594
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/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +1737 -1648
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-67PU73QE.mjs → acorn-M67PRRGJ.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-EWHA6X3Z.mjs → chunk-3VEDDAPT.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-DFF5XZ5M.mjs → chunk-4AOZYVB2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PITO2NI2.mjs → chunk-6MZ5FKMK.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-6DB5FR7S.mjs → chunk-EDBGKIQ2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EITX573K.mjs → chunk-FFHDCOXF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GY6TE4B4.mjs → chunk-GER2Z6BI.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-QSFWBVUO.mjs → chunk-HJJI36KV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EHRSWFTD.mjs → chunk-INOLFCG5.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-CF3MTPMY.mjs → chunk-IUDVBSA4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GQ3EO2UV.mjs → chunk-NN73CP4F.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XZ3FX3HW.mjs → chunk-PESI6OUB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RV4ACE6R.mjs → chunk-QHYHKB3J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KDI5YYQ6.mjs → chunk-QSPPJOT6.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-R3WTQB5J.mjs → chunk-QUMKCF67.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FYXXFYML.mjs → chunk-RESE3ERA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TJZPNFVF.mjs → chunk-SBHXHWKH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-M4QLI2SY.mjs → chunk-SV76NV36.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XSQH4R5E.mjs → chunk-UAEIMMNH.mjs} +69 -48
- package/dist-lib/esm-chunks/{chunk-D4LYKRRB.mjs → chunk-X242Y5KS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-L5T3HBPO.mjs → chunk-XM3OLATO.mjs} +240 -206
- package/dist-lib/esm-chunks/{chunk-SW4PSSTF.mjs → chunk-YGDCMWUX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5FTHILIE.mjs → chunk-Z6E7GAQS.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-EX65MARK.mjs → metro-layout-parser-ZJUAU4C3.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-3BPDQVA7.mjs → swift-package-prebuilt-2FFVA7SB.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-CRX6E3TR.mjs → swift-sdk-app-module-A2ZJMCBX.mjs} +30 -20
- package/dist-lib/esm-chunks/{swift-sdk-image-EJD5TPQH.mjs → swift-sdk-image-HJLWK2B6.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-QAZOSLTZ.mjs → swift-sdk-image-producer-7EM7U2LR.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +324 -235
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +480 -255
- package/dist-lib/host/fetch-proxy-handler.cjs +67 -16
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +5 -5
- package/dist-lib/native-app-identity-project.mjs +16 -16
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +81 -81
- package/dist-lib/public-origins-lib.json +71 -71
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +480 -255
- package/dist-lib/swift-compile.cjs +286 -230
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/binaryen.lock.json +3 -3
- package/src/host/fetch-proxy-handler.ts +63 -9
- package/src/one-native-controls-package.ts +95 -10
- package/src/one-sdk-preparation.ts +40 -2
- package/src/swift-guest-compile.ts +11 -2
- package/src/swift-guest-projection-storage.ts +45 -26
- package/src/swift-guest-runtime-plan.ts +1 -1
- package/src/swift-sdk-app-module.ts +15 -6
- package/src/swift-sdk-image-wasm.ts +5 -2
- package/src/swift-sdk-image.ts +69 -49
- package/src/swift-wasm-prune.ts +51 -34
- package/src/wasm-optimize.ts +146 -140
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2594 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
SWIFT_AUTOLINK_LINKER,
|
|
4
4
|
SWIFT_CACHE_HOLD_MARKER,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
windowAdmission,
|
|
22
22
|
withSwiftRootLock,
|
|
23
23
|
writeSwiftAutolinkLinker
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-NN73CP4F.mjs";
|
|
25
25
|
import {
|
|
26
26
|
SWIFT_BINARY_TREES_DIR,
|
|
27
27
|
SWIFT_NATIVE_INPUT_ROOT,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
isSwiftResourcePath,
|
|
37
37
|
isSwiftSourceLinkGraph,
|
|
38
38
|
swiftProjectFilesProblems
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-HJJI36KV.mjs";
|
|
40
40
|
import {
|
|
41
41
|
OBJC_RESOURCE_ACCESSOR_BODY,
|
|
42
42
|
OBJC_RESOURCE_ACCESSOR_HEADER,
|
|
@@ -60,16 +60,16 @@ import {
|
|
|
60
60
|
swiftPackagePartition,
|
|
61
61
|
swiftTargetModuleName,
|
|
62
62
|
withoutGlogModuleMap
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-YGDCMWUX.mjs";
|
|
64
64
|
import {
|
|
65
65
|
rnxPublicBrand
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-EDBGKIQ2.mjs";
|
|
67
67
|
import {
|
|
68
68
|
isRecord
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-IUDVBSA4.mjs";
|
|
70
70
|
import {
|
|
71
71
|
__publicField
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-FFHDCOXF.mjs";
|
|
73
73
|
|
|
74
74
|
// src/swift-compile.ts
|
|
75
75
|
import {
|
|
@@ -90,7 +90,7 @@ import {
|
|
|
90
90
|
readdirSync as readdirSync6,
|
|
91
91
|
readlinkSync,
|
|
92
92
|
realpathSync as realpathSync6,
|
|
93
|
-
renameSync as
|
|
93
|
+
renameSync as renameSync5,
|
|
94
94
|
rmSync as rmSync7,
|
|
95
95
|
statSync as statSync4,
|
|
96
96
|
symlinkSync as symlinkSync2,
|
|
@@ -5527,6 +5527,7 @@ var OBJC_LOAD_FUNCTION = ".objcv2_load_function";
|
|
|
5527
5527
|
|
|
5528
5528
|
// src/swift-sdk-image-wasm.ts
|
|
5529
5529
|
function wasmReader(bytes, start) {
|
|
5530
|
+
const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
5530
5531
|
let at = start;
|
|
5531
5532
|
const u = () => {
|
|
5532
5533
|
let value = 0;
|
|
@@ -5555,7 +5556,7 @@ function wasmReader(bytes, start) {
|
|
|
5555
5556
|
name: () => {
|
|
5556
5557
|
const length = u();
|
|
5557
5558
|
at += length;
|
|
5558
|
-
return
|
|
5559
|
+
return rawBuf.toString("utf8", at - length, at);
|
|
5559
5560
|
},
|
|
5560
5561
|
skip: (length) => {
|
|
5561
5562
|
at += length;
|
|
@@ -5953,7 +5954,7 @@ function codeOnlySdkImage(bytes, constructorMask) {
|
|
|
5953
5954
|
const bodies = m.bodies.map(({ start, end }) => bytes.subarray(start, end));
|
|
5954
5955
|
const initMemory = functionIndex("__wasm_init_memory") - m.importedFuncs;
|
|
5955
5956
|
{
|
|
5956
|
-
const body = Uint8Array
|
|
5957
|
+
const body = new Uint8Array(bodies[initMemory]);
|
|
5957
5958
|
const r = wasmReader(body, 0);
|
|
5958
5959
|
if (r.u() !== 0) throw new Error("sdk memory initializer has locals");
|
|
5959
5960
|
while (r.at < body.length) {
|
|
@@ -6997,7 +6998,18 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
6997
6998
|
dataOwnerSymIdx[kept] = ownerSymIdx;
|
|
6998
6999
|
kept++;
|
|
6999
7000
|
}
|
|
7000
|
-
const dataRelocs = {
|
|
7001
|
+
const dataRelocs = kept === rawData.count ? {
|
|
7002
|
+
count: kept,
|
|
7003
|
+
bytes: rawData.bytes,
|
|
7004
|
+
start: rawData.start,
|
|
7005
|
+
end: rawData.end,
|
|
7006
|
+
ro: rawData.ro,
|
|
7007
|
+
rs: rawData.rs,
|
|
7008
|
+
addend: rawData.addend,
|
|
7009
|
+
segIdx: dataSegIdx,
|
|
7010
|
+
offInSeg: dataOffInSeg,
|
|
7011
|
+
ownerSymIdx: dataOwnerSymIdx
|
|
7012
|
+
} : {
|
|
7001
7013
|
count: kept,
|
|
7002
7014
|
bytes: rawData.bytes,
|
|
7003
7015
|
start: rawData.start.slice(0, kept),
|
|
@@ -7009,26 +7021,29 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
7009
7021
|
offInSeg: dataOffInSeg.slice(0, kept),
|
|
7010
7022
|
ownerSymIdx: dataOwnerSymIdx.slice(0, kept)
|
|
7011
7023
|
};
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
const
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7024
|
+
if (segTopSyms.size > 0) {
|
|
7025
|
+
const relocatedWords = /* @__PURE__ */ new Map();
|
|
7026
|
+
for (let i = 0; i < dataRelocs.count; i++) {
|
|
7027
|
+
const segIdx = dataRelocs.segIdx[i];
|
|
7028
|
+
if (!segTopSyms.has(segIdx)) continue;
|
|
7029
|
+
let words = relocatedWords.get(segIdx);
|
|
7030
|
+
if (!words) relocatedWords.set(segIdx, words = /* @__PURE__ */ new Set());
|
|
7031
|
+
words.add(dataRelocs.offInSeg[i]);
|
|
7032
|
+
}
|
|
7033
|
+
for (const [segIdx, tops] of segTopSyms) {
|
|
7034
|
+
const starts = new Map(tops.map((top) => [top.off, top.symIdx]));
|
|
7035
|
+
const relocated = relocatedWords.get(segIdx);
|
|
7036
|
+
const payload = dataStart + sPayloadStarts[segIdx];
|
|
7037
|
+
const view = new DataView(buf.buffer, buf.byteOffset + payload);
|
|
7038
|
+
for (const top of tops) {
|
|
7039
|
+
for (let at = top.off; at + 4 <= top.end; at += 4) {
|
|
7040
|
+
if (relocated?.has(at)) continue;
|
|
7041
|
+
const target = starts.get(at + (view.getInt32(at, true) & ~3));
|
|
7042
|
+
if (target === void 0 || target === top.symIdx) continue;
|
|
7043
|
+
let list = symDataRelocs.get(top.symIdx);
|
|
7044
|
+
if (!list) symDataRelocs.set(top.symIdx, list = []);
|
|
7045
|
+
list.push(target);
|
|
7046
|
+
}
|
|
7032
7047
|
}
|
|
7033
7048
|
}
|
|
7034
7049
|
}
|
|
@@ -7200,7 +7215,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
7200
7215
|
};
|
|
7201
7216
|
}
|
|
7202
7217
|
function parseWasmObjectFile(file, isDist) {
|
|
7203
|
-
return parseWasmObjectBytes(file,
|
|
7218
|
+
return parseWasmObjectBytes(file, fs5.readFileSync(file), isDist);
|
|
7204
7219
|
}
|
|
7205
7220
|
function parseWasmObjectCached(file, isDist, entries2) {
|
|
7206
7221
|
const key = `${isDist ? "1" : "0"}:${file}`;
|
|
@@ -10216,18 +10231,6 @@ function readWasmMemoryAndTableImports(bytes, layout2) {
|
|
|
10216
10231
|
}
|
|
10217
10232
|
return { memory, tableImports };
|
|
10218
10233
|
}
|
|
10219
|
-
function hasWasmExport(bytes, name) {
|
|
10220
|
-
const section2 = wasmSections2(bytes).find((value) => value.id === 7);
|
|
10221
|
-
if (!section2) return false;
|
|
10222
|
-
const input = readWasmSection(bytes, section2.start, section2.end);
|
|
10223
|
-
for (let count = input.number(); count > 0; count--) {
|
|
10224
|
-
const found = input.name();
|
|
10225
|
-
input.byte();
|
|
10226
|
-
input.number();
|
|
10227
|
-
if (found === name) return true;
|
|
10228
|
-
}
|
|
10229
|
-
return false;
|
|
10230
|
-
}
|
|
10231
10234
|
function withSections(bytes, layout2, replacements) {
|
|
10232
10235
|
const parts = [bytes.subarray(0, 8)];
|
|
10233
10236
|
let at = 8;
|
|
@@ -10889,23 +10892,40 @@ function reserveGuestProjectionStorage(images, capacities) {
|
|
|
10889
10892
|
};
|
|
10890
10893
|
}
|
|
10891
10894
|
function mergeGuestProjectionSpans(imageCount, spans) {
|
|
10892
|
-
const
|
|
10893
|
-
|
|
10894
|
-
)
|
|
10895
|
-
const merged = [];
|
|
10896
|
-
for (const span of sorted) {
|
|
10895
|
+
const tableSpans = [];
|
|
10896
|
+
const memorySpans = [];
|
|
10897
|
+
for (const span of spans) {
|
|
10897
10898
|
if (!Number.isInteger(span.image) || span.image < 0 || span.image >= imageCount || !Number.isInteger(span.address) || !Number.isInteger(span.length) || span.address < 0 || span.length <= 0 || span.address + span.length > 4294967296)
|
|
10898
10899
|
throw new Error("invalid linked guest span");
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
throw new Error("linked guest span has ambiguous image ownership");
|
|
10902
|
-
if (previous && previous.space === span.space && previous.image === span.image && span.address <= previous.address + previous.length) {
|
|
10903
|
-
merged[merged.length - 1] = {
|
|
10904
|
-
...previous,
|
|
10905
|
-
length: Math.max(previous.address + previous.length, span.address + span.length) - previous.address
|
|
10906
|
-
};
|
|
10907
|
-
} else merged.push(span);
|
|
10900
|
+
if (span.space === "function-table") tableSpans.push(span);
|
|
10901
|
+
else memorySpans.push(span);
|
|
10908
10902
|
}
|
|
10903
|
+
const byAddress = (a, b) => a.address - b.address || a.image - b.image;
|
|
10904
|
+
tableSpans.sort(byAddress);
|
|
10905
|
+
memorySpans.sort(byAddress);
|
|
10906
|
+
const merged = [];
|
|
10907
|
+
const mergeGroup = (group) => {
|
|
10908
|
+
let previous = null;
|
|
10909
|
+
for (const span of group) {
|
|
10910
|
+
if (previous && span.address < previous.address + previous.length && previous.image !== span.image)
|
|
10911
|
+
throw new Error("linked guest span has ambiguous image ownership");
|
|
10912
|
+
if (previous && previous.image === span.image && span.address <= previous.address + previous.length) {
|
|
10913
|
+
const end = span.address + span.length;
|
|
10914
|
+
if (end > previous.address + previous.length)
|
|
10915
|
+
previous.length = end - previous.address;
|
|
10916
|
+
} else {
|
|
10917
|
+
previous = {
|
|
10918
|
+
image: span.image,
|
|
10919
|
+
space: span.space,
|
|
10920
|
+
address: span.address,
|
|
10921
|
+
length: span.length
|
|
10922
|
+
};
|
|
10923
|
+
merged.push(previous);
|
|
10924
|
+
}
|
|
10925
|
+
}
|
|
10926
|
+
};
|
|
10927
|
+
mergeGroup(tableSpans);
|
|
10928
|
+
mergeGroup(memorySpans);
|
|
10909
10929
|
return merged;
|
|
10910
10930
|
}
|
|
10911
10931
|
function guestProjectionRegionCounts(imageCount, spans) {
|
|
@@ -11089,7 +11109,7 @@ function sdkArtifactBytes(root, artifact) {
|
|
|
11089
11109
|
const source = readFileSync9(path16.join(sourceDirectory, "libFoundation.a"));
|
|
11090
11110
|
if (hash(source) !== artifact.sha256)
|
|
11091
11111
|
throw new Error(`SDK product artifact changed ${file}`);
|
|
11092
|
-
const transformed = Uint8Array
|
|
11112
|
+
const transformed = new Uint8Array(source);
|
|
11093
11113
|
weakenFoundationOverridesInArchive(transformed);
|
|
11094
11114
|
if (!linked.equals(transformed))
|
|
11095
11115
|
throw new Error(`SDK view transformation changed ${file}`);
|
|
@@ -11602,7 +11622,16 @@ function guestAliasedSdkArchiveArtifacts(options) {
|
|
|
11602
11622
|
|
|
11603
11623
|
// src/wasm-optimize.ts
|
|
11604
11624
|
import { execFile } from "node:child_process";
|
|
11605
|
-
import {
|
|
11625
|
+
import {
|
|
11626
|
+
closeSync as closeSync2,
|
|
11627
|
+
existsSync as existsSync3,
|
|
11628
|
+
fstatSync,
|
|
11629
|
+
openSync as openSync2,
|
|
11630
|
+
readFileSync as readFileSync10,
|
|
11631
|
+
readSync as readSync2,
|
|
11632
|
+
rmSync as rmSync4,
|
|
11633
|
+
writeFileSync as writeFileSync4
|
|
11634
|
+
} from "node:fs";
|
|
11606
11635
|
import { dirname, join } from "node:path";
|
|
11607
11636
|
import { promisify } from "node:util";
|
|
11608
11637
|
|
|
@@ -11895,17 +11924,17 @@ var binaryen_lock_default = {
|
|
|
11895
11924
|
"linux-x64": {
|
|
11896
11925
|
asset: "x86_64-linux",
|
|
11897
11926
|
upstreamSha256: "195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572",
|
|
11898
|
-
sha256: "
|
|
11927
|
+
sha256: "1024974f254c1c2edd738246ec6af5add16d3d36b5f58a94545febda3b33c869"
|
|
11899
11928
|
},
|
|
11900
11929
|
"linux-arm64": {
|
|
11901
11930
|
asset: "aarch64-linux",
|
|
11902
11931
|
upstreamSha256: "c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f",
|
|
11903
|
-
sha256: "
|
|
11932
|
+
sha256: "7dedfc9f5cb32e75a28831f3b5aa053fd3e0bdd74f73dc4d1b1588947236daef"
|
|
11904
11933
|
},
|
|
11905
11934
|
"darwin-arm64": {
|
|
11906
11935
|
asset: "arm64-macos",
|
|
11907
11936
|
upstreamSha256: "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
|
|
11908
|
-
sha256: "
|
|
11937
|
+
sha256: "0b56e0a06b6a873877871537a120fd94e2121e67f4bce5f8b5252c47b615854a"
|
|
11909
11938
|
}
|
|
11910
11939
|
}
|
|
11911
11940
|
};
|
|
@@ -11976,6 +12005,45 @@ var BINARYEN_VERSION = binaryen_lock_default.version;
|
|
|
11976
12005
|
var runBinaryen = promisify(execFile);
|
|
11977
12006
|
var WASM_LOWER_IDENTITY = `binaryen ${BINARYEN_VERSION} narrow ${LOWERING.join(" ")} ${FEATURES.join(",")} shared-stack-check-v2 native-image-v1 table-reserve-v2 ${NATIVE_TABLE_ABI} unoptimized-names`;
|
|
11978
12007
|
var BINARYEN_RELEASES = new Map(Object.entries(binaryen_lock_default.platforms));
|
|
12008
|
+
function readWasmMemoryFromFile(file) {
|
|
12009
|
+
const fd = openSync2(file, "r");
|
|
12010
|
+
try {
|
|
12011
|
+
const total = fstatSync(fd).size;
|
|
12012
|
+
const header = Buffer.allocUnsafe(8);
|
|
12013
|
+
if (total < 8 || readSync2(fd, header, 0, 8, 0) < 8) return void 0;
|
|
12014
|
+
let offset = 8;
|
|
12015
|
+
const probe = Buffer.allocUnsafe(16);
|
|
12016
|
+
let prefixEnd = 8;
|
|
12017
|
+
while (offset < total) {
|
|
12018
|
+
const read = readSync2(fd, probe, 0, Math.min(16, total - offset), offset);
|
|
12019
|
+
if (read < 2) break;
|
|
12020
|
+
const id = probe[0];
|
|
12021
|
+
let size = 0;
|
|
12022
|
+
let shift = 0;
|
|
12023
|
+
let at = 1;
|
|
12024
|
+
for (; ; ) {
|
|
12025
|
+
const byte = probe[at++];
|
|
12026
|
+
size += (byte & 127) * 2 ** shift;
|
|
12027
|
+
if (!(byte & 128)) break;
|
|
12028
|
+
shift += 7;
|
|
12029
|
+
}
|
|
12030
|
+
const next = offset + at + size;
|
|
12031
|
+
if (id === 2 || id === 5) prefixEnd = next;
|
|
12032
|
+
if (id > 5) break;
|
|
12033
|
+
offset = next;
|
|
12034
|
+
}
|
|
12035
|
+
const prefix = Buffer.allocUnsafe(prefixEnd);
|
|
12036
|
+
let filled = 0;
|
|
12037
|
+
while (filled < prefixEnd) {
|
|
12038
|
+
const n = readSync2(fd, prefix, filled, prefixEnd - filled, filled);
|
|
12039
|
+
if (n <= 0) break;
|
|
12040
|
+
filled += n;
|
|
12041
|
+
}
|
|
12042
|
+
return readWasmMemory(prefix.subarray(0, filled));
|
|
12043
|
+
} finally {
|
|
12044
|
+
closeSync2(fd);
|
|
12045
|
+
}
|
|
12046
|
+
}
|
|
11979
12047
|
async function runWasmOpt(file, output, optimize, skipPasses, binary, sdkTableEnd, wideExports) {
|
|
11980
12048
|
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
11981
12049
|
const requestedCores = Number(process.env.BINARYEN_CORES);
|
|
@@ -11992,25 +12060,75 @@ async function runWasmOpt(file, output, optimize, skipPasses, binary, sdkTableEn
|
|
|
11992
12060
|
return;
|
|
11993
12061
|
}
|
|
11994
12062
|
const optimizeSize = optimize === true || optimize === "app-module";
|
|
11995
|
-
const optimizeBeforeGuard = optimize === true;
|
|
11996
12063
|
const relink = optimize === "relink";
|
|
11997
|
-
const
|
|
11998
|
-
const
|
|
11999
|
-
let input = readFileSync10(file);
|
|
12000
|
-
const memory = readWasmMemory(input);
|
|
12001
|
-
const checked = `${output}.stack-checked`;
|
|
12064
|
+
const keepNames = !optimizeSize && !relink || KEEP_WASM_NAMES;
|
|
12065
|
+
const memory = readWasmMemoryFromFile(file);
|
|
12002
12066
|
if (memory?.shared && memory.maximumPages !== 65536)
|
|
12003
12067
|
throw new Error("threaded native memory must declare a 65536-page maximum");
|
|
12004
|
-
if (memory?.shared
|
|
12005
|
-
|
|
12006
|
-
|
|
12007
|
-
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
"
|
|
12068
|
+
if (memory?.shared) {
|
|
12069
|
+
const wideExportsFile = wideExports.size ? `${output}.wide-exports` : void 0;
|
|
12070
|
+
const tableTool = join(dirname(binary), "wasm-table-guard");
|
|
12071
|
+
try {
|
|
12072
|
+
if (wideExportsFile)
|
|
12073
|
+
writeFileSync4(wideExportsFile, [...wideExports].join("\n") + "\n");
|
|
12074
|
+
const pipelineArgs = [
|
|
12075
|
+
"--pipeline",
|
|
12076
|
+
"--in",
|
|
12077
|
+
file,
|
|
12078
|
+
"--out",
|
|
12079
|
+
output,
|
|
12080
|
+
"--narrow",
|
|
12081
|
+
...wideExportsFile ? ["--wide-exports-file", wideExportsFile] : [],
|
|
12082
|
+
"--lower",
|
|
12083
|
+
"--shared",
|
|
12084
|
+
...keepNames ? ["--debug"] : [],
|
|
12085
|
+
...sdkTableEnd !== void 0 ? ["--slots-range", "1", String(sdkTableEnd), "--adapt"] : [],
|
|
12086
|
+
...optimizeSize ? ["--optimize", "oz"] : relink ? ["--optimize", "relink"] : [],
|
|
12087
|
+
...skipPasses.flatMap((pass) => ["--skip-pass", pass])
|
|
12088
|
+
];
|
|
12089
|
+
const { stdout } = await runBinaryen(tableTool, pipelineArgs, { env: environment });
|
|
12090
|
+
const metadata = JSON.parse(stdout);
|
|
12091
|
+
if (typeof metadata !== "object" || metadata === null || !("tableMinimum" in metadata) || typeof metadata.tableMinimum !== "number" || !Number.isSafeInteger(metadata.tableMinimum) || metadata.tableMinimum < 0)
|
|
12092
|
+
throw new Error("native table tool returned an invalid table minimum");
|
|
12093
|
+
const sectionName = new TextEncoder().encode(NATIVE_IMAGE_SECTION);
|
|
12094
|
+
const layout2 = new TextEncoder().encode(
|
|
12095
|
+
JSON.stringify({
|
|
12096
|
+
initialPages: memory.initialPages,
|
|
12097
|
+
tableMinimum: metadata.tableMinimum
|
|
12098
|
+
})
|
|
12012
12099
|
);
|
|
12100
|
+
const encode = (value) => {
|
|
12101
|
+
const bytes2 = [];
|
|
12102
|
+
do {
|
|
12103
|
+
const byte = value & 127;
|
|
12104
|
+
value >>>= 7;
|
|
12105
|
+
bytes2.push(byte | (value ? 128 : 0));
|
|
12106
|
+
} while (value);
|
|
12107
|
+
return bytes2;
|
|
12108
|
+
};
|
|
12109
|
+
const body = new Uint8Array([
|
|
12110
|
+
...encode(sectionName.length),
|
|
12111
|
+
...sectionName,
|
|
12112
|
+
...layout2
|
|
12113
|
+
]);
|
|
12114
|
+
const bytes = readFileSync10(output);
|
|
12115
|
+
writeFileSync4(
|
|
12116
|
+
output,
|
|
12117
|
+
Buffer.concat([
|
|
12118
|
+
sdkTableEnd === void 0 ? withWasmTableMinimum(
|
|
12119
|
+
bytes,
|
|
12120
|
+
metadata.tableMinimum + NATIVE_TABLE_RESERVE_SLOTS
|
|
12121
|
+
) : bytes,
|
|
12122
|
+
Buffer.from([0, ...encode(body.length), ...body])
|
|
12123
|
+
])
|
|
12124
|
+
);
|
|
12125
|
+
} finally {
|
|
12126
|
+
if (wideExportsFile) rmSync4(wideExportsFile, { force: true });
|
|
12127
|
+
}
|
|
12128
|
+
return;
|
|
12013
12129
|
}
|
|
12130
|
+
const outputNames = keepNames ? ["-g"] : [];
|
|
12131
|
+
const input = readFileSync10(file);
|
|
12014
12132
|
const narrowed = narrowWasmBoundary(input, wideExports);
|
|
12015
12133
|
const merged = `${output}.narrowed`;
|
|
12016
12134
|
if (narrowed) {
|
|
@@ -12022,7 +12140,7 @@ async function runWasmOpt(file, output, optimize, skipPasses, binary, sdkTableEn
|
|
|
12022
12140
|
join(dirname(binary), "wasm-merge"),
|
|
12023
12141
|
[
|
|
12024
12142
|
...features,
|
|
12025
|
-
...
|
|
12143
|
+
...outputNames,
|
|
12026
12144
|
guest,
|
|
12027
12145
|
NARROW_MERGE_NAMES.guest,
|
|
12028
12146
|
thunks,
|
|
@@ -12036,118 +12154,25 @@ async function runWasmOpt(file, output, optimize, skipPasses, binary, sdkTableEn
|
|
|
12036
12154
|
rmSync4(guest);
|
|
12037
12155
|
rmSync4(thunks);
|
|
12038
12156
|
}
|
|
12039
|
-
const
|
|
12040
|
-
const compiled = narrowed ? merged : memory?.shared && optimizeBeforeGuard ? checked : file;
|
|
12157
|
+
const compiled = narrowed ? merged : file;
|
|
12041
12158
|
const skip = skipPasses.flatMap((pass) => ["--skip-pass", pass]);
|
|
12042
12159
|
try {
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
);
|
|
12058
|
-
if (memory?.shared) {
|
|
12059
|
-
const guarded = `${output}.table.wasm`;
|
|
12060
|
-
const sdkGuarded = `${output}.sdk-table.wasm`;
|
|
12061
|
-
const sdkSlots = `${output}.sdk-table-slots`;
|
|
12062
|
-
const tableTool = join(dirname(binary), "wasm-table-guard");
|
|
12063
|
-
try {
|
|
12064
|
-
const { stdout } = await runBinaryen(
|
|
12065
|
-
tableTool,
|
|
12066
|
-
[
|
|
12067
|
-
optimizeBeforeGuard ? lowered : compiled,
|
|
12068
|
-
guarded,
|
|
12069
|
-
names.length ? "1" : "0",
|
|
12070
|
-
...optimizeBeforeGuard ? [] : ["lower"]
|
|
12071
|
-
],
|
|
12072
|
-
{ env: environment }
|
|
12073
|
-
);
|
|
12074
|
-
const metadata = JSON.parse(stdout);
|
|
12075
|
-
if (typeof metadata !== "object" || metadata === null || !("tableMinimum" in metadata) || typeof metadata.tableMinimum !== "number" || !Number.isSafeInteger(metadata.tableMinimum) || metadata.tableMinimum < 0)
|
|
12076
|
-
throw new Error("native table tool returned an invalid table minimum");
|
|
12077
|
-
if (sdkTableEnd !== void 0) {
|
|
12078
|
-
writeFileSync4(
|
|
12079
|
-
sdkSlots,
|
|
12080
|
-
Array.from({ length: sdkTableEnd - 1 }, (_, index) => index + 1).join("\n")
|
|
12081
|
-
);
|
|
12082
|
-
await runBinaryen(
|
|
12083
|
-
tableTool,
|
|
12084
|
-
[guarded, sdkGuarded, names.length ? "1" : "0", "0", sdkSlots, "adapt"],
|
|
12085
|
-
{ env: environment }
|
|
12086
|
-
);
|
|
12087
|
-
renameSync3(sdkGuarded, guarded);
|
|
12088
|
-
}
|
|
12089
|
-
if (optimize)
|
|
12090
|
-
await runBinaryen(
|
|
12091
|
-
binary,
|
|
12092
|
-
[
|
|
12093
|
-
...features,
|
|
12094
|
-
// an adapted call tests its target's type with a typed function reference.
|
|
12095
|
-
...sdkTableEnd === void 0 ? [] : ["--enable-gc"],
|
|
12096
|
-
...optimizeSize ? ["-Oz"] : RELINK_PASSES,
|
|
12097
|
-
...outputNames,
|
|
12098
|
-
...skip,
|
|
12099
|
-
guarded,
|
|
12100
|
-
"-o",
|
|
12101
|
-
output
|
|
12102
|
-
],
|
|
12103
|
-
{ env: environment }
|
|
12104
|
-
);
|
|
12105
|
-
const sectionName = new TextEncoder().encode(NATIVE_IMAGE_SECTION);
|
|
12106
|
-
const layout2 = new TextEncoder().encode(
|
|
12107
|
-
JSON.stringify({
|
|
12108
|
-
initialPages: memory.initialPages,
|
|
12109
|
-
tableMinimum: metadata.tableMinimum
|
|
12110
|
-
})
|
|
12111
|
-
);
|
|
12112
|
-
const encode = (value) => {
|
|
12113
|
-
const bytes2 = [];
|
|
12114
|
-
do {
|
|
12115
|
-
const byte = value & 127;
|
|
12116
|
-
value >>>= 7;
|
|
12117
|
-
bytes2.push(byte | (value ? 128 : 0));
|
|
12118
|
-
} while (value);
|
|
12119
|
-
return bytes2;
|
|
12120
|
-
};
|
|
12121
|
-
const body = new Uint8Array([
|
|
12122
|
-
...encode(sectionName.length),
|
|
12123
|
-
...sectionName,
|
|
12124
|
-
...layout2
|
|
12125
|
-
]);
|
|
12126
|
-
const image = optimize ? output : guarded;
|
|
12127
|
-
const bytes = readFileSync10(image);
|
|
12128
|
-
writeFileSync4(
|
|
12129
|
-
image,
|
|
12130
|
-
Buffer.concat([
|
|
12131
|
-
sdkTableEnd === void 0 ? withWasmTableMinimum(
|
|
12132
|
-
bytes,
|
|
12133
|
-
metadata.tableMinimum + NATIVE_TABLE_RESERVE_SLOTS
|
|
12134
|
-
) : bytes,
|
|
12135
|
-
Buffer.from([0, ...encode(body.length), ...body])
|
|
12136
|
-
])
|
|
12137
|
-
);
|
|
12138
|
-
if (!optimize) renameSync3(guarded, output);
|
|
12139
|
-
} finally {
|
|
12140
|
-
rmSync4(guarded, { force: true });
|
|
12141
|
-
rmSync4(sdkGuarded, { force: true });
|
|
12142
|
-
rmSync4(sdkSlots, { force: true });
|
|
12143
|
-
}
|
|
12144
|
-
}
|
|
12160
|
+
await runBinaryen(
|
|
12161
|
+
binary,
|
|
12162
|
+
[
|
|
12163
|
+
...LOWERING,
|
|
12164
|
+
...optimizeSize ? ["-Oz"] : relink ? RELINK_PASSES : [],
|
|
12165
|
+
...outputNames,
|
|
12166
|
+
...skip,
|
|
12167
|
+
...features,
|
|
12168
|
+
compiled,
|
|
12169
|
+
"-o",
|
|
12170
|
+
output
|
|
12171
|
+
],
|
|
12172
|
+
{ env: environment, maxBuffer: Infinity }
|
|
12173
|
+
);
|
|
12145
12174
|
} finally {
|
|
12146
12175
|
if (narrowed) rmSync4(merged, { force: true });
|
|
12147
|
-
if (memory?.shared) {
|
|
12148
|
-
rmSync4(checked, { force: true });
|
|
12149
|
-
rmSync4(lowered, { force: true });
|
|
12150
|
-
}
|
|
12151
12176
|
}
|
|
12152
12177
|
}
|
|
12153
12178
|
async function installWasmOpt() {
|
|
@@ -13488,7 +13513,7 @@ import {
|
|
|
13488
13513
|
mkdirSync as mkdirSync4,
|
|
13489
13514
|
readFileSync as readFileSync11,
|
|
13490
13515
|
realpathSync as realpathSync2,
|
|
13491
|
-
renameSync as
|
|
13516
|
+
renameSync as renameSync3,
|
|
13492
13517
|
statSync,
|
|
13493
13518
|
writeFileSync as writeFileSync5
|
|
13494
13519
|
} from "node:fs";
|
|
@@ -13831,7 +13856,7 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
13831
13856
|
validateClangLinkOptions(flags);
|
|
13832
13857
|
const temporary = `${cacheFile}.${process.pid}`;
|
|
13833
13858
|
writeFileSync5(temporary, JSON.stringify({ key, flags }));
|
|
13834
|
-
|
|
13859
|
+
renameSync3(temporary, cacheFile);
|
|
13835
13860
|
result.set(file, flags);
|
|
13836
13861
|
}
|
|
13837
13862
|
return result;
|
|
@@ -14387,7 +14412,7 @@ async function compileGuestLink(options) {
|
|
|
14387
14412
|
};
|
|
14388
14413
|
const sdk = options.sdkImage;
|
|
14389
14414
|
const sdkCallers = sdk?.sdkInterface.guestCallers;
|
|
14390
|
-
const sdkObjects = sdk ? (await import("./swift-sdk-image-
|
|
14415
|
+
const sdkObjects = sdk ? (await import("./swift-sdk-image-HJLWK2B6.mjs")).readSwiftSdkManifestIndex(sdk).guestObjects : void 0;
|
|
14391
14416
|
if (sdk && (!sdkCallers || !sdkObjects))
|
|
14392
14417
|
throw new Error("the SDK image has no guest link manifest");
|
|
14393
14418
|
const result = linkPrunedGuestImages({
|
|
@@ -14681,7 +14706,7 @@ async function compileGuestLink(options) {
|
|
|
14681
14706
|
linkSwiftAppModule,
|
|
14682
14707
|
readSwiftSdkUsage,
|
|
14683
14708
|
swiftSdkProjectionSpans
|
|
14684
|
-
} = await import("./swift-sdk-app-module-
|
|
14709
|
+
} = await import("./swift-sdk-app-module-A2ZJMCBX.mjs");
|
|
14685
14710
|
const project = options.project;
|
|
14686
14711
|
const work = project ? mkdtempSync2(path24.join(directory, "app-module-")) : path24.join(directory, "app-module");
|
|
14687
14712
|
if (project) chownSync(work, project.uid, project.gid);
|
|
@@ -14761,7 +14786,6 @@ async function compileGuestLink(options) {
|
|
|
14761
14786
|
bindingRows.set((address - values.address) / 8, value);
|
|
14762
14787
|
} else data.push(address, size, value);
|
|
14763
14788
|
}
|
|
14764
|
-
const binding = createSwiftSdkBinding({ ...link.linkage, data }, sdk, usage);
|
|
14765
14789
|
const linked = readFileSync13(
|
|
14766
14790
|
project ? projectOutputFile(work, linkedModule, project) : linkedModule
|
|
14767
14791
|
);
|
|
@@ -14786,7 +14810,17 @@ async function compileGuestLink(options) {
|
|
|
14786
14810
|
);
|
|
14787
14811
|
continue;
|
|
14788
14812
|
}
|
|
14789
|
-
|
|
14813
|
+
const lowerPromise = link.lower();
|
|
14814
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
14815
|
+
let binding;
|
|
14816
|
+
try {
|
|
14817
|
+
binding = createSwiftSdkBinding({ ...link.linkage, data }, sdk, usage);
|
|
14818
|
+
} catch (error) {
|
|
14819
|
+
await lowerPromise.catch(() => {
|
|
14820
|
+
});
|
|
14821
|
+
throw error;
|
|
14822
|
+
}
|
|
14823
|
+
await lowerPromise;
|
|
14790
14824
|
const finalized = finalizeGuestProjectionStorage({
|
|
14791
14825
|
map: map2,
|
|
14792
14826
|
linked,
|
|
@@ -14839,7 +14873,7 @@ import {
|
|
|
14839
14873
|
mkdirSync as mkdirSync7,
|
|
14840
14874
|
mkdtempSync as mkdtempSync3,
|
|
14841
14875
|
readFileSync as readFileSync14,
|
|
14842
|
-
renameSync as
|
|
14876
|
+
renameSync as renameSync4,
|
|
14843
14877
|
rmSync as rmSync6,
|
|
14844
14878
|
statSync as statSync3,
|
|
14845
14879
|
writeFileSync as writeFileSync7
|
|
@@ -14972,7 +15006,7 @@ async function withSwiftHeaderCompiler(root, toolchainBin, recipe, producers, bu
|
|
|
14972
15006
|
producer.publish();
|
|
14973
15007
|
if (fingerprint) {
|
|
14974
15008
|
writeFileSync7(`${receipt}.partial`, fingerprint);
|
|
14975
|
-
|
|
15009
|
+
renameSync4(`${receipt}.partial`, receipt);
|
|
14976
15010
|
}
|
|
14977
15011
|
response.end();
|
|
14978
15012
|
} catch (error) {
|
|
@@ -16186,7 +16220,7 @@ function swiftDistributionCompileView(moduleRoot, distribution) {
|
|
|
16186
16220
|
copyFileSync2(path33.join(moduleRoot, file), destination);
|
|
16187
16221
|
}
|
|
16188
16222
|
try {
|
|
16189
|
-
|
|
16223
|
+
renameSync5(staging, view);
|
|
16190
16224
|
} catch (error) {
|
|
16191
16225
|
if (!existsSync10(view)) throw error;
|
|
16192
16226
|
}
|
|
@@ -16434,7 +16468,7 @@ function swiftObjCSelectorOptions(moduleRoot) {
|
|
|
16434
16468
|
mkdirSync8(path33.dirname(map), { recursive: true });
|
|
16435
16469
|
const partial = `${map}.${randomUUID5()}`;
|
|
16436
16470
|
writeFileSync8(partial, content);
|
|
16437
|
-
|
|
16471
|
+
renameSync5(partial, map);
|
|
16438
16472
|
}
|
|
16439
16473
|
}
|
|
16440
16474
|
return ["-Xswiftc", "-Xllvm", "-Xswiftc", `-peach-objc-selector-map=${map}`];
|
|
@@ -16645,7 +16679,7 @@ function swiftModuleDigest(root) {
|
|
|
16645
16679
|
mkdirSync8(path33.dirname(target), { recursive: true });
|
|
16646
16680
|
const partial = `${target}.${process.pid}.${randomUUID5()}`;
|
|
16647
16681
|
writeFileSync8(partial, body);
|
|
16648
|
-
|
|
16682
|
+
renameSync5(partial, target);
|
|
16649
16683
|
};
|
|
16650
16684
|
if (existsSync10(record)) {
|
|
16651
16685
|
const saved = JSON.parse(readFileSync16(record, "utf8"));
|
|
@@ -17351,7 +17385,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
17351
17385
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
17352
17386
|
var MULTI_MANIFEST_VERSION = 76;
|
|
17353
17387
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
17354
|
-
var compilerSourceDigest = true ? "
|
|
17388
|
+
var compilerSourceDigest = true ? "834b5c28c27bc5807cbb3c4eed5c44f7de81d47db3e3a8819bea6e6635689b24" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
17355
17389
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
17356
17390
|
return swiftCompileInputHash(input, release).update(swiftModuleDigest(moduleRoot)).digest("hex");
|
|
17357
17391
|
}
|
|
@@ -21214,7 +21248,7 @@ function saveCompiledArtifact(root, artifact) {
|
|
|
21214
21248
|
const outputs = ["app.wasm", "icu.gz"];
|
|
21215
21249
|
if (artifact.sdk) outputs.push("sdk-binding.bin");
|
|
21216
21250
|
for (const file of [...outputs, "artifact.json"]) {
|
|
21217
|
-
|
|
21251
|
+
renameSync5(path33.join(pending, file), path33.join(directory, file));
|
|
21218
21252
|
}
|
|
21219
21253
|
} finally {
|
|
21220
21254
|
rmSync7(pending, { recursive: true, force: true });
|
|
@@ -21269,7 +21303,7 @@ function pruneSharedArtifacts(parent, keep) {
|
|
|
21269
21303
|
);
|
|
21270
21304
|
try {
|
|
21271
21305
|
if (statSync4(entry.directory).mtimeMs !== entry.used) continue;
|
|
21272
|
-
|
|
21306
|
+
renameSync5(entry.directory, retired);
|
|
21273
21307
|
} catch (error) {
|
|
21274
21308
|
if (vanished(error)) continue;
|
|
21275
21309
|
throw error;
|
|
@@ -21783,7 +21817,7 @@ ${args.frameworkKey}`, scratch, [
|
|
|
21783
21817
|
archived: [...archived.entries()]
|
|
21784
21818
|
})
|
|
21785
21819
|
);
|
|
21786
|
-
|
|
21820
|
+
renameSync5(partialReceipt, receiptFile);
|
|
21787
21821
|
return result;
|
|
21788
21822
|
}
|
|
21789
21823
|
var SWIFT_LINK_STAMP = ".peach-link-stamp";
|
|
@@ -21901,7 +21935,7 @@ function mirrorTree2(source, target, skip) {
|
|
|
21901
21935
|
const partial = `${to}.${randomUUID5()}`;
|
|
21902
21936
|
copyFileSync2(from, partial);
|
|
21903
21937
|
if (stat.mtimeMs > Date.now()) utimesSync(partial, stat.atime, stat.mtime);
|
|
21904
|
-
|
|
21938
|
+
renameSync5(partial, to);
|
|
21905
21939
|
}
|
|
21906
21940
|
}
|
|
21907
21941
|
for (const name of readdirSync6(target))
|
|
@@ -22058,7 +22092,7 @@ async function compileSwiftProjectOnce(sources, options) {
|
|
|
22058
22092
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
22059
22093
|
const mirrorDistribution = options.linkOnly || options.project ? null : distribution;
|
|
22060
22094
|
if (distribution) refreshSwiftCacheHold(moduleRoot);
|
|
22061
|
-
const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-
|
|
22095
|
+
const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-2FFVA7SB.mjs")).useSwiftPackagePrebuilts(
|
|
22062
22096
|
sources,
|
|
22063
22097
|
moduleRoot,
|
|
22064
22098
|
options.toolchainBin
|
|
@@ -22072,7 +22106,7 @@ async function compileSwiftProjectOnce(sources, options) {
|
|
|
22072
22106
|
multi: compileTargets(input).length > 0
|
|
22073
22107
|
};
|
|
22074
22108
|
const sdkModule = options.sdkModule && !options.linkOnly;
|
|
22075
|
-
const sdkImage = sdkModule ? await (await import("./swift-sdk-image-
|
|
22109
|
+
const sdkImage = sdkModule ? await (await import("./swift-sdk-image-HJLWK2B6.mjs")).buildSwiftSdkImage(
|
|
22076
22110
|
moduleRoot,
|
|
22077
22111
|
!!guestGraph,
|
|
22078
22112
|
distribution ? [] : linkedFrameworkTargets(moduleRoot, input).imports,
|
|
@@ -22627,7 +22661,7 @@ ${cap}` : "";
|
|
|
22627
22661
|
throw new Error(`missing Swift headers after building ${target}`);
|
|
22628
22662
|
mkdirSync8(checkpoints, { recursive: true });
|
|
22629
22663
|
writeFileSync8(`${receipt}.partial`, checkpoint);
|
|
22630
|
-
|
|
22664
|
+
renameSync5(`${receipt}.partial`, receipt);
|
|
22631
22665
|
}
|
|
22632
22666
|
}
|
|
22633
22667
|
await runCompiler(
|
|
@@ -22754,7 +22788,7 @@ ${cap}` : "";
|
|
|
22754
22788
|
if (sdkImage && binding)
|
|
22755
22789
|
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
22756
22790
|
} else if (sdkImage) {
|
|
22757
|
-
const { buildSwiftAppModule } = await import("./swift-sdk-app-module-
|
|
22791
|
+
const { buildSwiftAppModule } = await import("./swift-sdk-app-module-A2ZJMCBX.mjs");
|
|
22758
22792
|
const binding = await buildSwiftAppModule({
|
|
22759
22793
|
buildRoot: root,
|
|
22760
22794
|
toolchainBin: options.toolchainBin,
|