peachsim 0.1.2777 → 0.1.2779
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 +669 -840
- 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-M5O633NZ.mjs → acorn-SCZ56W4Q.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-NJHTAVEI.mjs → chunk-6BNEOOBT.mjs} +124 -18
- package/dist-lib/esm-chunks/{chunk-LB2X5KYV.mjs → chunk-7VWBLM73.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-V2I633CU.mjs → chunk-DX5V3733.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-THHP5XKD.mjs → chunk-E56EZ3QT.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-TRSHEQVJ.mjs → chunk-FNQXQNQK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WSHBJUCP.mjs → chunk-H2V3ZZTO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OVCIWUV2.mjs → chunk-H6JAFCAZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZKPBT6FD.mjs → chunk-HMFIO57I.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DPL3I4WY.mjs → chunk-HWK2V6R4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OSESKVWT.mjs → chunk-KAMO4C4X.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TONCJKKR.mjs → chunk-KFDP4372.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FHYWKCOZ.mjs → chunk-KOULWLTF.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-Q42OLP7O.mjs → chunk-LVEDBGWX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RX3WDTYI.mjs → chunk-MJXJYVF5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GISUEYXO.mjs → chunk-MK4VAM4G.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AGWZKA24.mjs → chunk-Q6XMYYNV.mjs} +168 -421
- package/dist-lib/esm-chunks/{chunk-KCSUAVJQ.mjs → chunk-SFTGQN5D.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-Q53QPYEU.mjs → chunk-SM5MJSQP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3UJO4NG3.mjs → chunk-SNMGOZXQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OLCLLGZF.mjs → chunk-SZI5IZ76.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-FB27T2JY.mjs → chunk-T7DTXCV5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IPX66HMP.mjs → chunk-UBM772FD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GMN43CNC.mjs → chunk-VJSHIZ7J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GSTVX33B.mjs → chunk-Z42YJEC4.mjs} +36 -14
- package/dist-lib/esm-chunks/{metro-layout-parser-PFRFHGDY.mjs → metro-layout-parser-7S5M3EG6.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-NUAEDMSQ.mjs → swift-package-prebuilt-MJSFHIOP.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-P3BARE2W.mjs → swift-sdk-app-module-ZIN3LFLS.mjs} +47 -69
- package/dist-lib/esm-chunks/{swift-sdk-image-Y6XT7KI4.mjs → swift-sdk-image-MIWPBZEN.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-DYR47O6H.mjs → swift-sdk-image-producer-OTH543HF.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +592 -763
- 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 +735 -901
- package/dist-lib/host/fetch-proxy-handler.cjs +117 -93
- 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 +20 -15
- package/dist-lib/native-app-identity-project.mjs +27 -32
- 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 +87 -86
- package/dist-lib/public-origins-lib.json +77 -70
- 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 +774 -940
- package/dist-lib/swift-compile.cjs +376 -525
- package/dist-lib/swift-compile.mjs +12 -12
- 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/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.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/core-abi/web/sceneClientContract.d.ts +0 -6
- package/dist-types/packages/peach-engine/src/components/native-ui/webview-frame-bridge.d.ts +0 -3
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +15 -2
- package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +10 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +0 -4
- package/package.json +1 -1
- package/src/bazel-project.ts +2 -6
- package/src/build-cache.ts +3 -2
- package/src/sha256.ts +8 -0
- package/src/swift-compiler-digest.ts +1 -0
- package/src/swift-coverage/indexing.ts +3 -4
- package/src/swift-coverage/package.ts +1 -4
- package/src/swift-coverage/reader.ts +1 -4
- package/src/swift-coverage/source.ts +1 -4
- package/src/swift-coverage/xcode-assets.ts +1 -4
- package/src/swift-coverage/xcode-bridging.ts +1 -4
- package/src/swift-coverage/xcode-packages.ts +1 -4
- package/src/swift-coverage/xcode-strings.ts +1 -4
- package/src/swift-coverage/xcode.ts +1 -4
- package/src/swift-guest-dyld-functions.ts +1 -11
- package/src/swift-guest-dyld-table.ts +3 -15
- package/src/swift-guest-image-ledger.ts +9 -35
- package/src/swift-guest-source-inputs.ts +8 -37
- package/src/swift-icu.ts +15 -28
- package/src/swift-link-roots.ts +4 -8
- package/src/swift-objc-compile.ts +2 -7
- package/src/swift-sdk-app-module.ts +5 -27
- package/src/swift-sdk-image-wasm.ts +12 -41
- package/src/swift-sdk-image.ts +50 -12
- package/src/swift-shared-sdk.ts +1 -13
- package/src/swift-wasm-archive.ts +6 -11
- package/src/swift-wasm-prune.ts +25 -109
- package/src/wasm-binary-sections.ts +61 -7
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2779 | (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;
|
|
@@ -29800,14 +29800,14 @@ var init_oneNativeControlsContract = __esm({
|
|
|
29800
29800
|
});
|
|
29801
29801
|
|
|
29802
29802
|
// ../peach-globals/src/oneNativeControlsReleaseContract.ts
|
|
29803
|
-
function oneNativeControlsReleaseObject(
|
|
29804
|
-
return `native/swift-package/${ONE_NATIVE_CONTROLS_PACKAGE}/releases/${
|
|
29803
|
+
function oneNativeControlsReleaseObject(sha2564) {
|
|
29804
|
+
return `native/swift-package/${ONE_NATIVE_CONTROLS_PACKAGE}/releases/${sha2564}.tar.gz`;
|
|
29805
29805
|
}
|
|
29806
29806
|
function parseOneNativeControlsReleasePin(pin2, file) {
|
|
29807
|
-
const
|
|
29808
|
-
if (!/^[a-f0-9]{64}$/.test(
|
|
29807
|
+
const sha2564 = pin2.trim();
|
|
29808
|
+
if (!/^[a-f0-9]{64}$/.test(sha2564))
|
|
29809
29809
|
throw new Error(`invalid OneNativeControls release digest at ${file}`);
|
|
29810
|
-
return
|
|
29810
|
+
return sha2564;
|
|
29811
29811
|
}
|
|
29812
29812
|
var ONE_NATIVE_CONTROLS_RELEASE_BUNDLE, ONE_NATIVE_CONTROLS_RELEASE_PIN, ONE_NATIVE_CONTROLS_STAGED_BUNDLE;
|
|
29813
29813
|
var init_oneNativeControlsReleaseContract = __esm({
|
|
@@ -30567,22 +30567,22 @@ function isOneNativeControlsReleaseAsset(pathname) {
|
|
|
30567
30567
|
async function serveOneNativeControlsRelease(req, res, pathname, runtime) {
|
|
30568
30568
|
const pin2 = import_node_path8.default.join(runtime, ONE_NATIVE_CONTROLS_RELEASE_PIN);
|
|
30569
30569
|
if (!import_node_fs12.default.existsSync(pin2)) return false;
|
|
30570
|
-
const
|
|
30571
|
-
const destDir = import_node_path8.default.join(cacheDir(), "one-native-controls",
|
|
30570
|
+
const sha2564 = parseOneNativeControlsReleasePin(import_node_fs12.default.readFileSync(pin2, "utf8"), pin2);
|
|
30571
|
+
const destDir = import_node_path8.default.join(cacheDir(), "one-native-controls", sha2564);
|
|
30572
30572
|
const metadata = pathname === ONE_NATIVE_CONTROLS_METADATA_PATH;
|
|
30573
30573
|
if (metadata && !import_node_fs12.default.existsSync(import_node_path8.default.join(destDir, METADATA_FILE))) {
|
|
30574
|
-
let pending2 = installing.get(
|
|
30574
|
+
let pending2 = installing.get(sha2564);
|
|
30575
30575
|
if (!pending2) {
|
|
30576
30576
|
const staged = import_node_path8.default.join(runtime, ONE_NATIVE_CONTROLS_STAGED_BUNDLE);
|
|
30577
30577
|
pending2 = installVerifiedTarball({
|
|
30578
|
-
url: `${NATIVE_PREBUILT_ORIGIN}/${oneNativeControlsReleaseObject(
|
|
30578
|
+
url: `${NATIVE_PREBUILT_ORIGIN}/${oneNativeControlsReleaseObject(sha2564)}`,
|
|
30579
30579
|
localPath: import_node_fs12.default.existsSync(staged) ? staged : void 0,
|
|
30580
|
-
digest: { algorithm: "sha256", encoding: "hex", value:
|
|
30580
|
+
digest: { algorithm: "sha256", encoding: "hex", value: sha2564 },
|
|
30581
30581
|
destDir,
|
|
30582
30582
|
installedMarker: METADATA_FILE,
|
|
30583
30583
|
label: ONE_NATIVE_CONTROLS_PACKAGE
|
|
30584
|
-
}).finally(() => installing.delete(
|
|
30585
|
-
installing.set(
|
|
30584
|
+
}).finally(() => installing.delete(sha2564));
|
|
30585
|
+
installing.set(sha2564, pending2);
|
|
30586
30586
|
}
|
|
30587
30587
|
await pending2;
|
|
30588
30588
|
}
|
|
@@ -31034,11 +31034,11 @@ async function installPack(runtimeRoot, prefix, destDir, allowDownload) {
|
|
|
31034
31034
|
await install;
|
|
31035
31035
|
return import_node_fs16.default.existsSync(marker);
|
|
31036
31036
|
}
|
|
31037
|
-
function desktopPackPath(
|
|
31037
|
+
function desktopPackPath(sha2564) {
|
|
31038
31038
|
if (process.platform !== "darwin") return;
|
|
31039
31039
|
const cliDir = import_node_path11.default.dirname(process.execPath);
|
|
31040
31040
|
const resources = cliDir.endsWith("/Contents/Resources/bin") ? import_node_path11.default.dirname(cliDir) : import_node_path11.default.join(MAC_HOST_APP, "Contents/Resources");
|
|
31041
|
-
const file = import_node_path11.default.join(resources, DESKTOP_RUNTIME_PACKS_DIR, `${
|
|
31041
|
+
const file = import_node_path11.default.join(resources, DESKTOP_RUNTIME_PACKS_DIR, `${sha2564}.tar.zst`);
|
|
31042
31042
|
if (import_node_fs16.default.existsSync(file)) return file;
|
|
31043
31043
|
}
|
|
31044
31044
|
var import_node_fs16, import_node_path11, import_node_timers, inflight, packsByRoot, listedByRoot, WARM_DELAY_MS, warming;
|
|
@@ -36021,7 +36021,7 @@ var init_swift_objc_sdk_tree = __esm({
|
|
|
36021
36021
|
|
|
36022
36022
|
// src/swift-compiler-digest.ts
|
|
36023
36023
|
function swiftArchiveCompilerDigestValue() {
|
|
36024
|
-
return true ? "
|
|
36024
|
+
return true ? "b4b2fc7face997792991900efb229414642f042031ba789c00a1d17e542756e3" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
|
|
36025
36025
|
}
|
|
36026
36026
|
var import_node_crypto11, import_node_fs27, import_node_path25, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
36027
36027
|
var init_swift_compiler_digest = __esm({
|
|
@@ -36050,6 +36050,7 @@ var init_swift_compiler_digest = __esm({
|
|
|
36050
36050
|
"swift-objc-prebuilt-catalog.ts",
|
|
36051
36051
|
"swift-toolchain.ts",
|
|
36052
36052
|
"swift-shared-sdk.ts",
|
|
36053
|
+
"wasm-binary-sections.ts",
|
|
36053
36054
|
"swift-distribution-mirror.ts",
|
|
36054
36055
|
"swift-design-time.ts",
|
|
36055
36056
|
"binaryen.lock.json",
|
|
@@ -36167,13 +36168,13 @@ var init_swift_standin_digest = __esm({
|
|
|
36167
36168
|
];
|
|
36168
36169
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
36169
36170
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
36170
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
36171
|
+
STANDIN_SOURCE_DIGEST = true ? "6f991ca933bc6ae43f06c18cb2029ff3209de583afa4457105e7452437c20f01" : standinSourceDigest();
|
|
36171
36172
|
}
|
|
36172
36173
|
});
|
|
36173
36174
|
|
|
36174
36175
|
// src/expo-native-compiler-digest.ts
|
|
36175
36176
|
function expoNativeCompilerDigestValue() {
|
|
36176
|
-
return true ? "
|
|
36177
|
+
return true ? "5217c97f9f40e75420d8af715a312e49984d9ec52582e3c5d6209439c3cb70f4" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
36177
36178
|
}
|
|
36178
36179
|
var import_node_crypto13;
|
|
36179
36180
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -39356,9 +39357,9 @@ async function ensureCompose(toolchain) {
|
|
|
39356
39357
|
const downloads = [...toolchain.composeLibraries, toolchain.composeLoader];
|
|
39357
39358
|
const root = import_node_path29.default.join(kotlinHome(), "compose", toolchain.composeArchive.sha256);
|
|
39358
39359
|
const verify = (dir) => {
|
|
39359
|
-
for (const { name: name3, sha256:
|
|
39360
|
+
for (const { name: name3, sha256: sha2564 } of downloads) {
|
|
39360
39361
|
const actual = (0, import_node_crypto15.createHash)("sha256").update(import_node_fs30.default.readFileSync(import_node_path29.default.join(dir, name3))).digest("hex");
|
|
39361
|
-
if (actual !==
|
|
39362
|
+
if (actual !== sha2564)
|
|
39362
39363
|
throw new Error(`Compose input differs from its pin: ${name3}`);
|
|
39363
39364
|
}
|
|
39364
39365
|
};
|
|
@@ -39647,15 +39648,15 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
|
|
|
39647
39648
|
if (!Buffer.from(text7).equals(bytes))
|
|
39648
39649
|
throw new Error(`Nitro dependency header is not UTF-8: ${source}`);
|
|
39649
39650
|
const backport = dependency.backport?.file === relative8 ? dependency.backport : void 0;
|
|
39650
|
-
let
|
|
39651
|
+
let sha2564 = original;
|
|
39651
39652
|
if (backport) {
|
|
39652
39653
|
if (original !== backport.originalSha256)
|
|
39653
39654
|
throw new Error(`${dependency.name} backport original differs: ${relative8}`);
|
|
39654
39655
|
if (!text7.includes(backport.before))
|
|
39655
39656
|
throw new Error(`${dependency.name} backport anchor missing: ${relative8}`);
|
|
39656
39657
|
text7 = text7.replace(backport.before, backport.after);
|
|
39657
|
-
|
|
39658
|
-
if (
|
|
39658
|
+
sha2564 = (0, import_node_crypto16.createHash)("sha256").update(text7).digest("hex");
|
|
39659
|
+
if (sha2564 !== backport.derivedSha256)
|
|
39659
39660
|
throw new Error(`${dependency.name} backport derived source differs: ${relative8}`);
|
|
39660
39661
|
}
|
|
39661
39662
|
return {
|
|
@@ -39663,7 +39664,7 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
|
|
|
39663
39664
|
name: dependency.name,
|
|
39664
39665
|
source,
|
|
39665
39666
|
text: text7,
|
|
39666
|
-
sha256:
|
|
39667
|
+
sha256: sha2564,
|
|
39667
39668
|
...backport && {
|
|
39668
39669
|
derivation: {
|
|
39669
39670
|
upstreamCommit: backport.upstreamCommit,
|
|
@@ -47593,10 +47594,10 @@ function swiftNativePin() {
|
|
|
47593
47594
|
}
|
|
47594
47595
|
return pin;
|
|
47595
47596
|
}
|
|
47596
|
-
function publishedSwiftSdk(
|
|
47597
|
+
function publishedSwiftSdk(sha2564) {
|
|
47597
47598
|
const { sdkRuntime, sdkGuestRuntime } = swiftNativePin().distribution;
|
|
47598
47599
|
return [sdkRuntime, sdkGuestRuntime].find(
|
|
47599
|
-
(publication) => publication?.source ===
|
|
47600
|
+
(publication) => publication?.source === sha2564
|
|
47600
47601
|
);
|
|
47601
47602
|
}
|
|
47602
47603
|
var pin;
|
|
@@ -58441,6 +58442,111 @@ var init_swift_objc_runtime = __esm({
|
|
|
58441
58442
|
}
|
|
58442
58443
|
});
|
|
58443
58444
|
|
|
58445
|
+
// src/wasm-binary-sections.ts
|
|
58446
|
+
function encodeWasmNumber(value) {
|
|
58447
|
+
const bytes = [];
|
|
58448
|
+
for (let rest = value; ; ) {
|
|
58449
|
+
const byte = rest % 128;
|
|
58450
|
+
rest = Math.floor(rest / 128);
|
|
58451
|
+
if (rest === 0) return [...bytes, byte];
|
|
58452
|
+
bytes.push(byte | 128);
|
|
58453
|
+
}
|
|
58454
|
+
}
|
|
58455
|
+
function encodeWasmSigned(value) {
|
|
58456
|
+
const out = [];
|
|
58457
|
+
for (; ; ) {
|
|
58458
|
+
const byte = Number(value & 127n);
|
|
58459
|
+
value >>= 7n;
|
|
58460
|
+
if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
|
|
58461
|
+
out.push(byte);
|
|
58462
|
+
return out;
|
|
58463
|
+
}
|
|
58464
|
+
out.push(byte | 128);
|
|
58465
|
+
}
|
|
58466
|
+
}
|
|
58467
|
+
function encodeWasmName(name3) {
|
|
58468
|
+
const bytes = new TextEncoder().encode(name3);
|
|
58469
|
+
return [...encodeWasmNumber(bytes.length), ...bytes];
|
|
58470
|
+
}
|
|
58471
|
+
function readULEB(bytes, offset, end = bytes.length) {
|
|
58472
|
+
if (offset < end) {
|
|
58473
|
+
const first = bytes[offset];
|
|
58474
|
+
if (first < 128) return [first, offset + 1];
|
|
58475
|
+
}
|
|
58476
|
+
let value = 0;
|
|
58477
|
+
for (let shift = 0; ; shift += 7) {
|
|
58478
|
+
if (offset >= end || shift > 63) throw new Error("invalid wasm integer");
|
|
58479
|
+
const byte = bytes[offset++];
|
|
58480
|
+
value += (byte & 127) * 2 ** shift;
|
|
58481
|
+
if (!(byte & 128)) return [value, offset];
|
|
58482
|
+
}
|
|
58483
|
+
}
|
|
58484
|
+
function readSLEB(bytes, offset, end = bytes.length) {
|
|
58485
|
+
let value = 0n;
|
|
58486
|
+
let shift = 0n;
|
|
58487
|
+
let byte = 0;
|
|
58488
|
+
do {
|
|
58489
|
+
if (offset >= end || shift > 70n) throw new Error("invalid wasm integer");
|
|
58490
|
+
byte = bytes[offset++];
|
|
58491
|
+
value |= BigInt(byte & 127) << shift;
|
|
58492
|
+
shift += 7n;
|
|
58493
|
+
} while (byte & 128);
|
|
58494
|
+
if (byte & 64) value -= 1n << shift;
|
|
58495
|
+
return [value, offset];
|
|
58496
|
+
}
|
|
58497
|
+
function skipLEB(bytes, offset) {
|
|
58498
|
+
while ((bytes[offset++] & 128) !== 0) {
|
|
58499
|
+
}
|
|
58500
|
+
return offset;
|
|
58501
|
+
}
|
|
58502
|
+
function readWasmSection(bytes, start, end) {
|
|
58503
|
+
let at = start;
|
|
58504
|
+
const number4 = () => {
|
|
58505
|
+
const [value, next] = readULEB(bytes, at, end);
|
|
58506
|
+
at = next;
|
|
58507
|
+
return value;
|
|
58508
|
+
};
|
|
58509
|
+
return {
|
|
58510
|
+
number: number4,
|
|
58511
|
+
byte: () => {
|
|
58512
|
+
if (at >= end) throw new Error("truncated wasm section");
|
|
58513
|
+
return bytes[at++];
|
|
58514
|
+
},
|
|
58515
|
+
name: () => {
|
|
58516
|
+
const length = number4();
|
|
58517
|
+
at += length;
|
|
58518
|
+
if (at > end) throw new Error("truncated wasm name");
|
|
58519
|
+
return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
|
|
58520
|
+
},
|
|
58521
|
+
skip: (length) => {
|
|
58522
|
+
at += length;
|
|
58523
|
+
if (at > end) throw new Error("truncated wasm section");
|
|
58524
|
+
},
|
|
58525
|
+
position: () => at,
|
|
58526
|
+
done: () => at === end
|
|
58527
|
+
};
|
|
58528
|
+
}
|
|
58529
|
+
function wasmSections(bytes) {
|
|
58530
|
+
if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
|
|
58531
|
+
throw new Error("not a wasm module");
|
|
58532
|
+
const found2 = [];
|
|
58533
|
+
for (let at = 8; at < bytes.length; ) {
|
|
58534
|
+
const header = readWasmSection(bytes, at, bytes.length);
|
|
58535
|
+
const id = header.byte();
|
|
58536
|
+
const size2 = header.number();
|
|
58537
|
+
const start = header.position();
|
|
58538
|
+
if (start + size2 > bytes.length) throw new Error("truncated wasm section");
|
|
58539
|
+
found2.push({ id, offset: at, start, end: start + size2 });
|
|
58540
|
+
at = start + size2;
|
|
58541
|
+
}
|
|
58542
|
+
return found2;
|
|
58543
|
+
}
|
|
58544
|
+
var init_wasm_binary_sections = __esm({
|
|
58545
|
+
"src/wasm-binary-sections.ts"() {
|
|
58546
|
+
"use strict";
|
|
58547
|
+
}
|
|
58548
|
+
});
|
|
58549
|
+
|
|
58444
58550
|
// src/swift-shared-sdk.ts
|
|
58445
58551
|
function swiftSharedSdkSourceRoot(moduleRoot, distribution) {
|
|
58446
58552
|
return import_node_path53.default.resolve(moduleRoot, distribution ? "sdk/ios" : "../peachsim/sdk/ios");
|
|
@@ -58491,18 +58597,6 @@ function swiftSharedSdkFlags(moduleRoot, distribution) {
|
|
|
58491
58597
|
import_node_path53.default.join(root, "usr/include")
|
|
58492
58598
|
];
|
|
58493
58599
|
}
|
|
58494
|
-
function readULEB(b, o) {
|
|
58495
|
-
let res = 0;
|
|
58496
|
-
let shift = 0;
|
|
58497
|
-
let p = o;
|
|
58498
|
-
while (true) {
|
|
58499
|
-
const byte = b[p++];
|
|
58500
|
-
res |= (byte & 127) << shift;
|
|
58501
|
-
if ((byte & 128) === 0) break;
|
|
58502
|
-
shift += 7;
|
|
58503
|
-
}
|
|
58504
|
-
return [res, p];
|
|
58505
|
-
}
|
|
58506
58600
|
function weakenFoundationSymbolsInWasmObj(buf) {
|
|
58507
58601
|
let pos = 8;
|
|
58508
58602
|
while (pos < buf.length) {
|
|
@@ -58867,6 +58961,7 @@ var init_swift_shared_sdk = __esm({
|
|
|
58867
58961
|
import_node_path53 = __toESM(require("node:path"), 1);
|
|
58868
58962
|
init_swift_toolchain();
|
|
58869
58963
|
init_swiftTargetContract();
|
|
58964
|
+
init_wasm_binary_sections();
|
|
58870
58965
|
SWIFT_DISTRIBUTION_MIRROR_RECORD = ".peach-mirror.json";
|
|
58871
58966
|
distributionHeaderRoots = /* @__PURE__ */ new Map();
|
|
58872
58967
|
WEAKEN_FOUNDATION_SYMS = /* @__PURE__ */ new Set([
|
|
@@ -59848,6 +59943,21 @@ var init_swift_foundation = __esm({
|
|
|
59848
59943
|
}
|
|
59849
59944
|
});
|
|
59850
59945
|
|
|
59946
|
+
// src/sha256.ts
|
|
59947
|
+
function sha256Hex2(input) {
|
|
59948
|
+
if (typeof Bun !== "undefined") {
|
|
59949
|
+
return new Bun.CryptoHasher("sha256").update(input).digest("hex");
|
|
59950
|
+
}
|
|
59951
|
+
return (0, import_node_crypto31.createHash)("sha256").update(input).digest("hex");
|
|
59952
|
+
}
|
|
59953
|
+
var import_node_crypto31;
|
|
59954
|
+
var init_sha256 = __esm({
|
|
59955
|
+
"src/sha256.ts"() {
|
|
59956
|
+
"use strict";
|
|
59957
|
+
import_node_crypto31 = require("node:crypto");
|
|
59958
|
+
}
|
|
59959
|
+
});
|
|
59960
|
+
|
|
59851
59961
|
// src/swift-guest-source-plan.ts
|
|
59852
59962
|
function swiftPackageLinkage(target) {
|
|
59853
59963
|
const linkage = target.machOType === "staticlib" ? "static" : target.machOType === "mh_dylib" ? "dynamic" : null;
|
|
@@ -60258,16 +60368,12 @@ var init_swift_link_roots = __esm({
|
|
|
60258
60368
|
"use strict";
|
|
60259
60369
|
import_node_fs58 = __toESM(require("node:fs"), 1);
|
|
60260
60370
|
import_node_path57 = __toESM(require("node:path"), 1);
|
|
60371
|
+
init_wasm_binary_sections();
|
|
60261
60372
|
OBJC_RUNTIME_LOOKUP_SECTION = "peach_objc_runtime_lookup";
|
|
60262
60373
|
leb = (bytes, at) => {
|
|
60263
|
-
|
|
60264
|
-
|
|
60265
|
-
|
|
60266
|
-
const byte = bytes[at.offset++];
|
|
60267
|
-
value += (byte & 127) * scale;
|
|
60268
|
-
if (!(byte & 128)) return value;
|
|
60269
|
-
scale *= 128;
|
|
60270
|
-
}
|
|
60374
|
+
const [value, next] = readULEB(bytes, at.offset);
|
|
60375
|
+
at.offset = next;
|
|
60376
|
+
return value;
|
|
60271
60377
|
};
|
|
60272
60378
|
rootsByDistribution = /* @__PURE__ */ new Map();
|
|
60273
60379
|
}
|
|
@@ -61096,68 +61202,6 @@ var init_swift_guest_linked_spans = __esm({
|
|
|
61096
61202
|
}
|
|
61097
61203
|
});
|
|
61098
61204
|
|
|
61099
|
-
// src/wasm-binary-sections.ts
|
|
61100
|
-
function encodeWasmNumber(value) {
|
|
61101
|
-
const bytes = [];
|
|
61102
|
-
for (let rest = value; ; ) {
|
|
61103
|
-
const byte = rest % 128;
|
|
61104
|
-
rest = Math.floor(rest / 128);
|
|
61105
|
-
if (rest === 0) return [...bytes, byte];
|
|
61106
|
-
bytes.push(byte | 128);
|
|
61107
|
-
}
|
|
61108
|
-
}
|
|
61109
|
-
function encodeWasmName(name3) {
|
|
61110
|
-
const bytes = new TextEncoder().encode(name3);
|
|
61111
|
-
return [...encodeWasmNumber(bytes.length), ...bytes];
|
|
61112
|
-
}
|
|
61113
|
-
function readWasmSection(bytes, start, end) {
|
|
61114
|
-
let at = start;
|
|
61115
|
-
const number4 = () => {
|
|
61116
|
-
let value = 0;
|
|
61117
|
-
for (let shift = 0; ; shift += 7) {
|
|
61118
|
-
if (at >= end || shift > 63) throw new Error("invalid wasm integer");
|
|
61119
|
-
const byte = bytes[at++];
|
|
61120
|
-
value += (byte & 127) * 2 ** shift;
|
|
61121
|
-
if (!(byte & 128)) return value;
|
|
61122
|
-
}
|
|
61123
|
-
};
|
|
61124
|
-
return {
|
|
61125
|
-
number: number4,
|
|
61126
|
-
byte: () => {
|
|
61127
|
-
if (at >= end) throw new Error("truncated wasm section");
|
|
61128
|
-
return bytes[at++];
|
|
61129
|
-
},
|
|
61130
|
-
name: () => {
|
|
61131
|
-
const length = number4();
|
|
61132
|
-
at += length;
|
|
61133
|
-
if (at > end) throw new Error("truncated wasm name");
|
|
61134
|
-
return Buffer.from(bytes.buffer, bytes.byteOffset + at - length, length).toString();
|
|
61135
|
-
},
|
|
61136
|
-
position: () => at,
|
|
61137
|
-
done: () => at === end
|
|
61138
|
-
};
|
|
61139
|
-
}
|
|
61140
|
-
function wasmSections(bytes) {
|
|
61141
|
-
if (Buffer.from(bytes.subarray(0, 8)).toString("hex") !== "0061736d01000000")
|
|
61142
|
-
throw new Error("not a wasm module");
|
|
61143
|
-
const found2 = [];
|
|
61144
|
-
for (let at = 8; at < bytes.length; ) {
|
|
61145
|
-
const header = readWasmSection(bytes, at, bytes.length);
|
|
61146
|
-
const id = header.byte();
|
|
61147
|
-
const size2 = header.number();
|
|
61148
|
-
const start = header.position();
|
|
61149
|
-
if (start + size2 > bytes.length) throw new Error("truncated wasm section");
|
|
61150
|
-
found2.push({ id, offset: at, start, end: start + size2 });
|
|
61151
|
-
at = start + size2;
|
|
61152
|
-
}
|
|
61153
|
-
return found2;
|
|
61154
|
-
}
|
|
61155
|
-
var init_wasm_binary_sections = __esm({
|
|
61156
|
-
"src/wasm-binary-sections.ts"() {
|
|
61157
|
-
"use strict";
|
|
61158
|
-
}
|
|
61159
|
-
});
|
|
61160
|
-
|
|
61161
61205
|
// src/wasm-imports.ts
|
|
61162
61206
|
function readWasmImports(bytes, section2, visit3) {
|
|
61163
61207
|
const input = readWasmSection(bytes, section2.start, section2.end);
|
|
@@ -61441,23 +61485,13 @@ function wasmReader(bytes, start) {
|
|
|
61441
61485
|
const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
61442
61486
|
let at = start;
|
|
61443
61487
|
const u = () => {
|
|
61444
|
-
|
|
61445
|
-
|
|
61446
|
-
|
|
61447
|
-
value += (byte & 127) * 2 ** shift;
|
|
61448
|
-
if (!(byte & 128)) return value;
|
|
61449
|
-
}
|
|
61488
|
+
const [value, next] = readULEB(bytes, at);
|
|
61489
|
+
at = next;
|
|
61490
|
+
return value;
|
|
61450
61491
|
};
|
|
61451
61492
|
const s = () => {
|
|
61452
|
-
|
|
61453
|
-
|
|
61454
|
-
let byte = 0;
|
|
61455
|
-
do {
|
|
61456
|
-
byte = bytes[at++];
|
|
61457
|
-
value |= BigInt(byte & 127) << shift;
|
|
61458
|
-
shift += 7n;
|
|
61459
|
-
} while (byte & 128);
|
|
61460
|
-
if (byte & 64) value -= 1n << shift;
|
|
61493
|
+
const [value, next] = readSLEB(bytes, at);
|
|
61494
|
+
at = next;
|
|
61461
61495
|
return value;
|
|
61462
61496
|
};
|
|
61463
61497
|
return {
|
|
@@ -61762,7 +61796,7 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
|
|
|
61762
61796
|
else data[entry.name] = value;
|
|
61763
61797
|
}
|
|
61764
61798
|
if (entry.kind !== 0 && entry.kind !== 3 || host2.has(entry.name))
|
|
61765
|
-
kept.push([...
|
|
61799
|
+
kept.push([...encodeWasmName(entry.name), entry.kind, ...encodeWasmNumber(entry.index)]);
|
|
61766
61800
|
}
|
|
61767
61801
|
if (guestMap) {
|
|
61768
61802
|
if (guestMap.code.length !== m.bodies.length)
|
|
@@ -61777,19 +61811,19 @@ function finishSdkImage(bytes, hostExports, libraries, guestMap) {
|
|
|
61777
61811
|
const er = wasmReader(bytes, elements.start);
|
|
61778
61812
|
const segments = er.u();
|
|
61779
61813
|
const replaced = /* @__PURE__ */ new Map([
|
|
61780
|
-
[4, [1, 112, 4, ...
|
|
61781
|
-
[7, [...
|
|
61814
|
+
[4, [1, 112, 4, ...encodeWasmNumber(tableEnd + added.length)]],
|
|
61815
|
+
[7, [...encodeWasmNumber(kept.length), ...kept.flat()]],
|
|
61782
61816
|
[
|
|
61783
61817
|
9,
|
|
61784
61818
|
[
|
|
61785
|
-
...
|
|
61819
|
+
...encodeWasmNumber(segments + 1),
|
|
61786
61820
|
...bytes.subarray(er.at, elements.end),
|
|
61787
61821
|
0,
|
|
61788
61822
|
66,
|
|
61789
|
-
...
|
|
61823
|
+
...encodeWasmSigned(BigInt(tableEnd)),
|
|
61790
61824
|
11,
|
|
61791
|
-
...
|
|
61792
|
-
...added.flatMap(
|
|
61825
|
+
...encodeWasmNumber(added.length),
|
|
61826
|
+
...added.flatMap(encodeWasmNumber)
|
|
61793
61827
|
]
|
|
61794
61828
|
]
|
|
61795
61829
|
]);
|
|
@@ -61895,33 +61929,33 @@ function codeOnlySdkImage(bytes, constructorMask) {
|
|
|
61895
61929
|
if (drop) r.skip(1);
|
|
61896
61930
|
gated.push(
|
|
61897
61931
|
66,
|
|
61898
|
-
...
|
|
61932
|
+
...encodeWasmSigned(BigInt(constructorMask + index++)),
|
|
61899
61933
|
45,
|
|
61900
61934
|
0,
|
|
61901
61935
|
0,
|
|
61902
61936
|
4,
|
|
61903
61937
|
64,
|
|
61904
61938
|
16,
|
|
61905
|
-
...
|
|
61939
|
+
...encodeWasmNumber(callee),
|
|
61906
61940
|
...drop ? [26] : [],
|
|
61907
61941
|
11
|
|
61908
61942
|
);
|
|
61909
61943
|
}
|
|
61910
61944
|
if (index > SWIFT_SDK_CONSTRUCTOR_LIMIT)
|
|
61911
61945
|
throw new Error(`${index} sdk constructors exceed the mask`);
|
|
61912
|
-
gated.push(16, ...
|
|
61946
|
+
gated.push(16, ...encodeWasmNumber(functionIndex("__peach_sdk_register")), 11);
|
|
61913
61947
|
bodies[constructors] = Uint8Array.from(gated);
|
|
61914
61948
|
}
|
|
61915
|
-
const codeParts = [Uint8Array.from(
|
|
61916
|
-
for (const body of bodies) codeParts.push(Uint8Array.from(
|
|
61949
|
+
const codeParts = [Uint8Array.from(encodeWasmNumber(bodies.length))];
|
|
61950
|
+
for (const body of bodies) codeParts.push(Uint8Array.from(encodeWasmNumber(body.length)), body);
|
|
61917
61951
|
const codeSize = codeParts.reduce((sum, part) => sum + part.length, 0);
|
|
61918
61952
|
const tls = passiveSegments(bytes)[0];
|
|
61919
61953
|
const out = [bytes.subarray(0, 8)];
|
|
61920
61954
|
for (const s of m.sections) {
|
|
61921
61955
|
if (s.id === 10) {
|
|
61922
|
-
out.push(Uint8Array.from([10, ...
|
|
61956
|
+
out.push(Uint8Array.from([10, ...encodeWasmNumber(codeSize)]));
|
|
61923
61957
|
for (const part of codeParts) out.push(part);
|
|
61924
|
-
} else if (s.id === 11) out.push(section(11, [1, 1, ...
|
|
61958
|
+
} else if (s.id === 11) out.push(section(11, [1, 1, ...encodeWasmNumber(tls.length), ...tls]));
|
|
61925
61959
|
else if (s.id === 12) out.push(section(12, [1]));
|
|
61926
61960
|
else out.push(bytes.subarray(s.offset, s.end));
|
|
61927
61961
|
}
|
|
@@ -62238,39 +62272,14 @@ function unslottedFunctions(bytes) {
|
|
|
62238
62272
|
}
|
|
62239
62273
|
return definedFuncs - slotted.size;
|
|
62240
62274
|
}
|
|
62241
|
-
var
|
|
62275
|
+
var section, PROCESS_EXPORTS, SWIFT_SDK_CONSTRUCTOR_LIMIT, FUNCTION_RELOCATIONS, MEMORY_RELOCATIONS, ADDEND_RELOCATIONS, FUNCTION_RELOC_MASK, MEMORY_RELOC_MASK, ADDEND_RELOC_MASK;
|
|
62242
62276
|
var init_swift_sdk_image_wasm = __esm({
|
|
62243
62277
|
"src/swift-sdk-image-wasm.ts"() {
|
|
62244
62278
|
"use strict";
|
|
62245
62279
|
init_swift_sdk_image_map();
|
|
62246
62280
|
init_swiftSdkLinkContract();
|
|
62247
|
-
|
|
62248
|
-
|
|
62249
|
-
do {
|
|
62250
|
-
let byte = value % 128;
|
|
62251
|
-
value = Math.floor(value / 128);
|
|
62252
|
-
if (value) byte |= 128;
|
|
62253
|
-
out.push(byte);
|
|
62254
|
-
} while (value);
|
|
62255
|
-
return out;
|
|
62256
|
-
};
|
|
62257
|
-
sleb = (value) => {
|
|
62258
|
-
const out = [];
|
|
62259
|
-
for (; ; ) {
|
|
62260
|
-
const byte = Number(value & 127n);
|
|
62261
|
-
value >>= 7n;
|
|
62262
|
-
if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
|
|
62263
|
-
out.push(byte);
|
|
62264
|
-
return out;
|
|
62265
|
-
}
|
|
62266
|
-
out.push(byte | 128);
|
|
62267
|
-
}
|
|
62268
|
-
};
|
|
62269
|
-
encodedName = (name3) => {
|
|
62270
|
-
const bytes = [...Buffer.from(name3)];
|
|
62271
|
-
return [...uleb(bytes.length), ...bytes];
|
|
62272
|
-
};
|
|
62273
|
-
section = (id, payload) => Uint8Array.from([id, ...uleb(payload.length), ...payload]);
|
|
62281
|
+
init_wasm_binary_sections();
|
|
62282
|
+
section = (id, payload) => Uint8Array.from([id, ...encodeWasmNumber(payload.length), ...payload]);
|
|
62274
62283
|
PROCESS_EXPORTS = [
|
|
62275
62284
|
"_initialize",
|
|
62276
62285
|
"__wasm_call_ctors",
|
|
@@ -62375,20 +62384,12 @@ function localizeDefinedWasmSymbols(bytes, names) {
|
|
|
62375
62384
|
const output = new Uint8Array(bytes);
|
|
62376
62385
|
let cur = 8;
|
|
62377
62386
|
const readU = () => {
|
|
62378
|
-
const
|
|
62379
|
-
|
|
62380
|
-
|
|
62381
|
-
let shift = 7;
|
|
62382
|
-
while (true) {
|
|
62383
|
-
const byte = bytes[cur++];
|
|
62384
|
-
res |= (byte & 127) << shift;
|
|
62385
|
-
if ((byte & 128) === 0) return res;
|
|
62386
|
-
shift += 7;
|
|
62387
|
-
}
|
|
62387
|
+
const [res, next] = readULEB(bytes, cur);
|
|
62388
|
+
cur = next;
|
|
62389
|
+
return res;
|
|
62388
62390
|
};
|
|
62389
62391
|
const skipU = () => {
|
|
62390
|
-
|
|
62391
|
-
}
|
|
62392
|
+
cur = skipLEB(bytes, cur);
|
|
62392
62393
|
};
|
|
62393
62394
|
const importFuncNames = [];
|
|
62394
62395
|
const importGlobalNames = [];
|
|
@@ -62495,50 +62496,11 @@ function localizeDefinedWasmSymbols(bytes, names) {
|
|
|
62495
62496
|
var init_swift_wasm_archive = __esm({
|
|
62496
62497
|
"src/swift-wasm-archive.ts"() {
|
|
62497
62498
|
"use strict";
|
|
62499
|
+
init_wasm_binary_sections();
|
|
62498
62500
|
}
|
|
62499
62501
|
});
|
|
62500
62502
|
|
|
62501
62503
|
// src/swift-wasm-prune.ts
|
|
62502
|
-
function sha256Hex2(bytes) {
|
|
62503
|
-
if (typeof Bun !== "undefined")
|
|
62504
|
-
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
62505
|
-
return (0, import_node_crypto31.createHash)("sha256").update(bytes).digest("hex");
|
|
62506
|
-
}
|
|
62507
|
-
function readULEB2(b, o) {
|
|
62508
|
-
let res = 0;
|
|
62509
|
-
let shift = 0;
|
|
62510
|
-
let p = o;
|
|
62511
|
-
while (true) {
|
|
62512
|
-
const byte = b[p++];
|
|
62513
|
-
res |= (byte & 127) << shift;
|
|
62514
|
-
if ((byte & 128) === 0) break;
|
|
62515
|
-
shift += 7;
|
|
62516
|
-
}
|
|
62517
|
-
return [res, p];
|
|
62518
|
-
}
|
|
62519
|
-
function readSLEB(b, o) {
|
|
62520
|
-
let res = 0;
|
|
62521
|
-
let shift = 0;
|
|
62522
|
-
let p = o;
|
|
62523
|
-
let byte = 0;
|
|
62524
|
-
do {
|
|
62525
|
-
byte = b[p++];
|
|
62526
|
-
res |= (byte & 127) << shift;
|
|
62527
|
-
shift += 7;
|
|
62528
|
-
} while (byte & 128);
|
|
62529
|
-
if (shift < 32 && byte & 64) res |= ~0 << shift;
|
|
62530
|
-
return [res, p];
|
|
62531
|
-
}
|
|
62532
|
-
function encodeULEB(val) {
|
|
62533
|
-
const out = [];
|
|
62534
|
-
do {
|
|
62535
|
-
let byte = val & 127;
|
|
62536
|
-
val >>>= 7;
|
|
62537
|
-
if (val !== 0) byte |= 128;
|
|
62538
|
-
out.push(byte);
|
|
62539
|
-
} while (val !== 0);
|
|
62540
|
-
return out;
|
|
62541
|
-
}
|
|
62542
62504
|
function isRootSegName(name3) {
|
|
62543
62505
|
for (const pref of ROOT_SEG_PREFIXES) {
|
|
62544
62506
|
if (name3 === pref || name3.startsWith(`${pref}.`)) return true;
|
|
@@ -62564,39 +62526,14 @@ function decodeRelocations(buf, sections) {
|
|
|
62564
62526
|
for (let k = 0; k < sectionCount; k++, i++) {
|
|
62565
62527
|
start[i] = length + cur - baseAt;
|
|
62566
62528
|
const rType = buf[cur++];
|
|
62567
|
-
let offset
|
|
62568
|
-
|
|
62569
|
-
|
|
62570
|
-
|
|
62571
|
-
while (true) {
|
|
62572
|
-
const byte = buf[cur++];
|
|
62573
|
-
offset |= (byte & 127) << shift;
|
|
62574
|
-
if (byte < 128) break;
|
|
62575
|
-
shift += 7;
|
|
62576
|
-
}
|
|
62577
|
-
}
|
|
62578
|
-
let symbol2 = buf[cur++];
|
|
62579
|
-
if (symbol2 >= 128) {
|
|
62580
|
-
symbol2 &= 127;
|
|
62581
|
-
let shift = 7;
|
|
62582
|
-
while (true) {
|
|
62583
|
-
const byte = buf[cur++];
|
|
62584
|
-
symbol2 |= (byte & 127) << shift;
|
|
62585
|
-
if (byte < 128) break;
|
|
62586
|
-
shift += 7;
|
|
62587
|
-
}
|
|
62588
|
-
}
|
|
62529
|
+
let offset;
|
|
62530
|
+
[offset, cur] = readULEB(buf, cur);
|
|
62531
|
+
let symbol2;
|
|
62532
|
+
[symbol2, cur] = readULEB(buf, cur);
|
|
62589
62533
|
if (rType < 32 && (ADDEND_RELOC_MASK2 & 1 << rType) !== 0) {
|
|
62590
|
-
let
|
|
62591
|
-
|
|
62592
|
-
|
|
62593
|
-
while (byte >= 128) {
|
|
62594
|
-
byte = buf[cur++];
|
|
62595
|
-
value |= (byte & 127) << shift;
|
|
62596
|
-
shift += 7;
|
|
62597
|
-
}
|
|
62598
|
-
if (shift < 32 && (byte & 64) !== 0) value |= ~0 << shift;
|
|
62599
|
-
addend[i] = value;
|
|
62534
|
+
let value;
|
|
62535
|
+
[value, cur] = readSLEB(buf, cur);
|
|
62536
|
+
addend[i] = Number(BigInt.asIntN(32, value));
|
|
62600
62537
|
}
|
|
62601
62538
|
ro[i] = offset;
|
|
62602
62539
|
rs[i] = symbol2;
|
|
@@ -62631,36 +62568,36 @@ function patchSwiftrtObject(src) {
|
|
|
62631
62568
|
let pos = 8;
|
|
62632
62569
|
while (pos < buf.length) {
|
|
62633
62570
|
const id = buf[pos++];
|
|
62634
|
-
const [sz, p] =
|
|
62571
|
+
const [sz, p] = readULEB(buf, pos);
|
|
62635
62572
|
const end = p + sz;
|
|
62636
62573
|
if (id === 0) {
|
|
62637
|
-
const [nLen, np] =
|
|
62574
|
+
const [nLen, np] = readULEB(buf, p);
|
|
62638
62575
|
const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
|
|
62639
62576
|
const cp = np + nLen;
|
|
62640
62577
|
if (name3 === "linking") {
|
|
62641
|
-
let [, lp] =
|
|
62578
|
+
let [, lp] = readULEB(buf, cp);
|
|
62642
62579
|
while (lp < end) {
|
|
62643
62580
|
const subId = buf[lp++];
|
|
62644
|
-
const [subLen, sp] =
|
|
62581
|
+
const [subLen, sp] = readULEB(buf, lp);
|
|
62645
62582
|
const subEnd = sp + subLen;
|
|
62646
62583
|
if (subId === 8) {
|
|
62647
|
-
let [cnt, cur] =
|
|
62584
|
+
let [cnt, cur] = readULEB(buf, sp);
|
|
62648
62585
|
for (let i = 0; i < cnt; i++) {
|
|
62649
62586
|
const kind = buf[cur++];
|
|
62650
62587
|
const flPos = cur;
|
|
62651
|
-
const [fl, c2] =
|
|
62588
|
+
const [fl, c2] = readULEB(buf, cur);
|
|
62652
62589
|
cur = c2;
|
|
62653
62590
|
const isUndef = (fl & 16) !== 0;
|
|
62654
62591
|
const isExplicitName = (fl & 64) !== 0;
|
|
62655
62592
|
if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
|
|
62656
|
-
const [, c3] =
|
|
62593
|
+
const [, c3] = readULEB(buf, cur);
|
|
62657
62594
|
cur = c3;
|
|
62658
62595
|
if (!isUndef || isExplicitName) {
|
|
62659
|
-
const [sLen, c4] =
|
|
62596
|
+
const [sLen, c4] = readULEB(buf, cur);
|
|
62660
62597
|
cur = c4 + sLen;
|
|
62661
62598
|
}
|
|
62662
62599
|
} else if (kind === 1) {
|
|
62663
|
-
const [sLen, c3] =
|
|
62600
|
+
const [sLen, c3] = readULEB(buf, cur);
|
|
62664
62601
|
const sName = Buffer.from(buf.subarray(c3, c3 + sLen)).toString("utf8");
|
|
62665
62602
|
if (sName === "_ZN12_GLOBAL__N_18sectionsE") fallbackSymIdx = i;
|
|
62666
62603
|
for (const prefix of ["__start_", "__stop_"]) {
|
|
@@ -62672,13 +62609,13 @@ function patchSwiftrtObject(src) {
|
|
|
62672
62609
|
}
|
|
62673
62610
|
cur = c3 + sLen;
|
|
62674
62611
|
if (!isUndef) {
|
|
62675
|
-
const [, c4] =
|
|
62676
|
-
const [, c5] =
|
|
62677
|
-
const [, c6] =
|
|
62612
|
+
const [, c4] = readULEB(buf, cur);
|
|
62613
|
+
const [, c5] = readULEB(buf, c4);
|
|
62614
|
+
const [, c6] = readULEB(buf, c5);
|
|
62678
62615
|
cur = c6;
|
|
62679
62616
|
}
|
|
62680
62617
|
} else if (kind === 3) {
|
|
62681
|
-
const [, c3] =
|
|
62618
|
+
const [, c3] = readULEB(buf, cur);
|
|
62682
62619
|
cur = c3;
|
|
62683
62620
|
}
|
|
62684
62621
|
}
|
|
@@ -62692,26 +62629,25 @@ function patchSwiftrtObject(src) {
|
|
|
62692
62629
|
pos = 8;
|
|
62693
62630
|
while (pos < buf.length) {
|
|
62694
62631
|
const id = buf[pos++];
|
|
62695
|
-
const [sz, p] =
|
|
62632
|
+
const [sz, p] = readULEB(buf, pos);
|
|
62696
62633
|
const end = p + sz;
|
|
62697
62634
|
if (id === 0) {
|
|
62698
|
-
const [nLen, np] =
|
|
62635
|
+
const [nLen, np] = readULEB(buf, p);
|
|
62699
62636
|
const name3 = Buffer.from(buf.subarray(np, np + nLen)).toString("utf8");
|
|
62700
62637
|
const cp = np + nLen;
|
|
62701
62638
|
if (name3 === "reloc.CODE") {
|
|
62702
|
-
const [, r1] =
|
|
62703
|
-
let [cnt, cur] =
|
|
62639
|
+
const [, r1] = readULEB(buf, cp);
|
|
62640
|
+
let [cnt, cur] = readULEB(buf, r1);
|
|
62704
62641
|
for (let i = 0; i < cnt; i++) {
|
|
62705
62642
|
const rType = buf[cur++];
|
|
62706
|
-
const [, c2] =
|
|
62707
|
-
const [rs, c3] =
|
|
62643
|
+
const [, c2] = readULEB(buf, cur);
|
|
62644
|
+
const [rs, c3] = readULEB(buf, c2);
|
|
62708
62645
|
if (neutralizedSyms.has(rs) && c3 - c2 === 1) {
|
|
62709
62646
|
buf[c2] = fallbackSymIdx;
|
|
62710
62647
|
}
|
|
62711
62648
|
cur = c3;
|
|
62712
62649
|
if (ADDEND_RELOCATIONS.has(rType)) {
|
|
62713
|
-
|
|
62714
|
-
cur = c4;
|
|
62650
|
+
cur = skipLEB(buf, cur);
|
|
62715
62651
|
}
|
|
62716
62652
|
}
|
|
62717
62653
|
}
|
|
@@ -62725,25 +62661,14 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
62725
62661
|
let pos = 8;
|
|
62726
62662
|
let cur = 8;
|
|
62727
62663
|
const readU = () => {
|
|
62728
|
-
const
|
|
62729
|
-
|
|
62730
|
-
|
|
62731
|
-
let shift = 7;
|
|
62732
|
-
while (true) {
|
|
62733
|
-
const byte = buf[cur++];
|
|
62734
|
-
res |= (byte & 127) << shift;
|
|
62735
|
-
if (byte < 128) return res;
|
|
62736
|
-
shift += 7;
|
|
62737
|
-
}
|
|
62664
|
+
const [res, next] = readULEB(buf, cur);
|
|
62665
|
+
cur = next;
|
|
62666
|
+
return res;
|
|
62738
62667
|
};
|
|
62739
62668
|
const skipU = () => {
|
|
62740
|
-
|
|
62741
|
-
}
|
|
62742
|
-
};
|
|
62743
|
-
const skipS = () => {
|
|
62744
|
-
while (buf[cur++] >= 128) {
|
|
62745
|
-
}
|
|
62669
|
+
cur = skipLEB(buf, cur);
|
|
62746
62670
|
};
|
|
62671
|
+
const skipS = skipU;
|
|
62747
62672
|
let numImportFuncs = 0;
|
|
62748
62673
|
let importsDlsym = false;
|
|
62749
62674
|
const importFuncNames = [];
|
|
@@ -63341,16 +63266,9 @@ function guestWasmSymbols(bytes) {
|
|
|
63341
63266
|
const rawBuf = Buffer.isBuffer(bytes) ? bytes : Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
63342
63267
|
let cur = 8;
|
|
63343
63268
|
const readU = () => {
|
|
63344
|
-
const
|
|
63345
|
-
|
|
63346
|
-
|
|
63347
|
-
let shift = 7;
|
|
63348
|
-
while (true) {
|
|
63349
|
-
const byte = bytes[cur++];
|
|
63350
|
-
res |= (byte & 127) << shift;
|
|
63351
|
-
if ((byte & 128) === 0) return res;
|
|
63352
|
-
shift += 7;
|
|
63353
|
-
}
|
|
63269
|
+
const [res, next] = readULEB(bytes, cur);
|
|
63270
|
+
cur = next;
|
|
63271
|
+
return res;
|
|
63354
63272
|
};
|
|
63355
63273
|
let importsDlsym = false;
|
|
63356
63274
|
const importFuncNames = [];
|
|
@@ -63540,7 +63458,7 @@ function swiftPrunedSdkObjectOrigins(sdk2, args, rewritten) {
|
|
|
63540
63458
|
}
|
|
63541
63459
|
function ensureUnpackedSdkObjects(sdkWasiDir) {
|
|
63542
63460
|
const archives = import_node_fs60.default.readdirSync(sdkWasiDir).filter((file) => file.endsWith(".a")).sort();
|
|
63543
|
-
const hash = (0,
|
|
63461
|
+
const hash = (0, import_node_crypto32.createHash)("sha256");
|
|
63544
63462
|
for (const archive of archives) {
|
|
63545
63463
|
hash.update(archive + "\0");
|
|
63546
63464
|
hash.update(swiftFileChecksum(import_node_path59.default.join(sdkWasiDir, archive)));
|
|
@@ -64491,7 +64409,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64491
64409
|
if (!deadSpecialSegs.has(sIdx)) continue;
|
|
64492
64410
|
if (!isSpecialSegRelocLive(obj, obj.segNames[sIdx], data.rs[i])) continue;
|
|
64493
64411
|
const first = relocationBytes(data, i);
|
|
64494
|
-
const [, afterRoOff] =
|
|
64412
|
+
const [, afterRoOff] = readULEB(first, 1);
|
|
64495
64413
|
firstLiveInSpecialSeg.set(sIdx, {
|
|
64496
64414
|
rType: first[0],
|
|
64497
64415
|
afterRo: first.subarray(afterRoOff)
|
|
@@ -64521,7 +64439,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64521
64439
|
zeroDataReloc(i);
|
|
64522
64440
|
} else {
|
|
64523
64441
|
const repl = firstLiveInSpecialSeg.get(segIdx);
|
|
64524
|
-
const roBytes =
|
|
64442
|
+
const roBytes = encodeWasmNumber(data.ro[i]);
|
|
64525
64443
|
const out = new Uint8Array(1 + roBytes.length + repl.afterRo.length);
|
|
64526
64444
|
out[0] = repl.rType;
|
|
64527
64445
|
out.set(roBytes, 1);
|
|
@@ -64560,34 +64478,34 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64560
64478
|
while (pos < buf.length) {
|
|
64561
64479
|
const secStart = pos;
|
|
64562
64480
|
const id = buf[pos++];
|
|
64563
|
-
const [sz, p] =
|
|
64481
|
+
const [sz, p] = readULEB(buf, pos);
|
|
64564
64482
|
const end = p + sz;
|
|
64565
64483
|
if (id === 0) {
|
|
64566
|
-
const [nLen, np] =
|
|
64484
|
+
const [nLen, np] = readULEB(buf, p);
|
|
64567
64485
|
const name3 = rawBuf.toString("utf8", np, np + nLen);
|
|
64568
64486
|
const cp = np + nLen;
|
|
64569
64487
|
if (name3 === "linking") {
|
|
64570
|
-
const [, lpStart] =
|
|
64488
|
+
const [, lpStart] = readULEB(buf, cp);
|
|
64571
64489
|
const subChunks = [buf.subarray(p, lpStart)];
|
|
64572
64490
|
let lp = lpStart;
|
|
64573
64491
|
while (lp < end) {
|
|
64574
64492
|
const subStart = lp;
|
|
64575
64493
|
const subId = buf[lp++];
|
|
64576
|
-
const [subLen, sp] =
|
|
64494
|
+
const [subLen, sp] = readULEB(buf, lp);
|
|
64577
64495
|
const subEnd = sp + subLen;
|
|
64578
64496
|
if (subId === 5) {
|
|
64579
64497
|
const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
|
|
64580
|
-
let [cnt, cur] =
|
|
64498
|
+
let [cnt, cur] = readULEB(buf, sp);
|
|
64581
64499
|
for (let i = 0; i < cnt; i++) {
|
|
64582
|
-
const [sLen, s2] =
|
|
64500
|
+
const [sLen, s2] = readULEB(buf, cur);
|
|
64583
64501
|
const segName = obj.segNames[i];
|
|
64584
64502
|
const repl = RECORD_SEGS.get(segName);
|
|
64585
64503
|
const isSpecial = repl !== void 0;
|
|
64586
64504
|
if (deadSpecialSegs.has(i) && repl !== void 0)
|
|
64587
64505
|
subCopy.set(Buffer.from(repl, "utf8"), s2 - subStart);
|
|
64588
64506
|
cur = s2 + sLen;
|
|
64589
|
-
const [, s3] =
|
|
64590
|
-
const [segFl, s4] =
|
|
64507
|
+
const [, s3] = readULEB(buf, cur);
|
|
64508
|
+
const [segFl, s4] = readULEB(buf, s3);
|
|
64591
64509
|
const sFlLen = s4 - s3;
|
|
64592
64510
|
const keepRetain = isSpecial ? !deadSpecialSegs.has(i) : isRootSegName(segName) && !segName.startsWith(".init_array") && sLive[i] === 1;
|
|
64593
64511
|
const newSegFl = keepRetain ? segFl | 4 : segFl & ~4;
|
|
@@ -64601,12 +64519,12 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64601
64519
|
}
|
|
64602
64520
|
subChunks.push(subCopy);
|
|
64603
64521
|
} else if (subId === 6) {
|
|
64604
|
-
let [cnt, cur] =
|
|
64522
|
+
let [cnt, cur] = readULEB(buf, sp);
|
|
64605
64523
|
const entrySlices = [];
|
|
64606
64524
|
for (let i = 0; i < cnt; i++) {
|
|
64607
64525
|
const eStart = cur;
|
|
64608
|
-
const [, s2] =
|
|
64609
|
-
const [symIdx, s3] =
|
|
64526
|
+
const [, s2] = readULEB(buf, cur);
|
|
64527
|
+
const [symIdx, s3] = readULEB(buf, s2);
|
|
64610
64528
|
cur = s3;
|
|
64611
64529
|
if (obj.symKind[symIdx] === 0 && obj.symElemIdx[symIdx] >= obj.numImportFuncs) {
|
|
64612
64530
|
if (fLive[obj.symElemIdx[symIdx] - obj.numImportFuncs] === 1) {
|
|
@@ -64617,19 +64535,19 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64617
64535
|
}
|
|
64618
64536
|
}
|
|
64619
64537
|
if (entrySlices.length > 0) {
|
|
64620
|
-
const cntBytes = Uint8Array.from(
|
|
64538
|
+
const cntBytes = Uint8Array.from(encodeWasmNumber(entrySlices.length));
|
|
64621
64539
|
const bodyLen = cntBytes.length + entrySlices.reduce((a, b) => a + b.length, 0);
|
|
64622
|
-
const lenBytes = Uint8Array.from(
|
|
64540
|
+
const lenBytes = Uint8Array.from(encodeWasmNumber(bodyLen));
|
|
64623
64541
|
subChunks.push(Uint8Array.of(6), lenBytes, cntBytes);
|
|
64624
64542
|
for (const entry of entrySlices) subChunks.push(entry);
|
|
64625
64543
|
}
|
|
64626
64544
|
} else if (subId === 8) {
|
|
64627
64545
|
const subCopy = new Uint8Array(buf.subarray(subStart, subEnd));
|
|
64628
|
-
let [cnt, cur] =
|
|
64546
|
+
let [cnt, cur] = readULEB(buf, sp);
|
|
64629
64547
|
for (let i = 0; i < cnt; i++) {
|
|
64630
64548
|
const kind = buf[cur++];
|
|
64631
64549
|
const flOffset = cur - subStart;
|
|
64632
|
-
const [fl, c2] =
|
|
64550
|
+
const [fl, c2] = readULEB(buf, cur);
|
|
64633
64551
|
cur = c2;
|
|
64634
64552
|
const isUndef = (fl & 16) !== 0;
|
|
64635
64553
|
const isExplicitName = (fl & 64) !== 0;
|
|
@@ -64649,23 +64567,23 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64649
64567
|
subCopy[flOffset + 1] = 0;
|
|
64650
64568
|
}
|
|
64651
64569
|
if (kind === 0 || kind === 2 || kind === 4 || kind === 5) {
|
|
64652
|
-
const [, c3] =
|
|
64570
|
+
const [, c3] = readULEB(buf, cur);
|
|
64653
64571
|
cur = c3;
|
|
64654
64572
|
if (!isUndef || isExplicitName) {
|
|
64655
|
-
const [sLen, c4] =
|
|
64573
|
+
const [sLen, c4] = readULEB(buf, cur);
|
|
64656
64574
|
cur = c4 + sLen;
|
|
64657
64575
|
}
|
|
64658
64576
|
} else if (kind === 1) {
|
|
64659
|
-
const [sLen, c3] =
|
|
64577
|
+
const [sLen, c3] = readULEB(buf, cur);
|
|
64660
64578
|
cur = c3 + sLen;
|
|
64661
64579
|
if (!isUndef) {
|
|
64662
|
-
const [, c4] =
|
|
64663
|
-
const [, c5] =
|
|
64664
|
-
const [, c6] =
|
|
64580
|
+
const [, c4] = readULEB(buf, cur);
|
|
64581
|
+
const [, c5] = readULEB(buf, c4);
|
|
64582
|
+
const [, c6] = readULEB(buf, c5);
|
|
64665
64583
|
cur = c6;
|
|
64666
64584
|
}
|
|
64667
64585
|
} else if (kind === 3) {
|
|
64668
|
-
const [, c3] =
|
|
64586
|
+
const [, c3] = readULEB(buf, cur);
|
|
64669
64587
|
cur = c3;
|
|
64670
64588
|
}
|
|
64671
64589
|
}
|
|
@@ -64676,29 +64594,29 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64676
64594
|
lp = subEnd;
|
|
64677
64595
|
}
|
|
64678
64596
|
const totalSubLen = subChunks.reduce((a, b) => a + b.length, 0);
|
|
64679
|
-
outChunks.push(Uint8Array.of(0), Uint8Array.from(
|
|
64597
|
+
outChunks.push(Uint8Array.of(0), Uint8Array.from(encodeWasmNumber(totalSubLen)));
|
|
64680
64598
|
for (const chunk of subChunks) outChunks.push(chunk);
|
|
64681
64599
|
} else if (name3 === "reloc.CODE") {
|
|
64682
|
-
const [, r1] =
|
|
64600
|
+
const [, r1] = readULEB(buf, cp);
|
|
64683
64601
|
const headerSlice = buf.subarray(p, r1);
|
|
64684
|
-
const cntBytes = Uint8Array.from(
|
|
64602
|
+
const cntBytes = Uint8Array.from(encodeWasmNumber(keptCodeRelocs.length));
|
|
64685
64603
|
const relSlices = keptCodeRelocs.map((i) => relocationBytes(code, i));
|
|
64686
64604
|
const totalLen = headerSlice.length + cntBytes.length + relSlices.reduce((a, b) => a + b.length, 0);
|
|
64687
64605
|
outChunks.push(
|
|
64688
64606
|
Uint8Array.of(0),
|
|
64689
|
-
Uint8Array.from(
|
|
64607
|
+
Uint8Array.from(encodeWasmNumber(totalLen)),
|
|
64690
64608
|
headerSlice,
|
|
64691
64609
|
cntBytes
|
|
64692
64610
|
);
|
|
64693
64611
|
for (const relocation of relSlices) outChunks.push(relocation);
|
|
64694
64612
|
} else if (name3 === "reloc.DATA") {
|
|
64695
|
-
const [, r1] =
|
|
64613
|
+
const [, r1] = readULEB(buf, cp);
|
|
64696
64614
|
const headerSlice = buf.subarray(p, r1);
|
|
64697
|
-
const cntBytes = Uint8Array.from(
|
|
64615
|
+
const cntBytes = Uint8Array.from(encodeWasmNumber(keptDataRelocBytes.length));
|
|
64698
64616
|
const totalLen = headerSlice.length + cntBytes.length + keptDataRelocBytes.reduce((a, b) => a + b.length, 0);
|
|
64699
64617
|
outChunks.push(
|
|
64700
64618
|
Uint8Array.of(0),
|
|
64701
|
-
Uint8Array.from(
|
|
64619
|
+
Uint8Array.from(encodeWasmNumber(totalLen)),
|
|
64702
64620
|
headerSlice,
|
|
64703
64621
|
cntBytes
|
|
64704
64622
|
);
|
|
@@ -64708,15 +64626,15 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64708
64626
|
const nameBytes = buf.subarray(p, cp);
|
|
64709
64627
|
outChunks.push(
|
|
64710
64628
|
Uint8Array.of(0),
|
|
64711
|
-
Uint8Array.from(
|
|
64629
|
+
Uint8Array.from(encodeWasmNumber(nameBytes.length)),
|
|
64712
64630
|
nameBytes
|
|
64713
64631
|
);
|
|
64714
64632
|
} else if (name3.startsWith("reloc..debug_")) {
|
|
64715
|
-
const [, r1] =
|
|
64633
|
+
const [, r1] = readULEB(buf, cp);
|
|
64716
64634
|
const headerSlice = buf.subarray(p, r1);
|
|
64717
64635
|
outChunks.push(
|
|
64718
64636
|
Uint8Array.of(0),
|
|
64719
|
-
Uint8Array.from(
|
|
64637
|
+
Uint8Array.from(encodeWasmNumber(headerSlice.length + 1)),
|
|
64720
64638
|
headerSlice,
|
|
64721
64639
|
Uint8Array.of(0)
|
|
64722
64640
|
);
|
|
@@ -64829,15 +64747,16 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
64829
64747
|
);
|
|
64830
64748
|
import_node_fs60.default.rmSync(rspPath, { force: true });
|
|
64831
64749
|
}
|
|
64832
|
-
var import_node_child_process27,
|
|
64750
|
+
var import_node_child_process27, import_node_crypto32, import_node_fs60, import_node_path59, v3, WIDE_DATA_RELOCS, ROOT_SEG_PREFIXES, RECORD_SEGS, PARTITIONED_SEGS, PRUNED_SDK_ARCHIVES, OMIT_SDK_LIB_FLAGS, NEUTRALIZED_SWIFTRT_SECTIONS, ADDEND_RELOC_MASK2, relocationBytes, parsedObjectCache, PARSED_ROOTS, SWIFTUI_WRAPPER_HOST_PROTOCOLS, SWIFT_PRUNED_LINK_MAP, SWIFT_PRUNED_LINK_RESPONSE;
|
|
64833
64751
|
var init_swift_wasm_prune = __esm({
|
|
64834
64752
|
"src/swift-wasm-prune.ts"() {
|
|
64835
64753
|
"use strict";
|
|
64836
64754
|
import_node_child_process27 = require("node:child_process");
|
|
64837
|
-
|
|
64755
|
+
import_node_crypto32 = require("node:crypto");
|
|
64838
64756
|
import_node_fs60 = __toESM(require("node:fs"), 1);
|
|
64839
64757
|
import_node_path59 = __toESM(require("node:path"), 1);
|
|
64840
64758
|
v3 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
64759
|
+
init_sha256();
|
|
64841
64760
|
init_swift_guest_source_plan();
|
|
64842
64761
|
init_swift_link_roots();
|
|
64843
64762
|
init_swift_resource_class_names();
|
|
@@ -64845,6 +64764,7 @@ var init_swift_wasm_prune = __esm({
|
|
|
64845
64764
|
init_swift_toolchain();
|
|
64846
64765
|
init_swift_wasm_archive();
|
|
64847
64766
|
init_swiftRuntimeProductContract();
|
|
64767
|
+
init_wasm_binary_sections();
|
|
64848
64768
|
WIDE_DATA_RELOCS = /* @__PURE__ */ new Set([16, 19, 22, 27]);
|
|
64849
64769
|
ROOT_SEG_PREFIXES = [
|
|
64850
64770
|
".init_array",
|
|
@@ -64951,7 +64871,7 @@ function aliasGuestArchive(options2) {
|
|
|
64951
64871
|
alias,
|
|
64952
64872
|
name: member.name,
|
|
64953
64873
|
ordinal,
|
|
64954
|
-
sha256: (0,
|
|
64874
|
+
sha256: (0, import_node_crypto33.createHash)("sha256").update(member.bytes).digest("hex")
|
|
64955
64875
|
};
|
|
64956
64876
|
});
|
|
64957
64877
|
const response = import_node_path60.default.join(options2.directory, "members.rsp");
|
|
@@ -64964,7 +64884,7 @@ function aliasGuestArchive(options2) {
|
|
|
64964
64884
|
(0, import_node_child_process28.execFileSync)(options2.llvmAr, ["rcsD", archive, `@${response}`], { stdio: "pipe" });
|
|
64965
64885
|
const rewritten = readArMembers((0, import_node_fs61.readFileSync)(archive));
|
|
64966
64886
|
if (rewritten.length !== members2.length || rewritten.some(
|
|
64967
|
-
(member, index) => member.name !== members2[index].alias || (0,
|
|
64887
|
+
(member, index) => member.name !== members2[index].alias || (0, import_node_crypto33.createHash)("sha256").update(member.bytes).digest("hex") !== members2[index].sha256
|
|
64968
64888
|
))
|
|
64969
64889
|
throw new Error(`guest archive changed members ${options2.archive}`);
|
|
64970
64890
|
return { source: options2.archive, archive, members: members2 };
|
|
@@ -65024,12 +64944,12 @@ function aliasGuestLinkIdentities(identities, archives) {
|
|
|
65024
64944
|
}
|
|
65025
64945
|
return result;
|
|
65026
64946
|
}
|
|
65027
|
-
var import_node_child_process28,
|
|
64947
|
+
var import_node_child_process28, import_node_crypto33, import_node_fs61, import_node_path60;
|
|
65028
64948
|
var init_swift_guest_archive = __esm({
|
|
65029
64949
|
"src/swift-guest-archive.ts"() {
|
|
65030
64950
|
"use strict";
|
|
65031
64951
|
import_node_child_process28 = require("node:child_process");
|
|
65032
|
-
|
|
64952
|
+
import_node_crypto33 = require("node:crypto");
|
|
65033
64953
|
import_node_fs61 = require("node:fs");
|
|
65034
64954
|
import_node_path60 = __toESM(require("node:path"), 1);
|
|
65035
64955
|
init_swift_wasm_prune();
|
|
@@ -65043,15 +64963,15 @@ function nativeDyldName(bytes) {
|
|
|
65043
64963
|
name3 += String.fromCharCode(...bytes.subarray(start, start + 4096));
|
|
65044
64964
|
return name3;
|
|
65045
64965
|
}
|
|
65046
|
-
function nativeDyldTablePath(primary,
|
|
64966
|
+
function nativeDyldTablePath(primary, sha2564) {
|
|
65047
64967
|
const prefix = primary.slice(0, primary.lastIndexOf("/") + 1);
|
|
65048
|
-
return prefix +
|
|
64968
|
+
return prefix + sha2564 + (primary.endsWith(".wasm") ? ".dyld" : "");
|
|
65049
64969
|
}
|
|
65050
64970
|
function readNativeDyldTableIndex(section2) {
|
|
65051
64971
|
const bytes = new Uint8Array(section2);
|
|
65052
64972
|
const view = new DataView(section2);
|
|
65053
64973
|
if (bytes.length < 40) throw new Error("native dyld table index is truncated");
|
|
65054
|
-
const
|
|
64974
|
+
const sha2564 = Array.from(
|
|
65055
64975
|
bytes.subarray(0, 32),
|
|
65056
64976
|
(byte) => byte.toString(16).padStart(2, "0")
|
|
65057
64977
|
).join("");
|
|
@@ -65075,7 +64995,7 @@ function readNativeDyldTableIndex(section2) {
|
|
|
65075
64995
|
at = end + 1;
|
|
65076
64996
|
}
|
|
65077
64997
|
if (at !== bytes.length) throw new Error("native dyld table index has trailing bytes");
|
|
65078
|
-
return { sha256:
|
|
64998
|
+
return { sha256: sha2564, byteLength, packs, firsts };
|
|
65079
64999
|
}
|
|
65080
65000
|
var NATIVE_DYLD_TABLE_SECTION, NATIVE_DYLD_PACKS_SECTION;
|
|
65081
65001
|
var init_nativeDyldTableContract = __esm({
|
|
@@ -65099,12 +65019,12 @@ function readNativeLazyParts(section2) {
|
|
|
65099
65019
|
for (let id = 0; id < count; id++) {
|
|
65100
65020
|
const offset = 4 + id * NATIVE_LAZY_PART_BYTES;
|
|
65101
65021
|
const digest3 = new Uint8Array(section2, offset, NATIVE_LAZY_DIGEST_BYTES);
|
|
65102
|
-
const
|
|
65022
|
+
const sha2564 = Array.from(digest3, (byte) => byte.toString(16).padStart(2, "0")).join(
|
|
65103
65023
|
""
|
|
65104
65024
|
);
|
|
65105
65025
|
const byteLength = view.getUint32(offset + NATIVE_LAZY_DIGEST_BYTES, true);
|
|
65106
65026
|
if (!byteLength) throw new Error("native code part has no bytes");
|
|
65107
|
-
parts2.push({ sha256:
|
|
65027
|
+
parts2.push({ sha256: sha2564, byteLength });
|
|
65108
65028
|
}
|
|
65109
65029
|
return { parts: parts2, slotOffset, slotBytes };
|
|
65110
65030
|
}
|
|
@@ -65138,34 +65058,11 @@ var init_nativeWasmContract = __esm({
|
|
|
65138
65058
|
});
|
|
65139
65059
|
|
|
65140
65060
|
// src/swift-guest-image-ledger.ts
|
|
65141
|
-
function readNumber(bytes, position) {
|
|
65142
|
-
if (position < bytes.length) {
|
|
65143
|
-
const first = bytes[position];
|
|
65144
|
-
if (first < 128) return [first, position + 1];
|
|
65145
|
-
}
|
|
65146
|
-
let value = 0;
|
|
65147
|
-
let shift = 0;
|
|
65148
|
-
for (; ; ) {
|
|
65149
|
-
if (position >= bytes.length || shift > 63) throw new Error("invalid wasm integer");
|
|
65150
|
-
const byte = bytes[position++];
|
|
65151
|
-
value += (byte & 127) * 2 ** shift;
|
|
65152
|
-
if (!(byte & 128)) return [value, position];
|
|
65153
|
-
shift += 7;
|
|
65154
|
-
}
|
|
65155
|
-
}
|
|
65156
65061
|
function encodeNumber(value) {
|
|
65157
|
-
|
|
65158
|
-
const bytes = [];
|
|
65159
|
-
do {
|
|
65160
|
-
let byte = value % 128;
|
|
65161
|
-
value = Math.floor(value / 128);
|
|
65162
|
-
if (value) byte |= 128;
|
|
65163
|
-
bytes.push(byte);
|
|
65164
|
-
} while (value);
|
|
65165
|
-
return Buffer.from(bytes);
|
|
65062
|
+
return Buffer.from(encodeWasmNumber(value));
|
|
65166
65063
|
}
|
|
65167
65064
|
function readString(bytes, position) {
|
|
65168
|
-
const [length, start] =
|
|
65065
|
+
const [length, start] = readULEB(bytes, position);
|
|
65169
65066
|
if (start + length > bytes.length) throw new Error("invalid wasm string");
|
|
65170
65067
|
return [
|
|
65171
65068
|
Buffer.from(bytes.buffer, bytes.byteOffset + start, length).toString("utf8"),
|
|
@@ -65491,13 +65388,13 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
|
|
|
65491
65388
|
for (const subsection of subsections) {
|
|
65492
65389
|
if (subsection.kind === 6 && objcLoader !== void 0) {
|
|
65493
65390
|
const content = subsection.parts[0];
|
|
65494
|
-
const [count, entriesStart] =
|
|
65391
|
+
const [count, entriesStart] = readULEB(content, 0);
|
|
65495
65392
|
const initWriter = new ByteWriter(content.length + 16);
|
|
65496
65393
|
initWriter.bytes(content, 0, entriesStart);
|
|
65497
65394
|
let entryStart = entriesStart;
|
|
65498
65395
|
for (let i = 0; i < count; i++) {
|
|
65499
|
-
const [, symbolStart] =
|
|
65500
|
-
const [symbol2, entryEnd] =
|
|
65396
|
+
const [, symbolStart] = readULEB(content, entryStart);
|
|
65397
|
+
const [symbol2, entryEnd] = readULEB(content, symbolStart);
|
|
65501
65398
|
if (symbol2 === objcLoader) {
|
|
65502
65399
|
initWriter.uleb(1);
|
|
65503
65400
|
initWriter.bytes(content, symbolStart, entryEnd);
|
|
@@ -65567,7 +65464,7 @@ function rewriteObject(bytes, names, callerAlias, binding, instrumentDynamicLook
|
|
|
65567
65464
|
if (position < bytes.length && bytes[position] < 128) {
|
|
65568
65465
|
size2 = bytes[position++];
|
|
65569
65466
|
} else {
|
|
65570
|
-
const [val, next] =
|
|
65467
|
+
const [val, next] = readULEB(bytes, position);
|
|
65571
65468
|
size2 = val;
|
|
65572
65469
|
position = next;
|
|
65573
65470
|
}
|
|
@@ -66067,7 +65964,7 @@ function createGuestImageLedger(input) {
|
|
|
66067
65964
|
const digest3 = ({ object: object9 }) => {
|
|
66068
65965
|
let value = digests2.get(object9);
|
|
66069
65966
|
if (value === void 0) {
|
|
66070
|
-
value = (0,
|
|
65967
|
+
value = (0, import_node_crypto34.createHash)("sha256").update(objects2.get(object9).bytes).digest("hex");
|
|
66071
65968
|
digests2.set(object9, value);
|
|
66072
65969
|
}
|
|
66073
65970
|
return value;
|
|
@@ -66282,7 +66179,7 @@ done:
|
|
|
66282
66179
|
attributes #0 = { "wasm-import-module"="${NATIVE_TABLE_IMPORT_MODULE}" "wasm-import-name"="${NATIVE_DYLD_FUNCTION_IMPORT}" }`;
|
|
66283
66180
|
}
|
|
66284
66181
|
function sdkGuestCallerId(product) {
|
|
66285
|
-
const hash = (0,
|
|
66182
|
+
const hash = (0, import_node_crypto34.createHash)("sha256").update(product).digest().readUInt32LE(0);
|
|
66286
66183
|
return (hash | 2147483648) >>> 0;
|
|
66287
66184
|
}
|
|
66288
66185
|
function sdkGuestSymbolName(product, name3) {
|
|
@@ -66323,7 +66220,7 @@ function nameGuestImageAliases(wasm, symbols) {
|
|
|
66323
66220
|
const parts2 = [wasm.subarray(0, 8)];
|
|
66324
66221
|
let position = 8;
|
|
66325
66222
|
while (position < wasm.length) {
|
|
66326
|
-
const [size2, start] =
|
|
66223
|
+
const [size2, start] = readULEB(wasm, position + 1);
|
|
66327
66224
|
const end = start + size2;
|
|
66328
66225
|
const custom = wasm[position] === 0 ? readString(wasm, start) : void 0;
|
|
66329
66226
|
if (custom?.[0] !== "name") {
|
|
@@ -66334,17 +66231,17 @@ function nameGuestImageAliases(wasm, symbols) {
|
|
|
66334
66231
|
const subsections = [encodedString("name")];
|
|
66335
66232
|
let at = custom[1];
|
|
66336
66233
|
while (at < end) {
|
|
66337
|
-
const [subSize, subStart] =
|
|
66234
|
+
const [subSize, subStart] = readULEB(wasm, at + 1);
|
|
66338
66235
|
const subEnd = subStart + subSize;
|
|
66339
66236
|
if (wasm[at] !== 1) {
|
|
66340
66237
|
subsections.push(wasm.subarray(at, subEnd));
|
|
66341
66238
|
at = subEnd;
|
|
66342
66239
|
continue;
|
|
66343
66240
|
}
|
|
66344
|
-
let [count, cursor] =
|
|
66241
|
+
let [count, cursor] = readULEB(wasm, subStart);
|
|
66345
66242
|
const entries2 = [encodeNumber(count)];
|
|
66346
66243
|
for (; count > 0; count--) {
|
|
66347
|
-
const [index, next] =
|
|
66244
|
+
const [index, next] = readULEB(wasm, cursor);
|
|
66348
66245
|
const [name3, after] = readString(wasm, next);
|
|
66349
66246
|
cursor = after;
|
|
66350
66247
|
const symbol2 = symbols[Number(alias.exec(name3)?.[1] ?? -1)];
|
|
@@ -66360,14 +66257,15 @@ function nameGuestImageAliases(wasm, symbols) {
|
|
|
66360
66257
|
}
|
|
66361
66258
|
return Buffer.concat(parts2);
|
|
66362
66259
|
}
|
|
66363
|
-
var
|
|
66260
|
+
var import_node_crypto34, ByteWriter, OBJC_INIT_RECORD, TABLE_INDEX_RELOCATIONS, sha256PairHex, GUEST_DYLD_VALUES_SECTION, GUEST_LAZY_FUNCTION_BASE, SDK_DYLD_RESOLVER;
|
|
66364
66261
|
var init_swift_guest_image_ledger = __esm({
|
|
66365
66262
|
"src/swift-guest-image-ledger.ts"() {
|
|
66366
66263
|
"use strict";
|
|
66367
|
-
|
|
66264
|
+
import_node_crypto34 = require("node:crypto");
|
|
66368
66265
|
init_nativeWasmContract();
|
|
66369
66266
|
init_swift_sdk_image_wasm();
|
|
66370
66267
|
init_swiftSdkLinkContract();
|
|
66268
|
+
init_wasm_binary_sections();
|
|
66371
66269
|
ByteWriter = class {
|
|
66372
66270
|
buf;
|
|
66373
66271
|
pos = 0;
|
|
@@ -66388,16 +66286,13 @@ var init_swift_guest_image_ledger = __esm({
|
|
|
66388
66286
|
this.buf[this.pos++] = value;
|
|
66389
66287
|
}
|
|
66390
66288
|
uleb(value) {
|
|
66391
|
-
|
|
66392
|
-
|
|
66393
|
-
|
|
66394
|
-
|
|
66395
|
-
|
|
66396
|
-
|
|
66397
|
-
|
|
66398
|
-
buf[pos++] = byte;
|
|
66399
|
-
} while (value);
|
|
66400
|
-
this.pos = pos;
|
|
66289
|
+
if (value < 128) {
|
|
66290
|
+
this.byte(value);
|
|
66291
|
+
return;
|
|
66292
|
+
}
|
|
66293
|
+
const encoded = encodeWasmNumber(value);
|
|
66294
|
+
this.ensure(encoded.length);
|
|
66295
|
+
for (let i = 0; i < encoded.length; i++) this.buf[this.pos++] = encoded[i];
|
|
66401
66296
|
}
|
|
66402
66297
|
bytes(source, start = 0, end = source.length) {
|
|
66403
66298
|
const len = end - start;
|
|
@@ -66421,7 +66316,7 @@ var init_swift_guest_image_ledger = __esm({
|
|
|
66421
66316
|
};
|
|
66422
66317
|
OBJC_INIT_RECORD = ".objc_init";
|
|
66423
66318
|
TABLE_INDEX_RELOCATIONS = /* @__PURE__ */ new Set([1, 2, 12, 18, 19, 24]);
|
|
66424
|
-
sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0,
|
|
66319
|
+
sha256PairHex = typeof Bun !== "undefined" ? (first, second) => new Bun.CryptoHasher("sha256").update(first).update("\0").update(second).digest("hex") : (first, second) => (0, import_node_crypto34.createHash)("sha256").update(first).update("\0").update(second).digest("hex");
|
|
66425
66320
|
GUEST_DYLD_VALUES_SECTION = "peach_dyld_values";
|
|
66426
66321
|
GUEST_LAZY_FUNCTION_BASE = 2 ** 32;
|
|
66427
66322
|
SDK_DYLD_RESOLVER = "__peach_sdk_dyld_resolve";
|
|
@@ -66913,19 +66808,7 @@ var init_wasm_narrow_boundary = __esm({
|
|
|
66913
66808
|
function sha256Buffer(bytes) {
|
|
66914
66809
|
if (typeof Bun !== "undefined")
|
|
66915
66810
|
return Buffer.from(new Bun.CryptoHasher("sha256").update(bytes).digest());
|
|
66916
|
-
return (0,
|
|
66917
|
-
}
|
|
66918
|
-
function sha256Hex3(bytes) {
|
|
66919
|
-
if (typeof Bun !== "undefined")
|
|
66920
|
-
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
66921
|
-
return (0, import_node_crypto34.createHash)("sha256").update(bytes).digest("hex");
|
|
66922
|
-
}
|
|
66923
|
-
function uleb2(value) {
|
|
66924
|
-
const bytes = [];
|
|
66925
|
-
for (let rest = value; ; rest = Math.floor(rest / 128)) {
|
|
66926
|
-
if (rest < 128) return [...bytes, rest];
|
|
66927
|
-
bytes.push(rest % 128 | 128);
|
|
66928
|
-
}
|
|
66811
|
+
return (0, import_node_crypto35.createHash)("sha256").update(bytes).digest();
|
|
66929
66812
|
}
|
|
66930
66813
|
function encodeGuestDyldTable(rows) {
|
|
66931
66814
|
const encoded = rows.map((row) => ({ ...row, bytes: Buffer.from(row.name) })).sort((a, b) => Buffer.compare(a.bytes, b.bytes));
|
|
@@ -66939,7 +66822,7 @@ function encodeGuestDyldTable(rows) {
|
|
|
66939
66822
|
value.writeBigUInt64LE(row.value);
|
|
66940
66823
|
const bytes = Buffer.concat([
|
|
66941
66824
|
row.bytes,
|
|
66942
|
-
Buffer.from([0, ...
|
|
66825
|
+
Buffer.from([0, ...encodeWasmNumber(row.image), row.kind]),
|
|
66943
66826
|
value
|
|
66944
66827
|
]);
|
|
66945
66828
|
if (!current2.length) firsts.push(row.bytes);
|
|
@@ -67009,8 +66892,8 @@ function guestDyldValueRange(map2) {
|
|
|
67009
66892
|
function swiftDyldTableReference(modulePath, module2) {
|
|
67010
66893
|
const section2 = readWasmCustomSection(module2, NATIVE_DYLD_TABLE_SECTION);
|
|
67011
66894
|
if (!section2 || readWasmCustomSection(module2, NATIVE_DYLD_PACKS_SECTION)) return;
|
|
67012
|
-
const { sha256:
|
|
67013
|
-
return { path: nativeDyldTablePath(modulePath,
|
|
66895
|
+
const { sha256: sha2564, byteLength } = readNativeDyldTableIndex(Uint8Array.from(section2).buffer);
|
|
66896
|
+
return { path: nativeDyldTablePath(modulePath, sha2564), sha256: sha2564, byteLength };
|
|
67014
66897
|
}
|
|
67015
66898
|
function splitSwiftDyldTable(wasm) {
|
|
67016
66899
|
const packs = readWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION);
|
|
@@ -67018,18 +66901,20 @@ function splitSwiftDyldTable(wasm) {
|
|
|
67018
66901
|
const bytes = Buffer.from(packs);
|
|
67019
66902
|
return {
|
|
67020
66903
|
module: dropWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION),
|
|
67021
|
-
table: { sha256:
|
|
66904
|
+
table: { sha256: sha256Hex2(bytes), bytes }
|
|
67022
66905
|
};
|
|
67023
66906
|
}
|
|
67024
|
-
var
|
|
66907
|
+
var import_node_crypto35, import_node_zlib4, PACK_BYTES;
|
|
67025
66908
|
var init_swift_guest_dyld_table = __esm({
|
|
67026
66909
|
"src/swift-guest-dyld-table.ts"() {
|
|
67027
66910
|
"use strict";
|
|
67028
|
-
|
|
66911
|
+
import_node_crypto35 = require("node:crypto");
|
|
67029
66912
|
import_node_zlib4 = require("node:zlib");
|
|
67030
66913
|
init_nativeDyldTableContract();
|
|
66914
|
+
init_sha256();
|
|
67031
66915
|
init_swift_guest_image_ledger();
|
|
67032
66916
|
init_swift_guest_linked_spans();
|
|
66917
|
+
init_wasm_binary_sections();
|
|
67033
66918
|
init_wasm_narrow_boundary();
|
|
67034
66919
|
PACK_BYTES = 64 * 1024;
|
|
67035
66920
|
}
|
|
@@ -67124,8 +67009,8 @@ function primaryFunctionTable(bytes) {
|
|
|
67124
67009
|
return { name: wasmReader(exported2, 0).name(), table64 };
|
|
67125
67010
|
}
|
|
67126
67011
|
function vectorSection(id, count, parts2) {
|
|
67127
|
-
const body = Buffer.concat([Buffer.from(
|
|
67128
|
-
return Buffer.concat([Buffer.from([id, ...
|
|
67012
|
+
const body = Buffer.concat([Buffer.from(encodeWasmNumber(count)), ...parts2]);
|
|
67013
|
+
return Buffer.concat([Buffer.from([id, ...encodeWasmNumber(body.length)]), body]);
|
|
67129
67014
|
}
|
|
67130
67015
|
function rewriteSections(bytes, sections, changes) {
|
|
67131
67016
|
const out = [bytes.subarray(0, 8)];
|
|
@@ -67181,9 +67066,9 @@ function appendLazyPlacement(bytes, functions, table) {
|
|
|
67181
67066
|
vectorSection(2, count + 1, [
|
|
67182
67067
|
found2 && header ? bytes.subarray(header.at, found2.end) : new Uint8Array(),
|
|
67183
67068
|
Buffer.from([
|
|
67184
|
-
...
|
|
67069
|
+
...encodeWasmNumber(module2.length),
|
|
67185
67070
|
...module2,
|
|
67186
|
-
...
|
|
67071
|
+
...encodeWasmNumber(name4.length),
|
|
67187
67072
|
...name4,
|
|
67188
67073
|
1,
|
|
67189
67074
|
112,
|
|
@@ -67205,7 +67090,7 @@ function appendLazyPlacement(bytes, functions, table) {
|
|
|
67205
67090
|
elements.splice(
|
|
67206
67091
|
placementIndex,
|
|
67207
67092
|
0,
|
|
67208
|
-
Buffer.from([1, 0, ...
|
|
67093
|
+
Buffer.from([1, 0, ...encodeWasmNumber(functions.length), ...functions.flatMap(encodeWasmNumber)])
|
|
67209
67094
|
);
|
|
67210
67095
|
const place2 = imports2.functions + declared.length;
|
|
67211
67096
|
const instructions = [
|
|
@@ -67219,7 +67104,7 @@ function appendLazyPlacement(bytes, functions, table) {
|
|
|
67219
67104
|
1,
|
|
67220
67105
|
252,
|
|
67221
67106
|
12,
|
|
67222
|
-
...
|
|
67107
|
+
...encodeWasmNumber(placementIndex),
|
|
67223
67108
|
0,
|
|
67224
67109
|
11
|
|
67225
67110
|
];
|
|
@@ -67240,14 +67125,14 @@ function appendLazyPlacement(bytes, functions, table) {
|
|
|
67240
67125
|
3,
|
|
67241
67126
|
vectorSection(3, declared.length + 1, [
|
|
67242
67127
|
...declared,
|
|
67243
|
-
Buffer.from(
|
|
67128
|
+
Buffer.from(encodeWasmNumber(types2.length))
|
|
67244
67129
|
])
|
|
67245
67130
|
],
|
|
67246
67131
|
[
|
|
67247
67132
|
7,
|
|
67248
67133
|
vectorSection(7, exports2.length + 1, [
|
|
67249
67134
|
...exports2,
|
|
67250
|
-
Buffer.from([...
|
|
67135
|
+
Buffer.from([...encodeWasmNumber(name3.length), ...name3, 0, ...encodeWasmNumber(place2)])
|
|
67251
67136
|
])
|
|
67252
67137
|
],
|
|
67253
67138
|
[9, vectorSection(9, elements.length, elements)],
|
|
@@ -67255,7 +67140,7 @@ function appendLazyPlacement(bytes, functions, table) {
|
|
|
67255
67140
|
10,
|
|
67256
67141
|
vectorSection(10, bodies.length + 1, [
|
|
67257
67142
|
...bodies,
|
|
67258
|
-
Buffer.from([...
|
|
67143
|
+
Buffer.from([...encodeWasmNumber(instructions.length), ...instructions])
|
|
67259
67144
|
])
|
|
67260
67145
|
]
|
|
67261
67146
|
])
|
|
@@ -67377,40 +67262,31 @@ function nameLazyFunctions(bytes, functions) {
|
|
|
67377
67262
|
for (const index of functions) {
|
|
67378
67263
|
if (names.has(index)) continue;
|
|
67379
67264
|
const name3 = Buffer.from(String(index - imported));
|
|
67380
|
-
names.set(index, Buffer.from([...
|
|
67265
|
+
names.set(index, Buffer.from([...encodeWasmNumber(name3.length), ...name3]));
|
|
67381
67266
|
}
|
|
67382
67267
|
const ordered = [...names].sort(([a], [b]) => a - b);
|
|
67383
67268
|
const functionNames = Buffer.concat([
|
|
67384
|
-
Buffer.from(
|
|
67385
|
-
...ordered.flatMap(([index, name3]) => [Buffer.from(
|
|
67269
|
+
Buffer.from(encodeWasmNumber(ordered.length)),
|
|
67270
|
+
...ordered.flatMap(([index, name3]) => [Buffer.from(encodeWasmNumber(index)), name3])
|
|
67386
67271
|
]);
|
|
67387
|
-
const content = [...subsections, { id: 1, body: functionNames }].sort((a, b) => a.id - b.id).flatMap(({ id, body }) => [Buffer.from([id, ...
|
|
67272
|
+
const content = [...subsections, { id: 1, body: functionNames }].sort((a, b) => a.id - b.id).flatMap(({ id, body }) => [Buffer.from([id, ...encodeWasmNumber(body.length)]), body]);
|
|
67388
67273
|
const label = Buffer.from("name");
|
|
67389
67274
|
const payload = Buffer.concat([
|
|
67390
|
-
Buffer.from([...
|
|
67275
|
+
Buffer.from([...encodeWasmNumber(label.length), ...label]),
|
|
67391
67276
|
...content
|
|
67392
67277
|
]);
|
|
67393
67278
|
const out = [bytes.subarray(0, 8)];
|
|
67394
67279
|
for (const s of sections) if (s !== custom) out.push(bytes.subarray(s.offset, s.end));
|
|
67395
|
-
out.push(Buffer.from([0, ...
|
|
67280
|
+
out.push(Buffer.from([0, ...encodeWasmNumber(payload.length)]), payload);
|
|
67396
67281
|
return Buffer.concat(out);
|
|
67397
67282
|
}
|
|
67398
|
-
var
|
|
67283
|
+
var SECTION_ORDER, readExport, lastTableElement, exportName;
|
|
67399
67284
|
var init_swift_guest_dyld_functions = __esm({
|
|
67400
67285
|
"src/swift-guest-dyld-functions.ts"() {
|
|
67401
67286
|
"use strict";
|
|
67402
67287
|
init_nativeWasmContract();
|
|
67403
67288
|
init_swift_sdk_image_wasm();
|
|
67404
|
-
|
|
67405
|
-
const out = [];
|
|
67406
|
-
do {
|
|
67407
|
-
let byte = value % 128;
|
|
67408
|
-
value = Math.floor(value / 128);
|
|
67409
|
-
if (value) byte |= 128;
|
|
67410
|
-
out.push(byte);
|
|
67411
|
-
} while (value);
|
|
67412
|
-
return out;
|
|
67413
|
-
};
|
|
67289
|
+
init_wasm_binary_sections();
|
|
67414
67290
|
SECTION_ORDER = [1, 2, 3, 4, 5, 13, 6, 7, 8, 9, 12, 10, 11];
|
|
67415
67291
|
readExport = (r) => {
|
|
67416
67292
|
r.name();
|
|
@@ -67477,7 +67353,7 @@ function selectedGuestManifestInputs(plan, selection, identities, readSelected)
|
|
|
67477
67353
|
throw new Error(
|
|
67478
67354
|
`selected member has no original identity: ${item.artifact}(${item.member})`
|
|
67479
67355
|
);
|
|
67480
|
-
if (origin && (0,
|
|
67356
|
+
if (origin && (0, import_node_crypto36.createHash)("sha256").update(bytes).digest("hex") !== origin.sha256)
|
|
67481
67357
|
throw new Error(
|
|
67482
67358
|
`selected member differs from original: ${item.artifact}(${item.member})`
|
|
67483
67359
|
);
|
|
@@ -67524,7 +67400,7 @@ function createGuestImageManifest(image) {
|
|
|
67524
67400
|
cpuType: -1,
|
|
67525
67401
|
cpuSubtype: 0
|
|
67526
67402
|
};
|
|
67527
|
-
const digest3 = (0,
|
|
67403
|
+
const digest3 = (0, import_node_crypto36.createHash)("sha256");
|
|
67528
67404
|
const sizeBuf = Buffer.allocUnsafe(8);
|
|
67529
67405
|
const add2 = (bytes) => {
|
|
67530
67406
|
sizeBuf.writeBigUInt64BE(BigInt(bytes.byteLength));
|
|
@@ -67566,11 +67442,11 @@ function createGuestImageManifest(image) {
|
|
|
67566
67442
|
regions: image.regions
|
|
67567
67443
|
};
|
|
67568
67444
|
}
|
|
67569
|
-
var
|
|
67445
|
+
var import_node_crypto36, import_node_fs62, framedLinkOptionsCache;
|
|
67570
67446
|
var init_swift_guest_manifest = __esm({
|
|
67571
67447
|
"src/swift-guest-manifest.ts"() {
|
|
67572
67448
|
"use strict";
|
|
67573
|
-
|
|
67449
|
+
import_node_crypto36 = require("node:crypto");
|
|
67574
67450
|
import_node_fs62 = require("node:fs");
|
|
67575
67451
|
init_swift_guest_link_plan();
|
|
67576
67452
|
init_swift_wasm_prune();
|
|
@@ -68036,11 +67912,11 @@ var init_swift_guest_projection_storage = __esm({
|
|
|
68036
67912
|
function frameworkRuntimeProductId(product) {
|
|
68037
67913
|
return `swift-package/${product.packageName}/${product.product.name}`;
|
|
68038
67914
|
}
|
|
68039
|
-
var
|
|
67915
|
+
var import_node_crypto37, v4, packageSchema;
|
|
68040
67916
|
var init_swift_runtime_products = __esm({
|
|
68041
67917
|
"src/swift-runtime-products.ts"() {
|
|
68042
67918
|
"use strict";
|
|
68043
|
-
|
|
67919
|
+
import_node_crypto37 = require("node:crypto");
|
|
68044
67920
|
v4 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
68045
67921
|
init_is_record();
|
|
68046
67922
|
packageSchema = v4.object({
|
|
@@ -68071,7 +67947,7 @@ function canonicalArchivePath(file) {
|
|
|
68071
67947
|
function sdkArtifactBytes(root, artifact) {
|
|
68072
67948
|
const file = import_node_path61.default.resolve(root, artifact.path);
|
|
68073
67949
|
const linked = (0, import_node_fs63.readFileSync)(file);
|
|
68074
|
-
const hash = (bytes) => (0,
|
|
67950
|
+
const hash = (bytes) => (0, import_node_crypto38.createHash)("sha256").update(bytes).digest("hex");
|
|
68075
67951
|
if (hash(linked) === artifact.sha256) return { source: linked, linked };
|
|
68076
67952
|
if (artifact.kind !== "archive" || artifact.path !== `${SWIFT_SDK_PRODUCT_DIRECTORY}/libFoundation.a`)
|
|
68077
67953
|
throw new Error(`SDK product artifact changed ${file}`);
|
|
@@ -68097,9 +67973,9 @@ function indexSdkMembers(bytes) {
|
|
|
68097
67973
|
);
|
|
68098
67974
|
}
|
|
68099
67975
|
function verifySdkObjectTransform(source, linked, sourceSha256, transformation) {
|
|
68100
|
-
if ((0,
|
|
67976
|
+
if ((0, import_node_crypto38.createHash)("sha256").update(source).digest("hex") !== sourceSha256 || transformation.inputSha256 !== sourceSha256)
|
|
68101
67977
|
throw new Error("SDK object transform input changed");
|
|
68102
|
-
if ((0,
|
|
67978
|
+
if ((0, import_node_crypto38.createHash)("sha256").update(linked).digest("hex") !== transformation.outputSha256 || transformation.kind === "swiftrt" && !Buffer.from(patchSwiftrtObject(source)).equals(linked))
|
|
68103
67979
|
throw new Error("SDK object transform output changed");
|
|
68104
67980
|
}
|
|
68105
67981
|
function readGuestRuntimeCatalogs(sdkRoot, distributionRoot) {
|
|
@@ -68379,7 +68255,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
|
|
|
68379
68255
|
const digest3 = (file) => {
|
|
68380
68256
|
let value = hashes.get(file);
|
|
68381
68257
|
if (!value) {
|
|
68382
|
-
value = (0,
|
|
68258
|
+
value = (0, import_node_crypto38.createHash)("sha256").update((0, import_node_fs63.readFileSync)(file)).digest("hex");
|
|
68383
68259
|
hashes.set(file, value);
|
|
68384
68260
|
}
|
|
68385
68261
|
return value;
|
|
@@ -68447,9 +68323,9 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
|
|
|
68447
68323
|
if (input.member) {
|
|
68448
68324
|
if (original.kind !== "archive")
|
|
68449
68325
|
throw new Error(`SDK input member has no archive ${originalFile}`);
|
|
68450
|
-
const { name: name3, ordinal, sha256:
|
|
68326
|
+
const { name: name3, ordinal, sha256: sha2564 } = input.member;
|
|
68451
68327
|
const member = original.members.find(
|
|
68452
|
-
(entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 ===
|
|
68328
|
+
(entry) => entry.name === name3 && entry.ordinal === ordinal && entry.sha256 === sha2564
|
|
68453
68329
|
);
|
|
68454
68330
|
let records = archiveMembers.get(originalFile);
|
|
68455
68331
|
if (!records) {
|
|
@@ -68457,7 +68333,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
|
|
|
68457
68333
|
archiveMembers.set(originalFile, records);
|
|
68458
68334
|
}
|
|
68459
68335
|
const bytes = records.filter((entry) => entry.name === name3)[ordinal - 1]?.bytes;
|
|
68460
|
-
if (!member || !bytes || (0,
|
|
68336
|
+
if (!member || !bytes || (0, import_node_crypto38.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
|
|
68461
68337
|
throw new Error(`SDK input member changed ${originalFile}(${name3})`);
|
|
68462
68338
|
} else if (original.kind !== "object")
|
|
68463
68339
|
throw new Error(`SDK object input has no member ${originalFile}`);
|
|
@@ -68486,7 +68362,7 @@ function guestSdkProductLinkArtifacts(products, sdk2, inputs2, linkedArchives, r
|
|
|
68486
68362
|
const member = members2.get(key2);
|
|
68487
68363
|
const source = indexed.source.get(key2);
|
|
68488
68364
|
const linked2 = indexed.linked.get(key2);
|
|
68489
|
-
if (!member || !source || !linked2 || (0,
|
|
68365
|
+
if (!member || !source || !linked2 || (0, import_node_crypto38.createHash)("sha256").update(source).digest("hex") !== member.sha256 || (0, import_node_crypto38.createHash)("sha256").update(linked2).digest("hex") !== digest3(origin.original))
|
|
68490
68366
|
throw new Error(`SDK member differs from source product ${origin.original}`);
|
|
68491
68367
|
add2({
|
|
68492
68368
|
path: origin.original,
|
|
@@ -68551,7 +68427,7 @@ function guestAliasedSdkArchiveArtifacts(options2) {
|
|
|
68551
68427
|
const key2 = JSON.stringify([member.name, member.ordinal]);
|
|
68552
68428
|
const bytes = sourceMembers[index].get(key2);
|
|
68553
68429
|
const linked = viewMembers[index].get(key2);
|
|
68554
|
-
return bytes !== void 0 && linked !== void 0 && (0,
|
|
68430
|
+
return bytes !== void 0 && linked !== void 0 && (0, import_node_crypto38.createHash)("sha256").update(bytes).digest("hex") === entry.sha256 && (0, import_node_crypto38.createHash)("sha256").update(linked).digest("hex") === member.sha256;
|
|
68555
68431
|
}) ? [product2.id] : []
|
|
68556
68432
|
)
|
|
68557
68433
|
);
|
|
@@ -68584,11 +68460,11 @@ function guestAliasedSdkArchiveArtifacts(options2) {
|
|
|
68584
68460
|
}
|
|
68585
68461
|
return result;
|
|
68586
68462
|
}
|
|
68587
|
-
var
|
|
68463
|
+
var import_node_crypto38, import_node_fs63, import_node_path61, v5, SDK_CONTAINING_IMAGE;
|
|
68588
68464
|
var init_swift_guest_runtime_plan = __esm({
|
|
68589
68465
|
"src/swift-guest-runtime-plan.ts"() {
|
|
68590
68466
|
"use strict";
|
|
68591
|
-
|
|
68467
|
+
import_node_crypto38 = require("node:crypto");
|
|
68592
68468
|
import_node_fs63 = require("node:fs");
|
|
68593
68469
|
import_node_path61 = __toESM(require("node:path"), 1);
|
|
68594
68470
|
v5 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
@@ -70424,13 +70300,8 @@ function clangBinaryStamp(file) {
|
|
|
70424
70300
|
const stat2 = (0, import_node_fs66.statSync)(file, { bigint: true });
|
|
70425
70301
|
return [file, stat2.size, stat2.mtimeNs].join(":");
|
|
70426
70302
|
}
|
|
70427
|
-
function sha256Hex4(bytes) {
|
|
70428
|
-
if (typeof Bun !== "undefined")
|
|
70429
|
-
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
70430
|
-
return (0, import_node_crypto38.createHash)("sha256").update(bytes).digest("hex");
|
|
70431
|
-
}
|
|
70432
70303
|
function clangWrapperStamp(file) {
|
|
70433
|
-
return
|
|
70304
|
+
return sha256Hex2((0, import_node_fs66.readFileSync)(file));
|
|
70434
70305
|
}
|
|
70435
70306
|
function clangArgsNeedCwd(args) {
|
|
70436
70307
|
const pathFlags = /* @__PURE__ */ new Set([
|
|
@@ -70608,7 +70479,7 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
70608
70479
|
import_node_path64.default.join(options2.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)
|
|
70609
70480
|
)))
|
|
70610
70481
|
throw new Error(`unsupported source object producer ${file}`);
|
|
70611
|
-
const key2 =
|
|
70482
|
+
const key2 = sha256Hex2(
|
|
70612
70483
|
JSON.stringify([
|
|
70613
70484
|
"clang-link-options/v2",
|
|
70614
70485
|
clangArgsNeedCwd(command.args) ? process.cwd() : null,
|
|
@@ -70619,7 +70490,7 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
70619
70490
|
clangProducerStamp(file)
|
|
70620
70491
|
])
|
|
70621
70492
|
);
|
|
70622
|
-
const cacheFile = import_node_path64.default.join(cacheDirectory,
|
|
70493
|
+
const cacheFile = import_node_path64.default.join(cacheDirectory, sha256Hex2(file) + ".json");
|
|
70623
70494
|
const cached5 = readClangLinkOptions(cacheFile, key2);
|
|
70624
70495
|
if (cached5) {
|
|
70625
70496
|
validateClangLinkOptions(cached5);
|
|
@@ -70741,30 +70612,12 @@ function wasmAutolinkEntries(bytes, out) {
|
|
|
70741
70612
|
const len = bytes.length;
|
|
70742
70613
|
while (pos < len) {
|
|
70743
70614
|
const id = bytes[pos++];
|
|
70744
|
-
let sz
|
|
70745
|
-
|
|
70746
|
-
sz &= 127;
|
|
70747
|
-
let shift = 7;
|
|
70748
|
-
while (true) {
|
|
70749
|
-
const b = bytes[pos++];
|
|
70750
|
-
sz |= (b & 127) << shift;
|
|
70751
|
-
if (b < 128) break;
|
|
70752
|
-
shift += 7;
|
|
70753
|
-
}
|
|
70754
|
-
}
|
|
70615
|
+
let sz;
|
|
70616
|
+
[sz, pos] = readULEB(bytes, pos, len);
|
|
70755
70617
|
const end = pos + sz;
|
|
70756
70618
|
if (id === 0) {
|
|
70757
|
-
let nLen
|
|
70758
|
-
|
|
70759
|
-
nLen &= 127;
|
|
70760
|
-
let shift = 7;
|
|
70761
|
-
while (true) {
|
|
70762
|
-
const b = bytes[pos++];
|
|
70763
|
-
nLen |= (b & 127) << shift;
|
|
70764
|
-
if (b < 128) break;
|
|
70765
|
-
shift += 7;
|
|
70766
|
-
}
|
|
70767
|
-
}
|
|
70619
|
+
let nLen;
|
|
70620
|
+
[nLen, pos] = readULEB(bytes, pos, end);
|
|
70768
70621
|
if (nLen === 24 && raw2.toString("ascii", pos, pos + 24) === ".swift1_autolink_entries") {
|
|
70769
70622
|
const payload = raw2.toString("utf8", pos + 24, end);
|
|
70770
70623
|
for (const entry of payload.split("\0")) {
|
|
@@ -70832,7 +70685,7 @@ function sourceGuestRuntimeLinks(options2) {
|
|
|
70832
70685
|
const file = import_node_path64.default.resolve(directory2, alias.moduleMap);
|
|
70833
70686
|
if (!file.startsWith(directory2 + import_node_path64.default.sep))
|
|
70834
70687
|
throw new Error(`invalid framework module map ${alias.moduleMap}`);
|
|
70835
|
-
if ((
|
|
70688
|
+
if (sha256Hex2((0, import_node_fs66.readFileSync)(file)) !== alias.moduleMapSha256)
|
|
70836
70689
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
70837
70690
|
sdkAliases.set(alias.name, {
|
|
70838
70691
|
product: product.id,
|
|
@@ -70888,7 +70741,7 @@ function sourceGuestRuntimeLinks(options2) {
|
|
|
70888
70741
|
const map2 = import_node_path64.default.resolve(root, alias.moduleMap);
|
|
70889
70742
|
if (!map2.startsWith(root + import_node_path64.default.sep))
|
|
70890
70743
|
throw new Error(`invalid framework module map ${alias.moduleMap}`);
|
|
70891
|
-
if ((
|
|
70744
|
+
if (sha256Hex2((0, import_node_fs66.readFileSync)(map2)) !== alias.moduleMapSha256)
|
|
70892
70745
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
70893
70746
|
frameworkAliases.set(alias.name, { kind: "package", targets: closure(alias.targets) });
|
|
70894
70747
|
}
|
|
@@ -70989,18 +70842,19 @@ function logicalGuestLinkOptions(args, identities, roots) {
|
|
|
70989
70842
|
}
|
|
70990
70843
|
return output;
|
|
70991
70844
|
}
|
|
70992
|
-
var import_node_child_process31,
|
|
70845
|
+
var import_node_child_process31, import_node_fs66, import_node_path64, CLANG_TARGET_MODULE_WRAPPER, PARALLEL_REPLAY;
|
|
70993
70846
|
var init_swift_guest_source_inputs = __esm({
|
|
70994
70847
|
"src/swift-guest-source-inputs.ts"() {
|
|
70995
70848
|
"use strict";
|
|
70996
70849
|
import_node_child_process31 = require("node:child_process");
|
|
70997
|
-
import_node_crypto38 = require("node:crypto");
|
|
70998
70850
|
import_node_fs66 = require("node:fs");
|
|
70999
70851
|
import_node_path64 = __toESM(require("node:path"), 1);
|
|
71000
70852
|
init_forked_script_contract();
|
|
70853
|
+
init_sha256();
|
|
71001
70854
|
init_swift_guest_source_plan();
|
|
71002
70855
|
init_swift_runtime_products();
|
|
71003
70856
|
init_swift_wasm_prune();
|
|
70857
|
+
init_wasm_binary_sections();
|
|
71004
70858
|
CLANG_TARGET_MODULE_WRAPPER = ".peach-clang";
|
|
71005
70859
|
PARALLEL_REPLAY = `
|
|
71006
70860
|
const { spawn } = require('node:child_process')
|
|
@@ -75971,6 +75825,10 @@ ${SWIFT_SDK_IMAGE_VERSION}
|
|
|
75971
75825
|
`).update(inputs2).update(products.length === 0 ? "" : `
|
|
75972
75826
|
products ${products.join(" ")}`).digest("hex").slice(0, 32);
|
|
75973
75827
|
}
|
|
75828
|
+
function swiftSdkImageVariantKey(baseKey, required) {
|
|
75829
|
+
if (!required.length) return baseKey;
|
|
75830
|
+
return (0, import_node_crypto45.createHash)("sha256").update(baseKey).update(JSON.stringify(required)).digest("hex").slice(0, 32);
|
|
75831
|
+
}
|
|
75974
75832
|
function swiftSdkImageEntry(key2, scopedLookups) {
|
|
75975
75833
|
const inputs2 = { image: key2 };
|
|
75976
75834
|
return {
|
|
@@ -76000,15 +75858,15 @@ function cached3(directory2, key2) {
|
|
|
76000
75858
|
return void 0;
|
|
76001
75859
|
}
|
|
76002
75860
|
}
|
|
76003
|
-
function sdkImageAt(directory2, key2,
|
|
75861
|
+
function sdkImageAt(directory2, key2, sha2564) {
|
|
76004
75862
|
refreshSwiftCacheHold(directory2);
|
|
76005
|
-
const cacheKey = `${directory2}\0${
|
|
75863
|
+
const cacheKey = `${directory2}\0${sha2564}`;
|
|
76006
75864
|
let loadedInterface;
|
|
76007
75865
|
return {
|
|
76008
75866
|
key: key2,
|
|
76009
75867
|
directory: directory2,
|
|
76010
75868
|
image: import_node_path73.default.join(directory2, IMAGE_FILE),
|
|
76011
|
-
sha256:
|
|
75869
|
+
sha256: sha2564,
|
|
76012
75870
|
get sdkInterface() {
|
|
76013
75871
|
if (loadedInterface) return loadedInterface;
|
|
76014
75872
|
const memo2 = cachedSdkInterfaces.get(cacheKey);
|
|
@@ -76022,11 +75880,24 @@ function sdkImageAt(directory2, key2, sha2565) {
|
|
|
76022
75880
|
}
|
|
76023
75881
|
async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkImports2 = [], options2) {
|
|
76024
75882
|
const { imports: imports2, products } = swiftSdkImageProducts(moduleRoot, frameworkImports2);
|
|
76025
|
-
const
|
|
76026
|
-
const
|
|
75883
|
+
const images = import_node_path73.default.join(swiftCacheDir(), "swift-sdk-images");
|
|
75884
|
+
const baseKey = swiftSdkImageKey(moduleRoot, scopedLookups, products);
|
|
75885
|
+
const required = [...new Set(options2?.requiredGuestSymbols)].sort();
|
|
75886
|
+
const base2 = cached3(import_node_path73.default.join(images, baseKey), baseKey);
|
|
75887
|
+
if (base2) {
|
|
75888
|
+
if (!required.length) return base2;
|
|
75889
|
+
const { functions, data, tls } = base2.sdkInterface;
|
|
75890
|
+
if (required.every(
|
|
75891
|
+
(name3) => functions[name3] !== void 0 || data[name3] !== void 0 || tls[name3] !== void 0
|
|
75892
|
+
))
|
|
75893
|
+
return base2;
|
|
75894
|
+
}
|
|
75895
|
+
const key2 = swiftSdkImageVariantKey(baseKey, required);
|
|
75896
|
+
const directory2 = import_node_path73.default.join(images, key2);
|
|
76027
75897
|
const existing = cached3(directory2, key2);
|
|
76028
75898
|
if (existing) return existing;
|
|
76029
|
-
|
|
75899
|
+
const distribution = swiftDistributionAt(moduleRoot);
|
|
75900
|
+
if (!options2?.producer && !required.length && !distribution && import_node_path73.default.resolve(moduleRoot) === sourceSwiftCheckout() && process.platform === "linux" && process.env.TM_SESSION) {
|
|
76030
75901
|
const { produceSwiftSdkImage: produceSwiftSdkImage2 } = await Promise.resolve().then(() => (init_swift_sdk_image_producer(), swift_sdk_image_producer_exports));
|
|
76031
75902
|
await produceSwiftSdkImage2({
|
|
76032
75903
|
moduleRoot,
|
|
@@ -76047,7 +75918,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
76047
75918
|
return cached3(directory2, key2) ?? withSwiftRootLock(directory2, async () => {
|
|
76048
75919
|
const previous = cached3(directory2, key2);
|
|
76049
75920
|
if (previous) return previous;
|
|
76050
|
-
if (
|
|
75921
|
+
if (distribution && !required.length) {
|
|
76051
75922
|
const entry = swiftSdkImageEntry(key2, scopedLookups);
|
|
76052
75923
|
const fetched = fetchNativeEntry("sdk-image", entry.name, entry.key);
|
|
76053
75924
|
if (fetched) {
|
|
@@ -76084,6 +75955,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
76084
75955
|
work,
|
|
76085
75956
|
scopedLookups,
|
|
76086
75957
|
imports2,
|
|
75958
|
+
required,
|
|
76087
75959
|
releaseFrameworks
|
|
76088
75960
|
)
|
|
76089
75961
|
);
|
|
@@ -76092,7 +75964,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
76092
75964
|
}
|
|
76093
75965
|
});
|
|
76094
75966
|
}
|
|
76095
|
-
async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, releaseFrameworks) {
|
|
75967
|
+
async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLookups, imports2, required, releaseFrameworks) {
|
|
76096
75968
|
(0, import_node_fs75.rmSync)(work, { recursive: true, force: true });
|
|
76097
75969
|
(0, import_node_fs75.mkdirSync)(work, { recursive: true });
|
|
76098
75970
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
@@ -76253,7 +76125,10 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
76253
76125
|
const quote3 = (value) => JSON.stringify(value);
|
|
76254
76126
|
(0, import_node_fs75.writeFileSync)(
|
|
76255
76127
|
import_node_path73.default.join(work, "exports.rsp"),
|
|
76256
|
-
[
|
|
76128
|
+
[
|
|
76129
|
+
...[...defined].map((name3) => quote3(`--export-if-defined=${name3}`)),
|
|
76130
|
+
...required.filter((name3) => !defined.has(name3)).map((name3) => quote3(`--export=${name3}`))
|
|
76131
|
+
].join("\n")
|
|
76257
76132
|
);
|
|
76258
76133
|
const guestServices = import_node_path73.default.join(work, "peach-guest-services.allow");
|
|
76259
76134
|
(0, import_node_fs75.writeFileSync)(guestServices, peachGuestServiceAllowlist);
|
|
@@ -76344,11 +76219,12 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
76344
76219
|
import_node_path73.default.join(work, IMAGE_DIGEST),
|
|
76345
76220
|
typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(image).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(image).digest("hex")
|
|
76346
76221
|
);
|
|
76347
|
-
|
|
76222
|
+
const baseKey = swiftSdkImageKey(
|
|
76348
76223
|
moduleRoot,
|
|
76349
76224
|
scopedLookups,
|
|
76350
76225
|
swiftSdkImageProducts(moduleRoot, imports2).products
|
|
76351
|
-
)
|
|
76226
|
+
);
|
|
76227
|
+
if (swiftSdkImageVariantKey(baseKey, required) !== key2)
|
|
76352
76228
|
throw new Error("Swift SDK image inputs changed during compilation");
|
|
76353
76229
|
for (const name3 of (0, import_node_fs75.readdirSync)(work))
|
|
76354
76230
|
if (!SWIFT_SDK_IMAGE_FILES.includes(name3))
|
|
@@ -76759,12 +76635,12 @@ function encodeNativeSdkLater(later) {
|
|
|
76759
76635
|
const view = new DataView(bytes.buffer);
|
|
76760
76636
|
view.setUint32(0, files2.length, true);
|
|
76761
76637
|
let at = 4;
|
|
76762
|
-
for (const { sha256:
|
|
76763
|
-
if (!/^[a-f0-9]{64}$/.test(
|
|
76638
|
+
for (const { sha256: sha2564, byteLength } of files2) {
|
|
76639
|
+
if (!/^[a-f0-9]{64}$/.test(sha2564))
|
|
76764
76640
|
throw new Error("Swift SDK later data needs a sha256 digest");
|
|
76765
76641
|
if (!byteLength) throw new Error("Swift SDK later data file is empty");
|
|
76766
76642
|
for (let i = 0; i < LATER_DIGEST_BYTES; i++)
|
|
76767
|
-
bytes[at + i] = Number.parseInt(
|
|
76643
|
+
bytes[at + i] = Number.parseInt(sha2564.slice(i * 2, i * 2 + 2), 16);
|
|
76768
76644
|
view.setUint32(at + LATER_DIGEST_BYTES, byteLength, true);
|
|
76769
76645
|
at += LATER_DIGEST_BYTES + 4;
|
|
76770
76646
|
}
|
|
@@ -76789,13 +76665,13 @@ function decodeNativeSdkLater(trailer) {
|
|
|
76789
76665
|
const files2 = [];
|
|
76790
76666
|
for (let file = 0; file < count; file++) {
|
|
76791
76667
|
if (at + LATER_DIGEST_BYTES + 4 > trailer.byteLength) throw truncated();
|
|
76792
|
-
const
|
|
76668
|
+
const sha2564 = Array.from(
|
|
76793
76669
|
trailer.subarray(at, at + LATER_DIGEST_BYTES),
|
|
76794
76670
|
(byte) => byte.toString(16).padStart(2, "0")
|
|
76795
76671
|
).join("");
|
|
76796
76672
|
const byteLength = view.getUint32(at + LATER_DIGEST_BYTES, true);
|
|
76797
76673
|
if (!byteLength) throw new Error("Swift SDK binding names empty later data");
|
|
76798
|
-
files2.push({ sha256:
|
|
76674
|
+
files2.push({ sha256: sha2564, byteLength });
|
|
76799
76675
|
at += LATER_DIGEST_BYTES + 4;
|
|
76800
76676
|
}
|
|
76801
76677
|
if (!files2.length || at + 4 > trailer.byteLength) throw truncated();
|
|
@@ -77030,8 +76906,8 @@ function finishSwiftAppModuleFile(file) {
|
|
|
77030
76906
|
return;
|
|
77031
76907
|
}
|
|
77032
76908
|
const thunks = sdkImportThunks(prefix);
|
|
77033
|
-
const nameBytes = Buffer.from(
|
|
77034
|
-
const header = Buffer.from([0, ...
|
|
76909
|
+
const nameBytes = Buffer.from(encodeWasmName(NATIVE_SDK_THUNK_SECTION));
|
|
76910
|
+
const header = Buffer.from([0, ...encodeWasmNumber(nameBytes.length + thunks.length)]);
|
|
77035
76911
|
(0, import_node_fs76.appendFileSync)(file, Buffer.concat([header, nameBytes, thunks]));
|
|
77036
76912
|
}
|
|
77037
76913
|
function swiftAppModuleInputs(tokens3, buildRoot, sdkLibraries) {
|
|
@@ -77383,17 +77259,17 @@ function sdkImportThunks(bytes) {
|
|
|
77383
77259
|
for (const { type } of imports2)
|
|
77384
77260
|
if (!typeIndex.has(type)) typeIndex.set(type, typeIndex.size + 1);
|
|
77385
77261
|
const loaderType = [96, 1, 127, 0];
|
|
77386
|
-
const vector = (items2) => [...
|
|
77387
|
-
const sectionBytes = (id, body) => [id, ...
|
|
77262
|
+
const vector = (items2) => [...encodeWasmNumber(items2.length), ...items2.flat()];
|
|
77263
|
+
const sectionBytes = (id, body) => [id, ...encodeWasmNumber(body.length), ...body];
|
|
77388
77264
|
const slotGlobals = imports2.map(({ slot }) => [
|
|
77389
|
-
...
|
|
77390
|
-
...
|
|
77265
|
+
...encodeWasmName(NATIVE_SDK_IMPORT_MODULE),
|
|
77266
|
+
...encodeWasmName(String(slot)),
|
|
77391
77267
|
3,
|
|
77392
77268
|
127,
|
|
77393
77269
|
0
|
|
77394
77270
|
]);
|
|
77395
77271
|
const bodies = imports2.map(({ type }, index) => {
|
|
77396
|
-
const slotValue = [35, ...
|
|
77272
|
+
const slotValue = [35, ...encodeWasmNumber(index)];
|
|
77397
77273
|
const code = [
|
|
77398
77274
|
0,
|
|
77399
77275
|
...slotValue,
|
|
@@ -77406,14 +77282,14 @@ function sdkImportThunks(bytes) {
|
|
|
77406
77282
|
16,
|
|
77407
77283
|
0,
|
|
77408
77284
|
11,
|
|
77409
|
-
...Array.from({ length: params[type] }, (_, i) => [32, ...
|
|
77285
|
+
...Array.from({ length: params[type] }, (_, i) => [32, ...encodeWasmNumber(i)]).flat(),
|
|
77410
77286
|
...slotValue,
|
|
77411
77287
|
17,
|
|
77412
|
-
...
|
|
77288
|
+
...encodeWasmNumber(typeIndex.get(type)),
|
|
77413
77289
|
0,
|
|
77414
77290
|
11
|
|
77415
77291
|
];
|
|
77416
|
-
return [...
|
|
77292
|
+
return [...encodeWasmNumber(code.length), ...code];
|
|
77417
77293
|
});
|
|
77418
77294
|
return Uint8Array.from([
|
|
77419
77295
|
0,
|
|
@@ -77431,21 +77307,21 @@ function sdkImportThunks(bytes) {
|
|
|
77431
77307
|
...sectionBytes(
|
|
77432
77308
|
2,
|
|
77433
77309
|
vector([
|
|
77434
|
-
[...
|
|
77310
|
+
[...encodeWasmName("env"), ...encodeWasmName("__indirect_function_table"), 1, ...table],
|
|
77435
77311
|
[
|
|
77436
|
-
...
|
|
77437
|
-
...
|
|
77312
|
+
...encodeWasmName(NATIVE_LAZY_IMPORT_MODULE),
|
|
77313
|
+
...encodeWasmName(NATIVE_LAZY_SLOT_IMPORT),
|
|
77438
77314
|
0,
|
|
77439
77315
|
0
|
|
77440
77316
|
],
|
|
77441
77317
|
...slotGlobals
|
|
77442
77318
|
])
|
|
77443
77319
|
),
|
|
77444
|
-
...sectionBytes(3, vector(imports2.map(({ type }) =>
|
|
77320
|
+
...sectionBytes(3, vector(imports2.map(({ type }) => encodeWasmNumber(typeIndex.get(type))))),
|
|
77445
77321
|
...sectionBytes(
|
|
77446
77322
|
7,
|
|
77447
77323
|
vector(
|
|
77448
|
-
imports2.map(({ slot }, i) => [...
|
|
77324
|
+
imports2.map(({ slot }, i) => [...encodeWasmName(String(slot)), 0, ...encodeWasmNumber(i + 1)])
|
|
77449
77325
|
)
|
|
77450
77326
|
),
|
|
77451
77327
|
...sectionBytes(10, vector(bodies))
|
|
@@ -77565,7 +77441,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77565
77441
|
syntheticGlobals.push(type);
|
|
77566
77442
|
got.set(index, value);
|
|
77567
77443
|
}
|
|
77568
|
-
return [35, ...
|
|
77444
|
+
return [35, ...encodeWasmNumber(index)];
|
|
77569
77445
|
};
|
|
77570
77446
|
const tlsHelpers = new Map(
|
|
77571
77447
|
symbols.filter((symbol2) => symbol2.kind === 0 && symbol2.name.startsWith(SDK_TLS_HELPER)).map((symbol2) => [symbol2.name.slice(SDK_TLS_HELPER.length), symbol2.index])
|
|
@@ -77617,7 +77493,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77617
77493
|
const code = [16];
|
|
77618
77494
|
for (let i = 0, rest = helper; i < 5; i++, rest >>>= 7)
|
|
77619
77495
|
code.push(i < 4 ? rest & 127 | 128 : rest & 127);
|
|
77620
|
-
if (addend) code.push(66, ...
|
|
77496
|
+
if (addend) code.push(66, ...encodeWasmSigned(addend), 124);
|
|
77621
77497
|
patchCode(at2, 11, code);
|
|
77622
77498
|
continue;
|
|
77623
77499
|
}
|
|
@@ -77691,7 +77567,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77691
77567
|
syntheticGlobals.push(valueType);
|
|
77692
77568
|
scratchGlobals.set(valueType, scratch2);
|
|
77693
77569
|
}
|
|
77694
|
-
const index =
|
|
77570
|
+
const index = encodeWasmNumber(scratch2);
|
|
77695
77571
|
patchCode(at - 2, 12, [
|
|
77696
77572
|
36,
|
|
77697
77573
|
...index,
|
|
@@ -77707,7 +77583,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77707
77583
|
}
|
|
77708
77584
|
const encodedNameBuf = (name3) => {
|
|
77709
77585
|
const raw2 = Buffer.from(name3, "utf8");
|
|
77710
|
-
const len =
|
|
77586
|
+
const len = encodeWasmNumber(raw2.length);
|
|
77711
77587
|
const out = Buffer.allocUnsafe(len.length + raw2.length);
|
|
77712
77588
|
for (let i = 0; i < len.length; i++) out[i] = len[i];
|
|
77713
77589
|
raw2.copy(out, len.length);
|
|
@@ -77752,7 +77628,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77752
77628
|
}
|
|
77753
77629
|
}
|
|
77754
77630
|
const globalParts = [
|
|
77755
|
-
Buffer.from(
|
|
77631
|
+
Buffer.from(encodeWasmNumber(globalCount - 1 + syntheticGlobals.length))
|
|
77756
77632
|
];
|
|
77757
77633
|
for (let index = 0; index < globalCount; index++) {
|
|
77758
77634
|
const start = gr.at;
|
|
@@ -77797,18 +77673,18 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77797
77673
|
}
|
|
77798
77674
|
}
|
|
77799
77675
|
const exportParts = [
|
|
77800
|
-
Buffer.from(
|
|
77676
|
+
Buffer.from(encodeWasmNumber(exportCount + 1 + got.size)),
|
|
77801
77677
|
bytes.subarray(originalExportsStart, exportSection.end)
|
|
77802
77678
|
];
|
|
77803
77679
|
for (const [index, value] of got) {
|
|
77804
77680
|
exportParts.push(
|
|
77805
77681
|
encodedNameBuf(`${NATIVE_SDK_GLOBAL_PREFIX}${value}.${index}`),
|
|
77806
|
-
Buffer.from([3, ...
|
|
77682
|
+
Buffer.from([3, ...encodeWasmNumber(index)])
|
|
77807
77683
|
);
|
|
77808
77684
|
}
|
|
77809
77685
|
exportParts.push(encodedNameBuf("__indirect_function_table"), Buffer.from([1, 0]));
|
|
77810
77686
|
const replaced = /* @__PURE__ */ new Map([
|
|
77811
|
-
[2, Buffer.concat([Buffer.from(
|
|
77687
|
+
[2, Buffer.concat([Buffer.from(encodeWasmNumber(importEntryCount)), ...importParts])],
|
|
77812
77688
|
[6, Buffer.concat(globalParts)],
|
|
77813
77689
|
[7, Buffer.concat(exportParts)]
|
|
77814
77690
|
]);
|
|
@@ -77825,7 +77701,7 @@ function resolveSdkReferences(source, sdk2, forwarders) {
|
|
|
77825
77701
|
if (s.id === 10 && rebuiltCode) {
|
|
77826
77702
|
parts2.push(rebuiltCode);
|
|
77827
77703
|
} else if (payload) {
|
|
77828
|
-
parts2.push(Buffer.from([s.id, ...
|
|
77704
|
+
parts2.push(Buffer.from([s.id, ...encodeWasmNumber(payload.length)]), payload);
|
|
77829
77705
|
} else {
|
|
77830
77706
|
parts2.push(bytes.subarray(s.offset, s.end));
|
|
77831
77707
|
}
|
|
@@ -77841,7 +77717,7 @@ function expandSdkRelocations(bytes, section2, patches) {
|
|
|
77841
77717
|
patches.sort((a, b) => a.at - b.at);
|
|
77842
77718
|
const r = wasmReader(bytes, section2.start);
|
|
77843
77719
|
const count = r.u();
|
|
77844
|
-
const payload = [Uint8Array.from(
|
|
77720
|
+
const payload = [Uint8Array.from(encodeWasmNumber(count))];
|
|
77845
77721
|
let next = 0;
|
|
77846
77722
|
for (let i = 0; i < count; i++) {
|
|
77847
77723
|
const start = r.at;
|
|
@@ -77861,7 +77737,7 @@ function expandSdkRelocations(bytes, section2, patches) {
|
|
|
77861
77737
|
}
|
|
77862
77738
|
parts2.push(bytes.subarray(at, end));
|
|
77863
77739
|
payload.push(
|
|
77864
|
-
Uint8Array.from(
|
|
77740
|
+
Uint8Array.from(encodeWasmNumber(parts2.reduce((size3, part) => size3 + part.length, 0))),
|
|
77865
77741
|
...parts2
|
|
77866
77742
|
);
|
|
77867
77743
|
}
|
|
@@ -77870,7 +77746,7 @@ function expandSdkRelocations(bytes, section2, patches) {
|
|
|
77870
77746
|
if (next !== patches.length || r.at !== section2.end)
|
|
77871
77747
|
throw new Error("Swift SDK code relocations exceed the code section");
|
|
77872
77748
|
return Buffer.concat([
|
|
77873
|
-
Uint8Array.from([10, ...
|
|
77749
|
+
Uint8Array.from([10, ...encodeWasmNumber(payload.reduce((size2, part) => size2 + part.length, 0))]),
|
|
77874
77750
|
...payload
|
|
77875
77751
|
]);
|
|
77876
77752
|
}
|
|
@@ -77982,8 +77858,8 @@ function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
|
|
|
77982
77858
|
const binding = bindSwiftAppModule(linkage, sdk2);
|
|
77983
77859
|
const { data, liveSlots } = selectSwiftSdkData(sdk2, usage, linkage, projection);
|
|
77984
77860
|
const bytes = Buffer.concat([binding, data]);
|
|
77985
|
-
const
|
|
77986
|
-
return { bytes, sha256:
|
|
77861
|
+
const sha2564 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto46.createHash)("sha256").update(bytes).digest("hex");
|
|
77862
|
+
return { bytes, sha256: sha2564, liveSlots };
|
|
77987
77863
|
}
|
|
77988
77864
|
function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
|
|
77989
77865
|
const map2 = readWasmLinkMap(mapFile, false);
|
|
@@ -78562,7 +78438,7 @@ function partitionParent(section2) {
|
|
|
78562
78438
|
"__objc_class_refs"
|
|
78563
78439
|
].find((name3) => section2 === name3 || section2.startsWith(`${name3}.`));
|
|
78564
78440
|
}
|
|
78565
|
-
var import_node_child_process40, import_node_crypto46, import_node_fs76, import_node_path74, import_node_util11, import_node_zlib5, run6, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY,
|
|
78441
|
+
var import_node_child_process40, import_node_crypto46, import_node_fs76, import_node_path74, import_node_util11, import_node_zlib5, run6, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, SCANNED, RUN_GAP;
|
|
78566
78442
|
var init_swift_sdk_app_module = __esm({
|
|
78567
78443
|
"src/swift-sdk-app-module.ts"() {
|
|
78568
78444
|
"use strict";
|
|
@@ -78585,6 +78461,7 @@ var init_swift_sdk_app_module = __esm({
|
|
|
78585
78461
|
init_swift_wasm_prune();
|
|
78586
78462
|
init_swiftSdkLinkContract();
|
|
78587
78463
|
init_swiftTargetContract();
|
|
78464
|
+
init_wasm_binary_sections();
|
|
78588
78465
|
init_wasm_narrow_boundary();
|
|
78589
78466
|
init_wasm_optimize();
|
|
78590
78467
|
run6 = (0, import_node_util11.promisify)(import_node_child_process40.execFile);
|
|
@@ -78605,32 +78482,6 @@ var init_swift_sdk_app_module = __esm({
|
|
|
78605
78482
|
SDK_TLS_HELPER = "__peach_sdk_tls.";
|
|
78606
78483
|
SDK_TLS_DELTA = "__peach_sdk_tls_delta.";
|
|
78607
78484
|
OBJC_SECTION_BOUNDARY = /^__(?:start|stop)_(__objc_(?:selectors|classes|class_refs|cats|protocols|protocol_refs|class_aliases|constant_string))$/;
|
|
78608
|
-
uleb4 = (value) => {
|
|
78609
|
-
const out = [];
|
|
78610
|
-
do {
|
|
78611
|
-
let byte = value % 128;
|
|
78612
|
-
value = Math.floor(value / 128);
|
|
78613
|
-
if (value) byte |= 128;
|
|
78614
|
-
out.push(byte);
|
|
78615
|
-
} while (value);
|
|
78616
|
-
return out;
|
|
78617
|
-
};
|
|
78618
|
-
sleb2 = (value) => {
|
|
78619
|
-
const out = [];
|
|
78620
|
-
for (; ; ) {
|
|
78621
|
-
const byte = Number(value & 127n);
|
|
78622
|
-
value >>= 7n;
|
|
78623
|
-
if (value === 0n && !(byte & 64) || value === -1n && byte & 64) {
|
|
78624
|
-
out.push(byte);
|
|
78625
|
-
return out;
|
|
78626
|
-
}
|
|
78627
|
-
out.push(byte | 128);
|
|
78628
|
-
}
|
|
78629
|
-
};
|
|
78630
|
-
encodedName2 = (name3) => {
|
|
78631
|
-
const bytes = [...Buffer.from(name3)];
|
|
78632
|
-
return [...uleb4(bytes.length), ...bytes];
|
|
78633
|
-
};
|
|
78634
78485
|
SCANNED = /* @__PURE__ */ new Set([
|
|
78635
78486
|
"swift5_protocols",
|
|
78636
78487
|
"swift5_protocol_conformances",
|
|
@@ -79688,8 +79539,8 @@ function brotliCompressQ4(bytes, cacheKey) {
|
|
|
79688
79539
|
function brotliCompressQ6(bytes, cacheKey) {
|
|
79689
79540
|
return cachedBrotli(bytes, 6, cacheKey);
|
|
79690
79541
|
}
|
|
79691
|
-
function brotliCompressSwiftSdkBinding(bytes,
|
|
79692
|
-
return cachedBrotli(bytes, 5,
|
|
79542
|
+
function brotliCompressSwiftSdkBinding(bytes, sha2564) {
|
|
79543
|
+
return cachedBrotli(bytes, 5, sha2564);
|
|
79693
79544
|
}
|
|
79694
79545
|
async function memo(cache, key2, load2) {
|
|
79695
79546
|
const cached5 = cache.get(key2);
|
|
@@ -79758,36 +79609,22 @@ function archiveMember(archive, name3) {
|
|
|
79758
79609
|
throw new Error(`swift-icu: ${name3} is not in the sdk's icu archive`);
|
|
79759
79610
|
}
|
|
79760
79611
|
function icuSegment(object9) {
|
|
79761
|
-
let at = 8;
|
|
79762
|
-
const leb2 = () => {
|
|
79763
|
-
let result = 0;
|
|
79764
|
-
let shift = 0;
|
|
79765
|
-
let byte;
|
|
79766
|
-
do {
|
|
79767
|
-
byte = object9[at++];
|
|
79768
|
-
result += (byte & 127) * 2 ** shift;
|
|
79769
|
-
shift += 7;
|
|
79770
|
-
} while (byte & 128);
|
|
79771
|
-
return result;
|
|
79772
|
-
};
|
|
79773
79612
|
const found2 = [];
|
|
79774
|
-
|
|
79775
|
-
|
|
79776
|
-
const
|
|
79777
|
-
|
|
79778
|
-
|
|
79779
|
-
|
|
79780
|
-
|
|
79781
|
-
|
|
79782
|
-
|
|
79783
|
-
|
|
79784
|
-
|
|
79785
|
-
|
|
79786
|
-
|
|
79787
|
-
|
|
79788
|
-
}
|
|
79613
|
+
for (const section2 of wasmSections(object9)) {
|
|
79614
|
+
if (section2.id !== 11) continue;
|
|
79615
|
+
const reader = readWasmSection(object9, section2.start, section2.end);
|
|
79616
|
+
for (let count = reader.number(); count > 0; count--) {
|
|
79617
|
+
if (reader.number() !== 0)
|
|
79618
|
+
throw new Error("swift-icu: unexpected data segment kind");
|
|
79619
|
+
reader.byte();
|
|
79620
|
+
reader.number();
|
|
79621
|
+
reader.byte();
|
|
79622
|
+
const length = reader.number();
|
|
79623
|
+
const start = reader.position();
|
|
79624
|
+
const bytes = object9.subarray(start, start + length);
|
|
79625
|
+
if (bytes[2] === 218 && bytes[3] === 39) found2.push(bytes);
|
|
79626
|
+
reader.skip(length);
|
|
79789
79627
|
}
|
|
79790
|
-
at = end;
|
|
79791
79628
|
}
|
|
79792
79629
|
if (found2.length !== 1)
|
|
79793
79630
|
throw new Error(`swift-icu: expected one icu data segment, found ${found2.length}`);
|
|
@@ -79841,6 +79678,7 @@ var init_swift_icu = __esm({
|
|
|
79841
79678
|
init_icuData();
|
|
79842
79679
|
init_swift_toolchain();
|
|
79843
79680
|
init_swiftTargetContract();
|
|
79681
|
+
init_wasm_binary_sections();
|
|
79844
79682
|
run7 = (0, import_node_util12.promisify)(import_node_child_process42.execFile);
|
|
79845
79683
|
deflate = (0, import_node_util12.promisify)(import_node_zlib6.gzip);
|
|
79846
79684
|
compressBrotli = (0, import_node_util12.promisify)(import_node_zlib6.brotliCompress);
|
|
@@ -86497,7 +86335,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
86497
86335
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
86498
86336
|
MULTI_MANIFEST_VERSION = 76;
|
|
86499
86337
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
86500
|
-
compilerSourceDigest = true ? "
|
|
86338
|
+
compilerSourceDigest = true ? "816651f27c8e6bad4746f2f90d840446903e3c4a2384095dcdf1c9ceb69ceba8" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
86501
86339
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
86502
86340
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
86503
86341
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -97290,11 +97128,6 @@ end
|
|
|
97290
97128
|
});
|
|
97291
97129
|
|
|
97292
97130
|
// src/bazel-project.ts
|
|
97293
|
-
function sha256Hex5(bytes) {
|
|
97294
|
-
if (typeof Bun !== "undefined")
|
|
97295
|
-
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
97296
|
-
return (0, import_node_crypto55.createHash)("sha256").update(bytes).digest("hex");
|
|
97297
|
-
}
|
|
97298
97131
|
function isBazelPackage(input) {
|
|
97299
97132
|
return /^BUILD(?:\.bazel)?$/.test(import_node_path97.default.basename(input)) && import_node_fs96.default.statSync(input).isFile();
|
|
97300
97133
|
}
|
|
@@ -97324,7 +97157,7 @@ function bazelBinary(root) {
|
|
|
97324
97157
|
const expected = (0, import_node_child_process48.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
|
|
97325
97158
|
encoding: "utf8"
|
|
97326
97159
|
}).split(/\s/)[0];
|
|
97327
|
-
const actual = (
|
|
97160
|
+
const actual = sha256Hex2(import_node_fs96.default.readFileSync(partial));
|
|
97328
97161
|
if (actual !== expected) {
|
|
97329
97162
|
import_node_fs96.default.rmSync(partial, { force: true });
|
|
97330
97163
|
throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
|
|
@@ -98049,8 +97882,8 @@ ${published4.map(
|
|
|
98049
97882
|
]
|
|
98050
97883
|
)
|
|
98051
97884
|
]);
|
|
98052
|
-
const digest3 =
|
|
98053
|
-
JSON.stringify([...contents2].map(([file, bytes]) => [file,
|
|
97885
|
+
const digest3 = sha256Hex2(
|
|
97886
|
+
JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex2(bytes)]))
|
|
98054
97887
|
);
|
|
98055
97888
|
const stamp = import_node_path97.default.join(bundle, ".peach-digest");
|
|
98056
97889
|
if (!import_node_fs96.default.existsSync(stamp) || import_node_fs96.default.readFileSync(stamp, "utf8") !== digest3) {
|
|
@@ -98222,6 +98055,7 @@ var init_bazel_project = __esm({
|
|
|
98222
98055
|
import_node_path97 = __toESM(require("node:path"), 1);
|
|
98223
98056
|
init_is_record();
|
|
98224
98057
|
init_plist();
|
|
98058
|
+
init_sha256();
|
|
98225
98059
|
LIBRARY_RULES = /* @__PURE__ */ new Set(["swift_library", "objc_library", "cc_library"]);
|
|
98226
98060
|
QUERIED_RULES = [
|
|
98227
98061
|
"swift_library",
|
|
@@ -98710,7 +98544,7 @@ var init_provenance = __esm({
|
|
|
98710
98544
|
import_node_crypto57 = require("node:crypto");
|
|
98711
98545
|
import_node_fs98 = require("node:fs");
|
|
98712
98546
|
import_node_path99 = require("node:path");
|
|
98713
|
-
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"
|
|
98547
|
+
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"839661007eb801f3e3ec055a1f00c0e8b7a3d3be7f4bf1fc389ee6b5c2a290a6","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"2c235d7947d94c8a9f84b305f5453da8647c5c9f8180a38c59631868685b8723","swift-coverage/package.ts":"0f595bd55bcbd22bb337395f175d2aba23624d60f44d3309a61929629cc9b200","swift-coverage/xcode.ts":"059dd3b47d1ce4fe43acef97277c64b57507399866725a2144289eaa6ef8c1d4","swift-coverage/xcode-assets.ts":"a9314d1de1df0ce639a4402b66f89f8b20537f3fdadf0b7cf7355e6ac5b09f54","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"b7f31dd9c3c554bd69bff75cc9985a11032a394b405acc4b82be8f140a2a8676","swift-coverage/xcode-packages.ts":"d6b3d7fb1f5e32b4b08727927b794030d2f1285c7e3c41d7e8ab2e244a3d8c36","swift-coverage/xcode-strings.ts":"ef711d2a9039a08eb7d407546018ab22aafb0e883a65fc838bf864f5c5c9f85b","swift-coverage/reader.ts":"2562d668fd959c4ae3d24b765d3281b8d03251e8de65ec62bda305ba79f7d8c3","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"cc32d16a0a3539e97447f853dd876b6b9240d544f5e0f21852c5a8333968e8a5","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"d140088a94d032e28788e18bf11499965e0c626255fd904538764ededcf1d751","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path99.join)(__sootsim_import_meta_dirname, ".."));
|
|
98714
98548
|
}
|
|
98715
98549
|
});
|
|
98716
98550
|
|
|
@@ -99702,12 +99536,12 @@ function catalogDigest(directory2) {
|
|
|
99702
99536
|
const path195 = (0, import_node_path101.join)(dir, entry.name);
|
|
99703
99537
|
if (entry.isDirectory()) walk4(path195);
|
|
99704
99538
|
else if (entry.isFile() && (0, import_node_fs100.statSync)(path195).size <= 64 * 1024 * 1024)
|
|
99705
|
-
hashes.push([(0, import_node_path101.relative)(directory2, path195),
|
|
99539
|
+
hashes.push([(0, import_node_path101.relative)(directory2, path195), sha256Hex2((0, import_node_fs100.readFileSync)(path195))]);
|
|
99706
99540
|
else throw new Error(`Unsupported asset catalog entry: ${path195}`);
|
|
99707
99541
|
}
|
|
99708
99542
|
};
|
|
99709
99543
|
walk4(directory2);
|
|
99710
|
-
return
|
|
99544
|
+
return sha256Hex2(JSON.stringify(hashes));
|
|
99711
99545
|
}
|
|
99712
99546
|
function symbolSource(plan, root) {
|
|
99713
99547
|
const key2 = JSON.stringify([root, plan]);
|
|
@@ -99804,16 +99638,15 @@ function assetSymbolText(plan, root) {
|
|
|
99804
99638
|
if (source.status === "unknown") throw new Error(source.reason);
|
|
99805
99639
|
return source.text;
|
|
99806
99640
|
}
|
|
99807
|
-
var
|
|
99641
|
+
var import_node_fs100, import_node_path101, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
|
|
99808
99642
|
var init_xcode_assets = __esm({
|
|
99809
99643
|
"src/swift-coverage/xcode-assets.ts"() {
|
|
99810
99644
|
"use strict";
|
|
99811
|
-
import_node_crypto58 = require("node:crypto");
|
|
99812
99645
|
import_node_fs100 = require("node:fs");
|
|
99813
99646
|
import_node_path101 = require("node:path");
|
|
99647
|
+
init_sha256();
|
|
99814
99648
|
init_provenance();
|
|
99815
99649
|
init_xcode_asset_symbols();
|
|
99816
|
-
sha2562 = (bytes) => (0, import_node_crypto58.createHash)("sha256").update(bytes).digest("hex");
|
|
99817
99650
|
unprovenAssetSettings = [
|
|
99818
99651
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
|
|
99819
99652
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
|
|
@@ -100495,7 +100328,7 @@ function normalizedEnums(input) {
|
|
|
100495
100328
|
}
|
|
100496
100329
|
function localizationIdentifier(field2, key2) {
|
|
100497
100330
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
100498
|
-
const digest3 = (0,
|
|
100331
|
+
const digest3 = (0, import_node_crypto58.createHash)("sha256").update(JSON.stringify([...field2, key2])).digest();
|
|
100499
100332
|
return Array.from(
|
|
100500
100333
|
digest3.subarray(0, 6),
|
|
100501
100334
|
(byte) => alphabet[byte % alphabet.length]
|
|
@@ -100820,12 +100653,12 @@ function writeIntentDefinition(input, prefix) {
|
|
|
100820
100653
|
lines.push("</plist>", "");
|
|
100821
100654
|
return lines.join("\n");
|
|
100822
100655
|
}
|
|
100823
|
-
var import_strict4,
|
|
100656
|
+
var import_strict4, import_node_crypto58, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
|
|
100824
100657
|
var init_metadata = __esm({
|
|
100825
100658
|
"src/intent-definition/metadata.ts"() {
|
|
100826
100659
|
"use strict";
|
|
100827
100660
|
import_strict4 = __toESM(require("node:assert/strict"), 1);
|
|
100828
|
-
|
|
100661
|
+
import_node_crypto58 = require("node:crypto");
|
|
100829
100662
|
init_fields();
|
|
100830
100663
|
init_hash_input();
|
|
100831
100664
|
init_siphash();
|
|
@@ -101534,7 +101367,7 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
101534
101367
|
if (prefix) identifier(prefix);
|
|
101535
101368
|
if (module2) identifier(module2);
|
|
101536
101369
|
const source = import_node_fs102.default.readFileSync(definition2);
|
|
101537
|
-
const key2 = (0,
|
|
101370
|
+
const key2 = (0, import_node_crypto59.createHash)("sha256").update(
|
|
101538
101371
|
JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
|
|
101539
101372
|
).update("\0").update(source).digest("hex");
|
|
101540
101373
|
const cache = import_node_path103.default.join(derivedDirectory, "IntentDefinitions");
|
|
@@ -101574,11 +101407,11 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
101574
101407
|
import_node_fs102.default.rmSync(stage, { recursive: true, force: true });
|
|
101575
101408
|
}
|
|
101576
101409
|
}
|
|
101577
|
-
var
|
|
101410
|
+
var import_node_crypto59, import_node_fs102, import_node_path103, intentCompilerRevision;
|
|
101578
101411
|
var init_xcode_intents = __esm({
|
|
101579
101412
|
"src/xcode-intents.ts"() {
|
|
101580
101413
|
"use strict";
|
|
101581
|
-
|
|
101414
|
+
import_node_crypto59 = require("node:crypto");
|
|
101582
101415
|
import_node_fs102 = __toESM(require("node:fs"), 1);
|
|
101583
101416
|
import_node_path103 = __toESM(require("node:path"), 1);
|
|
101584
101417
|
init_fields();
|
|
@@ -102280,7 +102113,7 @@ function loadProject(xcodeproj) {
|
|
|
102280
102113
|
if (!projectFile)
|
|
102281
102114
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
102282
102115
|
const source = import_node_fs103.default.readFileSync(projectFile, "utf8");
|
|
102283
|
-
const digest3 = (0,
|
|
102116
|
+
const digest3 = (0, import_node_crypto60.createHash)("sha256").update(source).digest("hex");
|
|
102284
102117
|
const cached5 = loaded3.get(projectFile);
|
|
102285
102118
|
if (cached5?.digest === digest3) return cached5.project;
|
|
102286
102119
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -102332,7 +102165,7 @@ function xcodeInstallationIdentity() {
|
|
|
102332
102165
|
if (!selected) return null;
|
|
102333
102166
|
const directory2 = import_node_path105.default.extname(selected) === ".app" ? import_node_path105.default.join(selected, "Contents", "Developer") : selected;
|
|
102334
102167
|
const versionFile = `${directory2}/../version.plist`;
|
|
102335
|
-
const version2 = import_node_fs103.default.existsSync(versionFile) ? (0,
|
|
102168
|
+
const version2 = import_node_fs103.default.existsSync(versionFile) ? (0, import_node_crypto60.createHash)("sha256").update(import_node_fs103.default.readFileSync(versionFile)).digest("hex") : null;
|
|
102336
102169
|
return { directory: directory2, version: version2 };
|
|
102337
102170
|
}
|
|
102338
102171
|
function defaultConfiguration(project2) {
|
|
@@ -102816,7 +102649,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
102816
102649
|
);
|
|
102817
102650
|
});
|
|
102818
102651
|
}
|
|
102819
|
-
const signature2 = (0,
|
|
102652
|
+
const signature2 = (0, import_node_crypto60.createHash)("sha256").update(
|
|
102820
102653
|
JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
|
|
102821
102654
|
);
|
|
102822
102655
|
for (const file of inputFiles) {
|
|
@@ -102971,7 +102804,7 @@ ${output}`
|
|
|
102971
102804
|
const inputs2 = JSON.stringify([
|
|
102972
102805
|
1,
|
|
102973
102806
|
args,
|
|
102974
|
-
(0,
|
|
102807
|
+
(0, import_node_crypto60.createHash)("sha256").update(import_node_fs103.default.readFileSync(file)).digest("hex")
|
|
102975
102808
|
]);
|
|
102976
102809
|
const developer = settings("DEVELOPER_DIR");
|
|
102977
102810
|
const cached5 = import_node_fs103.default.existsSync(output) && import_node_fs103.default.existsSync(stamp) ? import_node_fs103.default.readFileSync(stamp, "utf8").split("\n") : [];
|
|
@@ -104521,12 +104354,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
104521
104354
|
cocoapods
|
|
104522
104355
|
};
|
|
104523
104356
|
}
|
|
104524
|
-
var import_node_child_process49,
|
|
104357
|
+
var import_node_child_process49, import_node_crypto60, import_node_fs103, import_node_module9, import_node_path105, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory3, loaded3, developerDir, preparedSourcePhases, isPodsProject, targetRefs, NativeAppTargetSelectionError, workspaceResolvedFile, SwiftPackageResolutionRequired;
|
|
104525
104358
|
var init_xcode_project = __esm({
|
|
104526
104359
|
"src/xcode-project.ts"() {
|
|
104527
104360
|
"use strict";
|
|
104528
104361
|
import_node_child_process49 = require("node:child_process");
|
|
104529
|
-
|
|
104362
|
+
import_node_crypto60 = require("node:crypto");
|
|
104530
104363
|
import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
104531
104364
|
import_node_module9 = require("node:module");
|
|
104532
104365
|
import_node_path105 = __toESM(require("node:path"), 1);
|
|
@@ -104735,8 +104568,8 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
104735
104568
|
);
|
|
104736
104569
|
const appRelative = import_node_path106.default.relative(root, app);
|
|
104737
104570
|
const manifest = JSON.parse(import_node_fs104.default.readFileSync(import_node_path106.default.join(root, "package.json"), "utf8"));
|
|
104738
|
-
const hash = (0,
|
|
104739
|
-
const native = (0,
|
|
104571
|
+
const hash = (0, import_node_crypto61.createHash)("sha256");
|
|
104572
|
+
const native = (0, import_node_crypto61.createHash)("sha256");
|
|
104740
104573
|
const nativeDirectories = localPackageDirectories(root, app);
|
|
104741
104574
|
const versionFree = new Set(
|
|
104742
104575
|
nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
|
|
@@ -104820,7 +104653,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
104820
104653
|
unread.slice(start, start + 32).map(async ({ file, content }) => {
|
|
104821
104654
|
const bytes = await import_node_fs104.default.promises.readFile(file);
|
|
104822
104655
|
content.size = bytes.length;
|
|
104823
|
-
content.digest = (0,
|
|
104656
|
+
content.digest = (0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex");
|
|
104824
104657
|
fileDigests.set(file, content);
|
|
104825
104658
|
})
|
|
104826
104659
|
);
|
|
@@ -105373,10 +105206,10 @@ function stageCachedQuickCryptoOpenSsl(app) {
|
|
|
105373
105206
|
const opensslDir = import_node_path106.default.join(packageDir, "ios", "openssl");
|
|
105374
105207
|
if (import_node_fs104.default.existsSync(import_node_path106.default.join(opensslDir, "quickcrypto_openssl_prefix.h"))) return;
|
|
105375
105208
|
const podspec = import_node_fs104.default.readFileSync(import_node_path106.default.join(packageDir, "QuickCrypto.podspec"), "utf8");
|
|
105376
|
-
const
|
|
105377
|
-
if (!
|
|
105378
|
-
const archive = import_node_path106.default.join(cacheDir(), "pod-archives", `${
|
|
105379
|
-
if (!import_node_fs104.default.existsSync(archive) || (0,
|
|
105209
|
+
const sha2564 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
|
|
105210
|
+
if (!sha2564) return;
|
|
105211
|
+
const archive = import_node_path106.default.join(cacheDir(), "pod-archives", `${sha2564}.zip`);
|
|
105212
|
+
if (!import_node_fs104.default.existsSync(archive) || (0, import_node_crypto61.createHash)("sha256").update(import_node_fs104.default.readFileSync(archive)).digest("hex") !== sha2564)
|
|
105380
105213
|
return;
|
|
105381
105214
|
import_node_fs104.default.rmSync(opensslDir, { recursive: true, force: true });
|
|
105382
105215
|
import_node_fs104.default.mkdirSync(opensslDir, { recursive: true });
|
|
@@ -105414,12 +105247,12 @@ ${failedOutputLine(command, cwd, bytes)}`
|
|
|
105414
105247
|
});
|
|
105415
105248
|
});
|
|
105416
105249
|
}
|
|
105417
|
-
var import_node_child_process50,
|
|
105250
|
+
var import_node_child_process50, import_node_crypto61, import_node_fs104, import_node_module10, import_node_os22, import_node_path106, import_node_util13, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE2, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
|
|
105418
105251
|
var init_expo_native_workspace = __esm({
|
|
105419
105252
|
"src/expo-native-workspace.ts"() {
|
|
105420
105253
|
"use strict";
|
|
105421
105254
|
import_node_child_process50 = require("node:child_process");
|
|
105422
|
-
|
|
105255
|
+
import_node_crypto61 = require("node:crypto");
|
|
105423
105256
|
import_node_fs104 = __toESM(require("node:fs"), 1);
|
|
105424
105257
|
import_node_module10 = require("node:module");
|
|
105425
105258
|
import_node_os22 = __toESM(require("node:os"), 1);
|
|
@@ -105493,7 +105326,7 @@ function run() {
|
|
|
105493
105326
|
|
|
105494
105327
|
// src/expo-discovery-cache.ts
|
|
105495
105328
|
function peachPin() {
|
|
105496
|
-
return (0,
|
|
105329
|
+
return (0, import_node_crypto62.createHash)("sha256").update(
|
|
105497
105330
|
`${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
|
|
105498
105331
|
).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
|
|
105499
105332
|
}
|
|
@@ -105507,7 +105340,7 @@ function stable(value) {
|
|
|
105507
105340
|
}
|
|
105508
105341
|
async function expoDiscoveryKey(options2) {
|
|
105509
105342
|
const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
|
|
105510
|
-
const key2 = (0,
|
|
105343
|
+
const key2 = (0, import_node_crypto62.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
|
|
105511
105344
|
return { key: key2, root };
|
|
105512
105345
|
}
|
|
105513
105346
|
function expoDiscoveryCacheDir() {
|
|
@@ -105578,7 +105411,7 @@ function readExpoDiscovery(key2) {
|
|
|
105578
105411
|
if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
|
|
105579
105412
|
const archive = import_node_path107.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
|
|
105580
105413
|
const bytes = import_node_fs105.default.readFileSync(archive);
|
|
105581
|
-
if ((0,
|
|
105414
|
+
if ((0, import_node_crypto62.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
|
|
105582
105415
|
return void 0;
|
|
105583
105416
|
const bodies = (0, import_node_zlib7.zstdDecompressSync)(bytes);
|
|
105584
105417
|
const decoded = /* @__PURE__ */ new Map();
|
|
@@ -105652,7 +105485,7 @@ function stampedFileHash(file) {
|
|
|
105652
105485
|
const stamp = [stat2.dev, stat2.ino, stat2.size, stat2.mtimeNs, stat2.ctimeNs].join(":");
|
|
105653
105486
|
const cached5 = fileHashes.get(file);
|
|
105654
105487
|
if (cached5?.stamp === stamp) return cached5.checksum;
|
|
105655
|
-
const checksum = (0,
|
|
105488
|
+
const checksum = (0, import_node_crypto62.createHash)("sha256").update(import_node_fs105.default.readFileSync(file)).digest("hex");
|
|
105656
105489
|
fileHashes.set(file, { stamp, checksum });
|
|
105657
105490
|
fileHashesChanged = true;
|
|
105658
105491
|
return checksum;
|
|
@@ -105661,7 +105494,7 @@ function saveFileHashes() {
|
|
|
105661
105494
|
if (!fileHashesChanged) return;
|
|
105662
105495
|
fileHashesChanged = false;
|
|
105663
105496
|
const target = fileHashesPath();
|
|
105664
|
-
const temporary = `${target}.${process.pid}.${(0,
|
|
105497
|
+
const temporary = `${target}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`;
|
|
105665
105498
|
try {
|
|
105666
105499
|
import_node_fs105.default.mkdirSync(import_node_path107.default.dirname(target), { recursive: true });
|
|
105667
105500
|
import_node_fs105.default.writeFileSync(
|
|
@@ -105716,7 +105549,7 @@ function frameworkDigest(directory2, signal) {
|
|
|
105716
105549
|
if (target !== root && !target.startsWith(`${root}${import_node_path107.default.sep}`))
|
|
105717
105550
|
throw new Error(`framework link escapes its tree: ${relative8}`);
|
|
105718
105551
|
}
|
|
105719
|
-
return (0,
|
|
105552
|
+
return (0, import_node_crypto62.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
|
|
105720
105553
|
}
|
|
105721
105554
|
function rewritePreparedPaths(options2) {
|
|
105722
105555
|
const { units, sourceRoot, preparedRoot, signal } = options2;
|
|
@@ -105737,7 +105570,7 @@ function rewritePreparedPaths(options2) {
|
|
|
105737
105570
|
return null;
|
|
105738
105571
|
}
|
|
105739
105572
|
if (!preparedBytes.equals(sourceBytes)) return null;
|
|
105740
|
-
dependencies[sourceFile] = (0,
|
|
105573
|
+
dependencies[sourceFile] = (0, import_node_crypto62.createHash)("sha256").update(sourceBytes).digest("hex");
|
|
105741
105574
|
verifiedFiles.set(preparedFile, sourceFile);
|
|
105742
105575
|
return sourceFile;
|
|
105743
105576
|
};
|
|
@@ -105814,7 +105647,7 @@ function rewritePreparedPaths(options2) {
|
|
|
105814
105647
|
portableDir = import_node_path107.default.join(parent, import_node_path107.default.basename(dir));
|
|
105815
105648
|
if (!import_node_fs105.default.existsSync(portableDir)) {
|
|
105816
105649
|
import_node_fs105.default.mkdirSync(parent, { recursive: true });
|
|
105817
|
-
const tmp = import_node_path107.default.join(parent, `.${process.pid}.${(0,
|
|
105650
|
+
const tmp = import_node_path107.default.join(parent, `.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
|
|
105818
105651
|
try {
|
|
105819
105652
|
import_node_fs105.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
|
|
105820
105653
|
if (frameworkDigest(tmp, signal) !== preparedDigest)
|
|
@@ -105843,7 +105676,7 @@ function writeExpoDiscovery(options2) {
|
|
|
105843
105676
|
try {
|
|
105844
105677
|
const dir = expoDiscoveryCacheDir();
|
|
105845
105678
|
import_node_fs105.default.mkdirSync(dir, { recursive: true });
|
|
105846
|
-
const tmp = import_node_path107.default.join(dir, `.${options2.key}.${process.pid}.${(0,
|
|
105679
|
+
const tmp = import_node_path107.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
|
|
105847
105680
|
if (options2.units === null) {
|
|
105848
105681
|
import_node_fs105.default.writeFileSync(
|
|
105849
105682
|
tmp,
|
|
@@ -105906,8 +105739,8 @@ function writeExpoDiscovery(options2) {
|
|
|
105906
105739
|
}
|
|
105907
105740
|
);
|
|
105908
105741
|
const contents2 = (0, import_node_zlib7.zstdCompressSync)(Buffer.concat(chunks, size2));
|
|
105909
|
-
const archive = (0,
|
|
105910
|
-
const temporary = import_node_path107.default.join(blobDir, "." + (0,
|
|
105742
|
+
const archive = (0, import_node_crypto62.createHash)("sha256").update(contents2).digest("hex");
|
|
105743
|
+
const temporary = import_node_path107.default.join(blobDir, "." + (0, import_node_crypto62.randomUUID)() + ".tmp");
|
|
105911
105744
|
try {
|
|
105912
105745
|
import_node_fs105.default.writeFileSync(temporary, contents2);
|
|
105913
105746
|
import_node_fs105.default.renameSync(temporary, import_node_path107.default.join(blobDir, `${archive}.zst`));
|
|
@@ -105934,11 +105767,11 @@ function writeExpoDiscovery(options2) {
|
|
|
105934
105767
|
return error instanceof Error ? error.message : String(error);
|
|
105935
105768
|
}
|
|
105936
105769
|
}
|
|
105937
|
-
var
|
|
105770
|
+
var import_node_crypto62, import_node_fs105, import_node_path107, import_node_zlib7, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings3, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
|
|
105938
105771
|
var init_expo_discovery_cache = __esm({
|
|
105939
105772
|
"src/expo-discovery-cache.ts"() {
|
|
105940
105773
|
"use strict";
|
|
105941
|
-
|
|
105774
|
+
import_node_crypto62 = require("node:crypto");
|
|
105942
105775
|
import_node_fs105 = __toESM(require("node:fs"), 1);
|
|
105943
105776
|
import_node_path107 = __toESM(require("node:path"), 1);
|
|
105944
105777
|
import_node_zlib7 = require("node:zlib");
|
|
@@ -107001,7 +106834,7 @@ function hashPackageTree(root, options2) {
|
|
|
107001
106834
|
}
|
|
107002
106835
|
};
|
|
107003
106836
|
walk4(root, "");
|
|
107004
|
-
const hash = (0,
|
|
106837
|
+
const hash = (0, import_node_crypto63.createHash)("sha256");
|
|
107005
106838
|
return (async () => {
|
|
107006
106839
|
for (let start = 0; start < files2.length; start += READ_AHEAD) {
|
|
107007
106840
|
const batch = files2.slice(start, start + READ_AHEAD);
|
|
@@ -107022,11 +106855,11 @@ function nativePackageTreeDigest(root) {
|
|
|
107022
106855
|
skipFile: (name3) => name3.endsWith(".d.ts") || name3.endsWith(".d.ts.map") || name3.endsWith(".js.map")
|
|
107023
106856
|
});
|
|
107024
106857
|
}
|
|
107025
|
-
var
|
|
106858
|
+
var import_node_crypto63, import_node_fs108, import_promises13, import_node_path110, READ_AHEAD;
|
|
107026
106859
|
var init_package_tree_digest = __esm({
|
|
107027
106860
|
"src/package-tree-digest.ts"() {
|
|
107028
106861
|
"use strict";
|
|
107029
|
-
|
|
106862
|
+
import_node_crypto63 = require("node:crypto");
|
|
107030
106863
|
import_node_fs108 = require("node:fs");
|
|
107031
106864
|
import_promises13 = require("node:fs/promises");
|
|
107032
106865
|
import_node_path110 = require("node:path");
|
|
@@ -107106,7 +106939,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
107106
106939
|
"swift-pin": JSON.stringify(swiftNativePin()),
|
|
107107
106940
|
answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
|
|
107108
106941
|
"pods-environment": JSON.stringify(reactNativePodsEnvironment()),
|
|
107109
|
-
fingerprint: (0,
|
|
106942
|
+
fingerprint: (0, import_node_crypto64.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
|
|
107110
106943
|
},
|
|
107111
106944
|
packages
|
|
107112
106945
|
};
|
|
@@ -107224,7 +107057,7 @@ async function managedExpoNativeAppIdentity(appRoot, iosTarget) {
|
|
|
107224
107057
|
}
|
|
107225
107058
|
function servedExpoSwift(appRoot, entry, app) {
|
|
107226
107059
|
if (!entry.expoSwift) return null;
|
|
107227
|
-
const rootId = `${(0,
|
|
107060
|
+
const rootId = `${(0, import_node_crypto64.createHash)("sha256").update(import_node_fs109.default.realpathSync(appRoot)).digest("hex")}/Expo`;
|
|
107228
107061
|
if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
|
|
107229
107062
|
const installed2 = installedInfoPlist(app.infoPlist, entry.infoPlist);
|
|
107230
107063
|
const infoPlist2 = Buffer.from(installed2).toString("base64");
|
|
@@ -107252,11 +107085,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
|
|
|
107252
107085
|
await prebuiltAppTarget(appRoot, signal, "installed")
|
|
107253
107086
|
);
|
|
107254
107087
|
}
|
|
107255
|
-
var
|
|
107088
|
+
var import_node_crypto64, import_node_fs109, import_node_module13, import_node_path111, import_node_util14, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published, lookups, answers;
|
|
107256
107089
|
var init_expo_native_prebuilt = __esm({
|
|
107257
107090
|
"src/expo-native-prebuilt.ts"() {
|
|
107258
107091
|
"use strict";
|
|
107259
|
-
|
|
107092
|
+
import_node_crypto64 = require("node:crypto");
|
|
107260
107093
|
import_node_fs109 = __toESM(require("node:fs"), 1);
|
|
107261
107094
|
import_node_module13 = require("node:module");
|
|
107262
107095
|
import_node_path111 = __toESM(require("node:path"), 1);
|
|
@@ -107308,7 +107141,7 @@ function watchNativeInputs(root) {
|
|
|
107308
107141
|
(0, import_node_timers2.clearTimeout)(expiry);
|
|
107309
107142
|
for (const watcher of watchers) watcher.close();
|
|
107310
107143
|
}
|
|
107311
|
-
const inputs2 = { expiry, revision: (0,
|
|
107144
|
+
const inputs2 = { expiry, revision: (0, import_node_crypto65.randomUUID)() };
|
|
107312
107145
|
const watch4 = (directory2, recursive, name3) => {
|
|
107313
107146
|
const watcher = import_node_fs110.default.watch(
|
|
107314
107147
|
directory2,
|
|
@@ -107353,11 +107186,11 @@ function nativeInputRevision(root) {
|
|
|
107353
107186
|
const inputs2 = watchNativeInputs(root);
|
|
107354
107187
|
if (inputs2) return JSON.stringify([inputs2.revision, resolveActiveRuntimeRoot()]);
|
|
107355
107188
|
}
|
|
107356
|
-
var
|
|
107189
|
+
var import_node_crypto65, import_node_fs110, import_node_path112, import_node_timers2, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
|
|
107357
107190
|
var init_native_preparation = __esm({
|
|
107358
107191
|
"src/native-preparation.ts"() {
|
|
107359
107192
|
"use strict";
|
|
107360
|
-
|
|
107193
|
+
import_node_crypto65 = require("node:crypto");
|
|
107361
107194
|
import_node_fs110 = __toESM(require("node:fs"), 1);
|
|
107362
107195
|
import_node_path112 = __toESM(require("node:path"), 1);
|
|
107363
107196
|
import_node_timers2 = require("node:timers");
|
|
@@ -107456,7 +107289,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk2, distribution) {
|
|
|
107456
107289
|
return { name: recipe2.name, inputs: inputs2, key: nativeEntryKey(inputs2) };
|
|
107457
107290
|
}
|
|
107458
107291
|
function nativeStaticLibraryRecipe(bytes) {
|
|
107459
|
-
const digest3 = (0,
|
|
107292
|
+
const digest3 = (0, import_node_crypto66.createHash)("sha256").update(bytes).digest("hex");
|
|
107460
107293
|
return NATIVE_STATIC_LIBRARY_RECIPES.find((item) => item.nativeSha256 === digest3);
|
|
107461
107294
|
}
|
|
107462
107295
|
function nativeStaticLibrary(file, recipe2, moduleRoot) {
|
|
@@ -107499,7 +107332,7 @@ function isRustSymbol(name3, demangled) {
|
|
|
107499
107332
|
function rustStaticLibrary(file, moduleRoot) {
|
|
107500
107333
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
107501
107334
|
const bytes = import_node_fs111.default.readFileSync(file);
|
|
107502
|
-
const key2 = (0,
|
|
107335
|
+
const key2 = (0, import_node_crypto66.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
|
|
107503
107336
|
const directory2 = import_node_path113.default.join(cacheDir(), "native-archives", key2);
|
|
107504
107337
|
const archive = import_node_path113.default.join(directory2, "library.a");
|
|
107505
107338
|
if (import_node_fs111.default.existsSync(archive)) return archive;
|
|
@@ -107528,7 +107361,7 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
107528
107361
|
const members2 = readArMembers(bytes, true);
|
|
107529
107362
|
const seen = /* @__PURE__ */ new Set();
|
|
107530
107363
|
const unique2 = members2.filter(({ name: name3, bytes: bytes2 }) => {
|
|
107531
|
-
const identity2 = name3 + "\0" + (0,
|
|
107364
|
+
const identity2 = name3 + "\0" + (0, import_node_crypto66.createHash)("sha256").update(bytes2).digest("hex");
|
|
107532
107365
|
if (seen.has(identity2)) return false;
|
|
107533
107366
|
seen.add(identity2);
|
|
107534
107367
|
return true;
|
|
@@ -107575,14 +107408,14 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
107575
107408
|
function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
107576
107409
|
if (files2.length === 1) return files2[0];
|
|
107577
107410
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
107578
|
-
const hash = (0,
|
|
107411
|
+
const hash = (0, import_node_crypto66.createHash)("sha256").update(toolchain.release);
|
|
107579
107412
|
for (const file of files2)
|
|
107580
107413
|
hash.update("\0").update(import_node_path113.default.basename(file)).update("\0").update(import_node_fs111.default.readFileSync(file));
|
|
107581
107414
|
const directory2 = import_node_path113.default.join(cacheDir(), "native-archives", hash.digest("hex"));
|
|
107582
107415
|
const archive = import_node_path113.default.join(directory2, "combined.a");
|
|
107583
107416
|
if (import_node_fs111.default.existsSync(archive)) return archive;
|
|
107584
107417
|
import_node_fs111.default.mkdirSync(directory2, { recursive: true });
|
|
107585
|
-
const temporary = import_node_path113.default.join(directory2, `combined-${(0,
|
|
107418
|
+
const temporary = import_node_path113.default.join(directory2, `combined-${(0, import_node_crypto66.randomUUID)()}.a`);
|
|
107586
107419
|
try {
|
|
107587
107420
|
(0, import_node_child_process52.execFileSync)(import_node_path113.default.join(toolchain.toolchainBin, "llvm-ar"), [
|
|
107588
107421
|
"qcsDL",
|
|
@@ -107595,12 +107428,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
|
107595
107428
|
}
|
|
107596
107429
|
return archive;
|
|
107597
107430
|
}
|
|
107598
|
-
var import_node_child_process52,
|
|
107431
|
+
var import_node_child_process52, import_node_crypto66, import_node_fs111, import_node_path113, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
|
|
107599
107432
|
var init_native_static_libraries = __esm({
|
|
107600
107433
|
"src/native-static-libraries.ts"() {
|
|
107601
107434
|
"use strict";
|
|
107602
107435
|
import_node_child_process52 = require("node:child_process");
|
|
107603
|
-
|
|
107436
|
+
import_node_crypto66 = require("node:crypto");
|
|
107604
107437
|
import_node_fs111 = __toESM(require("node:fs"), 1);
|
|
107605
107438
|
import_node_path113 = __toESM(require("node:path"), 1);
|
|
107606
107439
|
init_home_paths();
|
|
@@ -108212,13 +108045,13 @@ var init_swift_wasm64_wamr = __esm({
|
|
|
108212
108045
|
|
|
108213
108046
|
// src/swift-wasm64-native-source.ts
|
|
108214
108047
|
function deriveSource(file, bytes, backport) {
|
|
108215
|
-
if (!backport || (0,
|
|
108048
|
+
if (!backport || (0, import_node_crypto67.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
|
|
108216
108049
|
return null;
|
|
108217
108050
|
const source = bytes.toString("utf8");
|
|
108218
108051
|
const derived = Buffer.from(
|
|
108219
108052
|
"rewrite" in backport ? backport.rewrite(source) : source.replace(backport.before, backport.after)
|
|
108220
108053
|
);
|
|
108221
|
-
if ((0,
|
|
108054
|
+
if ((0, import_node_crypto67.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
|
|
108222
108055
|
throw new Error(`Native source derivation differs: ${file}`);
|
|
108223
108056
|
return {
|
|
108224
108057
|
bytes: derived,
|
|
@@ -108237,11 +108070,11 @@ function deriveWasm64NativeSource(file, bytes) {
|
|
|
108237
108070
|
sourceDerivations.get(name3) ?? headerDerivations.get(name3)
|
|
108238
108071
|
);
|
|
108239
108072
|
}
|
|
108240
|
-
var
|
|
108073
|
+
var import_node_crypto67, import_node_path115, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
|
|
108241
108074
|
var init_swift_wasm64_native_source = __esm({
|
|
108242
108075
|
"src/swift-wasm64-native-source.ts"() {
|
|
108243
108076
|
"use strict";
|
|
108244
|
-
|
|
108077
|
+
import_node_crypto67 = require("node:crypto");
|
|
108245
108078
|
import_node_path115 = __toESM(require("node:path"), 1);
|
|
108246
108079
|
init_swift_wasm64_wamr();
|
|
108247
108080
|
init_swiftWasm64ConfigContract();
|
|
@@ -108701,7 +108534,7 @@ var init_genrule_library_builds = __esm({
|
|
|
108701
108534
|
function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
108702
108535
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
108703
108536
|
const sdk2 = swiftSdkPaths(moduleRoot, toolchainBin);
|
|
108704
|
-
const identity2 = (0,
|
|
108537
|
+
const identity2 = (0, import_node_crypto68.createHash)("sha256").update(
|
|
108705
108538
|
JSON.stringify([
|
|
108706
108539
|
distribution?.id,
|
|
108707
108540
|
distribution?.link,
|
|
@@ -108727,7 +108560,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
108727
108560
|
for (const alias of product.frameworkAliases) {
|
|
108728
108561
|
if (alias.wasmSdkId !== distribution.wasmSdkId || alias.wasmSdkChecksum !== distribution.wasmSdkChecksum)
|
|
108729
108562
|
throw new Error(`framework SDK identity differs for ${alias.name}`);
|
|
108730
|
-
if ((0,
|
|
108563
|
+
if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs114.default.readFileSync(import_node_path117.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
108731
108564
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
108732
108565
|
const selected = /* @__PURE__ */ new Set();
|
|
108733
108566
|
const reach = (name3) => {
|
|
@@ -108768,7 +108601,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
108768
108601
|
for (const alias of owner.frameworkAliases) {
|
|
108769
108602
|
if (frameworkResponses[alias.name])
|
|
108770
108603
|
throw new Error(`ambiguous declared framework ${alias.name}`);
|
|
108771
|
-
if ((0,
|
|
108604
|
+
if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs114.default.readFileSync(import_node_path117.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
108772
108605
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
108773
108606
|
const file = import_node_path117.default.join(root, `${alias.name}.rsp`);
|
|
108774
108607
|
import_node_fs114.default.writeFileSync(file, aliasArtifacts.map(quote3).join("\n") + "\n");
|
|
@@ -108862,11 +108695,11 @@ exec ${shellQuote2(configuration2.compiler)} "$@"
|
|
|
108862
108695
|
};
|
|
108863
108696
|
return { cc: compiler("clang"), cxx: compiler("clang++"), identity: identity2 };
|
|
108864
108697
|
}
|
|
108865
|
-
var
|
|
108698
|
+
var import_node_crypto68, import_node_fs114, import_node_path117, v7;
|
|
108866
108699
|
var init_native_framework_compiler = __esm({
|
|
108867
108700
|
"src/native-framework-compiler.ts"() {
|
|
108868
108701
|
"use strict";
|
|
108869
|
-
|
|
108702
|
+
import_node_crypto68 = require("node:crypto");
|
|
108870
108703
|
import_node_fs114 = __toESM(require("node:fs"), 1);
|
|
108871
108704
|
import_node_path117 = __toESM(require("node:path"), 1);
|
|
108872
108705
|
v7 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
@@ -108887,7 +108720,7 @@ function processAlive(pid) {
|
|
|
108887
108720
|
}
|
|
108888
108721
|
function tryAcquireNumberedLock(directory2, detail = "") {
|
|
108889
108722
|
(0, import_node_fs115.mkdirSync)(directory2, { recursive: true });
|
|
108890
|
-
const claim = (0, import_node_path118.join)(directory2, `claim-${process.pid}-${(0,
|
|
108723
|
+
const claim = (0, import_node_path118.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto69.randomUUID)()}`);
|
|
108891
108724
|
for (; ; ) {
|
|
108892
108725
|
const numbers = (0, import_node_fs115.readdirSync)(directory2).filter((name3) => /^\d+$/.test(name3)).map(Number);
|
|
108893
108726
|
const top = Math.max(-1, ...numbers);
|
|
@@ -108926,11 +108759,11 @@ ${detail}` : ""}`);
|
|
|
108926
108759
|
};
|
|
108927
108760
|
}
|
|
108928
108761
|
}
|
|
108929
|
-
var
|
|
108762
|
+
var import_node_crypto69, import_node_fs115, import_node_path118, errorCode2;
|
|
108930
108763
|
var init_numbered_lock = __esm({
|
|
108931
108764
|
"src/numbered-lock.ts"() {
|
|
108932
108765
|
"use strict";
|
|
108933
|
-
|
|
108766
|
+
import_node_crypto69 = require("node:crypto");
|
|
108934
108767
|
import_node_fs115 = require("node:fs");
|
|
108935
108768
|
import_node_path118 = require("node:path");
|
|
108936
108769
|
errorCode2 = (error) => error instanceof Error && "code" in error ? error.code : void 0;
|
|
@@ -108957,7 +108790,7 @@ function llvmIdentity(toolchainBin, release) {
|
|
|
108957
108790
|
] : ["clang", "wasm-ld", "llvm-ar", "llvm-nm", "llvm-strip"].map(
|
|
108958
108791
|
(name3) => swiftFileChecksum(import_node_path119.default.join(toolchainBin, name3))
|
|
108959
108792
|
);
|
|
108960
|
-
const identity2 = (0,
|
|
108793
|
+
const identity2 = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
|
|
108961
108794
|
toolIdentities.set(toolchainBin, identity2);
|
|
108962
108795
|
return identity2;
|
|
108963
108796
|
}
|
|
@@ -108965,7 +108798,7 @@ function cSdkIdentity(sysroot, resourceDir, frameworks) {
|
|
|
108965
108798
|
const key2 = JSON.stringify([sysroot, resourceDir, frameworks]);
|
|
108966
108799
|
const cached5 = sysrootIdentities.get(key2);
|
|
108967
108800
|
if (cached5) return cached5;
|
|
108968
|
-
const hash = (0,
|
|
108801
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
108969
108802
|
const add2 = (root, relative8) => {
|
|
108970
108803
|
const file = import_node_path119.default.join(root, relative8);
|
|
108971
108804
|
const stat2 = import_node_fs116.default.statSync(file, { throwIfNoEntry: false });
|
|
@@ -109000,7 +108833,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
109000
108833
|
import_node_fs116.default.readFileSync(import_node_path119.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
109001
108834
|
)
|
|
109002
108835
|
);
|
|
109003
|
-
const hash = (0,
|
|
108836
|
+
const hash = (0, import_node_crypto70.createHash)("sha256").update(
|
|
109004
108837
|
JSON.stringify([
|
|
109005
108838
|
headers,
|
|
109006
108839
|
distribution.link,
|
|
@@ -109010,7 +108843,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
109010
108843
|
])
|
|
109011
108844
|
);
|
|
109012
108845
|
const objects = distribution.objects.map((file) => [file, distribution.files[file]]);
|
|
109013
|
-
const objectKey = (0,
|
|
108846
|
+
const objectKey = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
|
|
109014
108847
|
const cache = import_node_path119.default.join(cacheDir4, "framework-symbols-by-object", objectKey);
|
|
109015
108848
|
if (!import_node_fs116.default.existsSync(cache)) {
|
|
109016
108849
|
import_node_fs116.default.mkdirSync(import_node_path119.default.dirname(cache), { recursive: true });
|
|
@@ -109045,7 +108878,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
109045
108878
|
const digest3 = import_node_path119.default.join(temporary, "digest");
|
|
109046
108879
|
import_node_fs116.default.writeFileSync(
|
|
109047
108880
|
digest3,
|
|
109048
|
-
(0,
|
|
108881
|
+
(0, import_node_crypto70.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
|
|
109049
108882
|
);
|
|
109050
108883
|
import_node_fs116.default.renameSync(digest3, cache);
|
|
109051
108884
|
} finally {
|
|
@@ -109100,7 +108933,7 @@ function buildable(declaration) {
|
|
|
109100
108933
|
return builderOf(declaration) !== null && declaration.dependencies.every(buildable);
|
|
109101
108934
|
}
|
|
109102
108935
|
function declarationInputs(declaration, builder, toolchain, dependencyKeys) {
|
|
109103
|
-
const hash = (0,
|
|
108936
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
109104
108937
|
const files2 = declaration.sources.filter(
|
|
109105
108938
|
(source) => !source.generator && !source.file.split(import_node_path119.default.sep).includes(".git")
|
|
109106
108939
|
).map((source) => import_node_path119.default.relative(declaration.packageDir, source.file));
|
|
@@ -109234,12 +109067,12 @@ function genruleArchive(declaration, library, moduleRoot) {
|
|
|
109234
109067
|
}
|
|
109235
109068
|
return combined;
|
|
109236
109069
|
}
|
|
109237
|
-
var import_node_child_process55,
|
|
109070
|
+
var import_node_child_process55, import_node_crypto70, import_node_fs116, import_node_os24, import_node_path119, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
|
|
109238
109071
|
var init_genrule_archives = __esm({
|
|
109239
109072
|
"src/genrule-archives.ts"() {
|
|
109240
109073
|
"use strict";
|
|
109241
109074
|
import_node_child_process55 = require("node:child_process");
|
|
109242
|
-
|
|
109075
|
+
import_node_crypto70 = require("node:crypto");
|
|
109243
109076
|
import_node_fs116 = __toESM(require("node:fs"), 1);
|
|
109244
109077
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
109245
109078
|
import_node_path119 = __toESM(require("node:path"), 1);
|
|
@@ -109347,7 +109180,7 @@ function privateSentrySlice(entry, moduleRoot) {
|
|
|
109347
109180
|
function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact) {
|
|
109348
109181
|
if (standin.module !== SENTRY_SWIFT_SLICE.name) return standin;
|
|
109349
109182
|
const native = simulatorNativeLibrary(artifact());
|
|
109350
|
-
if (!native || (0,
|
|
109183
|
+
if (!native || (0, import_node_crypto71.createHash)("sha256").update(import_node_fs117.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
|
|
109351
109184
|
return standin;
|
|
109352
109185
|
if (configured)
|
|
109353
109186
|
throw new Error(
|
|
@@ -109405,12 +109238,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
|
|
|
109405
109238
|
}
|
|
109406
109239
|
};
|
|
109407
109240
|
}
|
|
109408
|
-
var import_node_child_process56,
|
|
109241
|
+
var import_node_child_process56, import_node_crypto71, import_node_fs117, import_node_os25, import_node_path120, SENTRY_SWIFT_SLICE;
|
|
109409
109242
|
var init_native_swift_slices = __esm({
|
|
109410
109243
|
"src/native-swift-slices.ts"() {
|
|
109411
109244
|
"use strict";
|
|
109412
109245
|
import_node_child_process56 = require("node:child_process");
|
|
109413
|
-
|
|
109246
|
+
import_node_crypto71 = require("node:crypto");
|
|
109414
109247
|
import_node_fs117 = __toESM(require("node:fs"), 1);
|
|
109415
109248
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
109416
109249
|
import_node_path120 = __toESM(require("node:path"), 1);
|
|
@@ -110218,7 +110051,7 @@ function treeDigest2(root) {
|
|
|
110218
110051
|
}).join("\n");
|
|
110219
110052
|
const memo2 = digests.get(`tree\0${root}`);
|
|
110220
110053
|
if (memo2?.stamp === stamp) return memo2.digest;
|
|
110221
|
-
const hash = (0,
|
|
110054
|
+
const hash = (0, import_node_crypto72.createHash)("sha256");
|
|
110222
110055
|
for (const name3 of names) {
|
|
110223
110056
|
hash.update(`${name3}\0`);
|
|
110224
110057
|
hash.update(import_node_fs121.default.readFileSync(import_node_path123.default.join(root, name3)));
|
|
@@ -110265,7 +110098,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
110265
110098
|
const found4 = locateXcframework(import_node_path123.default.join(dir, "tree"));
|
|
110266
110099
|
if (found4) return { dir: found4, digest: stored.sha };
|
|
110267
110100
|
}
|
|
110268
|
-
const sha2 = (0,
|
|
110101
|
+
const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs121.default.readFileSync(binary2.dir)).digest("hex");
|
|
110269
110102
|
if (sha2 !== stored?.sha || !locateXcframework(import_node_path123.default.join(dir, "tree"))) {
|
|
110270
110103
|
import_node_fs121.default.rmSync(dir, { recursive: true, force: true });
|
|
110271
110104
|
import_node_fs121.default.mkdirSync(import_node_path123.default.join(dir, "tree"), { recursive: true });
|
|
@@ -110277,7 +110110,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
110277
110110
|
return { dir: found3, digest: sha2 };
|
|
110278
110111
|
}
|
|
110279
110112
|
if (stored && import_node_fs121.default.existsSync(archive)) {
|
|
110280
|
-
const sha2 = (0,
|
|
110113
|
+
const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs121.default.readFileSync(archive)).digest("hex");
|
|
110281
110114
|
if (sha2 !== expected)
|
|
110282
110115
|
throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
|
|
110283
110116
|
const found3 = locateXcframework(import_node_path123.default.join(dir, "tree"));
|
|
@@ -110286,7 +110119,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
110286
110119
|
import_node_fs121.default.rmSync(dir, { recursive: true, force: true });
|
|
110287
110120
|
import_node_fs121.default.mkdirSync(import_node_path123.default.join(dir, "tree"), { recursive: true });
|
|
110288
110121
|
exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
|
|
110289
|
-
const sha = (0,
|
|
110122
|
+
const sha = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs121.default.readFileSync(archive)).digest("hex");
|
|
110290
110123
|
if (sha !== expected) {
|
|
110291
110124
|
import_node_fs121.default.rmSync(dir, { recursive: true, force: true });
|
|
110292
110125
|
throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
|
|
@@ -110411,7 +110244,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
110411
110244
|
});
|
|
110412
110245
|
}
|
|
110413
110246
|
}
|
|
110414
|
-
const declaredDigest = (0,
|
|
110247
|
+
const declaredDigest = (0, import_node_crypto72.createHash)("sha256");
|
|
110415
110248
|
for (const framework of providedFrameworks)
|
|
110416
110249
|
declaredDigest.update(`provided/${import_node_path123.default.relative(artifact.dir, framework)}\0`);
|
|
110417
110250
|
for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
|
|
@@ -110481,7 +110314,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
110481
110314
|
import_node_fs121.default.copyFileSync(surface.modulemap, modulemap);
|
|
110482
110315
|
}
|
|
110483
110316
|
}
|
|
110484
|
-
const contents2 = (0,
|
|
110317
|
+
const contents2 = (0, import_node_crypto72.createHash)("sha256");
|
|
110485
110318
|
for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
|
|
110486
110319
|
const modulemap = import_node_path123.default.join(
|
|
110487
110320
|
pending2,
|
|
@@ -111896,7 +111729,7 @@ function crateSourceRoots(manifest, searchRoot) {
|
|
|
111896
111729
|
return roots;
|
|
111897
111730
|
}
|
|
111898
111731
|
function crateSourceDigest(manifest, searchRoot) {
|
|
111899
|
-
const hash = (0,
|
|
111732
|
+
const hash = (0, import_node_crypto72.createHash)("sha256");
|
|
111900
111733
|
const walk4 = (dir, root) => {
|
|
111901
111734
|
for (const entry of import_node_fs121.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
|
|
111902
111735
|
const full = import_node_path123.default.join(dir, entry.name);
|
|
@@ -112343,7 +112176,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
112343
112176
|
...swiftSources.flags,
|
|
112344
112177
|
...swiftSources.sources.flatMap((source) => [
|
|
112345
112178
|
source,
|
|
112346
|
-
(0,
|
|
112179
|
+
(0, import_node_crypto72.createHash)("sha256").update(import_node_fs121.default.readFileSync(import_node_path123.default.join(binary2.dir, source))).digest("hex")
|
|
112347
112180
|
])
|
|
112348
112181
|
);
|
|
112349
112182
|
continue;
|
|
@@ -112379,7 +112212,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
112379
112212
|
);
|
|
112380
112213
|
}
|
|
112381
112214
|
}
|
|
112382
|
-
return (0,
|
|
112215
|
+
return (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex");
|
|
112383
112216
|
}
|
|
112384
112217
|
function missingArtifactGap(binary2) {
|
|
112385
112218
|
if (swiftBinaryOnDisk(binary2)) return null;
|
|
@@ -112461,7 +112294,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
112461
112294
|
return NO_IMPORTABLE_SURFACE;
|
|
112462
112295
|
}
|
|
112463
112296
|
const configured = new Map(Object.entries(behavior));
|
|
112464
|
-
const hash = (0,
|
|
112297
|
+
const hash = (0, import_node_crypto72.createHash)("sha256").update(
|
|
112465
112298
|
standinGenerationInputs([binary2], toolchain, behavior)
|
|
112466
112299
|
);
|
|
112467
112300
|
hash.update(digest3);
|
|
@@ -112701,7 +112534,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
112701
112534
|
);
|
|
112702
112535
|
if (binary2.moduleSources !== void 0)
|
|
112703
112536
|
frameworkInputs.push(
|
|
112704
|
-
`${binary2.target}\0${(0,
|
|
112537
|
+
`${binary2.target}\0${(0, import_node_crypto72.createHash)("sha256").update(
|
|
112705
112538
|
[iosSdkId(), ...swiftSources.flags, ...swiftSources.sources, ...texts].join(
|
|
112706
112539
|
"\0"
|
|
112707
112540
|
)
|
|
@@ -112742,7 +112575,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
112742
112575
|
import_node_fs121.default.mkdirSync(sourceFrameworks);
|
|
112743
112576
|
const frameworks = {
|
|
112744
112577
|
dirs: [...frameworkDirs, sourceFrameworks].sort(),
|
|
112745
|
-
digest: (0,
|
|
112578
|
+
digest: (0, import_node_crypto72.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
|
|
112746
112579
|
surfaces: frameworkSurfaces
|
|
112747
112580
|
};
|
|
112748
112581
|
const siblings = new Map(
|
|
@@ -112861,12 +112694,12 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
112861
112694
|
import_node_fs121.default.rmSync(modules, { recursive: true, force: true });
|
|
112862
112695
|
}
|
|
112863
112696
|
}
|
|
112864
|
-
var import_node_child_process58,
|
|
112697
|
+
var import_node_child_process58, import_node_crypto72, import_node_fs121, import_node_path123, TRIPLE, cacheDir5, key, digests, isBinaryLibraryFile, OBJC_IMPORT, files, OBJC, NO_IMPORTABLE_SURFACE, OBJC_ATTRIBUTE, TYPE_DECLARATION, OPTIONAL_REQUIREMENT, WASM_EH_FLAGS, OBJC_UNREPRESENTABLE, INERT_VALUE, identChar, RUST_TARGET, UNSEARCHED, RUST_TOOLCHAIN, built;
|
|
112865
112698
|
var init_swift_standins = __esm({
|
|
112866
112699
|
"src/swift-standins.ts"() {
|
|
112867
112700
|
"use strict";
|
|
112868
112701
|
import_node_child_process58 = require("node:child_process");
|
|
112869
|
-
|
|
112702
|
+
import_node_crypto72 = require("node:crypto");
|
|
112870
112703
|
import_node_fs121 = __toESM(require("node:fs"), 1);
|
|
112871
112704
|
import_node_path123 = __toESM(require("node:path"), 1);
|
|
112872
112705
|
init_forked_script_contract();
|
|
@@ -112896,7 +112729,7 @@ var init_swift_standins = __esm({
|
|
|
112896
112729
|
init_swiftTargetContract();
|
|
112897
112730
|
TRIPLE = SWIFT_WASM_TRIPLE;
|
|
112898
112731
|
cacheDir5 = import_node_path123.default.join(cacheDir(), "swift-standins");
|
|
112899
|
-
key = (...parts2) => (0,
|
|
112732
|
+
key = (...parts2) => (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
|
|
112900
112733
|
digests = /* @__PURE__ */ new Map();
|
|
112901
112734
|
isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
|
|
112902
112735
|
OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
|
|
@@ -113056,11 +112889,6 @@ function compiledFrameworkImports(app, products) {
|
|
|
113056
112889
|
}
|
|
113057
112890
|
return imports2;
|
|
113058
112891
|
}
|
|
113059
|
-
function sha256Hex6(bytes) {
|
|
113060
|
-
if (typeof Bun !== "undefined")
|
|
113061
|
-
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
113062
|
-
return (0, import_node_crypto74.createHash)("sha256").update(bytes).digest("hex");
|
|
113063
|
-
}
|
|
113064
112892
|
function regularFileStamp(file) {
|
|
113065
112893
|
const stat2 = import_node_fs122.default.lstatSync(file, { bigint: true, throwIfNoEntry: false });
|
|
113066
112894
|
if (!stat2 || !stat2.isFile()) return null;
|
|
@@ -113074,7 +112902,7 @@ function verifyRetainedFile(work, file, hash, stamps) {
|
|
|
113074
112902
|
if (typeof expectedStamp === "string" && regularFileStamp(resolved) === expectedStamp)
|
|
113075
112903
|
return true;
|
|
113076
112904
|
if (!import_node_fs122.default.existsSync(resolved)) return false;
|
|
113077
|
-
return
|
|
112905
|
+
return sha256Hex2(readPackageFile(work, resolved, Infinity)) === hash;
|
|
113078
112906
|
}
|
|
113079
112907
|
function recordRetainedStamps(work, files2) {
|
|
113080
112908
|
const stamps = {};
|
|
@@ -113091,7 +112919,7 @@ function cachedBinaryFileDigest(file) {
|
|
|
113091
112919
|
const memory = binaryFileDigests.get(real);
|
|
113092
112920
|
if (memory?.stamp === stamp) return memory.digest;
|
|
113093
112921
|
const dir = import_node_path124.default.join(swiftCacheDir(), "swift-binary-digests");
|
|
113094
|
-
const record6 = import_node_path124.default.join(dir, `${
|
|
112922
|
+
const record6 = import_node_path124.default.join(dir, `${sha256Hex2(real)}.json`);
|
|
113095
112923
|
if (import_node_fs122.default.existsSync(record6)) {
|
|
113096
112924
|
const saved = JSON.parse(import_node_fs122.default.readFileSync(record6, "utf8"));
|
|
113097
112925
|
if (isRecord(saved) && saved.stamp === stamp && typeof saved.digest === "string") {
|
|
@@ -113099,10 +112927,10 @@ function cachedBinaryFileDigest(file) {
|
|
|
113099
112927
|
return saved.digest;
|
|
113100
112928
|
}
|
|
113101
112929
|
}
|
|
113102
|
-
const digest3 =
|
|
112930
|
+
const digest3 = sha256Hex2(import_node_fs122.default.readFileSync(real));
|
|
113103
112931
|
binaryFileDigests.set(real, { stamp, digest: digest3 });
|
|
113104
112932
|
import_node_fs122.default.mkdirSync(dir, { recursive: true });
|
|
113105
|
-
const partial = `${record6}.${process.pid}.${(0,
|
|
112933
|
+
const partial = `${record6}.${process.pid}.${(0, import_node_crypto73.randomUUID)()}`;
|
|
113106
112934
|
import_node_fs122.default.writeFileSync(partial, JSON.stringify({ stamp, digest: digest3 }));
|
|
113107
112935
|
import_node_fs122.default.renameSync(partial, record6);
|
|
113108
112936
|
return digest3;
|
|
@@ -113640,7 +113468,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
113640
113468
|
const staged = withFrameworkCompanionImports(original);
|
|
113641
113469
|
if (staged !== original) sources.set(file, Buffer.from(staged));
|
|
113642
113470
|
}
|
|
113643
|
-
const digest3 =
|
|
113471
|
+
const digest3 = sha256Hex2;
|
|
113644
113472
|
const providers = /* @__PURE__ */ new Map();
|
|
113645
113473
|
for (const target of targets) {
|
|
113646
113474
|
if (!supplied.has(target.moduleName)) continue;
|
|
@@ -113996,7 +113824,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
113996
113824
|
products
|
|
113997
113825
|
);
|
|
113998
113826
|
const checkouts = remoteSwiftCheckouts(app.rootDir);
|
|
113999
|
-
const digest3 =
|
|
113827
|
+
const digest3 = sha256Hex2;
|
|
114000
113828
|
const inputs2 = Object.fromEntries(
|
|
114001
113829
|
[...sources].map(([file, bytes]) => [file, digest3(bytes)])
|
|
114002
113830
|
);
|
|
@@ -114378,16 +114206,17 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
|
|
|
114378
114206
|
import_node_fs122.default.closeSync(descriptor);
|
|
114379
114207
|
}
|
|
114380
114208
|
}
|
|
114381
|
-
var import_node_child_process59,
|
|
114209
|
+
var import_node_child_process59, import_node_crypto73, import_node_fs122, import_node_path124, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
|
|
114382
114210
|
var init_swift_objc_compile = __esm({
|
|
114383
114211
|
"src/swift-objc-compile.ts"() {
|
|
114384
114212
|
"use strict";
|
|
114385
114213
|
import_node_child_process59 = require("node:child_process");
|
|
114386
|
-
|
|
114214
|
+
import_node_crypto73 = require("node:crypto");
|
|
114387
114215
|
import_node_fs122 = __toESM(require("node:fs"), 1);
|
|
114388
114216
|
import_node_path124 = __toESM(require("node:path"), 1);
|
|
114389
114217
|
init_mapLimit();
|
|
114390
114218
|
init_is_record();
|
|
114219
|
+
init_sha256();
|
|
114391
114220
|
init_swift_objc_import();
|
|
114392
114221
|
init_swift_objc_runtime();
|
|
114393
114222
|
init_swift_objc_standin();
|
|
@@ -118473,19 +118302,19 @@ function u32(value) {
|
|
|
118473
118302
|
}
|
|
118474
118303
|
function propertyHash(property2) {
|
|
118475
118304
|
const transient = property2.kind === "attribute" && property2.transient;
|
|
118476
|
-
const base2 =
|
|
118305
|
+
const base2 = sha2562(
|
|
118477
118306
|
property2.name,
|
|
118478
118307
|
[(property2.optional ? 1 : 0) | (transient ? 2 : 0), 0],
|
|
118479
118308
|
property2.modifier ?? ""
|
|
118480
118309
|
);
|
|
118481
118310
|
if (property2.kind === "attribute")
|
|
118482
|
-
return
|
|
118311
|
+
return sha2562(
|
|
118483
118312
|
base2,
|
|
118484
118313
|
u32(property2.type),
|
|
118485
118314
|
property2.type === 1e3 && property2.flags & EXTERNAL_BINARY ? [1] : [],
|
|
118486
118315
|
property2.flags & PRESERVE_AFTER_DELETION ? [1] : []
|
|
118487
118316
|
);
|
|
118488
|
-
return
|
|
118317
|
+
return sha2562(
|
|
118489
118318
|
base2,
|
|
118490
118319
|
property2.destination,
|
|
118491
118320
|
property2.inverse ?? "",
|
|
@@ -118500,7 +118329,7 @@ function entityHashes(model) {
|
|
|
118500
118329
|
...item.parent === null ? [] : allProperties(byName2.get(item.parent)),
|
|
118501
118330
|
...item.properties
|
|
118502
118331
|
];
|
|
118503
|
-
const hash = (item) =>
|
|
118332
|
+
const hash = (item) => sha2562(
|
|
118504
118333
|
item.name,
|
|
118505
118334
|
[item.abstract ? 1 : 0],
|
|
118506
118335
|
item.parent === null ? [] : hash(byName2.get(item.parent)),
|
|
@@ -118528,7 +118357,7 @@ function compileCoreDataModel(directory2) {
|
|
|
118528
118357
|
files2[`${name3}.momd/${version2}.mom`] = archiveModel(model);
|
|
118529
118358
|
const entities = entityHashes(model);
|
|
118530
118359
|
hashes[version2] = Object.fromEntries(entities);
|
|
118531
|
-
checksums[version2] =
|
|
118360
|
+
checksums[version2] = sha2562(...entities.map(([, hash]) => hash)).toString("base64");
|
|
118532
118361
|
}
|
|
118533
118362
|
const named = (0, import_node_fs126.existsSync)(import_node_path128.default.join(directory2, ".xccurrentversion")) ? {
|
|
118534
118363
|
NSManagedObjectModel_CurrentVersionName: import_node_path128.default.basename(
|
|
@@ -118551,11 +118380,11 @@ function coreDataModelDirectories(files2) {
|
|
|
118551
118380
|
}
|
|
118552
118381
|
return [...models].sort();
|
|
118553
118382
|
}
|
|
118554
|
-
var
|
|
118383
|
+
var import_node_crypto74, import_node_fs126, import_node_path128, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2562;
|
|
118555
118384
|
var init_core_data_model = __esm({
|
|
118556
118385
|
"src/core-data-model.ts"() {
|
|
118557
118386
|
"use strict";
|
|
118558
|
-
|
|
118387
|
+
import_node_crypto74 = require("node:crypto");
|
|
118559
118388
|
import_node_fs126 = require("node:fs");
|
|
118560
118389
|
import_node_path128 = __toESM(require("node:path"), 1);
|
|
118561
118390
|
init_core_data_entity_classes();
|
|
@@ -118674,7 +118503,7 @@ var init_core_data_model = __esm({
|
|
|
118674
118503
|
});
|
|
118675
118504
|
}
|
|
118676
118505
|
};
|
|
118677
|
-
|
|
118506
|
+
sha2562 = (...parts2) => (0, import_node_crypto74.createHash)("sha256").update(
|
|
118678
118507
|
Buffer.concat(
|
|
118679
118508
|
parts2.map(
|
|
118680
118509
|
(part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
|
|
@@ -120866,7 +120695,7 @@ async function buildRiveRuntimeDependencies(checkout, moduleRoot) {
|
|
|
120866
120695
|
];
|
|
120867
120696
|
const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
|
|
120868
120697
|
const xcode = (0, import_node_child_process61.execFileSync)("xcodebuild", ["-version"], { encoding: "utf8" });
|
|
120869
|
-
const key2 = (0,
|
|
120698
|
+
const key2 = (0, import_node_crypto75.createHash)("sha256").update(
|
|
120870
120699
|
JSON.stringify([
|
|
120871
120700
|
RECIPE,
|
|
120872
120701
|
(0, import_node_child_process61.execFileSync)("git", ["-C", runtime, "rev-parse", "HEAD"], {
|
|
@@ -121077,12 +120906,12 @@ exec ${quote3(import_node_path129.default.join(toolchainBin, "llvm-ar"))} rcs "$
|
|
|
121077
120906
|
);
|
|
121078
120907
|
return directory2;
|
|
121079
120908
|
}
|
|
121080
|
-
var import_node_child_process61,
|
|
120909
|
+
var import_node_child_process61, import_node_crypto75, import_node_fs127, import_node_os26, import_node_path129, import_promises15, RECIPE, CONFIG, RUNTIME_LIBRARIES;
|
|
121081
120910
|
var init_rive_runtime_dependencies = __esm({
|
|
121082
120911
|
"src/rive-runtime-dependencies.ts"() {
|
|
121083
120912
|
"use strict";
|
|
121084
120913
|
import_node_child_process61 = require("node:child_process");
|
|
121085
|
-
|
|
120914
|
+
import_node_crypto75 = require("node:crypto");
|
|
121086
120915
|
import_node_fs127 = __toESM(require("node:fs"), 1);
|
|
121087
120916
|
import_node_os26 = __toESM(require("node:os"), 1);
|
|
121088
120917
|
import_node_path129 = __toESM(require("node:path"), 1);
|
|
@@ -121939,7 +121768,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
121939
121768
|
(binary2) => binary2.publicHeaders === void 0 && binary2.placeholder === void 0 && swiftBinaryOnDisk(binary2) && binaryHeaderSearchPaths(binary2, staged, app.rootDir).headers.length === 1
|
|
121940
121769
|
))
|
|
121941
121770
|
return [...binaries];
|
|
121942
|
-
const hash = (0,
|
|
121771
|
+
const hash = (0, import_node_crypto76.createHash)("sha256");
|
|
121943
121772
|
hash.update(
|
|
121944
121773
|
JSON.stringify([
|
|
121945
121774
|
inputs2.targets,
|
|
@@ -122148,12 +121977,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
122148
121977
|
);
|
|
122149
121978
|
return result;
|
|
122150
121979
|
}
|
|
122151
|
-
var import_node_child_process63,
|
|
121980
|
+
var import_node_child_process63, import_node_crypto76, import_node_fs129, import_node_path131, cachedInputs;
|
|
122152
121981
|
var init_swift_cxx_reachable = __esm({
|
|
122153
121982
|
"src/swift-cxx-reachable.ts"() {
|
|
122154
121983
|
"use strict";
|
|
122155
121984
|
import_node_child_process63 = require("node:child_process");
|
|
122156
|
-
|
|
121985
|
+
import_node_crypto76 = require("node:crypto");
|
|
122157
121986
|
import_node_fs129 = __toESM(require("node:fs"), 1);
|
|
122158
121987
|
import_node_path131 = __toESM(require("node:path"), 1);
|
|
122159
121988
|
init_is_record();
|
|
@@ -122174,15 +122003,15 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
|
|
|
122174
122003
|
const pending2 = /* @__PURE__ */ new Map();
|
|
122175
122004
|
const renderer = process.platform === "darwin" ? "30774891a9db216d" : "pdfium-1";
|
|
122176
122005
|
const cache = swiftCacheDir();
|
|
122177
|
-
const cached5 = (
|
|
122006
|
+
const cached5 = (sha2564) => import_node_path132.default.join(cache, `swift-pdf-png-${renderer}-${sha2564}.png`);
|
|
122178
122007
|
let remainingBytes = imageTotalBytes;
|
|
122179
|
-
const record6 = ({ file, sha256:
|
|
122008
|
+
const record6 = ({ file, sha256: sha2564 }, bytes) => {
|
|
122180
122009
|
if (bytes.length > imageBytes)
|
|
122181
122010
|
throw new Error(`swift image ${file} raster exceeds the per-image cap`);
|
|
122182
122011
|
remainingBytes -= bytes.length;
|
|
122183
122012
|
if (remainingBytes < 0)
|
|
122184
122013
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
122185
|
-
rendered.set(
|
|
122014
|
+
rendered.set(sha2564, bytes);
|
|
122186
122015
|
};
|
|
122187
122016
|
for (const input of inputs2) {
|
|
122188
122017
|
if (rendered.has(input.sha256) || pending2.has(input.sha256)) continue;
|
|
@@ -122701,7 +122530,7 @@ function fetchSwiftSdkDataPlan({ url, dataPlan }) {
|
|
|
122701
122530
|
if (!response.ok)
|
|
122702
122531
|
throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
|
|
122703
122532
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
122704
|
-
if ((0,
|
|
122533
|
+
if ((0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
|
|
122705
122534
|
throw new Error(`Swift SDK data plan ${address} failed its digest check`);
|
|
122706
122535
|
return bytes;
|
|
122707
122536
|
});
|
|
@@ -122806,7 +122635,7 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
122806
122635
|
encode2(now),
|
|
122807
122636
|
encodeNativeSdkLater({
|
|
122808
122637
|
files: later.map((bytes) => ({
|
|
122809
|
-
sha256: (0,
|
|
122638
|
+
sha256: (0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex"),
|
|
122810
122639
|
byteLength: bytes.length
|
|
122811
122640
|
})),
|
|
122812
122641
|
...needs && {
|
|
@@ -122822,11 +122651,11 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
122822
122651
|
later
|
|
122823
122652
|
};
|
|
122824
122653
|
}
|
|
122825
|
-
var
|
|
122654
|
+
var import_node_crypto77, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
|
|
122826
122655
|
var init_swift_sdk_later_data = __esm({
|
|
122827
122656
|
"src/swift-sdk-later-data.ts"() {
|
|
122828
122657
|
"use strict";
|
|
122829
|
-
|
|
122658
|
+
import_node_crypto77 = require("node:crypto");
|
|
122830
122659
|
init_nativeSdkBindingContract();
|
|
122831
122660
|
init_nativeWasmContract();
|
|
122832
122661
|
init_swift_sdk_image();
|
|
@@ -124437,7 +124266,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
124437
124266
|
const part = await guard((0, import_node_path134.join)(directory2, `side-${id}.wasm`), lazy, env);
|
|
124438
124267
|
const bytes = (0, import_node_fs132.readFileSync)(part.file);
|
|
124439
124268
|
assertWasmCodeOnly(bytes);
|
|
124440
|
-
return { ...part, slots: slots2, sha256: (0,
|
|
124269
|
+
return { ...part, slots: slots2, sha256: (0, import_node_crypto78.createHash)("sha256").update(bytes).digest("hex") };
|
|
124441
124270
|
}
|
|
124442
124271
|
);
|
|
124443
124272
|
const dyldGroups = parts2.flatMap(
|
|
@@ -124462,9 +124291,9 @@ function sealNativeWasmSplit(split2, initialPages) {
|
|
|
124462
124291
|
const slotOffset = 4 + split2.sides.length * NATIVE_LAZY_PART_BYTES;
|
|
124463
124292
|
const inventory = Buffer.alloc(slotOffset + (lastSlot + 1) * 2);
|
|
124464
124293
|
inventory.writeUInt32LE(split2.sides.length, 0);
|
|
124465
|
-
for (const [id, { sha256:
|
|
124294
|
+
for (const [id, { sha256: sha2564, byteLength, slots }] of split2.sides.entries()) {
|
|
124466
124295
|
const offset = 4 + id * NATIVE_LAZY_PART_BYTES;
|
|
124467
|
-
inventory.write(
|
|
124296
|
+
inventory.write(sha2564, offset, NATIVE_LAZY_DIGEST_BYTES, "hex");
|
|
124468
124297
|
inventory.writeUInt32LE(byteLength, offset + NATIVE_LAZY_DIGEST_BYTES);
|
|
124469
124298
|
for (const slot of slots) inventory.writeUInt16LE(id + 1, slotOffset + slot * 2);
|
|
124470
124299
|
}
|
|
@@ -124505,12 +124334,12 @@ function describePart(file) {
|
|
|
124505
124334
|
);
|
|
124506
124335
|
return { file, functions, byteLength: bytes.byteLength };
|
|
124507
124336
|
}
|
|
124508
|
-
var import_node_child_process66,
|
|
124337
|
+
var import_node_child_process66, import_node_crypto78, import_node_fs132, import_node_os28, import_node_path134, import_node_util16, run11, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
|
|
124509
124338
|
var init_wasm_lazy_split = __esm({
|
|
124510
124339
|
"src/wasm-lazy-split.ts"() {
|
|
124511
124340
|
"use strict";
|
|
124512
124341
|
import_node_child_process66 = require("node:child_process");
|
|
124513
|
-
|
|
124342
|
+
import_node_crypto78 = require("node:crypto");
|
|
124514
124343
|
import_node_fs132 = require("node:fs");
|
|
124515
124344
|
import_node_os28 = require("node:os");
|
|
124516
124345
|
import_node_path134 = require("node:path");
|
|
@@ -124741,7 +124570,7 @@ async function storeStartupSplit(work, profile, parent, cache, partCodeBytes) {
|
|
|
124741
124570
|
const result = {
|
|
124742
124571
|
primary: delivery.primary,
|
|
124743
124572
|
parts: new Map(
|
|
124744
|
-
split2.sides.map(({ sha256:
|
|
124573
|
+
split2.sides.map(({ sha256: sha2564 }, index) => [sha2564, delivery.sides[index]])
|
|
124745
124574
|
),
|
|
124746
124575
|
...partCodeBytes === void 0 ? {} : {
|
|
124747
124576
|
source: digest2(work.bytes),
|
|
@@ -124947,11 +124776,11 @@ async function bootSwiftPreview(launch2, profile) {
|
|
|
124947
124776
|
server.close();
|
|
124948
124777
|
}
|
|
124949
124778
|
}
|
|
124950
|
-
var
|
|
124779
|
+
var import_node_crypto79, import_node_fs133, import_node_http3, import_node_https2, import_node_os29, import_node_path135, packageName, guestPath, appPath, profileWindowMs, profileQuietMs, digest2, partDigest, platform;
|
|
124951
124780
|
var init_swift_startup_split = __esm({
|
|
124952
124781
|
"src/swift-startup-split.ts"() {
|
|
124953
124782
|
"use strict";
|
|
124954
|
-
|
|
124783
|
+
import_node_crypto79 = require("node:crypto");
|
|
124955
124784
|
import_node_fs133 = require("node:fs");
|
|
124956
124785
|
import_node_http3 = require("node:http");
|
|
124957
124786
|
import_node_https2 = require("node:https");
|
|
@@ -124976,7 +124805,7 @@ var init_swift_startup_split = __esm({
|
|
|
124976
124805
|
appPath = "/__peach/swift/startup.wasm";
|
|
124977
124806
|
profileWindowMs = 3e4;
|
|
124978
124807
|
profileQuietMs = 2e3;
|
|
124979
|
-
digest2 = (bytes) => (0,
|
|
124808
|
+
digest2 = (bytes) => (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex");
|
|
124980
124809
|
partDigest = /^[a-f0-9]{64}$/;
|
|
124981
124810
|
platform = `${process.platform}-${process.arch}`;
|
|
124982
124811
|
}
|
|
@@ -125001,7 +124830,7 @@ async function readAsset(url, digest3, contentType2 = "application/wasm") {
|
|
|
125001
124830
|
`published Swift SDK asset ${digest3} answered HTTP ${response.status}`
|
|
125002
124831
|
);
|
|
125003
124832
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
125004
|
-
if ((0,
|
|
124833
|
+
if ((0, import_node_crypto80.createHash)("sha256").update(bytes).digest("hex") !== digest3)
|
|
125005
124834
|
throw new Error(`published Swift SDK asset ${digest3} digest mismatch`);
|
|
125006
124835
|
return { bytes, contentType: contentType2, digest: digest3 };
|
|
125007
124836
|
}
|
|
@@ -125017,7 +124846,7 @@ async function readPublishedSwiftSdkParts(url, module2) {
|
|
|
125017
124846
|
const [dyld] = WebAssembly.Module.customSections(module2, NATIVE_DYLD_TABLE_SECTION);
|
|
125018
124847
|
if (lazy.length > 1) throw new Error("native code has more than one part inventory");
|
|
125019
124848
|
const parts2 = lazy[0] ? readNativeLazyParts(lazy[0]).parts : [];
|
|
125020
|
-
const assets2 = new Map(parts2.map(({ sha256:
|
|
124849
|
+
const assets2 = new Map(parts2.map(({ sha256: sha2564, byteLength }) => [sha2564, byteLength]));
|
|
125021
124850
|
let dyldDigest;
|
|
125022
124851
|
if (dyld && !WebAssembly.Module.customSections(module2, NATIVE_DYLD_PACKS_SECTION).length) {
|
|
125023
124852
|
const table = readNativeDyldTableIndex(dyld);
|
|
@@ -125036,11 +124865,11 @@ async function readPublishedSwiftSdkParts(url, module2) {
|
|
|
125036
124865
|
}
|
|
125037
124866
|
);
|
|
125038
124867
|
}
|
|
125039
|
-
var
|
|
124868
|
+
var import_node_crypto80;
|
|
125040
124869
|
var init_published_swift_sdk = __esm({
|
|
125041
124870
|
"src/published-swift-sdk.ts"() {
|
|
125042
124871
|
"use strict";
|
|
125043
|
-
|
|
124872
|
+
import_node_crypto80 = require("node:crypto");
|
|
125044
124873
|
init_mapLimit();
|
|
125045
124874
|
init_nativeDyldTableContract();
|
|
125046
124875
|
init_nativeWasmContract();
|
|
@@ -125085,7 +124914,7 @@ function* filesUnder(absolute) {
|
|
|
125085
124914
|
}
|
|
125086
124915
|
function hashFile(absolutePath) {
|
|
125087
124916
|
try {
|
|
125088
|
-
return (0,
|
|
124917
|
+
return (0, import_node_crypto81.createHash)("sha1").update((0, import_node_fs134.readFileSync)(absolutePath)).digest("hex");
|
|
125089
124918
|
} catch {
|
|
125090
124919
|
return null;
|
|
125091
124920
|
}
|
|
@@ -125219,11 +125048,11 @@ function findStaleRoutes(monorepoRoot, routes2) {
|
|
|
125219
125048
|
}
|
|
125220
125049
|
return stale;
|
|
125221
125050
|
}
|
|
125222
|
-
var
|
|
125051
|
+
var import_node_crypto81, import_node_fs134, import_node_path136, DEV_BUILD_REBUILD_COMMAND, RECORD_DIR, PEACHSIM_ENGINE_INPUTS, ENGINE_SOURCES, ROUTES, STANDALONE_ENGINE_ROUTES, EXCLUDED_DIR_NAMES;
|
|
125223
125052
|
var init_dev_build_freshness = __esm({
|
|
125224
125053
|
"cli/dev-build-freshness.ts"() {
|
|
125225
125054
|
"use strict";
|
|
125226
|
-
|
|
125055
|
+
import_node_crypto81 = require("node:crypto");
|
|
125227
125056
|
import_node_fs134 = require("node:fs");
|
|
125228
125057
|
import_node_path136 = require("node:path");
|
|
125229
125058
|
DEV_BUILD_REBUILD_COMMAND = "bun run build:peach";
|
|
@@ -125392,7 +125221,7 @@ function nativeSourceFiles(packagePath) {
|
|
|
125392
125221
|
function swiftArtifactContentDigest(bytes) {
|
|
125393
125222
|
let digest3 = swiftArtifactDigests.get(bytes);
|
|
125394
125223
|
if (!digest3) {
|
|
125395
|
-
digest3 = (0,
|
|
125224
|
+
digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
125396
125225
|
swiftArtifactDigests.set(bytes, digest3);
|
|
125397
125226
|
}
|
|
125398
125227
|
return digest3;
|
|
@@ -125543,7 +125372,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
125543
125372
|
const clang = import_node_path137.default.join(toolchainBin, "clang");
|
|
125544
125373
|
const empty = (binary2, file) => {
|
|
125545
125374
|
const source = import_node_path137.default.join(binary2.dir, file);
|
|
125546
|
-
const key2 = (0,
|
|
125375
|
+
const key2 = (0, import_node_crypto82.createHash)("sha256").update(
|
|
125547
125376
|
JSON.stringify([
|
|
125548
125377
|
clang,
|
|
125549
125378
|
sdk2.sysroot,
|
|
@@ -125588,7 +125417,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
125588
125417
|
return new Set(portable.flat());
|
|
125589
125418
|
}
|
|
125590
125419
|
async function swiftPackages(entry, app) {
|
|
125591
|
-
const stamp = (file) => import_node_fs135.default.existsSync(file) ? (0,
|
|
125420
|
+
const stamp = (file) => import_node_fs135.default.existsSync(file) ? (0, import_node_crypto82.createHash)("sha256").update(import_node_fs135.default.readFileSync(file)).digest("hex") : null;
|
|
125592
125421
|
const owners = [...app.frameworks, app].map((target) => ({
|
|
125593
125422
|
module: target.moduleName,
|
|
125594
125423
|
products: target.packageProducts ?? []
|
|
@@ -126757,18 +126586,18 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
126757
126586
|
const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
|
|
126758
126587
|
bytes
|
|
126759
126588
|
);
|
|
126760
|
-
const
|
|
126589
|
+
const sha2564 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
126761
126590
|
const bundle = swiftResourceBundleForFile(bundles, key2);
|
|
126762
126591
|
if (!bundle && inputs2["Package.swift"])
|
|
126763
126592
|
throw new Error(`metal source ${key2} has no resource target bundle`);
|
|
126764
126593
|
metalSources[key2] = {
|
|
126765
|
-
sha256:
|
|
126766
|
-
url: `${baseUrl}${RESOURCE_PATH}${
|
|
126594
|
+
sha256: sha2564,
|
|
126595
|
+
url: `${baseUrl}${RESOURCE_PATH}${sha2564}.metal`,
|
|
126767
126596
|
bundlePath: bundle?.path ?? "."
|
|
126768
126597
|
};
|
|
126769
126598
|
metalUploads[key2] = source;
|
|
126770
126599
|
watched.push(file);
|
|
126771
|
-
registered.set(`${
|
|
126600
|
+
registered.set(`${sha2564}.metal`, { bytes, contentType: "text/plain; charset=utf-8" });
|
|
126772
126601
|
}
|
|
126773
126602
|
const pdfs = /* @__PURE__ */ new Map();
|
|
126774
126603
|
for (const { file } of found2) {
|
|
@@ -126780,7 +126609,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
126780
126609
|
const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
|
|
126781
126610
|
pdfs.set(file, {
|
|
126782
126611
|
file: disk,
|
|
126783
|
-
sha256: (0,
|
|
126612
|
+
sha256: (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex")
|
|
126784
126613
|
});
|
|
126785
126614
|
}
|
|
126786
126615
|
const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
|
|
@@ -126826,7 +126655,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
126826
126655
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
126827
126656
|
}
|
|
126828
126657
|
imageBytes += bytes.length;
|
|
126829
|
-
const hash = (0,
|
|
126658
|
+
const hash = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
|
|
126830
126659
|
const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
|
|
126831
126660
|
const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
|
|
126832
126661
|
const variant2 = {
|
|
@@ -127135,7 +126964,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
|
|
|
127135
126964
|
hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
|
|
127136
126965
|
}
|
|
127137
126966
|
function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
127138
|
-
const hash = (0,
|
|
126967
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
127139
126968
|
hash.update(packagePath);
|
|
127140
126969
|
updateSwiftConfigStamp(hash, packagePath);
|
|
127141
126970
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -127164,7 +126993,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
|
127164
126993
|
return hash.digest("hex").slice(0, 16);
|
|
127165
126994
|
}
|
|
127166
126995
|
function sourceContentStamp(packagePath, moduleRootOverride) {
|
|
127167
|
-
const hash = (0,
|
|
126996
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
127168
126997
|
hash.update(compilerSourceDigest);
|
|
127169
126998
|
updateSwiftConfigStamp(hash, packagePath);
|
|
127170
126999
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -127196,7 +127025,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
127196
127025
|
(root) => import_node_fs135.default.existsSync(import_node_path137.default.join(root, "toolchain.json"))
|
|
127197
127026
|
);
|
|
127198
127027
|
if (!moduleRoot) return "";
|
|
127199
|
-
const hash = (0,
|
|
127028
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
127200
127029
|
hash.update(moduleRoot);
|
|
127201
127030
|
for (const relative8 of swiftModuleInputFiles(moduleRoot)) {
|
|
127202
127031
|
hash.update(relative8);
|
|
@@ -127206,7 +127035,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
127206
127035
|
}
|
|
127207
127036
|
function otherInputs(input) {
|
|
127208
127037
|
const { files: _files, ...rest } = input;
|
|
127209
|
-
return (0,
|
|
127038
|
+
return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify(rest)).digest("hex");
|
|
127210
127039
|
}
|
|
127211
127040
|
function entryRootId(packagePath, file) {
|
|
127212
127041
|
const relative8 = import_node_path137.default.relative(packagePath, file).split(import_node_path137.default.sep).join(import_node_path137.default.posix.sep);
|
|
@@ -127228,7 +127057,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
|
|
|
127228
127057
|
for (const standin of standins) {
|
|
127229
127058
|
if (!standin.prebuilt) continue;
|
|
127230
127059
|
const bytes = Buffer.from(standin.prebuilt.library, "base64");
|
|
127231
|
-
const digest3 = (0,
|
|
127060
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
127232
127061
|
const dir = import_node_path137.default.join(swiftCacheDir(), "native-archives", digest3);
|
|
127233
127062
|
import_node_fs135.default.mkdirSync(dir, { recursive: true });
|
|
127234
127063
|
const library = import_node_path137.default.join(dir, `lib${standin.module}.a`);
|
|
@@ -127576,7 +127405,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
|
|
|
127576
127405
|
return import_node_path137.default.join(
|
|
127577
127406
|
swiftCacheDir(),
|
|
127578
127407
|
"swift-builds",
|
|
127579
|
-
(0,
|
|
127408
|
+
(0, import_node_crypto82.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
|
|
127580
127409
|
);
|
|
127581
127410
|
}
|
|
127582
127411
|
function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
@@ -127870,14 +127699,14 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
|
|
|
127870
127699
|
const url = new URL(moduleUrl);
|
|
127871
127700
|
const table = swiftDyldTableReference(url.pathname, module2);
|
|
127872
127701
|
if (!table) return {};
|
|
127873
|
-
const { sha256:
|
|
127702
|
+
const { sha256: sha2564, byteLength } = table;
|
|
127874
127703
|
url.pathname = table.path;
|
|
127875
127704
|
const response = await fetch(url, { signal });
|
|
127876
127705
|
if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
|
|
127877
127706
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
127878
|
-
if (bytes.length !== byteLength || (0,
|
|
127707
|
+
if (bytes.length !== byteLength || (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
|
|
127879
127708
|
throw new Error(`swift compile: ${url} does not match its module's index`);
|
|
127880
|
-
return { dyldTable: { sha256:
|
|
127709
|
+
return { dyldTable: { sha256: sha2564, bytes } };
|
|
127881
127710
|
}
|
|
127882
127711
|
function currentStamp(project2, moduleRoot) {
|
|
127883
127712
|
return withXcodeLayout(
|
|
@@ -128166,10 +127995,10 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
|
128166
127995
|
sdk2.binding.bytes,
|
|
128167
127996
|
plan
|
|
128168
127997
|
);
|
|
128169
|
-
const digest3 = (0,
|
|
127998
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(split2.binding).digest("hex");
|
|
128170
127999
|
sdkBindingFiles.set(digest3, split2.binding);
|
|
128171
128000
|
for (const later of split2.later)
|
|
128172
|
-
sdkBindingFiles.set((0,
|
|
128001
|
+
sdkBindingFiles.set((0, import_node_crypto82.createHash)("sha256").update(later).digest("hex"), later);
|
|
128173
128002
|
sdkSplitBindings.set(key2, digest3);
|
|
128174
128003
|
}
|
|
128175
128004
|
function swiftCodePartAssets(origin, appParts, sdkDigest) {
|
|
@@ -128248,7 +128077,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch2, run
|
|
|
128248
128077
|
const { key: key2 } = sdk2;
|
|
128249
128078
|
const normalizedPackage = normalizedSwiftPackagePath(packagePath);
|
|
128250
128079
|
const requireCurrentProfile = import_node_path137.default.basename(import_node_path137.default.dirname(normalizedPackage)) === "one-native-controls";
|
|
128251
|
-
const app = (0,
|
|
128080
|
+
const app = (0, import_node_crypto82.createHash)("sha256").update(
|
|
128252
128081
|
JSON.stringify([
|
|
128253
128082
|
normalizedPackage,
|
|
128254
128083
|
launch2.environment,
|
|
@@ -128282,7 +128111,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch2, run
|
|
|
128282
128111
|
app,
|
|
128283
128112
|
requireCurrentProfile
|
|
128284
128113
|
);
|
|
128285
|
-
const name3 = (0,
|
|
128114
|
+
const name3 = (0, import_node_crypto82.createHash)("sha256").update(split2.primary).digest("hex");
|
|
128286
128115
|
sdkPieces2.set(name3, split2.primary);
|
|
128287
128116
|
for (const [digest3, bytes] of split2.parts) sdkPieces2.set(digest3, bytes);
|
|
128288
128117
|
sdkStartupParts.set(name3, split2.parts);
|
|
@@ -128511,10 +128340,10 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
|
|
|
128511
128340
|
const later = decodeNativeSdkBinding(
|
|
128512
128341
|
bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)
|
|
128513
128342
|
).later;
|
|
128514
|
-
for (const { sha256:
|
|
128515
|
-
const laterBytes = sdkBindingFiles.get(
|
|
128516
|
-
if (!laterBytes) throw new Error(`swift sdk later data ${
|
|
128517
|
-
assets2.set(`${SDK_BINDING_PATH}${
|
|
128343
|
+
for (const { sha256: sha2564 } of later?.files ?? []) {
|
|
128344
|
+
const laterBytes = sdkBindingFiles.get(sha2564);
|
|
128345
|
+
if (!laterBytes) throw new Error(`swift sdk later data ${sha2564} is not served`);
|
|
128346
|
+
assets2.set(`${SDK_BINDING_PATH}${sha2564}.bin`, {
|
|
128518
128347
|
bytes: laterBytes,
|
|
128519
128348
|
contentType: "application/octet-stream"
|
|
128520
128349
|
});
|
|
@@ -128559,13 +128388,13 @@ function disposeSwiftProject(packagePath, signal) {
|
|
|
128559
128388
|
xcodeProjects().delete(packagePath);
|
|
128560
128389
|
sourceEntries().delete(packagePath);
|
|
128561
128390
|
}
|
|
128562
|
-
var import_node_async_hooks3, import_node_child_process67,
|
|
128391
|
+
var import_node_async_hooks3, import_node_child_process67, import_node_crypto82, import_node_fs135, import_node_os30, import_node_path137, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, SwiftMissingModulesError, startupImages, swiftArtifactDigests, sharedProjects, projectScope, projects, sharedSourceEntries, sourceEntries, sharedXcodeProjects, xcodeProjects, preparedScriptInputs, emptyWasmAssembly, XCODE_APP_DIR, XCODE_FRAMEWORKS_DIR, XCODE_PACKAGES_DIR, layoutScope, HOSTED_LIMITS, LOCAL_LIMITS, inputLimits, RESOURCE_CONTENT_TYPES, API_GAP_PATTERNS, IOS_SDK_FRAMEWORKS, sdkStartups, sdkStartupParts, sdkStartupPlans, sdkPieces2, publishedSdkPieces, publishedSdkMirrors, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
128563
128392
|
var init_swift_host = __esm({
|
|
128564
128393
|
"src/swift-host.ts"() {
|
|
128565
128394
|
"use strict";
|
|
128566
128395
|
import_node_async_hooks3 = require("node:async_hooks");
|
|
128567
128396
|
import_node_child_process67 = require("node:child_process");
|
|
128568
|
-
|
|
128397
|
+
import_node_crypto82 = require("node:crypto");
|
|
128569
128398
|
import_node_fs135 = __toESM(require("node:fs"), 1);
|
|
128570
128399
|
import_node_os30 = __toESM(require("node:os"), 1);
|
|
128571
128400
|
import_node_path137 = __toESM(require("node:path"), 1);
|
|
@@ -129327,7 +129156,7 @@ function hashTree(root) {
|
|
|
129327
129156
|
for (const entry of import_node_fs138.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
|
|
129328
129157
|
if (!entry.isFile()) continue;
|
|
129329
129158
|
const file = import_node_path140.default.join(entry.parentPath, entry.name);
|
|
129330
|
-
hashes[import_node_path140.default.relative(root, file).split(import_node_path140.default.sep).join("/")] = (0,
|
|
129159
|
+
hashes[import_node_path140.default.relative(root, file).split(import_node_path140.default.sep).join("/")] = (0, import_node_crypto83.createHash)("sha256").update(import_node_fs138.default.readFileSync(file)).digest("hex");
|
|
129331
129160
|
}
|
|
129332
129161
|
return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
|
|
129333
129162
|
}
|
|
@@ -129377,12 +129206,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
129377
129206
|
files: hashTree(generatedRoot)
|
|
129378
129207
|
};
|
|
129379
129208
|
}
|
|
129380
|
-
var import_node_child_process68,
|
|
129209
|
+
var import_node_child_process68, import_node_crypto83, import_node_fs138, import_node_module17, import_node_path140, import_node_util17, run12, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
129381
129210
|
var init_turbo_codegen_intake = __esm({
|
|
129382
129211
|
"src/turbo-codegen-intake.ts"() {
|
|
129383
129212
|
"use strict";
|
|
129384
129213
|
import_node_child_process68 = require("node:child_process");
|
|
129385
|
-
|
|
129214
|
+
import_node_crypto83 = require("node:crypto");
|
|
129386
129215
|
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
129387
129216
|
import_node_module17 = require("node:module");
|
|
129388
129217
|
import_node_path140 = __toESM(require("node:path"), 1);
|
|
@@ -130455,7 +130284,7 @@ async function collectTurboSources(options2) {
|
|
|
130455
130284
|
);
|
|
130456
130285
|
const installedHeaders = /* @__PURE__ */ new Map();
|
|
130457
130286
|
const targetPath = (name3) => `Sources/${name3}`;
|
|
130458
|
-
const providerTarget = (name3) => `TurboPackage_${
|
|
130287
|
+
const providerTarget = (name3) => `TurboPackage_${sha2563(name3).slice(0, 16)}`;
|
|
130459
130288
|
const folly = readFollyConfig(reactNative.root);
|
|
130460
130289
|
const baseDefines = [
|
|
130461
130290
|
options2.configuration === "Debug" ? "DEBUG=1" : "NDEBUG",
|
|
@@ -130599,7 +130428,7 @@ async function collectTurboSources(options2) {
|
|
|
130599
130428
|
if (!Buffer.from(text7).equals(bytes))
|
|
130600
130429
|
throw new Error(`TurboModule source is not UTF-8: ${disk}`);
|
|
130601
130430
|
add2(key2, text7);
|
|
130602
|
-
result.sources.push({ file: key2, source: disk, sha256:
|
|
130431
|
+
result.sources.push({ file: key2, source: disk, sha256: sha2563(bytes) });
|
|
130603
130432
|
pending2.push({ key: key2, targetName, label, root, relative: relative8 });
|
|
130604
130433
|
return key2;
|
|
130605
130434
|
};
|
|
@@ -131412,13 +131241,13 @@ async function collectTurboSources(options2) {
|
|
|
131412
131241
|
let decoratorHasPerformanceLogger = false;
|
|
131413
131242
|
let managerHasDevMenuDecorator = false;
|
|
131414
131243
|
if (fabric) objc = true;
|
|
131415
|
-
for (const { relative: relative8, source, text: text7, sha256:
|
|
131244
|
+
for (const { relative: relative8, source, text: text7, sha256: sha2564, configured } of glogSources()) {
|
|
131416
131245
|
const key2 = `${core}/dependencies/glog/${relative8}`;
|
|
131417
131246
|
add2(key2, text7);
|
|
131418
131247
|
result.sources.push({
|
|
131419
131248
|
file: key2,
|
|
131420
131249
|
source,
|
|
131421
|
-
sha256:
|
|
131250
|
+
sha256: sha2564,
|
|
131422
131251
|
...configured && { configured }
|
|
131423
131252
|
});
|
|
131424
131253
|
if (relative8.startsWith("src/glog/"))
|
|
@@ -133701,11 +133530,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
|
|
|
133701
133530
|
}
|
|
133702
133531
|
`;
|
|
133703
133532
|
}
|
|
133704
|
-
var
|
|
133533
|
+
var import_node_crypto84, import_node_fs139, import_node_module18, import_node_path141, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER5, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, DECLARED_MODULE_NAME, EXPORTED_MODULE, sha2563, podspecList, reactNativePods, reactNativePod, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_SHADOW_HANDLE_HOST, FABRIC_HOST_INCLUDES, FABRIC_HOST_PAPER_INCLUDES, PAPER_UIKIT_BRIDGE_SWIFT;
|
|
133705
133534
|
var init_turbo_source = __esm({
|
|
133706
133535
|
"src/turbo-source.ts"() {
|
|
133707
133536
|
"use strict";
|
|
133708
|
-
|
|
133537
|
+
import_node_crypto84 = require("node:crypto");
|
|
133709
133538
|
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
133710
133539
|
import_node_module18 = require("node:module");
|
|
133711
133540
|
import_node_path141 = __toESM(require("node:path"), 1);
|
|
@@ -133835,7 +133664,7 @@ var init_turbo_source = __esm({
|
|
|
133835
133664
|
];
|
|
133836
133665
|
DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
|
|
133837
133666
|
EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
|
|
133838
|
-
|
|
133667
|
+
sha2563 = (data) => (0, import_node_crypto84.createHash)("sha256").update(data).digest("hex");
|
|
133839
133668
|
podspecList = podspecAttribute;
|
|
133840
133669
|
reactNativePods = /* @__PURE__ */ new Set([
|
|
133841
133670
|
"React",
|
|
@@ -134722,7 +134551,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped, cor
|
|
|
134722
134551
|
}
|
|
134723
134552
|
async function prepareTurboCompileInput(options2) {
|
|
134724
134553
|
await prepareTurboSourceDependencies(options2.reactNativeRoot);
|
|
134725
|
-
const key2 = (0,
|
|
134554
|
+
const key2 = (0, import_node_crypto85.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs140.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs140.default.realpathSync(options2.moduleRoot)).digest("hex");
|
|
134726
134555
|
const scratch2 = import_node_path142.default.join(import_node_os31.default.tmpdir(), "peach-turbo-swift", key2);
|
|
134727
134556
|
import_node_fs140.default.mkdirSync(scratch2, { recursive: true });
|
|
134728
134557
|
const codegenDir = import_node_fs140.default.mkdtempSync(import_node_path142.default.join(scratch2, "codegen-"));
|
|
@@ -134964,11 +134793,11 @@ async function compileTurboModule(options2) {
|
|
|
134964
134793
|
collection
|
|
134965
134794
|
};
|
|
134966
134795
|
}
|
|
134967
|
-
var
|
|
134796
|
+
var import_node_crypto85, import_node_fs140, import_node_module19, import_node_os31, import_node_path142;
|
|
134968
134797
|
var init_turbo_compile = __esm({
|
|
134969
134798
|
"src/turbo-compile.ts"() {
|
|
134970
134799
|
"use strict";
|
|
134971
|
-
|
|
134800
|
+
import_node_crypto85 = require("node:crypto");
|
|
134972
134801
|
import_node_fs140 = __toESM(require("node:fs"), 1);
|
|
134973
134802
|
import_node_module19 = require("node:module");
|
|
134974
134803
|
import_node_os31 = __toESM(require("node:os"), 1);
|
|
@@ -135168,8 +134997,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
|
|
|
135168
134997
|
);
|
|
135169
134998
|
if (!isRecord(manifest) || typeof manifest.version !== "string")
|
|
135170
134999
|
throw new Error(`${reactNativeRoot}: react-native has no version`);
|
|
135171
|
-
const headers = (0,
|
|
135172
|
-
const sources = (0,
|
|
135000
|
+
const headers = (0, import_node_crypto86.createHash)("sha256");
|
|
135001
|
+
const sources = (0, import_node_crypto86.createHash)("sha256");
|
|
135173
135002
|
const walk4 = (relative8) => {
|
|
135174
135003
|
for (const file of import_node_fs142.default.readdirSync(import_node_path144.default.join(reactNativeRoot, relative8), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
135175
135004
|
if (file.name === "node_modules" || file.name.startsWith(".")) continue;
|
|
@@ -135276,7 +135105,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
135276
135105
|
const file = import_node_path144.default.join(
|
|
135277
135106
|
cacheDir(),
|
|
135278
135107
|
"native-archives",
|
|
135279
|
-
`${(0,
|
|
135108
|
+
`${(0, import_node_crypto86.createHash)("sha256").update(data).digest("hex")}.a`
|
|
135280
135109
|
);
|
|
135281
135110
|
import_node_fs142.default.mkdirSync(import_node_path144.default.dirname(file), { recursive: true });
|
|
135282
135111
|
if (!import_node_fs142.default.existsSync(file)) import_node_fs142.default.writeFileSync(file, Buffer.from(data, "base64"));
|
|
@@ -135286,11 +135115,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
135286
135115
|
}
|
|
135287
135116
|
}
|
|
135288
135117
|
}
|
|
135289
|
-
var
|
|
135118
|
+
var import_node_crypto86, import_node_fs142, import_node_module20, import_node_path144, import_node_util18, recipe, strings4, building;
|
|
135290
135119
|
var init_react_native_core = __esm({
|
|
135291
135120
|
"src/react-native-core.ts"() {
|
|
135292
135121
|
"use strict";
|
|
135293
|
-
|
|
135122
|
+
import_node_crypto86 = require("node:crypto");
|
|
135294
135123
|
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
135295
135124
|
import_node_module20 = require("node:module");
|
|
135296
135125
|
import_node_path144 = __toESM(require("node:path"), 1);
|
|
@@ -135316,7 +135145,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
135316
135145
|
const modules = import_node_path145.default.join(moduleRoot, "modules");
|
|
135317
135146
|
const module2 = import_node_path145.default.join(modules, `${name3}.swiftmodule`);
|
|
135318
135147
|
if (!import_node_fs143.default.existsSync(module2)) return /* @__PURE__ */ new Set();
|
|
135319
|
-
const key2 = (0,
|
|
135148
|
+
const key2 = (0, import_node_crypto87.createHash)("sha256").update(import_node_fs143.default.readFileSync(module2)).digest("hex");
|
|
135320
135149
|
const directory2 = import_node_path145.default.join(swiftCacheDir(), "swift-public-names");
|
|
135321
135150
|
const receipt = import_node_path145.default.join(directory2, `${key2}.json`);
|
|
135322
135151
|
if (import_node_fs143.default.existsSync(receipt)) {
|
|
@@ -135399,12 +135228,12 @@ function clangTypeOwnership(moduleRoot, module2) {
|
|
|
135399
135228
|
}
|
|
135400
135229
|
);
|
|
135401
135230
|
}
|
|
135402
|
-
var import_node_child_process70,
|
|
135231
|
+
var import_node_child_process70, import_node_crypto87, import_node_fs143, import_node_path145, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
|
|
135403
135232
|
var init_swift_clang_type_ownership = __esm({
|
|
135404
135233
|
"src/swift-clang-type-ownership.ts"() {
|
|
135405
135234
|
"use strict";
|
|
135406
135235
|
import_node_child_process70 = require("node:child_process");
|
|
135407
|
-
|
|
135236
|
+
import_node_crypto87 = require("node:crypto");
|
|
135408
135237
|
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
135409
135238
|
import_node_path145 = __toESM(require("node:path"), 1);
|
|
135410
135239
|
init_is_record();
|
|
@@ -137084,7 +136913,7 @@ function targetSettings2(units) {
|
|
|
137084
136913
|
}
|
|
137085
136914
|
function oneSDKStamp(oneSDK) {
|
|
137086
136915
|
if (!oneSDK) return "";
|
|
137087
|
-
const hash = (0,
|
|
136916
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
137088
136917
|
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
137089
136918
|
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
137090
136919
|
hash.update(`${name3}\0${source}\0`);
|
|
@@ -137135,7 +136964,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
|
|
|
137135
136964
|
`;
|
|
137136
136965
|
}
|
|
137137
136966
|
function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
|
|
137138
|
-
const hash = (0,
|
|
136967
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
137139
136968
|
hash.update(base2);
|
|
137140
136969
|
hash.update(reactProviderStamp);
|
|
137141
136970
|
for (const unit2 of units) {
|
|
@@ -137508,8 +137337,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
137508
137337
|
}
|
|
137509
137338
|
return provider;
|
|
137510
137339
|
})() : void 0;
|
|
137511
|
-
const reactProviderStamp = reactProvider ? (0,
|
|
137512
|
-
const key2 = (0,
|
|
137340
|
+
const reactProviderStamp = reactProvider ? (0, import_node_crypto88.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
137341
|
+
const key2 = (0, import_node_crypto88.createHash)("sha256").update(import_node_fs144.default.realpathSync(root)).digest("hex");
|
|
137513
137342
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
137514
137343
|
const failures = /* @__PURE__ */ new Map();
|
|
137515
137344
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -137803,7 +137632,7 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
137803
137632
|
await check2(part[0]);
|
|
137804
137633
|
continue;
|
|
137805
137634
|
}
|
|
137806
|
-
const name3 = (0,
|
|
137635
|
+
const name3 = (0, import_node_crypto88.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
|
|
137807
137636
|
report(`linking ${part.length} namespaces to isolate failures`);
|
|
137808
137637
|
try {
|
|
137809
137638
|
const built2 = await link(part, `isolate-${name3}`);
|
|
@@ -137988,13 +137817,13 @@ ${diagnostics}`}`
|
|
|
137988
137817
|
}
|
|
137989
137818
|
return true;
|
|
137990
137819
|
}
|
|
137991
|
-
var import_node_async_hooks4, import_node_child_process71,
|
|
137820
|
+
var import_node_async_hooks4, import_node_child_process71, import_node_crypto88, import_node_fs144, import_node_module21, import_node_os32, import_node_path146, import_node_url7, import_node_util19, run13, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
137992
137821
|
var init_expo_swift_host = __esm({
|
|
137993
137822
|
"src/expo-swift-host.ts"() {
|
|
137994
137823
|
"use strict";
|
|
137995
137824
|
import_node_async_hooks4 = require("node:async_hooks");
|
|
137996
137825
|
import_node_child_process71 = require("node:child_process");
|
|
137997
|
-
|
|
137826
|
+
import_node_crypto88 = require("node:crypto");
|
|
137998
137827
|
import_node_fs144 = __toESM(require("node:fs"), 1);
|
|
137999
137828
|
import_node_module21 = require("node:module");
|
|
138000
137829
|
import_node_os32 = __toESM(require("node:os"), 1);
|
|
@@ -141270,7 +141099,7 @@ async function createIdentity() {
|
|
|
141270
141099
|
const keys = await crypto.subtle.generateKey(algorithm, true, ["sign", "verify"]);
|
|
141271
141100
|
const certificate = await import_x5092.X509CertificateGenerator.createSelfSigned(
|
|
141272
141101
|
{
|
|
141273
|
-
serialNumber: (0,
|
|
141102
|
+
serialNumber: (0, import_node_crypto89.randomBytes)(16).toString("hex"),
|
|
141274
141103
|
name: "CN=localhost",
|
|
141275
141104
|
notBefore: new Date(Date.now() - 6e4),
|
|
141276
141105
|
notAfter: new Date(Date.now() + 365 * 24 * 60 * 6e4),
|
|
@@ -141289,7 +141118,7 @@ async function createIdentity() {
|
|
|
141289
141118
|
${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
141290
141119
|
-----END PRIVATE KEY-----
|
|
141291
141120
|
`,
|
|
141292
|
-
spki: (0,
|
|
141121
|
+
spki: (0, import_node_crypto89.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
|
|
141293
141122
|
};
|
|
141294
141123
|
}
|
|
141295
141124
|
async function startFetchProxyTransport(identityPath, hasLiveSims = () => false) {
|
|
@@ -141363,11 +141192,11 @@ async function startFetchProxyTransport(identityPath, hasLiveSims = () => false)
|
|
|
141363
141192
|
);
|
|
141364
141193
|
}
|
|
141365
141194
|
}
|
|
141366
|
-
var
|
|
141195
|
+
var import_node_crypto89, import_node_fs148, import_node_http23, import_node_path150, import_x5092;
|
|
141367
141196
|
var init_fetch_proxy_transport = __esm({
|
|
141368
141197
|
"src/host/fetch-proxy-transport.ts"() {
|
|
141369
141198
|
"use strict";
|
|
141370
|
-
|
|
141199
|
+
import_node_crypto89 = require("node:crypto");
|
|
141371
141200
|
import_node_fs148 = require("node:fs");
|
|
141372
141201
|
import_node_http23 = require("node:http2");
|
|
141373
141202
|
import_node_path150 = __toESM(require("node:path"), 1);
|
|
@@ -142599,10 +142428,10 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
142599
142428
|
}
|
|
142600
142429
|
async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
|
|
142601
142430
|
const directory2 = prepareStagedDirectory();
|
|
142602
|
-
const inputDigest = (0,
|
|
142431
|
+
const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
|
|
142603
142432
|
const index = import_node_path154.default.join(
|
|
142604
142433
|
directory2,
|
|
142605
|
-
`derived-${(0,
|
|
142434
|
+
`derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
|
|
142606
142435
|
);
|
|
142607
142436
|
const recorded = import_node_fs152.default.existsSync(index) ? import_node_fs152.default.readFileSync(index, "utf8") : "";
|
|
142608
142437
|
if (STAGED_NAME.test(recorded) && import_node_fs152.default.existsSync(import_node_path154.default.join(directory2, recorded))) {
|
|
@@ -142613,7 +142442,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
|
|
|
142613
142442
|
return new URL(STAGED_PREFIX + recorded, origin).toString();
|
|
142614
142443
|
}
|
|
142615
142444
|
const staged = writeStagedBytes(await derive(), origin, extension, directory2);
|
|
142616
|
-
const temporary = import_node_path154.default.join(directory2, (0,
|
|
142445
|
+
const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
142617
142446
|
try {
|
|
142618
142447
|
import_node_fs152.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
|
|
142619
142448
|
flag: "wx"
|
|
@@ -142640,7 +142469,7 @@ function stageHostMetroAssets(assets2, origin) {
|
|
|
142640
142469
|
const name3 = staged.pathname.slice(STAGED_PREFIX.length);
|
|
142641
142470
|
const destination = import_node_path154.default.join(directory2, index);
|
|
142642
142471
|
stagedCapture.getStore()?.add(index);
|
|
142643
|
-
const temporary = import_node_path154.default.join(directory2, (0,
|
|
142472
|
+
const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
142644
142473
|
try {
|
|
142645
142474
|
import_node_fs152.default.writeFileSync(temporary, name3, { flag: "wx" });
|
|
142646
142475
|
try {
|
|
@@ -142665,7 +142494,7 @@ function metroIndexName(url) {
|
|
|
142665
142494
|
url.searchParams.get("unstable_path"),
|
|
142666
142495
|
hashes[0]
|
|
142667
142496
|
]);
|
|
142668
|
-
return `metro-${(0,
|
|
142497
|
+
return `metro-${(0, import_node_crypto90.createHash)("sha256").update(key2).digest("hex")}`;
|
|
142669
142498
|
}
|
|
142670
142499
|
function metroRequestIndex(rawUrl) {
|
|
142671
142500
|
if (!rawUrl?.startsWith("/") || rawUrl.startsWith("//")) return null;
|
|
@@ -142693,7 +142522,7 @@ function prepareStagedDirectory() {
|
|
|
142693
142522
|
return directory2;
|
|
142694
142523
|
}
|
|
142695
142524
|
function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
142696
|
-
const digest3 = (0,
|
|
142525
|
+
const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
|
|
142697
142526
|
extension = extension.toLowerCase();
|
|
142698
142527
|
const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
|
|
142699
142528
|
stagedCapture.getStore()?.add(name3);
|
|
@@ -142702,7 +142531,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
142702
142531
|
if (import_node_fs152.default.existsSync(destination)) {
|
|
142703
142532
|
import_node_fs152.default.utimesSync(destination, new Date(now), new Date(now));
|
|
142704
142533
|
} else {
|
|
142705
|
-
const temporary = import_node_path154.default.join(directory2, (0,
|
|
142534
|
+
const temporary = import_node_path154.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
142706
142535
|
try {
|
|
142707
142536
|
import_node_fs152.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
142708
142537
|
import_node_fs152.default.renameSync(temporary, destination);
|
|
@@ -142774,12 +142603,12 @@ async function handleStagedHostFileRequest(req, res) {
|
|
|
142774
142603
|
throw error;
|
|
142775
142604
|
}
|
|
142776
142605
|
}
|
|
142777
|
-
var import_node_async_hooks5,
|
|
142606
|
+
var import_node_async_hooks5, import_node_crypto90, import_node_fs152, import_node_path154, stagedCapture, STAGED_PREFIX, STAGED_NAME, METRO_INDEX_NAME, STAGED_RETENTION_MS;
|
|
142778
142607
|
var init_staged_host_files = __esm({
|
|
142779
142608
|
"src/host/staged-host-files.ts"() {
|
|
142780
142609
|
"use strict";
|
|
142781
142610
|
import_node_async_hooks5 = require("node:async_hooks");
|
|
142782
|
-
|
|
142611
|
+
import_node_crypto90 = require("node:crypto");
|
|
142783
142612
|
import_node_fs152 = __toESM(require("node:fs"), 1);
|
|
142784
142613
|
import_node_path154 = __toESM(require("node:path"), 1);
|
|
142785
142614
|
init_uttype_mime();
|
|
@@ -142827,7 +142656,7 @@ function writeGeneratedFile(file, content) {
|
|
|
142827
142656
|
if (!error || typeof error !== "object" || !("code" in error) || error.code !== "ENOENT")
|
|
142828
142657
|
throw error;
|
|
142829
142658
|
}
|
|
142830
|
-
const temporary = (0, import_node_path156.join)((0, import_node_path156.dirname)(file), `.${(0, import_node_path156.basename)(file)}.${(0,
|
|
142659
|
+
const temporary = (0, import_node_path156.join)((0, import_node_path156.dirname)(file), `.${(0, import_node_path156.basename)(file)}.${(0, import_node_crypto91.randomUUID)()}.tmp`);
|
|
142831
142660
|
try {
|
|
142832
142661
|
(0, import_node_fs154.writeFileSync)(temporary, content);
|
|
142833
142662
|
(0, import_node_fs154.renameSync)(temporary, file);
|
|
@@ -143935,7 +143764,7 @@ function nativeSourceContract(file, source) {
|
|
|
143935
143764
|
enums,
|
|
143936
143765
|
defaultView
|
|
143937
143766
|
});
|
|
143938
|
-
const hash = (0,
|
|
143767
|
+
const hash = (0, import_node_crypto91.createHash)("sha256").update(canonical).digest("hex");
|
|
143939
143768
|
const declarations = structs.map(
|
|
143940
143769
|
(struct) => `export interface ${struct.name} {${struct.fields.map((field2) => ` ${field2.name}${field2.optional ? "?" : ""}: ${field2.type};`).join("")} }`
|
|
143941
143770
|
);
|
|
@@ -144070,7 +143899,7 @@ function renderSwiftSourceGlue(packageId, contracts, linkedViews = false) {
|
|
|
144070
143899
|
throw new Error(`swift package ${packageId} declares ${name3} twice`);
|
|
144071
143900
|
names.add(name3);
|
|
144072
143901
|
}
|
|
144073
|
-
const hash = (0,
|
|
143902
|
+
const hash = (0, import_node_crypto91.createHash)("sha256").update(JSON.stringify({ packageId, modules, views })).digest("hex");
|
|
144074
143903
|
const hasMain = contracts.some((contract) => contract.defaultView);
|
|
144075
143904
|
const bodyName = `OneNativeSourceBody_${packageId}`;
|
|
144076
143905
|
const className2 = `OneNativeSource_${packageId}`;
|
|
@@ -144455,11 +144284,11 @@ function renderSwiftSourceGlue(packageId, contracts, linkedViews = false) {
|
|
|
144455
144284
|
].join("\n");
|
|
144456
144285
|
return { hash, source };
|
|
144457
144286
|
}
|
|
144458
|
-
var
|
|
144287
|
+
var import_node_crypto91, import_node_fs154, import_node_path156, GENERATED_HEADER, DECLARATION_MODIFIERS, PLAIN_ATTRIBUTES, STRUCT_MEMBER_WORDS;
|
|
144459
144288
|
var init_nativeSourceContract = __esm({
|
|
144460
144289
|
"../one-bundler/src/nativeSourceContract.ts"() {
|
|
144461
144290
|
"use strict";
|
|
144462
|
-
|
|
144291
|
+
import_node_crypto91 = require("node:crypto");
|
|
144463
144292
|
import_node_fs154 = require("node:fs");
|
|
144464
144293
|
import_node_path156 = require("node:path");
|
|
144465
144294
|
init_swiftPackageId();
|
|
@@ -144531,7 +144360,7 @@ function chunkKey2(lines) {
|
|
|
144531
144360
|
return lines.map((item) => item.text).join("\n");
|
|
144532
144361
|
}
|
|
144533
144362
|
function stableShardIndex(key2, shardCount) {
|
|
144534
|
-
return (0,
|
|
144363
|
+
return (0, import_node_crypto92.createHash)("sha256").update(key2).digest().readUInt32BE(0) % shardCount;
|
|
144535
144364
|
}
|
|
144536
144365
|
function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SHARDS) {
|
|
144537
144366
|
if (shardCount <= 1 || !name3.endsWith(".swift") || name3.endsWith(".types.swift") || source.length < ONE_SDK_BINDING_SHARD_MIN_BYTES) {
|
|
@@ -144775,11 +144604,11 @@ function shardOneSDKBindingSource(name3, source, shardCount = ONE_SDK_BINDING_SH
|
|
|
144775
144604
|
};
|
|
144776
144605
|
});
|
|
144777
144606
|
}
|
|
144778
|
-
var
|
|
144607
|
+
var import_node_crypto92, import_node_path157, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES;
|
|
144779
144608
|
var init_one_sdk_shard = __esm({
|
|
144780
144609
|
"../peach-globals/build/one-sdk-shard.ts"() {
|
|
144781
144610
|
"use strict";
|
|
144782
|
-
|
|
144611
|
+
import_node_crypto92 = require("node:crypto");
|
|
144783
144612
|
import_node_path157 = __toESM(require("node:path"), 1);
|
|
144784
144613
|
init_swift_source_mask();
|
|
144785
144614
|
ONE_SDK_BINDING_SHARDS = 8;
|
|
@@ -148861,7 +148690,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2, appPackages
|
|
|
148861
148690
|
""
|
|
148862
148691
|
].join("\n");
|
|
148863
148692
|
}
|
|
148864
|
-
const digest3 = (0,
|
|
148693
|
+
const digest3 = (0, import_node_crypto93.createHash)("sha256").update(manifest);
|
|
148865
148694
|
for (const [name3, source] of files2)
|
|
148866
148695
|
digest3.update(name3).update("\0").update(source).update("\0");
|
|
148867
148696
|
const key2 = digest3.digest("hex").slice(0, 16);
|
|
@@ -148884,11 +148713,11 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2, appPackages
|
|
|
148884
148713
|
...oneSDKShards.size ? { oneSDKShards } : {}
|
|
148885
148714
|
};
|
|
148886
148715
|
}
|
|
148887
|
-
var
|
|
148716
|
+
var import_node_crypto93, import_node_fs157, import_node_module22, import_node_path160, import_node_url8, ONE_SDK_DEFINES, GUEST_ENTRY, BRIDGE_SWIFT, ONE_SDK_RUNTIME_SOURCES, ONE_NATIVE_STYLE_SHARDS, ONE_NATIVE_STYLE_SHARD_MIN_BYTES, DIRECT_HOST_SWIFT_SEEDS, DIRECT_HOST_IOS_FILES;
|
|
148888
148717
|
var init_one_native_controls_package = __esm({
|
|
148889
148718
|
"src/one-native-controls-package.ts"() {
|
|
148890
148719
|
"use strict";
|
|
148891
|
-
|
|
148720
|
+
import_node_crypto93 = require("node:crypto");
|
|
148892
148721
|
import_node_fs157 = __toESM(require("node:fs"), 1);
|
|
148893
148722
|
import_node_module22 = require("node:module");
|
|
148894
148723
|
import_node_path160 = __toESM(require("node:path"), 1);
|
|
@@ -150223,7 +150052,7 @@ async function readOneWidgetSources(appRoot) {
|
|
|
150223
150052
|
if (!Buffer.from(text7).equals(bytes))
|
|
150224
150053
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
150225
150054
|
files2.set(name3, text7);
|
|
150226
|
-
sources[import_node_path162.default.relative(root, file).split(import_node_path162.default.sep).join("/")] = (0,
|
|
150055
|
+
sources[import_node_path162.default.relative(root, file).split(import_node_path162.default.sep).join("/")] = (0, import_node_crypto94.createHash)("sha256").update(bytes).digest("hex");
|
|
150227
150056
|
}
|
|
150228
150057
|
const contract = files2.get("OneWidgetContract.swift") ?? "";
|
|
150229
150058
|
const source = files2.get("OneWidget.swift") ?? "";
|
|
@@ -150247,17 +150076,17 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
|
|
|
150247
150076
|
return {
|
|
150248
150077
|
metadata: source.widget,
|
|
150249
150078
|
projectRoot: source.root,
|
|
150250
|
-
appIdentity: (0,
|
|
150079
|
+
appIdentity: (0, import_node_crypto94.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
|
|
150251
150080
|
bundleUrl,
|
|
150252
150081
|
packageUrl,
|
|
150253
150082
|
urlSchemes: source.urlSchemes
|
|
150254
150083
|
};
|
|
150255
150084
|
}
|
|
150256
|
-
var
|
|
150085
|
+
var import_node_crypto94, import_node_fs159, import_node_path162, ONE_WIDGET_PACKAGE, nonEmpty;
|
|
150257
150086
|
var init_one_widget_metadata = __esm({
|
|
150258
150087
|
"src/one-widget-metadata.ts"() {
|
|
150259
150088
|
"use strict";
|
|
150260
|
-
|
|
150089
|
+
import_node_crypto94 = require("node:crypto");
|
|
150261
150090
|
import_node_fs159 = __toESM(require("node:fs"), 1);
|
|
150262
150091
|
import_node_path162 = __toESM(require("node:path"), 1);
|
|
150263
150092
|
init_is_record();
|
|
@@ -150291,7 +150120,7 @@ async function oneWidgetPackage(appRoot) {
|
|
|
150291
150120
|
const packagePath = import_node_path163.default.join(
|
|
150292
150121
|
import_node_os34.default.tmpdir(),
|
|
150293
150122
|
"peach-one-widgets",
|
|
150294
|
-
(0,
|
|
150123
|
+
(0, import_node_crypto95.createHash)("sha256").update(root).digest("hex"),
|
|
150295
150124
|
ONE_WIDGET_PACKAGE
|
|
150296
150125
|
);
|
|
150297
150126
|
import_node_fs160.default.mkdirSync(packagePath, { recursive: true });
|
|
@@ -150305,11 +150134,11 @@ async function oneWidgetPackage(appRoot) {
|
|
|
150305
150134
|
widget
|
|
150306
150135
|
};
|
|
150307
150136
|
}
|
|
150308
|
-
var
|
|
150137
|
+
var import_node_crypto95, import_node_fs160, import_node_os34, import_node_path163;
|
|
150309
150138
|
var init_one_widget_package = __esm({
|
|
150310
150139
|
"src/one-widget-package.ts"() {
|
|
150311
150140
|
"use strict";
|
|
150312
|
-
|
|
150141
|
+
import_node_crypto95 = require("node:crypto");
|
|
150313
150142
|
import_node_fs160 = __toESM(require("node:fs"), 1);
|
|
150314
150143
|
import_node_os34 = __toESM(require("node:os"), 1);
|
|
150315
150144
|
import_node_path163 = __toESM(require("node:path"), 1);
|
|
@@ -150525,7 +150354,7 @@ var init_android_view_classes = __esm({
|
|
|
150525
150354
|
|
|
150526
150355
|
// src/java-module-abi.ts
|
|
150527
150356
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
150528
|
-
const digest3 = (0,
|
|
150357
|
+
const digest3 = (0, import_node_crypto96.createHash)("sha256");
|
|
150529
150358
|
const parent = import_node_path165.default.join(kotlinHome(), "java-specs");
|
|
150530
150359
|
import_node_fs162.default.mkdirSync(parent, { recursive: true });
|
|
150531
150360
|
const work = import_node_fs162.default.mkdtempSync(import_node_path165.default.join(parent, ".read-"));
|
|
@@ -150622,12 +150451,12 @@ async function compileJavaModuleAbi(input) {
|
|
|
150622
150451
|
);
|
|
150623
150452
|
return library;
|
|
150624
150453
|
}
|
|
150625
|
-
var import_node_child_process74,
|
|
150454
|
+
var import_node_child_process74, import_node_crypto96, import_node_fs162, import_node_path165, import_node_util20, run14, JAVA_BINDINGS_INITIALIZER;
|
|
150626
150455
|
var init_java_module_abi = __esm({
|
|
150627
150456
|
"src/java-module-abi.ts"() {
|
|
150628
150457
|
"use strict";
|
|
150629
150458
|
import_node_child_process74 = require("node:child_process");
|
|
150630
|
-
|
|
150459
|
+
import_node_crypto96 = require("node:crypto");
|
|
150631
150460
|
import_node_fs162 = __toESM(require("node:fs"), 1);
|
|
150632
150461
|
import_node_path165 = __toESM(require("node:path"), 1);
|
|
150633
150462
|
import_node_util20 = require("node:util");
|
|
@@ -151061,7 +150890,7 @@ function zipSources(bytes, where) {
|
|
|
151061
150890
|
return entries2;
|
|
151062
150891
|
}
|
|
151063
150892
|
function extract(bytes, where) {
|
|
151064
|
-
const key2 = (0,
|
|
150893
|
+
const key2 = (0, import_node_crypto97.createHash)("sha256").update(bytes).digest("hex");
|
|
151065
150894
|
const cached5 = pending.get(key2);
|
|
151066
150895
|
if (cached5) return cached5;
|
|
151067
150896
|
const request = (async () => {
|
|
@@ -151172,11 +151001,11 @@ async function kotlinSources(bytes, where) {
|
|
|
151172
151001
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
151173
151002
|
return kotlin;
|
|
151174
151003
|
}
|
|
151175
|
-
var
|
|
151004
|
+
var import_node_crypto97, import_node_fs164, import_node_os35, import_node_path167, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
|
|
151176
151005
|
var init_kotlin_maven_sources = __esm({
|
|
151177
151006
|
"src/kotlin-maven-sources.ts"() {
|
|
151178
151007
|
"use strict";
|
|
151179
|
-
|
|
151008
|
+
import_node_crypto97 = require("node:crypto");
|
|
151180
151009
|
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
151181
151010
|
import_node_os35 = __toESM(require("node:os"), 1);
|
|
151182
151011
|
import_node_path167 = __toESM(require("node:path"), 1);
|
|
@@ -151266,7 +151095,7 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
151266
151095
|
])
|
|
151267
151096
|
];
|
|
151268
151097
|
const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
151269
|
-
const suffix = (0,
|
|
151098
|
+
const suffix = (0, import_node_crypto98.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
|
|
151270
151099
|
const klib = import_node_path168.default.join(input.output, `${name3}-${suffix}.klib`);
|
|
151271
151100
|
const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
|
|
151272
151101
|
const abiPairs = java.length ? dependencies.flatMap(
|
|
@@ -151308,11 +151137,11 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
151308
151137
|
}
|
|
151309
151138
|
return [...compiled.values()].map(({ klib }) => klib);
|
|
151310
151139
|
}
|
|
151311
|
-
var
|
|
151140
|
+
var import_node_crypto98, import_node_fs165, import_node_path168;
|
|
151312
151141
|
var init_kotlin_gradle_library_plan = __esm({
|
|
151313
151142
|
"src/kotlin-gradle-library-plan.ts"() {
|
|
151314
151143
|
"use strict";
|
|
151315
|
-
|
|
151144
|
+
import_node_crypto98 = require("node:crypto");
|
|
151316
151145
|
import_node_fs165 = __toESM(require("node:fs"), 1);
|
|
151317
151146
|
import_node_path168 = __toESM(require("node:path"), 1);
|
|
151318
151147
|
init_kotlin_library_sources();
|
|
@@ -151548,17 +151377,17 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
151548
151377
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
151549
151378
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
151550
151379
|
const bytes = import_node_fs166.default.readFileSync(target);
|
|
151551
|
-
if (bytes.length !== expected.bytes || (0,
|
|
151380
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto99.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
151552
151381
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
151553
151382
|
}
|
|
151554
151383
|
return manifest;
|
|
151555
151384
|
}
|
|
151556
151385
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
151557
|
-
const
|
|
151386
|
+
const sha2564 = (0, import_node_crypto99.createHash)("sha256").update(archive).digest("hex");
|
|
151558
151387
|
const parent = import_node_path169.default.join(kotlinHome(), "sdk");
|
|
151559
|
-
const root = import_node_path169.default.join(parent,
|
|
151388
|
+
const root = import_node_path169.default.join(parent, sha2564);
|
|
151560
151389
|
if (import_node_fs166.default.existsSync(root))
|
|
151561
|
-
return { root, sha256:
|
|
151390
|
+
return { root, sha256: sha2564, manifest: verifyKotlinSdkDirectory(root, compiler) };
|
|
151562
151391
|
import_node_fs166.default.mkdirSync(parent, { recursive: true });
|
|
151563
151392
|
const work = import_node_fs166.default.mkdtempSync(import_node_path169.default.join(parent, ".install-"));
|
|
151564
151393
|
try {
|
|
@@ -151578,17 +151407,17 @@ async function installKotlinSdkArchive(archive, compiler) {
|
|
|
151578
151407
|
if (!import_node_fs166.default.existsSync(root)) throw error;
|
|
151579
151408
|
verifyKotlinSdkDirectory(root, compiler);
|
|
151580
151409
|
}
|
|
151581
|
-
return { root, sha256:
|
|
151410
|
+
return { root, sha256: sha2564, manifest };
|
|
151582
151411
|
} finally {
|
|
151583
151412
|
import_node_fs166.default.rmSync(work, { recursive: true, force: true });
|
|
151584
151413
|
}
|
|
151585
151414
|
}
|
|
151586
|
-
var import_node_child_process76,
|
|
151415
|
+
var import_node_child_process76, import_node_crypto99, import_node_fs166, import_node_path169, import_node_util21, run15;
|
|
151587
151416
|
var init_kotlin_sdk = __esm({
|
|
151588
151417
|
"src/kotlin-sdk.ts"() {
|
|
151589
151418
|
"use strict";
|
|
151590
151419
|
import_node_child_process76 = require("node:child_process");
|
|
151591
|
-
|
|
151420
|
+
import_node_crypto99 = require("node:crypto");
|
|
151592
151421
|
import_node_fs166 = __toESM(require("node:fs"), 1);
|
|
151593
151422
|
import_node_path169 = __toESM(require("node:path"), 1);
|
|
151594
151423
|
import_node_util21 = require("node:util");
|
|
@@ -151724,7 +151553,7 @@ function peachKotlinModuleRoot() {
|
|
|
151724
151553
|
if (!IS_STANDALONE) return import_node_path170.default.join(peachsimPackageRoot(), "kotlin");
|
|
151725
151554
|
if (installedRoot) return installedRoot;
|
|
151726
151555
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
151727
|
-
const digest3 = (0,
|
|
151556
|
+
const digest3 = (0, import_node_crypto100.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
151728
151557
|
const parent = import_node_path170.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
151729
151558
|
const root = import_node_path170.default.join(parent, digest3);
|
|
151730
151559
|
import_node_fs167.default.mkdirSync(parent, { recursive: true });
|
|
@@ -151753,11 +151582,11 @@ function peachKotlinModuleRoot() {
|
|
|
151753
151582
|
installedRoot = root;
|
|
151754
151583
|
return root;
|
|
151755
151584
|
}
|
|
151756
|
-
var
|
|
151585
|
+
var import_node_crypto100, import_node_fs167, import_node_path170, installedRoot;
|
|
151757
151586
|
var init_kotlin_module = __esm({
|
|
151758
151587
|
"src/kotlin-module.ts"() {
|
|
151759
151588
|
"use strict";
|
|
151760
|
-
|
|
151589
|
+
import_node_crypto100 = require("node:crypto");
|
|
151761
151590
|
import_node_fs167 = __toESM(require("node:fs"), 1);
|
|
151762
151591
|
import_node_path170 = __toESM(require("node:path"), 1);
|
|
151763
151592
|
init_standalone();
|
|
@@ -151791,7 +151620,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
151791
151620
|
const parent = import_node_path171.default.join(kotlinHome(), "gradle-sources");
|
|
151792
151621
|
import_node_fs168.default.mkdirSync(parent, { recursive: true });
|
|
151793
151622
|
const work = import_node_fs168.default.mkdtempSync(import_node_path171.default.join(parent, ".query-"));
|
|
151794
|
-
const task = `peachAndroidSources${(0,
|
|
151623
|
+
const task = `peachAndroidSources${(0, import_node_crypto101.randomBytes)(8).toString("hex")}`;
|
|
151795
151624
|
const script = import_node_path171.default.join(work, "sources.gradle");
|
|
151796
151625
|
const encoded = Buffer.from(
|
|
151797
151626
|
JSON.stringify({
|
|
@@ -151943,12 +151772,12 @@ function readDependencySources(value) {
|
|
|
151943
151772
|
};
|
|
151944
151773
|
});
|
|
151945
151774
|
}
|
|
151946
|
-
var import_node_child_process77,
|
|
151775
|
+
var import_node_child_process77, import_node_crypto101, import_node_fs168, import_node_path171, import_node_util22, run16, modelQuery;
|
|
151947
151776
|
var init_android_gradle_sources = __esm({
|
|
151948
151777
|
"src/android-gradle-sources.ts"() {
|
|
151949
151778
|
"use strict";
|
|
151950
151779
|
import_node_child_process77 = require("node:child_process");
|
|
151951
|
-
|
|
151780
|
+
import_node_crypto101 = require("node:crypto");
|
|
151952
151781
|
import_node_fs168 = __toESM(require("node:fs"), 1);
|
|
151953
151782
|
import_node_path171 = __toESM(require("node:path"), 1);
|
|
151954
151783
|
import_node_util22 = require("node:util");
|
|
@@ -152363,7 +152192,7 @@ function readExpoTypes(output) {
|
|
|
152363
152192
|
});
|
|
152364
152193
|
}
|
|
152365
152194
|
async function scanSources(tool, parse19, toolchain, moduleRoot, files2) {
|
|
152366
|
-
const digest3 = (0,
|
|
152195
|
+
const digest3 = (0, import_node_crypto102.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
152367
152196
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
152368
152197
|
digest3.update(import_node_fs169.default.readFileSync(import_node_path172.default.join(moduleRoot, "sdk.tar.gz")));
|
|
152369
152198
|
digest3.update(tool);
|
|
@@ -153025,7 +152854,7 @@ async function compileKotlin(input, origin) {
|
|
|
153025
152854
|
bytes: import_node_fs169.default.readFileSync(file)
|
|
153026
152855
|
}));
|
|
153027
152856
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
153028
|
-
const digest3 = (0,
|
|
152857
|
+
const digest3 = (0, import_node_crypto102.createHash)("sha256");
|
|
153029
152858
|
digest3.update(
|
|
153030
152859
|
JSON.stringify({
|
|
153031
152860
|
format: BUILD_FORMAT,
|
|
@@ -153047,7 +152876,7 @@ async function compileKotlin(input, origin) {
|
|
|
153047
152876
|
...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
|
|
153048
152877
|
]);
|
|
153049
152878
|
for (const file of files2) {
|
|
153050
|
-
digest3.update((0,
|
|
152879
|
+
digest3.update((0, import_node_crypto102.createHash)("sha256").update(import_node_fs169.default.readFileSync(file)).digest());
|
|
153051
152880
|
}
|
|
153052
152881
|
}
|
|
153053
152882
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
@@ -153339,12 +153168,12 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
153339
153168
|
}
|
|
153340
153169
|
return true;
|
|
153341
153170
|
}
|
|
153342
|
-
var import_node_child_process78,
|
|
153171
|
+
var import_node_child_process78, import_node_crypto102, import_node_fs169, import_node_module23, import_node_path172, import_node_util23, run17, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal5, CONTENT_TYPES;
|
|
153343
153172
|
var init_kotlin_host = __esm({
|
|
153344
153173
|
"src/kotlin-host.ts"() {
|
|
153345
153174
|
"use strict";
|
|
153346
153175
|
import_node_child_process78 = require("node:child_process");
|
|
153347
|
-
|
|
153176
|
+
import_node_crypto102 = require("node:crypto");
|
|
153348
153177
|
import_node_fs169 = __toESM(require("node:fs"), 1);
|
|
153349
153178
|
import_node_module23 = require("node:module");
|
|
153350
153179
|
import_node_path172 = __toESM(require("node:path"), 1);
|
|
@@ -153700,7 +153529,7 @@ async function readManagedExpoIdentity(root, platform3, iosTarget, bridgeOrigin)
|
|
|
153700
153529
|
url.searchParams.set("root", root);
|
|
153701
153530
|
const response = await nodeHttpFetch(url.href);
|
|
153702
153531
|
if (response.ok && response.headers.get("content-type") === revisionType) {
|
|
153703
|
-
const environment = (0,
|
|
153532
|
+
const environment = (0, import_node_crypto103.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
|
|
153704
153533
|
const inputs2 = Buffer.from(
|
|
153705
153534
|
JSON.stringify([
|
|
153706
153535
|
await response.text(),
|
|
@@ -153756,11 +153585,11 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
153756
153585
|
res.writeHead(200, { "Content-Type": revisionType });
|
|
153757
153586
|
res.end(revision);
|
|
153758
153587
|
}
|
|
153759
|
-
var
|
|
153588
|
+
var import_node_crypto103, import_node_fs171, import_node_path174, revisionType;
|
|
153760
153589
|
var init_managed_expo_identity = __esm({
|
|
153761
153590
|
"src/managed-expo-identity.ts"() {
|
|
153762
153591
|
"use strict";
|
|
153763
|
-
|
|
153592
|
+
import_node_crypto103 = require("node:crypto");
|
|
153764
153593
|
import_node_fs171 = __toESM(require("node:fs"), 1);
|
|
153765
153594
|
import_node_path174 = __toESM(require("node:path"), 1);
|
|
153766
153595
|
init_backend_origin();
|
|
@@ -153988,8 +153817,8 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
|
153988
153817
|
const ext = import_node_path177.default.extname(file);
|
|
153989
153818
|
if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
|
|
153990
153819
|
if (ext.toLowerCase() === ".pdf") {
|
|
153991
|
-
const
|
|
153992
|
-
const png = rasterizePdfFiles([{ file: members2.get(file), sha256:
|
|
153820
|
+
const sha2564 = (0, import_node_crypto104.createHash)("sha256").update(bytes).digest("hex");
|
|
153821
|
+
const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2564 }]).get(sha2564);
|
|
153993
153822
|
return stageHostBytes(png, origin, ".png");
|
|
153994
153823
|
}
|
|
153995
153824
|
return stageHostBytes(bytes, origin, ext);
|
|
@@ -154001,11 +153830,11 @@ async function stageExpoWidgetAssets(appRoot, origin) {
|
|
|
154001
153830
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
154002
153831
|
return stagePreparedExpoWidgetAssets(prepared.app, origin);
|
|
154003
153832
|
}
|
|
154004
|
-
var
|
|
153833
|
+
var import_node_crypto104, import_node_fs173, import_node_path177;
|
|
154005
153834
|
var init_expo_widget_assets = __esm({
|
|
154006
153835
|
"src/expo-widget-assets.ts"() {
|
|
154007
153836
|
"use strict";
|
|
154008
|
-
|
|
153837
|
+
import_node_crypto104 = require("node:crypto");
|
|
154009
153838
|
import_node_fs173 = __toESM(require("node:fs"), 1);
|
|
154010
153839
|
import_node_path177 = __toESM(require("node:path"), 1);
|
|
154011
153840
|
init_app_catalog();
|
|
@@ -154060,11 +153889,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
154060
153889
|
"specifications",
|
|
154061
153890
|
`${checksum}.json`
|
|
154062
153891
|
);
|
|
154063
|
-
const sha1 = (value) => (0,
|
|
153892
|
+
const sha1 = (value) => (0, import_node_crypto105.createHash)("sha1").update(value).digest("hex");
|
|
154064
153893
|
let text7;
|
|
154065
153894
|
if (import_node_fs174.default.existsSync(file)) text7 = import_node_fs174.default.readFileSync(file, "utf8");
|
|
154066
153895
|
else {
|
|
154067
|
-
const shard2 = (0,
|
|
153896
|
+
const shard2 = (0, import_node_crypto105.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
154068
153897
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
154069
153898
|
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
154070
153899
|
if (!response.ok)
|
|
@@ -154193,7 +154022,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
154193
154022
|
"end",
|
|
154194
154023
|
""
|
|
154195
154024
|
].join("\n");
|
|
154196
|
-
const key2 = (0,
|
|
154025
|
+
const key2 = (0, import_node_crypto105.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
|
|
154197
154026
|
JSON.stringify(
|
|
154198
154027
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
154199
154028
|
)
|
|
@@ -154262,11 +154091,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
154262
154091
|
);
|
|
154263
154092
|
});
|
|
154264
154093
|
}
|
|
154265
|
-
var
|
|
154094
|
+
var import_node_crypto105, import_node_fs174, import_node_path178, APP, record5, project, podModuleName;
|
|
154266
154095
|
var init_swift_source_pods = __esm({
|
|
154267
154096
|
"src/swift-source-pods.ts"() {
|
|
154268
154097
|
"use strict";
|
|
154269
|
-
|
|
154098
|
+
import_node_crypto105 = require("node:crypto");
|
|
154270
154099
|
import_node_fs174 = __toESM(require("node:fs"), 1);
|
|
154271
154100
|
import_node_path178 = __toESM(require("node:path"), 1);
|
|
154272
154101
|
init_browser();
|
|
@@ -154947,7 +154776,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
154947
154776
|
input.libraries ??= {};
|
|
154948
154777
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
154949
154778
|
}
|
|
154950
|
-
const key2 = (0,
|
|
154779
|
+
const key2 = (0, import_node_crypto106.createHash)("sha256").update(
|
|
154951
154780
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
154952
154781
|
).update("\0").update(import_node_fs175.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
154953
154782
|
const packagePath = import_node_path179.default.join(import_node_os36.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
@@ -155003,11 +154832,11 @@ function nitrogenGeneratedSources(podDirectory) {
|
|
|
155003
154832
|
...sources(import_node_path179.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
155004
154833
|
];
|
|
155005
154834
|
}
|
|
155006
|
-
var
|
|
154835
|
+
var import_node_crypto106, import_node_fs175, import_node_os36, import_node_path179, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
155007
154836
|
var init_nitro_compile = __esm({
|
|
155008
154837
|
"src/nitro-compile.ts"() {
|
|
155009
154838
|
"use strict";
|
|
155010
|
-
|
|
154839
|
+
import_node_crypto106 = require("node:crypto");
|
|
155011
154840
|
import_node_fs175 = __toESM(require("node:fs"), 1);
|
|
155012
154841
|
import_node_os36 = __toESM(require("node:os"), 1);
|
|
155013
154842
|
import_node_path179 = __toESM(require("node:path"), 1);
|
|
@@ -155084,11 +154913,11 @@ var init_nitro_compile = __esm({
|
|
|
155084
154913
|
});
|
|
155085
154914
|
|
|
155086
154915
|
// src/nitro-compiler-digest.ts
|
|
155087
|
-
var
|
|
154916
|
+
var import_node_crypto107, import_node_fs176, import_node_path180;
|
|
155088
154917
|
var init_nitro_compiler_digest = __esm({
|
|
155089
154918
|
"src/nitro-compiler-digest.ts"() {
|
|
155090
154919
|
"use strict";
|
|
155091
|
-
|
|
154920
|
+
import_node_crypto107 = require("node:crypto");
|
|
155092
154921
|
import_node_fs176 = require("node:fs");
|
|
155093
154922
|
import_node_path180 = __toESM(require("node:path"), 1);
|
|
155094
154923
|
init_swift_compiler_digest();
|
|
@@ -155226,7 +155055,7 @@ var init_nitro_superset = __esm({
|
|
|
155226
155055
|
init_nitroContract();
|
|
155227
155056
|
init_swift_standin_digest();
|
|
155228
155057
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
155229
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
155058
|
+
NITRO_COMPILER_DIGEST = true ? "379ef4bc3caf96c52a4ffe7df50670f16d8db945bfbc90e1513bff35258d8b6f" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
155230
155059
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
155231
155060
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
155232
155061
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -155592,7 +155421,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
155592
155421
|
const packagePath = import_node_path184.default.join(
|
|
155593
155422
|
swiftCacheDir(),
|
|
155594
155423
|
"peach-one-sdk-swift",
|
|
155595
|
-
(0,
|
|
155424
|
+
(0, import_node_crypto108.createHash)("sha256").update(import_node_fs179.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
155596
155425
|
"sdk"
|
|
155597
155426
|
);
|
|
155598
155427
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -155639,11 +155468,11 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
155639
155468
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
155640
155469
|
};
|
|
155641
155470
|
}
|
|
155642
|
-
var
|
|
155471
|
+
var import_node_crypto108, import_node_fs179, import_node_path184, ONE_SDK_ROUTE, handleOneSDKRequest;
|
|
155643
155472
|
var init_one_sdk_bundle = __esm({
|
|
155644
155473
|
"src/one-sdk-bundle.ts"() {
|
|
155645
155474
|
"use strict";
|
|
155646
|
-
|
|
155475
|
+
import_node_crypto108 = require("node:crypto");
|
|
155647
155476
|
import_node_fs179 = __toESM(require("node:fs"), 1);
|
|
155648
155477
|
import_node_path184 = __toESM(require("node:path"), 1);
|
|
155649
155478
|
init_one_sdk_shard();
|
|
@@ -156361,7 +156190,7 @@ function writeSharedDesktopAuthSession(session) {
|
|
|
156361
156190
|
validatedAt: session.validatedAt ?? same?.validatedAt,
|
|
156362
156191
|
accountId: session.accountId?.trim() || same?.accountId
|
|
156363
156192
|
};
|
|
156364
|
-
const temporary = `${filepath}.${process.pid}.${(0,
|
|
156193
|
+
const temporary = `${filepath}.${process.pid}.${(0, import_node_crypto109.randomUUID)()}.tmp`;
|
|
156365
156194
|
try {
|
|
156366
156195
|
(0, import_node_fs183.writeFileSync)(temporary, JSON.stringify(normalized, null, 2) + "\n", {
|
|
156367
156196
|
mode: 384,
|
|
@@ -156413,11 +156242,11 @@ async function refreshSharedDesktopAuthSession(originOverride) {
|
|
|
156413
156242
|
return readSharedDesktopAuthSession();
|
|
156414
156243
|
}
|
|
156415
156244
|
}
|
|
156416
|
-
var
|
|
156245
|
+
var import_node_crypto109, import_node_fs183, import_node_path189, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
156417
156246
|
var init_shared_session = __esm({
|
|
156418
156247
|
"src/auth/shared-session.ts"() {
|
|
156419
156248
|
"use strict";
|
|
156420
|
-
|
|
156249
|
+
import_node_crypto109 = require("node:crypto");
|
|
156421
156250
|
import_node_fs183 = require("node:fs");
|
|
156422
156251
|
import_node_path189 = require("node:path");
|
|
156423
156252
|
init_home_paths();
|
|
@@ -156458,7 +156287,7 @@ var init_run_rnx = __esm({
|
|
|
156458
156287
|
// cli/secure-file.ts
|
|
156459
156288
|
function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
156460
156289
|
(0, import_node_fs184.mkdirSync)((0, import_node_path190.dirname)(filepath), { recursive: true });
|
|
156461
|
-
const temporary = `${filepath}.tmp-${process.pid}-${(0,
|
|
156290
|
+
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto110.randomUUID)()}`;
|
|
156462
156291
|
let descriptor = null;
|
|
156463
156292
|
try {
|
|
156464
156293
|
descriptor = (0, import_node_fs184.openSync)(temporary, "wx", 384);
|
|
@@ -156475,11 +156304,11 @@ function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
|
156475
156304
|
throw error;
|
|
156476
156305
|
}
|
|
156477
156306
|
}
|
|
156478
|
-
var
|
|
156307
|
+
var import_node_crypto110, import_node_fs184, import_node_path190;
|
|
156479
156308
|
var init_secure_file = __esm({
|
|
156480
156309
|
"cli/secure-file.ts"() {
|
|
156481
156310
|
"use strict";
|
|
156482
|
-
|
|
156311
|
+
import_node_crypto110 = require("node:crypto");
|
|
156483
156312
|
import_node_fs184 = require("node:fs");
|
|
156484
156313
|
import_node_path190 = require("node:path");
|
|
156485
156314
|
}
|
|
@@ -157272,6 +157101,11 @@ async function sha256HexBytes(bytes) {
|
|
|
157272
157101
|
for (const byte of new Uint8Array(digest3)) hex += byte.toString(16).padStart(2, "0");
|
|
157273
157102
|
return hex;
|
|
157274
157103
|
}
|
|
157104
|
+
async function sha256Hex3(input) {
|
|
157105
|
+
return sha256HexBytes(
|
|
157106
|
+
typeof input === "string" ? new TextEncoder().encode(input) : input
|
|
157107
|
+
);
|
|
157108
|
+
}
|
|
157275
157109
|
async function assertSelfContainedMetroArtifactAssets(bundle) {
|
|
157276
157110
|
return visitVerifiedMetroArtifactAssets(
|
|
157277
157111
|
bundle,
|
|
@@ -157371,24 +157205,24 @@ async function separateMetroArtifactAssets(bundle) {
|
|
|
157371
157205
|
entry = { fileUris: [], fileHashes: [], scales: descriptor.scales };
|
|
157372
157206
|
entries2.set(key2, entry);
|
|
157373
157207
|
}
|
|
157374
|
-
const
|
|
157208
|
+
const sha2564 = descriptor.fileHashes?.[index];
|
|
157375
157209
|
const scale = descriptor.scales[index];
|
|
157376
|
-
if (!
|
|
157210
|
+
if (!sha2564 || scale === void 0) {
|
|
157377
157211
|
throw new Error("verified Metro asset variant is incomplete");
|
|
157378
157212
|
}
|
|
157379
157213
|
const filename = metroAssetScaleFilename(descriptor.name, descriptor.type, scale);
|
|
157380
|
-
const uri = `${PEACH_BUNDLE_ASSET_PREFIX}${
|
|
157214
|
+
const uri = `${PEACH_BUNDLE_ASSET_PREFIX}${sha2564}/${encodeURIComponent(filename)}`;
|
|
157381
157215
|
if (!resources.has(uri)) {
|
|
157382
157216
|
resources.set(uri, {
|
|
157383
157217
|
uri,
|
|
157384
|
-
sha256:
|
|
157218
|
+
sha256: sha2564,
|
|
157385
157219
|
contentType: metroAssetContentType(descriptor.type),
|
|
157386
157220
|
bytes,
|
|
157387
157221
|
byteLength: bytes.byteLength
|
|
157388
157222
|
});
|
|
157389
157223
|
}
|
|
157390
157224
|
entry.fileUris.push(uri);
|
|
157391
|
-
entry.fileHashes.push(
|
|
157225
|
+
entry.fileHashes.push(sha2564);
|
|
157392
157226
|
},
|
|
157393
157227
|
(site) => {
|
|
157394
157228
|
const entry = entries2.get(assetDescriptorKey(site.descriptor));
|
|
@@ -158684,7 +158518,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
|
|
|
158684
158518
|
}
|
|
158685
158519
|
const composed = composeRnxCloudDebugSourceMap(bundleSourceMap, sections);
|
|
158686
158520
|
sourceMap = {
|
|
158687
|
-
id: `sha256:${await
|
|
158521
|
+
id: `sha256:${await sha256Hex3(composed.json)}`,
|
|
158688
158522
|
bytes: composed.bytes,
|
|
158689
158523
|
json: composed.json,
|
|
158690
158524
|
resolved: composed.resolved,
|
|
@@ -158705,7 +158539,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
|
|
|
158705
158539
|
version: 2,
|
|
158706
158540
|
mode,
|
|
158707
158541
|
source: {
|
|
158708
|
-
sha256: await
|
|
158542
|
+
sha256: await sha256Hex3(bundle),
|
|
158709
158543
|
bytes: Buffer.byteLength(bundle, "utf8")
|
|
158710
158544
|
},
|
|
158711
158545
|
modules,
|
|
@@ -158716,7 +158550,7 @@ async function buildRnxCloudArtifact(bundle, options2 = {}) {
|
|
|
158716
158550
|
assets: { ...assets2, encodedBytes: artifactEncoded },
|
|
158717
158551
|
debug: sourceMap ? { sourceMap: { id: sourceMap.id, bytes: sourceMap.bytes } } : null,
|
|
158718
158552
|
artifact: {
|
|
158719
|
-
sha256: await
|
|
158553
|
+
sha256: await sha256Hex3(code),
|
|
158720
158554
|
bytes: artifactBytes
|
|
158721
158555
|
}
|
|
158722
158556
|
}
|
|
@@ -158988,7 +158822,7 @@ function projectSessionFile() {
|
|
|
158988
158822
|
}
|
|
158989
158823
|
dir = parent;
|
|
158990
158824
|
}
|
|
158991
|
-
const key2 = (0,
|
|
158825
|
+
const key2 = (0, import_node_crypto111.createHash)("sha256").update(dir).digest("hex").slice(0, 32);
|
|
158992
158826
|
return (0, import_node_path192.join)(rnxHomeDir(), "remote-sessions", `${key2}.json`);
|
|
158993
158827
|
}
|
|
158994
158828
|
function readCloudSession() {
|
|
@@ -159002,11 +158836,11 @@ function readCloudSession() {
|
|
|
159002
158836
|
}
|
|
159003
158837
|
return parseCloudSession(saved.session);
|
|
159004
158838
|
}
|
|
159005
|
-
var
|
|
158839
|
+
var import_node_crypto111, import_node_fs186, import_node_path192, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, PEACH_CLOUD_SESSION_ENV, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET, PROJECT_MARKERS;
|
|
159006
158840
|
var init_cloud_session = __esm({
|
|
159007
158841
|
"cli/cloud-session.ts"() {
|
|
159008
158842
|
"use strict";
|
|
159009
|
-
|
|
158843
|
+
import_node_crypto111 = require("node:crypto");
|
|
159010
158844
|
import_node_fs186 = require("node:fs");
|
|
159011
158845
|
import_node_path192 = require("node:path");
|
|
159012
158846
|
init_backend_origin();
|
|
@@ -159888,7 +159722,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
159888
159722
|
return { directory: directory2, files: files2, truncated };
|
|
159889
159723
|
}
|
|
159890
159724
|
function metroDescriptorHash(scaleBytes) {
|
|
159891
|
-
const hasher = (0,
|
|
159725
|
+
const hasher = (0, import_node_crypto112.createHash)("md5");
|
|
159892
159726
|
for (const bytes of scaleBytes) hasher.update(bytes);
|
|
159893
159727
|
return hasher.digest("hex");
|
|
159894
159728
|
}
|
|
@@ -159917,7 +159751,7 @@ function distinctByContent(directory2, options2) {
|
|
|
159917
159751
|
} catch {
|
|
159918
159752
|
continue;
|
|
159919
159753
|
}
|
|
159920
|
-
const digest3 = (0,
|
|
159754
|
+
const digest3 = (0, import_node_crypto112.createHash)("md5").update(bytes).digest("hex");
|
|
159921
159755
|
if (!byContent.has(digest3)) byContent.set(digest3, relative8);
|
|
159922
159756
|
}
|
|
159923
159757
|
return [...byContent.values()];
|
|
@@ -159965,7 +159799,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
159965
159799
|
continue;
|
|
159966
159800
|
}
|
|
159967
159801
|
const identical = fileHashes2 ? bytes.every((file, index) => {
|
|
159968
|
-
const digest3 = (0,
|
|
159802
|
+
const digest3 = (0, import_node_crypto112.createHash)("md5").update(file).digest("hex");
|
|
159969
159803
|
return descriptor.scales.some(
|
|
159970
159804
|
(scale, declared) => scale === scales[index] && fileHashes2[declared] === digest3
|
|
159971
159805
|
);
|
|
@@ -159990,7 +159824,7 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
159990
159824
|
const file = (0, import_node_path194.join)(dest.directory, relative8);
|
|
159991
159825
|
let digest3 = fileDigests2.get(file);
|
|
159992
159826
|
if (digest3 === void 0) {
|
|
159993
|
-
digest3 = (0,
|
|
159827
|
+
digest3 = (0, import_node_crypto112.createHash)("sha256").update((0, import_node_fs188.readFileSync)(file)).digest("hex");
|
|
159994
159828
|
fileDigests2.set(file, digest3);
|
|
159995
159829
|
}
|
|
159996
159830
|
return [scale, digest3];
|
|
@@ -160145,17 +159979,17 @@ async function producePreviewArtifact(bundlePath) {
|
|
|
160145
159979
|
prepared.code
|
|
160146
159980
|
);
|
|
160147
159981
|
const bytes = Buffer.from(annotated, "utf8");
|
|
160148
|
-
const
|
|
159982
|
+
const sha2564 = (0, import_node_crypto112.createHash)("sha256").update(bytes).digest("hex");
|
|
160149
159983
|
return {
|
|
160150
159984
|
bytes,
|
|
160151
|
-
sha256:
|
|
159985
|
+
sha256: sha2564,
|
|
160152
159986
|
minified: false,
|
|
160153
159987
|
receipt: {
|
|
160154
159988
|
source: {
|
|
160155
|
-
sha256: (0,
|
|
159989
|
+
sha256: (0, import_node_crypto112.createHash)("sha256").update(prepared.source).digest("hex"),
|
|
160156
159990
|
bytes: Buffer.byteLength(prepared.source, "utf8")
|
|
160157
159991
|
},
|
|
160158
|
-
artifact: { sha256:
|
|
159992
|
+
artifact: { sha256: sha2564, bytes: bytes.byteLength }
|
|
160159
159993
|
},
|
|
160160
159994
|
warnings: prepared.search.unconfirmed && prepared.dest ? [
|
|
160161
159995
|
`peach preview could not authenticate asset hashes in ${prepared.dest.directory}; confirm these are the assets this bundle was built against.`
|
|
@@ -160308,7 +160142,7 @@ async function produceArtifact(prepared, maxBytes, command) {
|
|
|
160308
160142
|
}
|
|
160309
160143
|
return {
|
|
160310
160144
|
bytes,
|
|
160311
|
-
sha256: (0,
|
|
160145
|
+
sha256: (0, import_node_crypto112.createHash)("sha256").update(bytes).digest("hex"),
|
|
160312
160146
|
receipt: artifact.receipt,
|
|
160313
160147
|
assetsDirectory: prepared.dest?.directory ?? null,
|
|
160314
160148
|
warnings
|
|
@@ -160824,11 +160658,11 @@ async function closeCloudSession(session) {
|
|
|
160824
160658
|
throw responseError(response.status, text7);
|
|
160825
160659
|
}
|
|
160826
160660
|
}
|
|
160827
|
-
var
|
|
160661
|
+
var import_node_crypto112, import_node_fs188, import_node_path194, import_node_vm, DEFAULT_RNX_CLOUD_ORIGIN, MAX_RNX_CLOUD_BUNDLE_BYTES, REMOTE_COMMAND, PREVIEW_COMMAND, NanoDevelopmentOnlyError, UnsupportedRemoteHostError, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS, REMOTE_HAS_NO_LOCAL_SIMS, CloudBridge, CloudBoxBridge, SceneBridge, BoxBootFailedError, BOX_BOOT_WAIT_MS;
|
|
160828
160662
|
var init_cloud_client = __esm({
|
|
160829
160663
|
"cli/cloud-client.ts"() {
|
|
160830
160664
|
"use strict";
|
|
160831
|
-
|
|
160665
|
+
import_node_crypto112 = require("node:crypto");
|
|
160832
160666
|
import_node_fs188 = require("node:fs");
|
|
160833
160667
|
import_node_path194 = require("node:path");
|
|
160834
160668
|
import_node_vm = require("node:vm");
|
|
@@ -160901,7 +160735,7 @@ var init_cloud_client = __esm({
|
|
|
160901
160735
|
const timeoutMs = options2?.timeoutMs ?? this.explicitTimeoutMs ?? options2?.defaultTimeoutMs;
|
|
160902
160736
|
const agent = commandAgent(command);
|
|
160903
160737
|
const body = {
|
|
160904
|
-
id: (0,
|
|
160738
|
+
id: (0, import_node_crypto112.randomUUID)(),
|
|
160905
160739
|
claimId: this.session.claimId,
|
|
160906
160740
|
command: cloudCommand(agent ? { ...command, agent } : command)
|
|
160907
160741
|
};
|
|
@@ -160971,7 +160805,7 @@ var init_cloud_client = __esm({
|
|
|
160971
160805
|
plane = "cloud";
|
|
160972
160806
|
async send(command, options2) {
|
|
160973
160807
|
const timeoutMs = options2?.timeoutMs ?? this.explicitTimeoutMs ?? options2?.defaultTimeoutMs;
|
|
160974
|
-
const id = (0,
|
|
160808
|
+
const id = (0, import_node_crypto112.randomUUID)();
|
|
160975
160809
|
const agent = commandAgent(command);
|
|
160976
160810
|
const payload = cloudCommand(agent ? { ...command, agent } : command);
|
|
160977
160811
|
let response;
|
|
@@ -165107,11 +164941,11 @@ function splashImageUrls(spec) {
|
|
|
165107
164941
|
if (spec.dark?.backgroundImageUrl) urls.add(spec.dark.backgroundImageUrl);
|
|
165108
164942
|
return [...urls];
|
|
165109
164943
|
}
|
|
165110
|
-
var
|
|
164944
|
+
var import_node_crypto113, import_node_module29, require2;
|
|
165111
164945
|
var init_app_splash = __esm({
|
|
165112
164946
|
"cli/app-splash.ts"() {
|
|
165113
164947
|
"use strict";
|
|
165114
|
-
|
|
164948
|
+
import_node_crypto113 = require("node:crypto");
|
|
165115
164949
|
import_node_module29 = require("node:module");
|
|
165116
164950
|
init_backend_origin();
|
|
165117
164951
|
init_cli_runtime();
|
|
@@ -165165,7 +164999,7 @@ function extractAppBinaryBundle(binary2) {
|
|
|
165165
164999
|
);
|
|
165166
165000
|
const sidecar = import_node_path199.default.posix.dirname(manifestEntry);
|
|
165167
165001
|
const appRoot = import_node_path199.default.posix.dirname(sidecar);
|
|
165168
|
-
const digest3 = (0,
|
|
165002
|
+
const digest3 = (0, import_node_crypto114.createHash)("sha256").update(import_node_fs193.default.readFileSync(file)).digest("hex");
|
|
165169
165003
|
const out = import_node_path199.default.join(cacheDir(), "app-binaries", digest3);
|
|
165170
165004
|
const bundlePath = import_node_path199.default.join(out, "main.js");
|
|
165171
165005
|
const extracted = import_node_path199.default.join(out, "extracted");
|
|
@@ -165183,7 +165017,7 @@ function extractAppBinaryBundle(binary2) {
|
|
|
165183
165017
|
const bundle = (0, import_node_zlib12.brotliDecompressSync)(
|
|
165184
165018
|
import_node_fs193.default.readFileSync(import_node_path199.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
|
|
165185
165019
|
);
|
|
165186
|
-
if ((0,
|
|
165020
|
+
if ((0, import_node_crypto114.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
|
|
165187
165021
|
throw new Error(`${binary2}: the peach sidecar bundle does not match its manifest`);
|
|
165188
165022
|
const assets2 = manifest.platform === "ios" ? import_node_path199.default.join(extracted, appRoot, "assets") : import_node_path199.default.join(extracted, sidecar, PEACH_SIDECAR_ASSETS);
|
|
165189
165023
|
if (import_node_fs193.default.existsSync(assets2)) import_node_fs193.default.renameSync(assets2, import_node_path199.default.join(out, "assets"));
|
|
@@ -165203,12 +165037,12 @@ function extractAppBinaryBundle(binary2) {
|
|
|
165203
165037
|
);
|
|
165204
165038
|
return { bundlePath, platform: platform3 };
|
|
165205
165039
|
}
|
|
165206
|
-
var import_node_child_process81,
|
|
165040
|
+
var import_node_child_process81, import_node_crypto114, import_node_fs193, import_node_path199, import_node_zlib12;
|
|
165207
165041
|
var init_binary_sidecar = __esm({
|
|
165208
165042
|
"cli/binary-sidecar.ts"() {
|
|
165209
165043
|
"use strict";
|
|
165210
165044
|
import_node_child_process81 = require("node:child_process");
|
|
165211
|
-
|
|
165045
|
+
import_node_crypto114 = require("node:crypto");
|
|
165212
165046
|
import_node_fs193 = __toESM(require("node:fs"), 1);
|
|
165213
165047
|
import_node_path199 = __toESM(require("node:path"), 1);
|
|
165214
165048
|
import_node_zlib12 = require("node:zlib");
|
|
@@ -166044,7 +165878,7 @@ var init_core = __esm({
|
|
|
166044
165878
|
// cli/output-redaction.ts
|
|
166045
165879
|
function mask(value) {
|
|
166046
165880
|
if (MASKED.test(value)) return value;
|
|
166047
|
-
return `<redacted:${(0,
|
|
165881
|
+
return `<redacted:${(0, import_node_crypto115.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
|
|
166048
165882
|
}
|
|
166049
165883
|
function maskQuoted(quoted2) {
|
|
166050
165884
|
return `${quoted2[0]}${mask(quoted2.slice(1, -1))}${quoted2[0]}`;
|
|
@@ -166166,11 +166000,11 @@ function redactText(text7, configurationOnly, decodedString = false) {
|
|
|
166166
166000
|
(line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
|
|
166167
166001
|
).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
|
|
166168
166002
|
}
|
|
166169
|
-
var
|
|
166003
|
+
var import_node_crypto115, import_node_util26, SECRET_NAME, JWT, GOOGLE_API_KEY, BEARER, EMAIL, OPAQUE_ID, STRING, NUMBER, PAIR2, STRING_TOKEN, QUERY_PAIR, HEADER_LINE, MASKED, CONFIG_CONTAINER, utf8;
|
|
166170
166004
|
var init_output_redaction = __esm({
|
|
166171
166005
|
"cli/output-redaction.ts"() {
|
|
166172
166006
|
"use strict";
|
|
166173
|
-
|
|
166007
|
+
import_node_crypto115 = require("node:crypto");
|
|
166174
166008
|
import_node_util26 = require("node:util");
|
|
166175
166009
|
init_config();
|
|
166176
166010
|
SECRET_NAME = /^(?:[\w-]*(?:api[-_]?key|token|secret|password|passwd|authorization|cookie|signature|credential)s?|auth|sig|email|uid|[\w-]*(?:user|account|local|device|installation|client|app|project|sender|measurement|tenant)[-_]?id)$/i;
|
|
@@ -166673,7 +166507,7 @@ function macDesktopLaunchHome(bridgePort) {
|
|
|
166673
166507
|
const dev = readDevBridgeLockfiles().find(
|
|
166674
166508
|
(lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
|
|
166675
166509
|
);
|
|
166676
|
-
const homeKey = (0,
|
|
166510
|
+
const homeKey = (0, import_node_crypto116.createHash)("sha256").update(home).digest("hex");
|
|
166677
166511
|
const dir = (0, import_path7.join)((0, import_os4.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
|
|
166678
166512
|
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
166679
166513
|
if ((0, import_fs8.existsSync)(home)) {
|
|
@@ -166779,13 +166613,13 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
|
|
|
166779
166613
|
}
|
|
166780
166614
|
return deepLink.toString();
|
|
166781
166615
|
}
|
|
166782
|
-
var import_child_process6, import_fs8,
|
|
166616
|
+
var import_child_process6, import_fs8, import_node_crypto116, import_os4, import_path7, import_url2, import_meta2, _sootsimRoot;
|
|
166783
166617
|
var init_desktop_companion = __esm({
|
|
166784
166618
|
"cli/desktop-companion.ts"() {
|
|
166785
166619
|
"use strict";
|
|
166786
166620
|
import_child_process6 = require("child_process");
|
|
166787
166621
|
import_fs8 = require("fs");
|
|
166788
|
-
|
|
166622
|
+
import_node_crypto116 = require("node:crypto");
|
|
166789
166623
|
import_os4 = require("os");
|
|
166790
166624
|
import_path7 = require("path");
|
|
166791
166625
|
import_url2 = require("url");
|
|
@@ -167520,11 +167354,11 @@ function trackCliDiagnostic(diagnostic) {
|
|
|
167520
167354
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
167521
167355
|
});
|
|
167522
167356
|
}
|
|
167523
|
-
var
|
|
167357
|
+
var import_node_crypto117, import_node_fs194, import_node_os38, observedRuntimeVersion, queue, CRASH_REPORT_EVERY_MS;
|
|
167524
167358
|
var init_telemetry = __esm({
|
|
167525
167359
|
"cli/telemetry.ts"() {
|
|
167526
167360
|
"use strict";
|
|
167527
|
-
|
|
167361
|
+
import_node_crypto117 = require("node:crypto");
|
|
167528
167362
|
import_node_fs194 = require("node:fs");
|
|
167529
167363
|
import_node_os38 = require("node:os");
|
|
167530
167364
|
init_event_identity();
|
|
@@ -173280,18 +173114,18 @@ function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
|
173280
173114
|
const content = bytes[index];
|
|
173281
173115
|
result[base2] = {
|
|
173282
173116
|
uri: urls[index],
|
|
173283
|
-
sha256: (0,
|
|
173117
|
+
sha256: (0, import_node_crypto118.createHash)("sha256").update(content).digest("hex"),
|
|
173284
173118
|
contentType: preferredMimeType(base2) ?? "application/octet-stream",
|
|
173285
173119
|
byteLength: content.byteLength
|
|
173286
173120
|
};
|
|
173287
173121
|
});
|
|
173288
173122
|
return result;
|
|
173289
173123
|
}
|
|
173290
|
-
var
|
|
173124
|
+
var import_node_crypto118, import_node_fs197, import_node_path201;
|
|
173291
173125
|
var init_app_bundle_resources = __esm({
|
|
173292
173126
|
"cli/app-bundle-resources.ts"() {
|
|
173293
173127
|
"use strict";
|
|
173294
|
-
|
|
173128
|
+
import_node_crypto118 = require("node:crypto");
|
|
173295
173129
|
import_node_fs197 = __toESM(require("node:fs"), 1);
|
|
173296
173130
|
import_node_path201 = __toESM(require("node:path"), 1);
|
|
173297
173131
|
init_uttype_mime();
|
|
@@ -173429,7 +173263,7 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
173429
173263
|
const directory2 = import_node_path202.default.dirname(selected[0]);
|
|
173430
173264
|
const codepointsFile = import_node_path202.default.join(directory2, "MaterialSymbols.codepoints");
|
|
173431
173265
|
const mirroredFile = import_node_path202.default.join(directory2, "MaterialSymbols.mirrored");
|
|
173432
|
-
const digest3 = (0,
|
|
173266
|
+
const digest3 = (0, import_node_crypto119.createHash)("md5");
|
|
173433
173267
|
for (const asset of [...selected, codepointsFile, mirroredFile].sort(
|
|
173434
173268
|
(a, b) => import_node_path202.default.basename(a) < import_node_path202.default.basename(b) ? -1 : import_node_path202.default.basename(a) > import_node_path202.default.basename(b) ? 1 : 0
|
|
173435
173269
|
)) {
|
|
@@ -173441,11 +173275,11 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
173441
173275
|
mirroredPath: mirroredFile
|
|
173442
173276
|
};
|
|
173443
173277
|
}
|
|
173444
|
-
var
|
|
173278
|
+
var import_node_crypto119, import_node_fs198, import_node_module30, import_node_path202;
|
|
173445
173279
|
var init_material_symbol_fonts2 = __esm({
|
|
173446
173280
|
"cli/material-symbol-fonts.ts"() {
|
|
173447
173281
|
"use strict";
|
|
173448
|
-
|
|
173282
|
+
import_node_crypto119 = require("node:crypto");
|
|
173449
173283
|
import_node_fs198 = __toESM(require("node:fs"), 1);
|
|
173450
173284
|
import_node_module30 = require("node:module");
|
|
173451
173285
|
import_node_path202 = __toESM(require("node:path"), 1);
|
|
@@ -173684,11 +173518,11 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
173684
173518
|
materialSymbols: materialSymbolFontAssets(materialFonts)
|
|
173685
173519
|
};
|
|
173686
173520
|
}
|
|
173687
|
-
var
|
|
173521
|
+
var import_node_crypto120, import_node_fs199, import_node_module31, import_node_path203, require3;
|
|
173688
173522
|
var init_app_fonts = __esm({
|
|
173689
173523
|
"cli/app-fonts.ts"() {
|
|
173690
173524
|
"use strict";
|
|
173691
|
-
|
|
173525
|
+
import_node_crypto120 = require("node:crypto");
|
|
173692
173526
|
import_node_fs199 = __toESM(require("node:fs"), 1);
|
|
173693
173527
|
import_node_module31 = require("node:module");
|
|
173694
173528
|
import_node_path203 = __toESM(require("node:path"), 1);
|
|
@@ -174903,11 +174737,11 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
174903
174737
|
return import_node_fs201.default.readFileSync(import_node_path205.default.join(search.dest.directory, relative8));
|
|
174904
174738
|
});
|
|
174905
174739
|
const verified2 = perFile && hashes ? bytes.every((content, i) => {
|
|
174906
|
-
const hash = (0,
|
|
174740
|
+
const hash = (0, import_node_crypto121.createHash)("md5").update(content).digest("hex");
|
|
174907
174741
|
return descriptor.scales.some(
|
|
174908
174742
|
(scale, j) => scale === scales[i] && hashes[j] === hash
|
|
174909
174743
|
);
|
|
174910
|
-
}) : scales.length === descriptor.scales.length && (0,
|
|
174744
|
+
}) : scales.length === descriptor.scales.length && (0, import_node_crypto121.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
|
|
174911
174745
|
if (!verified2)
|
|
174912
174746
|
throw new Error(`Metro asset changed while staging: ${descriptor.name}`);
|
|
174913
174747
|
scales.forEach((scale, i) => {
|
|
@@ -174934,11 +174768,11 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
174934
174768
|
});
|
|
174935
174769
|
stageHostMetroAssets(staged, origin);
|
|
174936
174770
|
}
|
|
174937
|
-
var
|
|
174771
|
+
var import_node_crypto121, import_node_fs201, import_node_path205;
|
|
174938
174772
|
var init_metro_bundle_assets = __esm({
|
|
174939
174773
|
"cli/metro-bundle-assets.ts"() {
|
|
174940
174774
|
"use strict";
|
|
174941
|
-
|
|
174775
|
+
import_node_crypto121 = require("node:crypto");
|
|
174942
174776
|
import_node_fs201 = __toESM(require("node:fs"), 1);
|
|
174943
174777
|
import_node_path205 = __toESM(require("node:path"), 1);
|
|
174944
174778
|
init_metroAssetArtifact();
|
|
@@ -175103,7 +174937,7 @@ async function signIn(origin, requestedAccount, chooseLater, announce) {
|
|
|
175103
174937
|
` dev-login not available (${devResult.error}); falling back to browser`
|
|
175104
174938
|
);
|
|
175105
174939
|
}
|
|
175106
|
-
const state = (0,
|
|
174940
|
+
const state = (0, import_node_crypto122.randomBytes)(16).toString("hex");
|
|
175107
174941
|
const LOGIN_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
175108
174942
|
const result = await new Promise((resolve16) => {
|
|
175109
174943
|
let timer;
|
|
@@ -175212,11 +175046,11 @@ async function signIn(origin, requestedAccount, chooseLater, announce) {
|
|
|
175212
175046
|
dev: false
|
|
175213
175047
|
};
|
|
175214
175048
|
}
|
|
175215
|
-
var
|
|
175049
|
+
var import_node_crypto122, import_node_http4, import_promises21, REMOTE_DEFAULT_ORIGIN, DEV_LOGIN_WARMUP_MS;
|
|
175216
175050
|
var init_login = __esm({
|
|
175217
175051
|
"cli/commands/login.ts"() {
|
|
175218
175052
|
"use strict";
|
|
175219
|
-
|
|
175053
|
+
import_node_crypto122 = require("node:crypto");
|
|
175220
175054
|
import_node_http4 = __toESM(require("node:http"), 1);
|
|
175221
175055
|
import_promises21 = require("node:readline/promises");
|
|
175222
175056
|
init_shared_session();
|
|
@@ -175428,7 +175262,7 @@ async function requireAccount(commandLabel, options2 = {}, signedInAgain = false
|
|
|
175428
175262
|
if (auth.kind === "github") return;
|
|
175429
175263
|
const header = authHeaderValue(auth);
|
|
175430
175264
|
const origin = await billingOriginFor(auth);
|
|
175431
|
-
const credential = (0,
|
|
175265
|
+
const credential = (0, import_node_crypto123.createHash)("sha256").update(`${origin}
|
|
175432
175266
|
${header}`).digest("hex");
|
|
175433
175267
|
const check2 = readCheck();
|
|
175434
175268
|
const known = check2?.credential === credential ? check2 : null;
|
|
@@ -175476,11 +175310,11 @@ ${header}`).digest("hex");
|
|
|
175476
175310
|
`${name3} could not reach ${origin} to verify your account${status ? ` (${status})` : ""}; connect once and run it again`
|
|
175477
175311
|
);
|
|
175478
175312
|
}
|
|
175479
|
-
var
|
|
175313
|
+
var import_node_crypto123, import_node_fs202, import_node_path206, import_zod5, REFRESH_AFTER_MS, VALID_FOR_MS, VERIFY_TIMEOUT_MS, checkSchema, ACCOUNT_REQUIRED_HINT, waitlistedSchema;
|
|
175480
175314
|
var init_account_gate = __esm({
|
|
175481
175315
|
"cli/account-gate.ts"() {
|
|
175482
175316
|
"use strict";
|
|
175483
|
-
|
|
175317
|
+
import_node_crypto123 = require("node:crypto");
|
|
175484
175318
|
import_node_fs202 = require("node:fs");
|
|
175485
175319
|
import_node_path206 = __toESM(require("node:path"), 1);
|
|
175486
175320
|
import_zod5 = require("peachsim/vendor/zod");
|