peachsim 0.1.2590 → 0.1.2591
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 +323 -93
- 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-65FNEARV.mjs → acorn-EMX4WZ72.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-NZY4GOG5.mjs → chunk-4QHHRGO4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SRFKOU76.mjs → chunk-7627LKJK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BZS5SIYK.mjs → chunk-AKKHSVJ4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WPDY5IAD.mjs → chunk-EGKH2L6J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JG4AANWA.mjs → chunk-ILWFGZWW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SLPXTLBK.mjs → chunk-J676B57D.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-ADKUIQXX.mjs → chunk-JHXDM3YU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RGC2JNCL.mjs → chunk-MC6NMYWY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HZTK7TP5.mjs → chunk-NX23AMX4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2GUB5OLB.mjs → chunk-Q4NA6PUR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-EFKDUMB5.mjs → chunk-QBMFX3J2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-462CWTWI.mjs → chunk-RKQZGWX2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5GNGHM5B.mjs → chunk-SOAYP72T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YPPH6F77.mjs → chunk-TFG4LZ5T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OZJ66CXY.mjs → chunk-UIVXVMS5.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-X2EKFONU.mjs → chunk-UYJXLDCG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-N2II5SRJ.mjs → chunk-VD27WNCT.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-V5TTEXYO.mjs → chunk-VF5WVB3D.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WYDRQRJL.mjs → chunk-VRVXRZI4.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-4VCRUQ36.mjs → chunk-VYZ5DC3M.mjs} +194 -48
- package/dist-lib/esm-chunks/{chunk-GBD26EBV.mjs → chunk-YR6DNV76.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XE3VHAU2.mjs → chunk-ZL5N6ENT.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-CRI3GMCM.mjs → metro-layout-parser-ANKZARNW.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-5XDZ2HZZ.mjs → swift-package-prebuilt-4N5CXBOZ.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-6H3G6AXD.mjs → swift-sdk-app-module-5IUSRXYA.mjs} +151 -67
- package/dist-lib/esm-chunks/{swift-sdk-image-WAC7GG2R.mjs → swift-sdk-image-7T2LMQS5.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-B3L27QTG.mjs → swift-sdk-image-producer-7QJ3BF6E.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +322 -92
- 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 +323 -93
- package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
- 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 +2 -2
- 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 +69 -69
- 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 +323 -93
- package/dist-lib/swift-compile.cjs +320 -90
- 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/swift-guest-compile.ts +41 -8
- package/src/swift-guest-link.ts +3 -0
- package/src/swift-guest-source-inputs.ts +158 -30
- package/src/swift-sdk-app-module.ts +146 -59
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2591 | (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;
|
|
@@ -14354,6 +14354,7 @@ function linkGuestImages(options) {
|
|
|
14354
14354
|
{ stdio: "pipe" }
|
|
14355
14355
|
);
|
|
14356
14356
|
finalTrace = linkFinal(projectionObject, callerMap ? void 0 : layoutMap);
|
|
14357
|
+
if (sharedSdk) break;
|
|
14357
14358
|
const wasm = import_node_fs24.default.readFileSync(finalOutput);
|
|
14358
14359
|
const actual = guestProjectionRegionCounts(
|
|
14359
14360
|
images.length,
|
|
@@ -15116,6 +15117,85 @@ function clangProducerStamp(file) {
|
|
|
15116
15117
|
const stat = (0, import_node_fs25.statSync)(file, { bigint: true });
|
|
15117
15118
|
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
15118
15119
|
}
|
|
15120
|
+
function clangBinaryStamp(file) {
|
|
15121
|
+
const stat = (0, import_node_fs25.statSync)(file, { bigint: true });
|
|
15122
|
+
return [file, stat.size, stat.mtimeNs].join(":");
|
|
15123
|
+
}
|
|
15124
|
+
function clangWrapperStamp(file) {
|
|
15125
|
+
return (0, import_node_crypto17.createHash)("sha256").update((0, import_node_fs25.readFileSync)(file)).digest("hex");
|
|
15126
|
+
}
|
|
15127
|
+
function clangArgsNeedCwd(args) {
|
|
15128
|
+
const pathFlags = /* @__PURE__ */ new Set([
|
|
15129
|
+
"-I",
|
|
15130
|
+
"-isystem",
|
|
15131
|
+
"-iquote",
|
|
15132
|
+
"-F",
|
|
15133
|
+
"-iframework",
|
|
15134
|
+
"-isysroot",
|
|
15135
|
+
"-o",
|
|
15136
|
+
"-MF"
|
|
15137
|
+
]);
|
|
15138
|
+
const includeFlags = /* @__PURE__ */ new Set(["-include", "-imacros"]);
|
|
15139
|
+
const valueFlags = /* @__PURE__ */ new Set([
|
|
15140
|
+
"-x",
|
|
15141
|
+
"-target",
|
|
15142
|
+
"-MT",
|
|
15143
|
+
"-MQ",
|
|
15144
|
+
"-D",
|
|
15145
|
+
"-U",
|
|
15146
|
+
"-mllvm",
|
|
15147
|
+
"-Xclang",
|
|
15148
|
+
"-arch",
|
|
15149
|
+
"-std"
|
|
15150
|
+
]);
|
|
15151
|
+
const prefixFlags = [
|
|
15152
|
+
"-I",
|
|
15153
|
+
"-F",
|
|
15154
|
+
"-isystem",
|
|
15155
|
+
"-iquote",
|
|
15156
|
+
"--sysroot=",
|
|
15157
|
+
"-fmodule-map-file=",
|
|
15158
|
+
"-fmodules-cache-path="
|
|
15159
|
+
];
|
|
15160
|
+
const isRelativePath = (value) => value.length > 0 && !value.startsWith("/") && !value.startsWith("=/") && value !== "-";
|
|
15161
|
+
for (let i = 1; i < args.length; i++) {
|
|
15162
|
+
const arg = args[i];
|
|
15163
|
+
if (pathFlags.has(arg)) {
|
|
15164
|
+
if (isRelativePath(args[++i] ?? "")) return true;
|
|
15165
|
+
continue;
|
|
15166
|
+
}
|
|
15167
|
+
if (includeFlags.has(arg)) {
|
|
15168
|
+
const value = args[++i] ?? "";
|
|
15169
|
+
if (isRelativePath(value) && (value.includes("/") || (0, import_node_fs25.existsSync)(value))) return true;
|
|
15170
|
+
continue;
|
|
15171
|
+
}
|
|
15172
|
+
if (valueFlags.has(arg)) {
|
|
15173
|
+
i++;
|
|
15174
|
+
continue;
|
|
15175
|
+
}
|
|
15176
|
+
if (arg.startsWith("@")) {
|
|
15177
|
+
if (isRelativePath(arg.slice(1))) return true;
|
|
15178
|
+
continue;
|
|
15179
|
+
}
|
|
15180
|
+
if (arg.startsWith("-")) {
|
|
15181
|
+
if (arg.startsWith("-include") && arg.length > 8) {
|
|
15182
|
+
const value = arg.slice(8);
|
|
15183
|
+
if (isRelativePath(value) && (value.includes("/") || (0, import_node_fs25.existsSync)(value)))
|
|
15184
|
+
return true;
|
|
15185
|
+
continue;
|
|
15186
|
+
}
|
|
15187
|
+
for (const prefix of prefixFlags) {
|
|
15188
|
+
if (arg.startsWith(prefix) && arg.length > prefix.length) {
|
|
15189
|
+
if (isRelativePath(arg.slice(prefix.length))) return true;
|
|
15190
|
+
break;
|
|
15191
|
+
}
|
|
15192
|
+
}
|
|
15193
|
+
continue;
|
|
15194
|
+
}
|
|
15195
|
+
if (isRelativePath(arg)) return true;
|
|
15196
|
+
}
|
|
15197
|
+
return false;
|
|
15198
|
+
}
|
|
15119
15199
|
function validateClangLinkOptions(flags) {
|
|
15120
15200
|
for (let index = 0; index < flags.length; index++) {
|
|
15121
15201
|
const flag = flags[index];
|
|
@@ -15195,7 +15275,7 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
15195
15275
|
let clang;
|
|
15196
15276
|
let clangStamp;
|
|
15197
15277
|
let wrapperStamp;
|
|
15198
|
-
for (const
|
|
15278
|
+
for (const file of wanted) {
|
|
15199
15279
|
const command = commands.get(file);
|
|
15200
15280
|
if (!command) throw new Error(`missing source object producer ${file}`);
|
|
15201
15281
|
if (command.tool === "shell") {
|
|
@@ -15209,12 +15289,12 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
15209
15289
|
throw new Error(`unsupported source object producer ${file}`);
|
|
15210
15290
|
const key = (0, import_node_crypto17.createHash)("sha256").update(
|
|
15211
15291
|
JSON.stringify([
|
|
15212
|
-
"clang-link-options/
|
|
15213
|
-
process.cwd(),
|
|
15292
|
+
"clang-link-options/v2",
|
|
15293
|
+
clangArgsNeedCwd(command.args) ? process.cwd() : null,
|
|
15214
15294
|
driverEnvironment,
|
|
15215
15295
|
command.args,
|
|
15216
|
-
clangStamp ??=
|
|
15217
|
-
compiler === clang ? null : wrapperStamp ??=
|
|
15296
|
+
clangStamp ??= clangBinaryStamp(clang),
|
|
15297
|
+
compiler === clang ? null : wrapperStamp ??= clangWrapperStamp(compiler),
|
|
15218
15298
|
clangProducerStamp(file)
|
|
15219
15299
|
])
|
|
15220
15300
|
).digest("hex");
|
|
@@ -15229,31 +15309,44 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
15229
15309
|
continue;
|
|
15230
15310
|
}
|
|
15231
15311
|
result.set(file, []);
|
|
15232
|
-
const args = command.args.slice(1).filter((arg) => arg !== "-c");
|
|
15233
15312
|
const targetBuild = import_node_path25.default.relative(options.buildDirectory, file).split(import_node_path25.default.sep).findLast((part) => part !== ".build" && part.endsWith(".build"));
|
|
15234
|
-
const
|
|
15235
|
-
|
|
15236
|
-
|
|
15237
|
-
)
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15313
|
+
const args = [];
|
|
15314
|
+
let sawOutput = false;
|
|
15315
|
+
let explicitModuleName = false;
|
|
15316
|
+
for (let i = 1; i < command.args.length; i++) {
|
|
15317
|
+
const arg = command.args[i];
|
|
15318
|
+
if (arg === "-c" || arg === "-MD" || arg === "-MMD" || arg === "-MP") continue;
|
|
15319
|
+
if (arg === "-MF" || arg === "-MT" || arg === "-MQ") {
|
|
15320
|
+
if (i + 1 >= command.args.length)
|
|
15321
|
+
throw new Error(`missing clang ${arg} for ${file}`);
|
|
15322
|
+
i++;
|
|
15323
|
+
continue;
|
|
15324
|
+
}
|
|
15325
|
+
if (arg === "-o") {
|
|
15326
|
+
if (i + 1 >= command.args.length) throw new Error(`missing clang -o for ${file}`);
|
|
15327
|
+
i++;
|
|
15328
|
+
args.push("-o", "-");
|
|
15329
|
+
sawOutput = true;
|
|
15330
|
+
continue;
|
|
15331
|
+
}
|
|
15332
|
+
if (arg.startsWith("-fmodule-name=")) explicitModuleName = true;
|
|
15333
|
+
args.push(arg);
|
|
15334
|
+
}
|
|
15335
|
+
if (!sawOutput) throw new Error(`missing clang -o for ${file}`);
|
|
15336
|
+
if (compiler !== clang && targetBuild && !explicitModuleName) {
|
|
15337
|
+
args.unshift(`-fmodule-name=${targetBuild.slice(0, -".build".length)}`);
|
|
15245
15338
|
}
|
|
15246
15339
|
replays.push({
|
|
15247
15340
|
file,
|
|
15248
15341
|
compiler: command.args[0],
|
|
15249
15342
|
args: [...args, "-S", "-emit-llvm", "-Xclang", "-disable-llvm-passes"],
|
|
15250
|
-
output,
|
|
15251
15343
|
cacheFile,
|
|
15252
15344
|
key
|
|
15253
15345
|
});
|
|
15254
15346
|
}
|
|
15255
15347
|
if (replays.length === 0) return result;
|
|
15256
15348
|
const plan = import_node_path25.default.join(options.directory, "clang-link-replays.json");
|
|
15349
|
+
const resultsPath = import_node_path25.default.join(options.directory, "clang-link-results.json");
|
|
15257
15350
|
(0, import_node_fs25.writeFileSync)(
|
|
15258
15351
|
plan,
|
|
15259
15352
|
JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
|
|
@@ -15266,12 +15359,16 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
15266
15359
|
...process.env,
|
|
15267
15360
|
[PEACH_FORKED_SCRIPT_ENV]: "1",
|
|
15268
15361
|
PEACH_CLANG_REPLAYS: plan,
|
|
15362
|
+
PEACH_CLANG_RESULTS: resultsPath,
|
|
15269
15363
|
PEACH_CLANG_JOBS: String(options.jobs)
|
|
15270
15364
|
}
|
|
15271
15365
|
});
|
|
15366
|
+
const replayMetadata = JSON.parse((0, import_node_fs25.readFileSync)(resultsPath, "utf8"));
|
|
15367
|
+
if (!Array.isArray(replayMetadata) || replayMetadata.length !== replays.length || !replayMetadata.every((item) => typeof item === "string"))
|
|
15368
|
+
throw new Error("invalid clang link replay results");
|
|
15272
15369
|
(0, import_node_fs25.mkdirSync)(cacheDirectory, { recursive: true });
|
|
15273
|
-
for (const { file,
|
|
15274
|
-
const flags = clangIrLinkOptions(
|
|
15370
|
+
for (const [index, { file, cacheFile, key }] of replays.entries()) {
|
|
15371
|
+
const flags = clangIrLinkOptions(replayMetadata[index]);
|
|
15275
15372
|
validateClangLinkOptions(flags);
|
|
15276
15373
|
const temporary = `${cacheFile}.${process.pid}`;
|
|
15277
15374
|
(0, import_node_fs25.writeFileSync)(temporary, JSON.stringify({ key, flags }));
|
|
@@ -15509,22 +15606,47 @@ var init_swift_guest_source_inputs = __esm({
|
|
|
15509
15606
|
CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
|
|
15510
15607
|
PARALLEL_REPLAY = `
|
|
15511
15608
|
const { spawn } = require('node:child_process')
|
|
15512
|
-
const
|
|
15609
|
+
const fs = require('node:fs')
|
|
15610
|
+
const commands = JSON.parse(fs.readFileSync(process.env.PEACH_CLANG_REPLAYS, 'utf8'))
|
|
15611
|
+
const results = new Array(commands.length)
|
|
15513
15612
|
let next = 0
|
|
15514
15613
|
const run = () => {
|
|
15515
15614
|
if (next >= commands.length) return Promise.resolve()
|
|
15516
|
-
const
|
|
15615
|
+
const index = next++
|
|
15616
|
+
const [file, ...args] = commands[index]
|
|
15517
15617
|
return new Promise((resolve, reject) => {
|
|
15518
|
-
const child = spawn(file, args, { stdio: 'inherit' })
|
|
15618
|
+
const child = spawn(file, args, { stdio: ['ignore', 'pipe', 'inherit'] })
|
|
15619
|
+
const metadata = []
|
|
15620
|
+
let pending = ''
|
|
15621
|
+
child.stdout.setEncoding('utf8')
|
|
15622
|
+
child.stdout.on('data', (chunk) => {
|
|
15623
|
+
const text = pending + chunk
|
|
15624
|
+
let start = 0
|
|
15625
|
+
for (let nl = text.indexOf('\\n'); nl !== -1; nl = text.indexOf('\\n', start)) {
|
|
15626
|
+
if (text.charCodeAt(start) === 33) metadata.push(text.slice(start, nl))
|
|
15627
|
+
start = nl + 1
|
|
15628
|
+
}
|
|
15629
|
+
pending = text.slice(start)
|
|
15630
|
+
})
|
|
15519
15631
|
child.on('error', reject)
|
|
15520
|
-
child.on('close', (code) =>
|
|
15632
|
+
child.on('close', (code) => {
|
|
15633
|
+
if (pending.charCodeAt(0) === 33) metadata.push(pending)
|
|
15634
|
+
if (code === 0) {
|
|
15635
|
+
results[index] = metadata.join('\\n')
|
|
15636
|
+
resolve()
|
|
15637
|
+
} else reject(new Error('clang link replay failed: ' + file))
|
|
15638
|
+
})
|
|
15521
15639
|
}).then(run)
|
|
15522
15640
|
}
|
|
15523
15641
|
const jobs = Math.max(1, Number(process.env.PEACH_CLANG_JOBS) || 1)
|
|
15524
|
-
Promise.all(Array.from({ length: jobs }, run))
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
})
|
|
15642
|
+
Promise.all(Array.from({ length: jobs }, run))
|
|
15643
|
+
.then(() => {
|
|
15644
|
+
fs.writeFileSync(process.env.PEACH_CLANG_RESULTS, JSON.stringify(results))
|
|
15645
|
+
})
|
|
15646
|
+
.catch((error) => {
|
|
15647
|
+
console.error(error.message)
|
|
15648
|
+
process.exit(1)
|
|
15649
|
+
})
|
|
15528
15650
|
`;
|
|
15529
15651
|
}
|
|
15530
15652
|
});
|
|
@@ -17325,6 +17447,7 @@ __export(swift_sdk_app_module_exports, {
|
|
|
17325
17447
|
readSwiftSdkUsage: () => readSwiftSdkUsage,
|
|
17326
17448
|
selectSwiftSdkData: () => selectSwiftSdkData,
|
|
17327
17449
|
swiftAppModuleInputs: () => swiftAppModuleInputs,
|
|
17450
|
+
swiftSdkProjectionSpans: () => swiftSdkProjectionSpans,
|
|
17328
17451
|
writeSwiftSdkAppLink: () => writeSwiftSdkAppLink
|
|
17329
17452
|
});
|
|
17330
17453
|
async function buildSwiftAppModule(options) {
|
|
@@ -17440,15 +17563,18 @@ async function compileSdkForwarders(inputs, sdk, toolchainBin, output, project,
|
|
|
17440
17563
|
index++;
|
|
17441
17564
|
}
|
|
17442
17565
|
const errno = tls.errno;
|
|
17566
|
+
let declaredErrno = false;
|
|
17443
17567
|
for (const name3 of referenced) {
|
|
17444
17568
|
const offset = tls[name3];
|
|
17445
17569
|
if (offset === void 0 || defined.has(name3)) continue;
|
|
17446
17570
|
if (errno === void 0 || signatures.__errno_location !== ":j")
|
|
17447
17571
|
throw new Error("the sdk image has no errno to find its thread block by");
|
|
17448
|
-
if (!
|
|
17572
|
+
if (!declaredErrno) {
|
|
17573
|
+
declaredErrno = true;
|
|
17449
17574
|
lines.push(
|
|
17450
17575
|
`__attribute__((import_module("env"), import_name("__errno_location"))) char *__peach_errno(void);`
|
|
17451
17576
|
);
|
|
17577
|
+
}
|
|
17452
17578
|
lines.push(
|
|
17453
17579
|
`__attribute__((weak)) _Thread_local char t${index} __asm__(${literal2(name3)});`,
|
|
17454
17580
|
`__attribute__((used)) long long h${index}(void) __asm__(${literal2(SDK_TLS_HELPER + name3)});`,
|
|
@@ -17824,6 +17950,20 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17824
17950
|
symbols.filter((symbol) => symbol.kind === 0 && symbol.name.startsWith(SDK_TLS_HELPER)).map((symbol) => [symbol.name.slice(SDK_TLS_HELPER.length), symbol.index])
|
|
17825
17951
|
);
|
|
17826
17952
|
const segments = guestWasmDataSegments(bytes, false);
|
|
17953
|
+
const segmentsByOffset = [...segments].sort((a, b) => a.offset - b.offset);
|
|
17954
|
+
const segmentNameSet = new Set(segmentNames);
|
|
17955
|
+
const findSegmentByOffset = (at, size) => {
|
|
17956
|
+
let lo = 0;
|
|
17957
|
+
let hi = segmentsByOffset.length - 1;
|
|
17958
|
+
while (lo <= hi) {
|
|
17959
|
+
const mid = lo + hi >> 1;
|
|
17960
|
+
const entry = segmentsByOffset[mid];
|
|
17961
|
+
if (at < entry.offset) hi = mid - 1;
|
|
17962
|
+
else if (at >= entry.offset + entry.length) lo = mid + 1;
|
|
17963
|
+
else return at + size <= entry.offset + entry.length ? entry : void 0;
|
|
17964
|
+
}
|
|
17965
|
+
return void 0;
|
|
17966
|
+
};
|
|
17827
17967
|
const tdata = segmentNames.indexOf(".tdata");
|
|
17828
17968
|
const tlsTemplate = tdata < 0 ? void 0 : passiveSegments(bytes)[tdata];
|
|
17829
17969
|
const tlsStart = tlsTemplate && tlsTemplate.byteOffset - bytes.byteOffset;
|
|
@@ -17888,7 +18028,7 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17888
18028
|
const encoding = width.width;
|
|
17889
18029
|
if (kind === "address" && target.id === 11 && encoding === "u64" && addend === 0n) {
|
|
17890
18030
|
const section2 = OBJC_SECTION_BOUNDARY.exec(name3)?.[1];
|
|
17891
|
-
if (section2 && !
|
|
18031
|
+
if (section2 && !segmentNameSet.has(section2)) {
|
|
17892
18032
|
bytes.fill(0, at, at + 8);
|
|
17893
18033
|
continue;
|
|
17894
18034
|
}
|
|
@@ -17900,9 +18040,7 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17900
18040
|
if (tlsStart !== void 0 && at >= tlsStart && at < tlsStart + tlsTemplate.length)
|
|
17901
18041
|
linkage.tls.push(at - tlsStart, size, value);
|
|
17902
18042
|
else {
|
|
17903
|
-
const segment =
|
|
17904
|
-
(entry) => at >= entry.offset && at + size <= entry.offset + entry.length
|
|
17905
|
-
);
|
|
18043
|
+
const segment = findSegmentByOffset(at, size);
|
|
17906
18044
|
if (!segment)
|
|
17907
18045
|
throw new Error(`Swift SDK relocation has no load address for ${name3}`);
|
|
17908
18046
|
linkage.data.push(segment.address + at - segment.offset, size, value);
|
|
@@ -17946,15 +18084,29 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17946
18084
|
}
|
|
17947
18085
|
}
|
|
17948
18086
|
}
|
|
17949
|
-
const
|
|
18087
|
+
const encodedNameBuf = (name3) => {
|
|
18088
|
+
const raw2 = Buffer.from(name3, "utf8");
|
|
18089
|
+
const len = uleb4(raw2.length);
|
|
18090
|
+
const out = Buffer.allocUnsafe(len.length + raw2.length);
|
|
18091
|
+
for (let i = 0; i < len.length; i++) out[i] = len[i];
|
|
18092
|
+
raw2.copy(out, len.length);
|
|
18093
|
+
return out;
|
|
18094
|
+
};
|
|
18095
|
+
const importParts = [];
|
|
18096
|
+
let importEntryCount = imports.length + 1;
|
|
18097
|
+
for (const entry of imports) {
|
|
17950
18098
|
const slot = entry.kind === 0 && entry.module === "env" ? functionSlots.get(entry.name) : void 0;
|
|
17951
|
-
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
}
|
|
17957
|
-
|
|
18099
|
+
importParts.push(
|
|
18100
|
+
encodedNameBuf(slot === void 0 ? entry.module : NATIVE_SDK_IMPORT_MODULE),
|
|
18101
|
+
encodedNameBuf(slot === void 0 ? entry.name : String(slot)),
|
|
18102
|
+
bytes.subarray(entry.start, entry.end)
|
|
18103
|
+
);
|
|
18104
|
+
}
|
|
18105
|
+
importParts.push(
|
|
18106
|
+
encodedNameBuf("env"),
|
|
18107
|
+
encodedNameBuf("__stack_pointer"),
|
|
18108
|
+
Buffer.from([3, 126, 1])
|
|
18109
|
+
);
|
|
17958
18110
|
const tags = sections.find((section2) => section2.id === 13);
|
|
17959
18111
|
if (tags) {
|
|
17960
18112
|
const r = wasmReader(bytes, tags.start);
|
|
@@ -17969,15 +18121,18 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17969
18121
|
throw new Error(
|
|
17970
18122
|
`Swift app defines an exception tag the sdk does not own: ${name3}`
|
|
17971
18123
|
);
|
|
17972
|
-
|
|
17973
|
-
|
|
17974
|
-
|
|
17975
|
-
4,
|
|
17976
|
-
|
|
17977
|
-
|
|
18124
|
+
importParts.push(
|
|
18125
|
+
encodedNameBuf("env"),
|
|
18126
|
+
encodedNameBuf(name3),
|
|
18127
|
+
Buffer.from([4]),
|
|
18128
|
+
bytes.subarray(start, r.at)
|
|
18129
|
+
);
|
|
18130
|
+
importEntryCount++;
|
|
17978
18131
|
}
|
|
17979
18132
|
}
|
|
17980
|
-
const
|
|
18133
|
+
const globalParts = [
|
|
18134
|
+
Buffer.from(uleb4(globalCount - 1 + syntheticGlobals.length))
|
|
18135
|
+
];
|
|
17981
18136
|
for (let index = 0; index < globalCount; index++) {
|
|
17982
18137
|
const start = gr.at;
|
|
17983
18138
|
const type = gr.byte();
|
|
@@ -17989,12 +18144,12 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
17989
18144
|
if (gr.byte() !== 11) throw new Error("app global initializer has no end");
|
|
17990
18145
|
if (index === 0) continue;
|
|
17991
18146
|
const value = got.get(index);
|
|
17992
|
-
if (value === void 0)
|
|
17993
|
-
else
|
|
18147
|
+
if (value === void 0) globalParts.push(bytes.subarray(start, gr.at));
|
|
18148
|
+
else globalParts.push(Buffer.from([type, 1, type === 126 ? 66 : 65, 0, 11]));
|
|
17994
18149
|
}
|
|
17995
18150
|
for (const type of syntheticGlobals) {
|
|
17996
18151
|
const zero = type === 125 ? [67, 0, 0, 0, 0] : type === 124 ? [68, 0, 0, 0, 0, 0, 0, 0, 0] : [type === 126 ? 66 : 65, 0];
|
|
17997
|
-
|
|
18152
|
+
globalParts.push(Buffer.from([type, 1, ...zero, 11]));
|
|
17998
18153
|
}
|
|
17999
18154
|
const exportSection = sections.find((s) => s.id === 7);
|
|
18000
18155
|
if (!exportSection) throw new Error("app link has no exports");
|
|
@@ -18017,24 +18172,21 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
18017
18172
|
throw new Error("Swift app exceeds its reserved static memory range");
|
|
18018
18173
|
}
|
|
18019
18174
|
}
|
|
18175
|
+
const exportParts = [
|
|
18176
|
+
Buffer.from(uleb4(exportCount + 1 + got.size)),
|
|
18177
|
+
bytes.subarray(originalExportsStart, exportSection.end)
|
|
18178
|
+
];
|
|
18179
|
+
for (const [index, value] of got) {
|
|
18180
|
+
exportParts.push(
|
|
18181
|
+
encodedNameBuf(`${NATIVE_SDK_GLOBAL_PREFIX}${value}.${index}`),
|
|
18182
|
+
Buffer.from([3, ...uleb4(index)])
|
|
18183
|
+
);
|
|
18184
|
+
}
|
|
18185
|
+
exportParts.push(encodedNameBuf("__indirect_function_table"), Buffer.from([1, 0]));
|
|
18020
18186
|
const replaced = /* @__PURE__ */ new Map([
|
|
18021
|
-
[2, [
|
|
18022
|
-
[6,
|
|
18023
|
-
[
|
|
18024
|
-
7,
|
|
18025
|
-
[
|
|
18026
|
-
...uleb4(exportCount + 1 + got.size),
|
|
18027
|
-
...bytes.subarray(originalExportsStart, exportSection.end),
|
|
18028
|
-
...[...got].flatMap(([index, value]) => [
|
|
18029
|
-
...encodedName2(`${NATIVE_SDK_GLOBAL_PREFIX}${value}.${index}`),
|
|
18030
|
-
3,
|
|
18031
|
-
...uleb4(index)
|
|
18032
|
-
]),
|
|
18033
|
-
...encodedName2("__indirect_function_table"),
|
|
18034
|
-
1,
|
|
18035
|
-
0
|
|
18036
|
-
]
|
|
18037
|
-
]
|
|
18187
|
+
[2, Buffer.concat([Buffer.from(uleb4(importEntryCount)), ...importParts])],
|
|
18188
|
+
[6, Buffer.concat(globalParts)],
|
|
18189
|
+
[7, Buffer.concat(exportParts)]
|
|
18038
18190
|
]);
|
|
18039
18191
|
const rebuiltCode = expanded.length ? expandSdkRelocations(
|
|
18040
18192
|
bytes,
|
|
@@ -18046,9 +18198,13 @@ function resolveSdkReferences(source, sdk, forwarders) {
|
|
|
18046
18198
|
if (s === tags || s.name === "linking" || s.name?.startsWith("reloc.") || s.name === ".swift1_autolink_entries")
|
|
18047
18199
|
continue;
|
|
18048
18200
|
const payload = replaced.get(s.id);
|
|
18049
|
-
|
|
18050
|
-
|
|
18051
|
-
)
|
|
18201
|
+
if (s.id === 10 && rebuiltCode) {
|
|
18202
|
+
parts.push(rebuiltCode);
|
|
18203
|
+
} else if (payload) {
|
|
18204
|
+
parts.push(Buffer.from([s.id, ...uleb4(payload.length)]), payload);
|
|
18205
|
+
} else {
|
|
18206
|
+
parts.push(bytes.subarray(s.offset, s.end));
|
|
18207
|
+
}
|
|
18052
18208
|
}
|
|
18053
18209
|
return { bytes: Buffer.concat(parts), linkage };
|
|
18054
18210
|
}
|
|
@@ -18146,6 +18302,49 @@ function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
|
|
|
18146
18302
|
constructors: [...new Set(constructorKeys(map, (0, import_node_fs36.readFileSync)(linkedFile)))]
|
|
18147
18303
|
};
|
|
18148
18304
|
}
|
|
18305
|
+
function swiftSdkProjectionSpans(sdk, imageFor) {
|
|
18306
|
+
const { manifest, block } = readSwiftSdkManifest(sdk);
|
|
18307
|
+
const guestObjects = manifest.guestObjects;
|
|
18308
|
+
if (!guestObjects) return [];
|
|
18309
|
+
const { strings } = manifest;
|
|
18310
|
+
const fields = block("pieces");
|
|
18311
|
+
const ordered = [];
|
|
18312
|
+
for (let i = 0; i < fields.length; i += SWIFT_SDK_PIECE_FIELDS) {
|
|
18313
|
+
const size = fields[i + 1];
|
|
18314
|
+
if (!size) continue;
|
|
18315
|
+
ordered.push({
|
|
18316
|
+
address: fields[i],
|
|
18317
|
+
size,
|
|
18318
|
+
object: strings[fields[i + 3]]
|
|
18319
|
+
});
|
|
18320
|
+
}
|
|
18321
|
+
ordered.sort((a, b) => a.address - b.address);
|
|
18322
|
+
const imageOf = (object3) => {
|
|
18323
|
+
const product = guestObjects[object3]?.product;
|
|
18324
|
+
return product === void 0 ? void 0 : imageFor(object3, product);
|
|
18325
|
+
};
|
|
18326
|
+
const spans = [];
|
|
18327
|
+
for (let index = 0; index < ordered.length; index++) {
|
|
18328
|
+
const { object: object3, address, size } = ordered[index];
|
|
18329
|
+
const image = imageOf(object3);
|
|
18330
|
+
if (image === void 0) continue;
|
|
18331
|
+
let next = index + 1;
|
|
18332
|
+
while (next < ordered.length && ordered[next].address < address + size) next++;
|
|
18333
|
+
const end = ordered[next]?.address ?? address + size;
|
|
18334
|
+
spans.push({ image, space: "linear-memory", address, length: end - address });
|
|
18335
|
+
}
|
|
18336
|
+
const functionKeys = block("functions");
|
|
18337
|
+
const slots = block("functionSlots");
|
|
18338
|
+
for (let index = 0; index < functionKeys.length; index++) {
|
|
18339
|
+
const slot = slots[index];
|
|
18340
|
+
if (!slot) continue;
|
|
18341
|
+
const key = strings[functionKeys[index]];
|
|
18342
|
+
const image = imageOf(key.slice(0, key.indexOf(":")));
|
|
18343
|
+
if (image !== void 0)
|
|
18344
|
+
spans.push({ image, space: "function-table", address: slot, length: 1 });
|
|
18345
|
+
}
|
|
18346
|
+
return spans;
|
|
18347
|
+
}
|
|
18149
18348
|
function selectSwiftSdkData(sdk, usage, linkage, projection) {
|
|
18150
18349
|
const { manifest, block, segments } = readSwiftSdkManifest(sdk);
|
|
18151
18350
|
const { strings } = manifest;
|
|
@@ -18168,15 +18367,24 @@ function selectSwiftSdkData(sdk, usage, linkage, projection) {
|
|
|
18168
18367
|
});
|
|
18169
18368
|
}
|
|
18170
18369
|
const memory = new Map(segments.map((segment) => [segment.name, segment]));
|
|
18171
|
-
|
|
18370
|
+
let lastSegment = segments[0];
|
|
18371
|
+
const segmentAt = (address2, size) => {
|
|
18372
|
+
if (lastSegment && address2 >= lastSegment.address && address2 + size <= lastSegment.address + lastSegment.data.length)
|
|
18373
|
+
return lastSegment;
|
|
18172
18374
|
for (const segment of segments)
|
|
18173
|
-
if (address2 >= segment.address && address2 + size <= segment.address + segment.data.length)
|
|
18174
|
-
|
|
18175
|
-
|
|
18176
|
-
|
|
18177
|
-
);
|
|
18375
|
+
if (address2 >= segment.address && address2 + size <= segment.address + segment.data.length) {
|
|
18376
|
+
lastSegment = segment;
|
|
18377
|
+
return segment;
|
|
18378
|
+
}
|
|
18178
18379
|
return void 0;
|
|
18179
18380
|
};
|
|
18381
|
+
const read = (address2, size) => {
|
|
18382
|
+
const segment = segmentAt(address2, size);
|
|
18383
|
+
return segment?.data.subarray(
|
|
18384
|
+
address2 - segment.address,
|
|
18385
|
+
address2 - segment.address + size
|
|
18386
|
+
);
|
|
18387
|
+
};
|
|
18180
18388
|
const appSectionsByObject = /* @__PURE__ */ new Map();
|
|
18181
18389
|
const appSections = /* @__PURE__ */ new Set();
|
|
18182
18390
|
const appSymbols = /* @__PURE__ */ new Set();
|
|
@@ -18282,9 +18490,7 @@ function selectSwiftSdkData(sdk, usage, linkage, projection) {
|
|
|
18282
18490
|
const classAddress = Number(
|
|
18283
18491
|
new DataView(field.buffer, field.byteOffset, 8).getBigUint64(0, true)
|
|
18284
18492
|
);
|
|
18285
|
-
const segment =
|
|
18286
|
-
({ address: address3, data }) => classAddress >= address3 && classAddress < address3 + data.length
|
|
18287
|
-
);
|
|
18493
|
+
const segment = segmentAt(classAddress, 1);
|
|
18288
18494
|
if (!segment) continue;
|
|
18289
18495
|
const start = classAddress - segment.address;
|
|
18290
18496
|
const end = segment.data.indexOf(0, start);
|
|
@@ -18492,7 +18698,7 @@ function selectSwiftSdkData(sdk, usage, linkage, projection) {
|
|
|
18492
18698
|
if (current)
|
|
18493
18699
|
runs.push({
|
|
18494
18700
|
address: current.address,
|
|
18495
|
-
bytes:
|
|
18701
|
+
bytes: Buffer.concat(current.parts)
|
|
18496
18702
|
});
|
|
18497
18703
|
};
|
|
18498
18704
|
for (const piece of loaded) {
|
|
@@ -18910,13 +19116,19 @@ async function compileGuestLink(options) {
|
|
|
18910
19116
|
const selectedSource = source.artifacts.filter(
|
|
18911
19117
|
(artifact) => selected.has(import_node_path37.default.resolve(rewritten.get(artifact.path) ?? artifact.path))
|
|
18912
19118
|
);
|
|
19119
|
+
const admittedCores = Number(process.env.TM_EXEC_CPU_CORES);
|
|
19120
|
+
const linuxMemory = process.env.TM_EXEC_ADMITTED === "1" && process.env.LINUX_BUILD_SCOPE ? Number(process.env.TM_EXEC_LINUX_MEMORY_MAX) : NaN;
|
|
19121
|
+
const clangReplayJobs = Number.isInteger(admittedCores) && admittedCores > 0 ? Math.min(
|
|
19122
|
+
admittedCores,
|
|
19123
|
+
Number.isSafeInteger(linuxMemory) && linuxMemory > 0 ? Math.max(options.jobs, Math.floor(linuxMemory / (512 * 1024 ** 2))) : Math.max(options.jobs, admittedCores)
|
|
19124
|
+
) : options.jobs;
|
|
18913
19125
|
const clangOptions2 = sourceGuestClangLinkOptions({
|
|
18914
19126
|
buildDirectory: options.buildDirectory,
|
|
18915
19127
|
directory,
|
|
18916
19128
|
toolchainBin: options.toolchainBin,
|
|
18917
19129
|
swiftCompiler: options.swiftCompiler,
|
|
18918
19130
|
objects: selectedSource.map((artifact) => artifact.path),
|
|
18919
|
-
jobs:
|
|
19131
|
+
jobs: clangReplayJobs
|
|
18920
19132
|
});
|
|
18921
19133
|
const links = sourceGuestRuntimeLinks({
|
|
18922
19134
|
toolchainBin: options.toolchainBin,
|
|
@@ -19098,7 +19310,8 @@ async function compileGuestLink(options) {
|
|
|
19098
19310
|
createSwiftSdkBinding: createSwiftSdkBinding2,
|
|
19099
19311
|
finishSwiftAppModule: finishSwiftAppModule2,
|
|
19100
19312
|
linkSwiftAppModule: linkSwiftAppModule2,
|
|
19101
|
-
readSwiftSdkUsage: readSwiftSdkUsage2
|
|
19313
|
+
readSwiftSdkUsage: readSwiftSdkUsage2,
|
|
19314
|
+
swiftSdkProjectionSpans: swiftSdkProjectionSpans2
|
|
19102
19315
|
} = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
19103
19316
|
const project = options.project;
|
|
19104
19317
|
const work = project ? (0, import_node_fs37.mkdtempSync)(import_node_path37.default.join(directory, "app-module-")) : import_node_path37.default.join(directory, "app-module");
|
|
@@ -19120,7 +19333,28 @@ async function compileGuestLink(options) {
|
|
|
19120
19333
|
}
|
|
19121
19334
|
const usage = readSwiftSdkUsage2(result.mapPath, options.output, sdkObjectKeys);
|
|
19122
19335
|
const linkedModule = import_node_path37.default.join(work, "app.wasm");
|
|
19336
|
+
const sdkSpans = swiftSdkProjectionSpans2(
|
|
19337
|
+
sdk,
|
|
19338
|
+
(object3, product) => sdkObjectImages.get(object3) ?? sdkProductImages.get(product)
|
|
19339
|
+
);
|
|
19123
19340
|
let storage = reserved;
|
|
19341
|
+
if (sdkSpans.length > 0) {
|
|
19342
|
+
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
19343
|
+
storage = reserveGuestProjectionStorage(
|
|
19344
|
+
storage.images,
|
|
19345
|
+
storage.capacities.map((capacity, index) => ({
|
|
19346
|
+
...capacity,
|
|
19347
|
+
regions: capacity.regions + sdkCounts[index] + 16
|
|
19348
|
+
}))
|
|
19349
|
+
);
|
|
19350
|
+
const projectionSource = import_node_path37.default.join(work, "projection.c");
|
|
19351
|
+
(0, import_node_fs37.writeFileSync)(projectionSource, storage.source);
|
|
19352
|
+
(0, import_node_child_process23.execFileSync)(
|
|
19353
|
+
import_node_path37.default.join(options.toolchainBin, "clang"),
|
|
19354
|
+
[...clangOptions, "-c", projectionSource, "-o", projectionObject],
|
|
19355
|
+
{ stdio: "pipe" }
|
|
19356
|
+
);
|
|
19357
|
+
}
|
|
19124
19358
|
for (; ; ) {
|
|
19125
19359
|
const link = await linkSwiftAppModule2({
|
|
19126
19360
|
objects: [...owners.keys()],
|
|
@@ -19158,11 +19392,7 @@ async function compileGuestLink(options) {
|
|
|
19158
19392
|
bindingRows.set((address - values.address) / 8, value);
|
|
19159
19393
|
} else data.push(address, size, value);
|
|
19160
19394
|
}
|
|
19161
|
-
const
|
|
19162
|
-
const binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk, usage, {
|
|
19163
|
-
imageFor: (object3, product) => sdkObjectImages.get(object3) ?? sdkProductImages.get(product),
|
|
19164
|
-
spans: sdkSpans
|
|
19165
|
-
});
|
|
19395
|
+
const binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk, usage);
|
|
19166
19396
|
const linked = (0, import_node_fs37.readFileSync)(
|
|
19167
19397
|
project ? projectOutputFile(work, linkedModule, project) : linkedModule
|
|
19168
19398
|
);
|
|
@@ -26896,7 +27126,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
26896
27126
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
26897
27127
|
MULTI_MANIFEST_VERSION = 76;
|
|
26898
27128
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
26899
|
-
compilerSourceDigest = true ? "
|
|
27129
|
+
compilerSourceDigest = true ? "d4cf22b53d08266bf9bd0238bffe899805f62daeb3d628664ee351830e496cda" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
26900
27130
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
26901
27131
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
26902
27132
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2591 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
FOUNDATION_IMPLICIT_MODULES,
|
|
4
4
|
MULTI_MANIFEST_VERSION,
|
|
@@ -63,15 +63,15 @@ import {
|
|
|
63
63
|
withoutSwiftDeclarations,
|
|
64
64
|
wrapUIApplicationMainEntry,
|
|
65
65
|
writeSwiftProject
|
|
66
|
-
} from "./esm-chunks/chunk-
|
|
67
|
-
import "./esm-chunks/chunk-
|
|
68
|
-
import "./esm-chunks/chunk-
|
|
69
|
-
import "./esm-chunks/chunk-
|
|
70
|
-
import "./esm-chunks/chunk-
|
|
71
|
-
import "./esm-chunks/chunk-
|
|
72
|
-
import "./esm-chunks/chunk-
|
|
73
|
-
import "./esm-chunks/chunk-
|
|
74
|
-
import "./esm-chunks/chunk-
|
|
66
|
+
} from "./esm-chunks/chunk-VYZ5DC3M.mjs";
|
|
67
|
+
import "./esm-chunks/chunk-ILWFGZWW.mjs";
|
|
68
|
+
import "./esm-chunks/chunk-SOAYP72T.mjs";
|
|
69
|
+
import "./esm-chunks/chunk-YR6DNV76.mjs";
|
|
70
|
+
import "./esm-chunks/chunk-MC6NMYWY.mjs";
|
|
71
|
+
import "./esm-chunks/chunk-JHXDM3YU.mjs";
|
|
72
|
+
import "./esm-chunks/chunk-TFG4LZ5T.mjs";
|
|
73
|
+
import "./esm-chunks/chunk-EGKH2L6J.mjs";
|
|
74
|
+
import "./esm-chunks/chunk-4QHHRGO4.mjs";
|
|
75
75
|
export {
|
|
76
76
|
FOUNDATION_IMPLICIT_MODULES,
|
|
77
77
|
MULTI_MANIFEST_VERSION,
|