peachsim 0.1.2596 → 0.1.2597
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 +969 -423
- 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-WGTQK4JN.mjs → acorn-55PXV665.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-IGMABYTC.mjs → chunk-3DRJIOHV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BNXCKF2B.mjs → chunk-42RIRPTB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WPX7HLFR.mjs → chunk-56YYEI6C.mjs} +7 -6
- package/dist-lib/esm-chunks/{chunk-FDMS7FWE.mjs → chunk-7ECUAVIA.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-4PMXT2UO.mjs → chunk-7J65FNXI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SYCOZ2CT.mjs → chunk-AJHFCIEU.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-4MMPS5YL.mjs → chunk-CKUEWEY4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QEGUUPRI.mjs → chunk-DCL2ZEGA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4UUWP6NP.mjs → chunk-GECWNEHA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5NZPSLS4.mjs → chunk-GRGNTIO7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZVBBDMPW.mjs → chunk-GZD5CTG7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ISZE675P.mjs → chunk-HATXI62T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TILPABC4.mjs → chunk-INA4S3MF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3C2YVQZH.mjs → chunk-IPN35TGX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SPKD6UYK.mjs → chunk-LH524OUR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-DY6PUVXF.mjs → chunk-MMHNSEZY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BAEOHCN5.mjs → chunk-NWLCTKBM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HZPXGVY4.mjs → chunk-O5FDNHDG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TNZG7SFG.mjs → chunk-ROFBHGEA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UCIOSXXU.mjs → chunk-V6SI2XY7.mjs} +963 -490
- package/dist-lib/esm-chunks/{chunk-C3C5OJG4.mjs → chunk-VN7BXTMG.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-LZF4BVEY.mjs → chunk-Y4XMEBRN.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-QNM3HYV7.mjs → metro-layout-parser-5FUYCP6P.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-BXXQB7Q2.mjs → swift-package-prebuilt-W3VMDYHC.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-FKL3X2ZC.mjs → swift-sdk-app-module-ZHGBY6T7.mjs} +126 -56
- package/dist-lib/esm-chunks/{swift-sdk-image-CCVWDFHB.mjs → swift-sdk-image-2PC4PKHZ.mjs} +14 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-OTMZVBDN.mjs → swift-sdk-image-producer-WDN6BXQL.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +968 -422
- 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 +969 -423
- package/dist-lib/host/fetch-proxy-handler.cjs +36 -6
- 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 +34 -4
- 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 +970 -424
- package/dist-lib/swift-compile.cjs +966 -420
- 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/dist-types/packages/peach-engine/src/render-worker/nativeAnimMirrorContract.d.ts +0 -2
- package/package.json +1 -1
- package/src/swift-compile.ts +421 -175
- package/src/swift-guest-compile.ts +16 -0
- package/src/swift-guest-image-ledger.ts +65 -14
- package/src/swift-guest-link.ts +21 -0
- package/src/swift-guest-manifest.ts +27 -5
- package/src/swift-guest-source-inputs.ts +119 -14
- package/src/swift-sdk-app-module.ts +128 -55
- package/src/swift-sdk-image-wasm.ts +76 -39
- package/src/swift-sdk-image.ts +2 -1
- package/src/swift-wasm-prune.ts +282 -222
- package/src/wasm-optimize.ts +1 -1
- package/src/write-build-file.ts +9 -8
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
LAUNCH_METADATA_KEYS,
|
|
4
4
|
LAUNCH_METADATA_KEYS_PATH
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ROFBHGEA.mjs";
|
|
6
6
|
import {
|
|
7
7
|
parseSwiftDistributionLock,
|
|
8
8
|
readActiveRuntime,
|
|
9
9
|
runtimeDir,
|
|
10
10
|
swiftDistributionAt,
|
|
11
11
|
swiftModuleSdk
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-V6SI2XY7.mjs";
|
|
13
13
|
import {
|
|
14
14
|
SWIFT_WASM_TRIPLE,
|
|
15
15
|
registerSwiftHostCompiler,
|
|
16
16
|
swiftCompiler,
|
|
17
17
|
swiftToolchain
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IPN35TGX.mjs";
|
|
19
19
|
import {
|
|
20
20
|
isRecord
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-INA4S3MF.mjs";
|
|
22
22
|
|
|
23
23
|
// src/swift-distribution.ts
|
|
24
24
|
import fs2 from "node:fs";
|
package/dist-lib/esm-chunks/{metro-layout-parser-QNM3HYV7.mjs → metro-layout-parser-5FUYCP6P.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
import "./chunk-
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import "./chunk-NWLCTKBM.mjs";
|
|
3
3
|
|
|
4
4
|
// src/metro-layout-parser.ts
|
|
5
5
|
var whitespace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/y;
|
|
@@ -8,7 +8,7 @@ var lineBreak = /[\r\n\u2028\u2029]/;
|
|
|
8
8
|
var metroLayoutParser;
|
|
9
9
|
async function loadMetroLayoutParser() {
|
|
10
10
|
if (metroLayoutParser) return metroLayoutParser;
|
|
11
|
-
const { Parser } = await import("./acorn-
|
|
11
|
+
const { Parser } = await import("./acorn-55PXV665.mjs");
|
|
12
12
|
metroLayoutParser = Parser.extend(
|
|
13
13
|
(Base) => {
|
|
14
14
|
const parseFunctionBody = Reflect.get(Base.prototype, "parseFunctionBody");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
compileTargets,
|
|
4
4
|
fetchNativeEntry,
|
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
swiftAvailableModules,
|
|
7
7
|
swiftDistributionAt,
|
|
8
8
|
swiftImportNames
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-V6SI2XY7.mjs";
|
|
10
|
+
import "./chunk-IPN35TGX.mjs";
|
|
11
11
|
import {
|
|
12
12
|
SWIFT_REMOTE_PACKAGES_DIR
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GZD5CTG7.mjs";
|
|
14
14
|
import {
|
|
15
15
|
manifestCalls
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
16
|
+
} from "./chunk-MMHNSEZY.mjs";
|
|
17
|
+
import "./chunk-GECWNEHA.mjs";
|
|
18
|
+
import "./chunk-3DRJIOHV.mjs";
|
|
19
|
+
import "./chunk-7J65FNXI.mjs";
|
|
20
|
+
import "./chunk-INA4S3MF.mjs";
|
|
21
|
+
import "./chunk-NWLCTKBM.mjs";
|
|
22
22
|
|
|
23
23
|
// src/swift-package-prebuilt.ts
|
|
24
24
|
import { createHash } from "node:crypto";
|
package/dist-lib/esm-chunks/{swift-sdk-app-module-FKL3X2ZC.mjs → swift-sdk-app-module-ZHGBY6T7.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
SWIFT_SDK_APP_MEMORY_BASE,
|
|
4
4
|
SWIFT_SDK_APP_TABLE_BASE,
|
|
5
5
|
SWIFT_SDK_MEMORY_BASE,
|
|
6
6
|
SWIFT_SDK_PIECE_FIELDS,
|
|
7
7
|
readSwiftSdkManifest
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-56YYEI6C.mjs";
|
|
9
|
+
import "./chunk-VN7BXTMG.mjs";
|
|
10
|
+
import "./chunk-ROFBHGEA.mjs";
|
|
11
|
+
import "./chunk-HATXI62T.mjs";
|
|
12
12
|
import {
|
|
13
13
|
ADDEND_RELOCATIONS,
|
|
14
14
|
KEEP_WASM_NAMES,
|
|
@@ -36,17 +36,17 @@ import {
|
|
|
36
36
|
wasmReader,
|
|
37
37
|
wasmSections,
|
|
38
38
|
writeWasmCustomSection
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-V6SI2XY7.mjs";
|
|
40
40
|
import {
|
|
41
41
|
SWIFT_WASM_TRIPLE
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-IPN35TGX.mjs";
|
|
43
|
+
import "./chunk-GZD5CTG7.mjs";
|
|
44
|
+
import "./chunk-MMHNSEZY.mjs";
|
|
45
|
+
import "./chunk-GECWNEHA.mjs";
|
|
46
|
+
import "./chunk-3DRJIOHV.mjs";
|
|
47
|
+
import "./chunk-7J65FNXI.mjs";
|
|
48
|
+
import "./chunk-INA4S3MF.mjs";
|
|
49
|
+
import "./chunk-NWLCTKBM.mjs";
|
|
50
50
|
|
|
51
51
|
// src/swift-sdk-app-module.ts
|
|
52
52
|
import { execFile } from "node:child_process";
|
|
@@ -172,56 +172,109 @@ function swiftAppModuleInputs(tokens, buildRoot, sdkLibraries) {
|
|
|
172
172
|
}
|
|
173
173
|
return inputs;
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
function llvmQuoted(value) {
|
|
176
|
+
const bytes = Buffer.from(value, "utf8");
|
|
177
|
+
let out = '"';
|
|
178
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
179
|
+
const b = bytes[i];
|
|
180
|
+
if (b >= 32 && b <= 126 && b !== 34 && b !== 92) out += String.fromCharCode(b);
|
|
181
|
+
else out += `\\${b.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
182
|
+
}
|
|
183
|
+
return out + '"';
|
|
184
|
+
}
|
|
185
|
+
async function compileSdkForwarders(inputs, sdk, toolchainBin, output, project, readInput, precomputedSymbols) {
|
|
176
186
|
const { signatures, tls } = sdk.sdkInterface;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
let referenced;
|
|
188
|
+
let defined;
|
|
189
|
+
if (precomputedSymbols) {
|
|
190
|
+
referenced = precomputedSymbols.referenced;
|
|
191
|
+
defined = precomputedSymbols.defined;
|
|
192
|
+
} else {
|
|
193
|
+
const directories = inputs.filter((input) => input.startsWith("-L")).map((input) => input.slice(2));
|
|
194
|
+
const refSet = /* @__PURE__ */ new Set();
|
|
195
|
+
const defSet = /* @__PURE__ */ new Set();
|
|
196
|
+
const scan = (bytes) => {
|
|
197
|
+
const symbols = guestWasmSymbols(bytes);
|
|
198
|
+
for (const name of symbols.undefined) refSet.add(name);
|
|
199
|
+
for (const name of symbols.defined) defSet.add(name);
|
|
200
|
+
};
|
|
201
|
+
for (const input of inputs) {
|
|
202
|
+
const file = input.startsWith("-l") ? directories.map((directory) => path.join(directory, `lib${input.slice(2)}.a`)).find((candidate) => existsSync(candidate)) : input.startsWith("-") ? void 0 : input;
|
|
203
|
+
if (!file) continue;
|
|
204
|
+
const bytes = readInput(file);
|
|
205
|
+
if (file.endsWith(".a"))
|
|
206
|
+
for (const member of readArMembers(bytes)) scan(member.bytes);
|
|
207
|
+
else scan(bytes);
|
|
208
|
+
}
|
|
209
|
+
referenced = refSet;
|
|
210
|
+
defined = defSet;
|
|
191
211
|
}
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
212
|
+
const irType = {
|
|
213
|
+
i: "i32",
|
|
214
|
+
j: "i64",
|
|
215
|
+
f: "float",
|
|
216
|
+
d: "double"
|
|
217
|
+
};
|
|
218
|
+
const type = (kinds) => {
|
|
219
|
+
const out = new Array(kinds.length);
|
|
220
|
+
for (let i = 0; i < kinds.length; i++) {
|
|
221
|
+
const kind = kinds[i];
|
|
222
|
+
const name = irType[kind];
|
|
223
|
+
if (!name) throw new Error(`sdk signature kind ${kind}`);
|
|
224
|
+
out[i] = name;
|
|
225
|
+
}
|
|
226
|
+
return out;
|
|
227
|
+
};
|
|
228
|
+
const lines = [`target triple = "${SWIFT_WASM_TRIPLE}"`];
|
|
229
|
+
const attrs = [];
|
|
230
|
+
const addImportAttr = (name) => {
|
|
231
|
+
const id = attrs.length;
|
|
232
|
+
attrs.push(
|
|
233
|
+
`attributes #${id} = { "wasm-import-module"="env" "wasm-import-name"=${llvmQuoted(name)} }`
|
|
234
|
+
);
|
|
235
|
+
return id;
|
|
236
|
+
};
|
|
237
|
+
if (signatures.__objc_send_load_messages === ":") {
|
|
238
|
+
const attr = addImportAttr("__objc_send_load_messages");
|
|
201
239
|
lines.push(
|
|
202
|
-
|
|
203
|
-
|
|
240
|
+
"@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @send_app_load_messages, ptr null }]",
|
|
241
|
+
`declare void @sdk_send_load_messages() #${attr}`,
|
|
242
|
+
"define internal void @send_app_load_messages() {",
|
|
243
|
+
" tail call void @sdk_send_load_messages()",
|
|
244
|
+
" ret void",
|
|
245
|
+
"}"
|
|
204
246
|
);
|
|
247
|
+
}
|
|
205
248
|
const forwarders = /* @__PURE__ */ new Set();
|
|
206
249
|
let index = 0;
|
|
207
250
|
for (const name of referenced) {
|
|
208
251
|
const signature = signatures[name];
|
|
209
252
|
if (signature === void 0 || defined.has(name)) continue;
|
|
210
|
-
const
|
|
253
|
+
const colon = signature.indexOf(":");
|
|
254
|
+
const params = colon < 0 ? signature : signature.slice(0, colon);
|
|
255
|
+
const results = colon < 0 ? "" : signature.slice(colon + 1);
|
|
211
256
|
if (results.length > 1) throw new Error(`sdk function ${name} returns several values`);
|
|
212
257
|
const result = results ? type(results)[0] : "void";
|
|
213
|
-
const
|
|
214
|
-
const
|
|
258
|
+
const paramTypes = type(params);
|
|
259
|
+
const declParams = paramTypes.join(", ");
|
|
260
|
+
const defParams = paramTypes.map((kind, at) => `${kind} %a${at}`).join(", ");
|
|
261
|
+
const callArgs = paramTypes.map((kind, at) => `${kind} %a${at}`).join(", ");
|
|
262
|
+
const attr = addImportAttr(name);
|
|
263
|
+
const quoted = llvmQuoted(name);
|
|
215
264
|
lines.push(
|
|
216
|
-
`
|
|
217
|
-
`
|
|
218
|
-
|
|
265
|
+
`declare ${result} @i${index}(${declParams}) #${attr}`,
|
|
266
|
+
`define weak hidden ${result} @${quoted}(${defParams}) {`,
|
|
267
|
+
result === "void" ? ` tail call void @i${index}(${callArgs})
|
|
268
|
+
ret void` : ` %r = tail call ${result} @i${index}(${callArgs})
|
|
269
|
+
ret ${result} %r`,
|
|
270
|
+
"}"
|
|
219
271
|
);
|
|
220
272
|
forwarders.add(name);
|
|
221
273
|
index++;
|
|
222
274
|
}
|
|
223
275
|
const errno = tls.errno;
|
|
224
276
|
let declaredErrno = false;
|
|
277
|
+
const usedHelpers = [];
|
|
225
278
|
for (const name of referenced) {
|
|
226
279
|
const offset = tls[name];
|
|
227
280
|
if (offset === void 0 || defined.has(name)) continue;
|
|
@@ -229,28 +282,44 @@ async function compileSdkForwarders(inputs, sdk, toolchainBin, output, project,
|
|
|
229
282
|
throw new Error("the sdk image has no errno to find its thread block by");
|
|
230
283
|
if (!declaredErrno) {
|
|
231
284
|
declaredErrno = true;
|
|
285
|
+
const attr = addImportAttr("__errno_location");
|
|
232
286
|
lines.push(
|
|
233
|
-
`
|
|
287
|
+
`declare ptr @__peach_errno() #${attr}`,
|
|
288
|
+
"declare ptr @llvm.wasm.tls.base()"
|
|
234
289
|
);
|
|
235
290
|
}
|
|
291
|
+
const helper = `@${llvmQuoted(SDK_TLS_HELPER + name)}`;
|
|
292
|
+
const delta = `@${llvmQuoted(SDK_TLS_DELTA + name)}`;
|
|
293
|
+
usedHelpers.push(`ptr ${helper}`);
|
|
236
294
|
lines.push(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
`
|
|
240
|
-
|
|
295
|
+
`@${llvmQuoted(name)} = weak hidden thread_local global i8 0, align 1`,
|
|
296
|
+
`${delta} = external global i8, align 1`,
|
|
297
|
+
`define hidden i64 ${helper}() {`,
|
|
298
|
+
" %e = tail call ptr @__peach_errno()",
|
|
299
|
+
" %ei = ptrtoint ptr %e to i64",
|
|
300
|
+
` %di = ptrtoint ptr ${delta} to i64`,
|
|
301
|
+
" %s = add i64 %ei, %di",
|
|
302
|
+
" %b = tail call ptr @llvm.wasm.tls.base()",
|
|
303
|
+
" %bi = ptrtoint ptr %b to i64",
|
|
304
|
+
" %r = sub i64 %s, %bi",
|
|
305
|
+
" ret i64 %r",
|
|
306
|
+
"}"
|
|
241
307
|
);
|
|
242
308
|
index++;
|
|
243
309
|
}
|
|
244
|
-
|
|
245
|
-
|
|
310
|
+
if (usedHelpers.length > 0) {
|
|
311
|
+
lines.push(
|
|
312
|
+
`@llvm.used = appending global [${usedHelpers.length} x ptr] [${usedHelpers.join(", ")}], section "llvm.metadata"`
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
const source = `${output.slice(0, -2)}.ll`;
|
|
316
|
+
writeFileSync(source, [...lines, ...attrs].join("\n") + "\n");
|
|
246
317
|
await run(
|
|
247
318
|
path.join(toolchainBin, "clang"),
|
|
248
319
|
[
|
|
249
320
|
`--target=${SWIFT_WASM_TRIPLE}`,
|
|
250
|
-
"-O2",
|
|
251
321
|
"-matomics",
|
|
252
322
|
"-mbulk-memory",
|
|
253
|
-
"-ffreestanding",
|
|
254
323
|
"-c",
|
|
255
324
|
source,
|
|
256
325
|
"-o",
|
|
@@ -269,7 +338,8 @@ async function linkSwiftAppModule(options) {
|
|
|
269
338
|
toolchainBin,
|
|
270
339
|
forwarders,
|
|
271
340
|
options.project,
|
|
272
|
-
options.readInput ?? readFileSync
|
|
341
|
+
options.readInput ?? readFileSync,
|
|
342
|
+
options.precomputedSymbols
|
|
273
343
|
);
|
|
274
344
|
const lazy = options.lazyFunctions ?? [];
|
|
275
345
|
const lazyExports = path.join(work, "lazy-exports.rsp");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
SWIFT_SDK_APP_MEMORY_BASE,
|
|
4
4
|
SWIFT_SDK_APP_TABLE_BASE,
|
|
@@ -15,19 +15,19 @@ import {
|
|
|
15
15
|
swiftSdkImageFile,
|
|
16
16
|
swiftSdkImageKey,
|
|
17
17
|
swiftSdkImageProducts
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-56YYEI6C.mjs";
|
|
19
|
+
import "./chunk-VN7BXTMG.mjs";
|
|
20
|
+
import "./chunk-ROFBHGEA.mjs";
|
|
21
|
+
import "./chunk-HATXI62T.mjs";
|
|
22
|
+
import "./chunk-V6SI2XY7.mjs";
|
|
23
|
+
import "./chunk-IPN35TGX.mjs";
|
|
24
|
+
import "./chunk-GZD5CTG7.mjs";
|
|
25
|
+
import "./chunk-MMHNSEZY.mjs";
|
|
26
|
+
import "./chunk-GECWNEHA.mjs";
|
|
27
|
+
import "./chunk-3DRJIOHV.mjs";
|
|
28
|
+
import "./chunk-7J65FNXI.mjs";
|
|
29
|
+
import "./chunk-INA4S3MF.mjs";
|
|
30
|
+
import "./chunk-NWLCTKBM.mjs";
|
|
31
31
|
export {
|
|
32
32
|
SWIFT_SDK_APP_MEMORY_BASE,
|
|
33
33
|
SWIFT_SDK_APP_TABLE_BASE,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2597 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
swiftCacheDir,
|
|
4
4
|
windowAdmission,
|
|
5
5
|
withSwiftRootLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IPN35TGX.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-INA4S3MF.mjs";
|
|
10
|
+
import "./chunk-NWLCTKBM.mjs";
|
|
11
11
|
|
|
12
12
|
// src/swift-sdk-image-producer.ts
|
|
13
13
|
import { execFile, execFileSync } from "node:child_process";
|