peachsim 0.1.2623 → 0.1.2625
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 +1023 -621
- 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-E6V72TM2.mjs → acorn-SHZZDBSI.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-EIOVKQ2C.mjs → chunk-2LDG7OD4.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-ISH6XB23.mjs → chunk-3XZGWT62.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-Q7KCK4YO.mjs → chunk-6PZI7TYE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RLWITQ5C.mjs → chunk-7Z7YJ4FU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4GNQG2GT.mjs → chunk-A4R4YGFJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GP3KL2GC.mjs → chunk-A66VNSO6.mjs} +565 -290
- package/dist-lib/esm-chunks/{chunk-XOAOND7F.mjs → chunk-DVMKYLDN.mjs} +9 -8
- package/dist-lib/esm-chunks/{chunk-IGB7TRLS.mjs → chunk-F4YHL4UM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4BJIJ3GP.mjs → chunk-JRU2VXUU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EI7CZDMR.mjs → chunk-JVEJLPJC.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-UCW7ITXE.mjs → chunk-KA4AQDVF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RLWTJ6II.mjs → chunk-LJYNZ5HM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RBXTTEI6.mjs → chunk-M2FEKSK3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KPG4FUTY.mjs → chunk-OCCZJOSA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXNXKUNJ.mjs → chunk-P542MMIN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NOM66H2G.mjs → chunk-Q5NI4L3Z.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-V2CHR3OI.mjs → chunk-R4FFTWPL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W3X7RP3H.mjs → chunk-RJWEWNAJ.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-B5OQSD4B.mjs → chunk-RXXCTHJG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-B4APPUTT.mjs → chunk-SRIRVPNX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6MNE57DC.mjs → chunk-ULHG6CND.mjs} +22 -13
- package/dist-lib/esm-chunks/{chunk-PAEJF2JP.mjs → chunk-W4HQINQ6.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-RVM3WWST.mjs → chunk-XQBHCWS4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-Q4ZATFEN.mjs → chunk-Z6AH6AQC.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-OHVROLNJ.mjs → metro-layout-parser-GJHR7FCR.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-DRAUK6KR.mjs → swift-package-prebuilt-UVRGKTD4.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-U2M7CMKA.mjs → swift-sdk-app-module-U3MUJ7QD.mjs} +107 -20
- package/dist-lib/esm-chunks/{swift-sdk-image-ZHWSHCNI.mjs → swift-sdk-image-U4W7QMAT.mjs} +16 -18
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-EOJUCK7N.mjs → swift-sdk-image-producer-TFFZDNRK.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +918 -516
- 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 +1025 -623
- package/dist-lib/host/fetch-proxy-handler.cjs +10 -9
- 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 +33 -17
- package/dist-lib/native-app-identity-project.mjs +44 -29
- 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 +69 -64
- 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 +1062 -660
- package/dist-lib/swift-compile.cjs +708 -336
- 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/package.json +1 -1
- package/src/bazel-project.ts +34 -18
- package/src/binaryen.lock.json +3 -3
- package/src/swift-compile.ts +8 -0
- package/src/swift-distribution-contract.ts +6 -1
- package/src/swift-distribution.lock.json +4 -2
- package/src/swift-guest-compile.ts +170 -160
- package/src/swift-guest-dyld-table.ts +22 -9
- package/src/swift-guest-link.ts +116 -42
- package/src/swift-guest-linked-spans.ts +63 -14
- package/src/swift-guest-projection-storage.ts +7 -6
- package/src/swift-guest-source-inputs.ts +35 -21
- package/src/swift-objc-compile.ts +1 -0
- package/src/swift-sdk-app-module.ts +118 -15
- package/src/swift-sdk-image-recipe.ts +20 -0
- package/src/swift-sdk-image-wasm.ts +119 -17
- package/src/swift-sdk-image.ts +6 -5
- package/src/swift-wasm-prune.ts +71 -41
- package/src/wasm-narrow-boundary.ts +31 -6
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2625 | (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;
|
|
@@ -35826,13 +35826,13 @@ var init_swift_standin_digest = __esm({
|
|
|
35826
35826
|
];
|
|
35827
35827
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
35828
35828
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
35829
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
35829
|
+
STANDIN_SOURCE_DIGEST = true ? "c87e0b7f1ae69b2a4e76611266612d6218f81a3244e592800c02f78c4f8e48f6" : standinSourceDigest();
|
|
35830
35830
|
}
|
|
35831
35831
|
});
|
|
35832
35832
|
|
|
35833
35833
|
// src/expo-native-compiler-digest.ts
|
|
35834
35834
|
function expoNativeCompilerDigestValue() {
|
|
35835
|
-
return true ? "
|
|
35835
|
+
return true ? "a46618eade53d31c53a3c6377fc86635c03dbcfedd5e131d38b77d9fcc366623" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
35836
35836
|
}
|
|
35837
35837
|
var import_node_crypto12;
|
|
35838
35838
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -57448,12 +57448,13 @@ function parseSwiftDistributionLock(value) {
|
|
|
57448
57448
|
if (runtime === void 0) return void 0;
|
|
57449
57449
|
if (!isRecord(runtime) || typeof runtime.source !== "string" || !/^[a-f0-9]{64}$/.test(runtime.source) || typeof runtime.url !== "string" || !/^https:\/\/[a-z0-9.-]+(?::\d+)?\/compile\/asset\/[a-f0-9]{64}$/.test(
|
|
57450
57450
|
runtime.url
|
|
57451
|
-
) || runtime.dataPlan !== void 0 && (typeof runtime.dataPlan !== "string" || !/^[a-f0-9]{64}$/.test(runtime.dataPlan)))
|
|
57451
|
+
) || runtime.dataPlan !== void 0 && (typeof runtime.dataPlan !== "string" || !/^[a-f0-9]{64}$/.test(runtime.dataPlan)) || runtime.recipe !== void 0 && (typeof runtime.recipe !== "string" || !/^[a-f0-9]{16}$/.test(runtime.recipe)))
|
|
57452
57452
|
throw new Error("invalid shared SDK runtime publication in Swift distribution lock");
|
|
57453
57453
|
return {
|
|
57454
57454
|
source: runtime.source,
|
|
57455
57455
|
url: runtime.url,
|
|
57456
|
-
...runtime.dataPlan && { dataPlan: runtime.dataPlan }
|
|
57456
|
+
...runtime.dataPlan && { dataPlan: runtime.dataPlan },
|
|
57457
|
+
...runtime.recipe && { recipe: runtime.recipe }
|
|
57457
57458
|
};
|
|
57458
57459
|
};
|
|
57459
57460
|
const sdkRuntime = publication(value.sdkRuntime);
|
|
@@ -58484,6 +58485,15 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
|
|
|
58484
58485
|
const unchanged = before === after;
|
|
58485
58486
|
const original = layout(before, !unchanged, !importsLayout);
|
|
58486
58487
|
const optimized = unchanged ? original : layout(after, true, !importsLayout);
|
|
58488
|
+
if (extra?.optimizedDataSegments) {
|
|
58489
|
+
for (const segment2 of optimized.data) {
|
|
58490
|
+
extra.optimizedDataSegments.push({
|
|
58491
|
+
address: segment2.address,
|
|
58492
|
+
offset: segment2.bytes.byteOffset - after.byteOffset,
|
|
58493
|
+
length: segment2.bytes.length
|
|
58494
|
+
});
|
|
58495
|
+
}
|
|
58496
|
+
}
|
|
58487
58497
|
const collectSymbols = extra?.collectSymbols;
|
|
58488
58498
|
const trackedObject = extra?.trackedObject;
|
|
58489
58499
|
const trackedObjectOwner = extra?.trackedObjectOwner;
|
|
@@ -58652,12 +58662,39 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
|
|
|
58652
58662
|
}
|
|
58653
58663
|
return result;
|
|
58654
58664
|
};
|
|
58665
|
+
const singleSegmentSlice = (module2, start, length) => {
|
|
58666
|
+
const segs = module2.dataByAddress;
|
|
58667
|
+
let low = 0;
|
|
58668
|
+
let high = segs.length;
|
|
58669
|
+
while (low < high) {
|
|
58670
|
+
const middle = low + high >> 1;
|
|
58671
|
+
if (segs[middle].maximumEnd <= start) low = middle + 1;
|
|
58672
|
+
else high = middle;
|
|
58673
|
+
}
|
|
58674
|
+
let found2;
|
|
58675
|
+
const end = start + length;
|
|
58676
|
+
for (let index = low; index < segs.length; index++) {
|
|
58677
|
+
const segment2 = segs[index];
|
|
58678
|
+
if (segment2.address >= end) break;
|
|
58679
|
+
if (segment2.address + segment2.bytes.length > start) {
|
|
58680
|
+
if (found2) return void 0;
|
|
58681
|
+
found2 = segment2;
|
|
58682
|
+
}
|
|
58683
|
+
}
|
|
58684
|
+
if (!found2 || found2.address > start || found2.address + found2.bytes.length < end)
|
|
58685
|
+
return void 0;
|
|
58686
|
+
return found2.bytes.subarray(start - found2.address, end - found2.address);
|
|
58687
|
+
};
|
|
58688
|
+
const sameDataAt = (start, length) => {
|
|
58689
|
+
const origSlice = singleSegmentSlice(original, start, length);
|
|
58690
|
+
const optSlice = origSlice ? singleSegmentSlice(optimized, start, length) : void 0;
|
|
58691
|
+
if (origSlice && optSlice) return Buffer.compare(origSlice, optSlice) === 0;
|
|
58692
|
+
return dataAt(original, start, length).equals(dataAt(optimized, start, length));
|
|
58693
|
+
};
|
|
58655
58694
|
for (const span of spans) {
|
|
58656
58695
|
if (span.address + span.length > original.memoryBytes || span.address + span.length > optimized.memoryBytes)
|
|
58657
58696
|
throw new Error(`linked data lies outside guest memory at ${span.address}`);
|
|
58658
|
-
if (!unchanged && !
|
|
58659
|
-
dataAt(optimized, span.address, span.length)
|
|
58660
|
-
))
|
|
58697
|
+
if (!unchanged && !sameDataAt(span.address, span.length))
|
|
58661
58698
|
throw new Error(`optimization changed linked data at ${span.address}`);
|
|
58662
58699
|
}
|
|
58663
58700
|
let previous;
|
|
@@ -58791,7 +58828,7 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
58791
58828
|
const bytes = new Uint8Array(length);
|
|
58792
58829
|
const emptied = /* @__PURE__ */ new Set();
|
|
58793
58830
|
let covered = 0;
|
|
58794
|
-
const
|
|
58831
|
+
const patchedBody = Buffer.from(wasm.subarray(body[0], body[1]));
|
|
58795
58832
|
for (const initializer of startupDataInitializers(wasm.subarray(...body))) {
|
|
58796
58833
|
const end = initializer.address + initializer.length;
|
|
58797
58834
|
if (end <= address || initializer.address >= address + length || !initializer.length)
|
|
@@ -58806,19 +58843,18 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
58806
58843
|
covered += segment2.length;
|
|
58807
58844
|
emptied.add(initializer.segment);
|
|
58808
58845
|
const [at, immediateEnd] = initializer.lengthImmediate;
|
|
58809
|
-
|
|
58810
|
-
|
|
58846
|
+
patchedBody.fill(128, at, immediateEnd - 1);
|
|
58847
|
+
patchedBody[immediateEnd - 1] = 0;
|
|
58811
58848
|
}
|
|
58812
58849
|
if (covered !== length)
|
|
58813
58850
|
throw new Error("guest startup data does not initialize the whole range");
|
|
58814
|
-
const
|
|
58815
|
-
const payload = [result.subarray(data[1], segments[0].header)];
|
|
58851
|
+
const payload = [wasm.subarray(data[1], segments[0].header)];
|
|
58816
58852
|
for (const [index, segment2] of segments.entries()) {
|
|
58817
58853
|
if (!emptied.has(index)) {
|
|
58818
|
-
payload.push(
|
|
58854
|
+
payload.push(wasm.subarray(segment2.header, segment2.payload + segment2.length));
|
|
58819
58855
|
continue;
|
|
58820
58856
|
}
|
|
58821
|
-
payload.push(
|
|
58857
|
+
payload.push(wasm.subarray(segment2.header, segment2.sizeAt), Uint8Array.of(0));
|
|
58822
58858
|
}
|
|
58823
58859
|
const section2 = Buffer.concat(payload);
|
|
58824
58860
|
const size2 = [];
|
|
@@ -58829,7 +58865,14 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
58829
58865
|
}
|
|
58830
58866
|
size2.push(rest % 128 | 128);
|
|
58831
58867
|
}
|
|
58832
|
-
parts2
|
|
58868
|
+
const parts2 = [
|
|
58869
|
+
wasm.subarray(0, body[0]),
|
|
58870
|
+
patchedBody,
|
|
58871
|
+
wasm.subarray(body[1], data[0]),
|
|
58872
|
+
Uint8Array.of(11, ...size2),
|
|
58873
|
+
section2,
|
|
58874
|
+
wasm.subarray(data[2])
|
|
58875
|
+
];
|
|
58833
58876
|
return { wasm: Buffer.concat(parts2), bytes };
|
|
58834
58877
|
}
|
|
58835
58878
|
var import_node_fs57, import_node_string_decoder, constant;
|
|
@@ -59138,6 +59181,32 @@ function readImports(bytes, imports2) {
|
|
|
59138
59181
|
}
|
|
59139
59182
|
return { functionTypes, importedGlobals, memoryPages };
|
|
59140
59183
|
}
|
|
59184
|
+
function countImportedFunctions(bytes, imports2) {
|
|
59185
|
+
let count = 0;
|
|
59186
|
+
if (!imports2) return count;
|
|
59187
|
+
const r = wasmReader(bytes, imports2.start);
|
|
59188
|
+
for (let n = r.u(); n > 0; n--) {
|
|
59189
|
+
r.skip(r.u());
|
|
59190
|
+
r.skip(r.u());
|
|
59191
|
+
const kind = r.byte();
|
|
59192
|
+
if (kind === 0) {
|
|
59193
|
+
r.u();
|
|
59194
|
+
count++;
|
|
59195
|
+
} else if (kind === 1) {
|
|
59196
|
+
r.byte();
|
|
59197
|
+
skipLimits(r);
|
|
59198
|
+
} else if (kind === 2) {
|
|
59199
|
+
skipLimits(r);
|
|
59200
|
+
} else if (kind === 3) {
|
|
59201
|
+
r.byte();
|
|
59202
|
+
r.byte();
|
|
59203
|
+
} else if (kind === 4) {
|
|
59204
|
+
r.byte();
|
|
59205
|
+
r.u();
|
|
59206
|
+
} else throw new Error(`unknown wasm import kind ${kind}`);
|
|
59207
|
+
}
|
|
59208
|
+
return count;
|
|
59209
|
+
}
|
|
59141
59210
|
function* readFunctionNames(bytes, names) {
|
|
59142
59211
|
for (const r = wasmReader(bytes, names.start); r.at < names.end; ) {
|
|
59143
59212
|
const id = r.byte();
|
|
@@ -59505,28 +59574,73 @@ function codeOnlySdkImage(bytes, constructorMask) {
|
|
|
59505
59574
|
return Buffer.concat(out);
|
|
59506
59575
|
}
|
|
59507
59576
|
function constructorKeys(map2, bytes) {
|
|
59508
|
-
const m = readModule(bytes);
|
|
59509
59577
|
const first = map2.code[0];
|
|
59510
|
-
if (!first
|
|
59511
|
-
const
|
|
59512
|
-
const
|
|
59513
|
-
|
|
59578
|
+
if (!first) throw new Error("link has no code");
|
|
59579
|
+
const sections = wasmSections(bytes);
|
|
59580
|
+
const code = sections.find((s) => s.id === 10);
|
|
59581
|
+
if (!code) throw new Error("link has no code");
|
|
59514
59582
|
const ctors = map2.code.find((chunk) => chunk.section === "__wasm_call_ctors");
|
|
59515
59583
|
if (!ctors) throw new Error("link has no constructors");
|
|
59516
|
-
const
|
|
59517
|
-
|
|
59518
|
-
|
|
59519
|
-
|
|
59584
|
+
const importedFuncs = countImportedFunctions(
|
|
59585
|
+
bytes,
|
|
59586
|
+
sections.find((s) => s.id === 2)
|
|
59587
|
+
);
|
|
59588
|
+
const codeReader = wasmReader(bytes, code.start);
|
|
59589
|
+
const bodyCount = codeReader.u();
|
|
59590
|
+
if (!bodyCount) throw new Error("link has no code");
|
|
59591
|
+
const prefixes = new Uint32Array(bodyCount);
|
|
59592
|
+
let delta = 0;
|
|
59593
|
+
let ctorPrefix = -1;
|
|
59594
|
+
let ctorStart = -1;
|
|
59595
|
+
let ctorEnd = -1;
|
|
59596
|
+
for (let i = 0; i < bodyCount; i++) {
|
|
59597
|
+
const prefix = codeReader.at;
|
|
59598
|
+
const size2 = codeReader.u();
|
|
59599
|
+
prefixes[i] = prefix;
|
|
59600
|
+
if (i === 0) {
|
|
59601
|
+
delta = prefix - first.offset;
|
|
59602
|
+
ctorPrefix = ctors.offset + delta;
|
|
59603
|
+
}
|
|
59604
|
+
if (prefix === ctorPrefix) {
|
|
59605
|
+
ctorStart = codeReader.at;
|
|
59606
|
+
ctorEnd = ctorStart + size2;
|
|
59607
|
+
}
|
|
59608
|
+
codeReader.skip(size2);
|
|
59609
|
+
}
|
|
59610
|
+
if (ctorStart < 0) throw new Error("constructor function not found by map offset");
|
|
59611
|
+
let sorted3 = true;
|
|
59612
|
+
for (let i = 1; i < map2.code.length; i++) {
|
|
59613
|
+
if (map2.code[i].offset < map2.code[i - 1].offset) {
|
|
59614
|
+
sorted3 = false;
|
|
59615
|
+
break;
|
|
59616
|
+
}
|
|
59617
|
+
}
|
|
59618
|
+
const byOffset = sorted3 ? void 0 : new Map(map2.code.map((chunk) => [chunk.offset + delta, chunk]));
|
|
59619
|
+
const findChunk = (targetPrefix) => {
|
|
59620
|
+
if (byOffset) return byOffset.get(targetPrefix);
|
|
59621
|
+
const targetOffset = targetPrefix - delta;
|
|
59622
|
+
let lo = 0;
|
|
59623
|
+
let hi = map2.code.length - 1;
|
|
59624
|
+
while (lo <= hi) {
|
|
59625
|
+
const mid = lo + hi >> 1;
|
|
59626
|
+
const offset = map2.code[mid].offset;
|
|
59627
|
+
if (offset < targetOffset) lo = mid + 1;
|
|
59628
|
+
else if (offset > targetOffset) hi = mid - 1;
|
|
59629
|
+
else return map2.code[mid];
|
|
59630
|
+
}
|
|
59631
|
+
return void 0;
|
|
59632
|
+
};
|
|
59633
|
+
const r = wasmReader(bytes, ctorStart);
|
|
59520
59634
|
for (let n = r.u(); n > 0; n--) {
|
|
59521
59635
|
r.u();
|
|
59522
59636
|
r.byte();
|
|
59523
59637
|
}
|
|
59524
59638
|
const keys = [];
|
|
59525
|
-
while (r.at <
|
|
59639
|
+
while (r.at < ctorEnd) {
|
|
59526
59640
|
const op = r.byte();
|
|
59527
59641
|
if (op === 16) {
|
|
59528
|
-
const callee = r.u() -
|
|
59529
|
-
const chunk =
|
|
59642
|
+
const callee = r.u() - importedFuncs;
|
|
59643
|
+
const chunk = callee >= 0 && callee < bodyCount ? findChunk(prefixes[callee]) : void 0;
|
|
59530
59644
|
if (!chunk) throw new Error("constructor without a map chunk");
|
|
59531
59645
|
keys.push(chunkKey(chunk, ""));
|
|
59532
59646
|
} else if (op !== 26 && op !== 11) throw new Error(`constructor op ${op}`);
|
|
@@ -59609,7 +59723,10 @@ function relocationEdges(bytes, segmentAddress) {
|
|
|
59609
59723
|
r.skip(r.u());
|
|
59610
59724
|
}
|
|
59611
59725
|
}
|
|
59612
|
-
const importedFunctions =
|
|
59726
|
+
const importedFunctions = countImportedFunctions(
|
|
59727
|
+
bytes,
|
|
59728
|
+
sections.find((s) => s.id === 2)
|
|
59729
|
+
);
|
|
59613
59730
|
const data = [];
|
|
59614
59731
|
const dataFunctions = [];
|
|
59615
59732
|
const bodyCount = bodyStarts.length;
|
|
@@ -59723,9 +59840,30 @@ function strongDefinitions(bytes) {
|
|
|
59723
59840
|
).map((s) => s.name);
|
|
59724
59841
|
}
|
|
59725
59842
|
function unslottedFunctions(bytes) {
|
|
59726
|
-
const
|
|
59727
|
-
const
|
|
59728
|
-
|
|
59843
|
+
const sections = wasmSections(bytes);
|
|
59844
|
+
const importedFuncs = countImportedFunctions(
|
|
59845
|
+
bytes,
|
|
59846
|
+
sections.find((s) => s.id === 2)
|
|
59847
|
+
);
|
|
59848
|
+
const code = sections.find((s) => s.id === 10);
|
|
59849
|
+
const definedFuncs = code ? wasmReader(bytes, code.start).u() : 0;
|
|
59850
|
+
const slotted = /* @__PURE__ */ new Set();
|
|
59851
|
+
const elements = sections.find((s) => s.id === 9);
|
|
59852
|
+
if (elements) {
|
|
59853
|
+
const r = wasmReader(bytes, elements.start);
|
|
59854
|
+
for (let n = r.u(); n > 0; n--) {
|
|
59855
|
+
const flags = r.u();
|
|
59856
|
+
if (flags !== 0 && flags !== 2) throw new Error(`sdk image element flags ${flags}`);
|
|
59857
|
+
if (flags === 2) r.u();
|
|
59858
|
+
constant2(r);
|
|
59859
|
+
if (flags === 2) r.byte();
|
|
59860
|
+
for (let i = 0, count = r.u(); i < count; i++) {
|
|
59861
|
+
const index = r.u();
|
|
59862
|
+
if (index >= importedFuncs) slotted.add(index);
|
|
59863
|
+
}
|
|
59864
|
+
}
|
|
59865
|
+
}
|
|
59866
|
+
return definedFuncs - slotted.size;
|
|
59729
59867
|
}
|
|
59730
59868
|
var uleb, sleb, encodedName, section, PROCESS_EXPORTS, SWIFT_SDK_CONSTRUCTOR_LIMIT, FUNCTION_RELOCATIONS, MEMORY_RELOCATIONS, ADDEND_RELOCATIONS, FUNCTION_RELOC_MASK, MEMORY_RELOC_MASK, ADDEND_RELOC_MASK;
|
|
59731
59869
|
var init_swift_sdk_image_wasm = __esm({
|
|
@@ -60109,6 +60247,11 @@ var init_swiftRuntimeProductContract = __esm({
|
|
|
60109
60247
|
});
|
|
60110
60248
|
|
|
60111
60249
|
// src/swift-wasm-prune.ts
|
|
60250
|
+
function sha256Hex(bytes) {
|
|
60251
|
+
if (typeof Bun !== "undefined")
|
|
60252
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
60253
|
+
return (0, import_node_crypto30.createHash)("sha256").update(bytes).digest("hex");
|
|
60254
|
+
}
|
|
60112
60255
|
function readULEB2(b, o) {
|
|
60113
60256
|
let res = 0;
|
|
60114
60257
|
let shift = 0;
|
|
@@ -60861,6 +61004,42 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
60861
61004
|
}
|
|
60862
61005
|
}
|
|
60863
61006
|
}
|
|
61007
|
+
const segObjCClasses = /* @__PURE__ */ new Map();
|
|
61008
|
+
for (let segIdx = 0; segIdx < sEnds.length; segIdx++) {
|
|
61009
|
+
const rangeStart = dataStart + sPayloadStarts[segIdx];
|
|
61010
|
+
const rangeEnd = dataStart + sEnds[segIdx];
|
|
61011
|
+
const sliceLen = rangeEnd - rangeStart;
|
|
61012
|
+
if (sliceLen < 4) continue;
|
|
61013
|
+
const slice = Buffer.from(rawBuf.buffer, rawBuf.byteOffset + rangeStart, sliceLen);
|
|
61014
|
+
let segPos = 0;
|
|
61015
|
+
let classes;
|
|
61016
|
+
while (segPos < sliceLen - 3) {
|
|
61017
|
+
const at = slice.indexOf("So", segPos);
|
|
61018
|
+
if (at < 0 || at >= sliceLen - 2) break;
|
|
61019
|
+
let digitEnd = at + 2;
|
|
61020
|
+
let length = 0;
|
|
61021
|
+
while (digitEnd < sliceLen) {
|
|
61022
|
+
const ch = slice[digitEnd];
|
|
61023
|
+
if (ch < 48 || ch > 57) break;
|
|
61024
|
+
length = length * 10 + (ch - 48);
|
|
61025
|
+
digitEnd++;
|
|
61026
|
+
}
|
|
61027
|
+
if (digitEnd === at + 2) {
|
|
61028
|
+
segPos = at + 2;
|
|
61029
|
+
continue;
|
|
61030
|
+
}
|
|
61031
|
+
segPos = digitEnd;
|
|
61032
|
+
const nameEnd = digitEnd + length;
|
|
61033
|
+
if (nameEnd >= sliceLen || slice[nameEnd] !== 67) continue;
|
|
61034
|
+
const symbol2 = `._OBJC_CLASS_${slice.toString("latin1", digitEnd, nameEnd)}`;
|
|
61035
|
+
if (!classes) {
|
|
61036
|
+
classes = [symbol2];
|
|
61037
|
+
segObjCClasses.set(segIdx, classes);
|
|
61038
|
+
} else if (!classes.includes(symbol2)) {
|
|
61039
|
+
classes.push(symbol2);
|
|
61040
|
+
}
|
|
61041
|
+
}
|
|
61042
|
+
}
|
|
60864
61043
|
return {
|
|
60865
61044
|
file,
|
|
60866
61045
|
isDist,
|
|
@@ -60890,10 +61069,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
60890
61069
|
objcCategoryTargets,
|
|
60891
61070
|
rootFuncs,
|
|
60892
61071
|
rootSegs,
|
|
60893
|
-
|
|
60894
|
-
dataStart + sPayloadStarts[i],
|
|
60895
|
-
dataStart + end
|
|
60896
|
-
])
|
|
61072
|
+
segObjCClasses
|
|
60897
61073
|
};
|
|
60898
61074
|
}
|
|
60899
61075
|
function parseWasmObjectFile(file, isDist) {
|
|
@@ -61261,16 +61437,26 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61261
61437
|
transformations.set(file, {
|
|
61262
61438
|
output,
|
|
61263
61439
|
inputSha256,
|
|
61264
|
-
outputSha256: (
|
|
61440
|
+
outputSha256: sha256Hex(result),
|
|
61265
61441
|
kind
|
|
61266
61442
|
});
|
|
61267
61443
|
};
|
|
61268
61444
|
const distFiles = [];
|
|
61269
61445
|
const distBaseNames = /* @__PURE__ */ new Set();
|
|
61270
61446
|
const eagerFiles = [];
|
|
61447
|
+
const parsedBuildObjects = /* @__PURE__ */ new Map();
|
|
61271
61448
|
const lazyBuildObjects = /* @__PURE__ */ new Map();
|
|
61272
61449
|
const extraArchiveObjs = [];
|
|
61273
61450
|
const objectBytes = /* @__PURE__ */ new Map();
|
|
61451
|
+
const archiveMembers = /* @__PURE__ */ new Map();
|
|
61452
|
+
const readArchiveMembers = (archive) => {
|
|
61453
|
+
let members2 = archiveMembers.get(archive);
|
|
61454
|
+
if (!members2) {
|
|
61455
|
+
members2 = readArMembers(new Uint8Array(import_node_fs58.default.readFileSync(archive)));
|
|
61456
|
+
archiveMembers.set(archive, members2);
|
|
61457
|
+
}
|
|
61458
|
+
return members2;
|
|
61459
|
+
};
|
|
61274
61460
|
let inStartLib = false;
|
|
61275
61461
|
let swiftrtOrigPath = "";
|
|
61276
61462
|
for (const t of tokens2) {
|
|
@@ -61307,8 +61493,10 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61307
61493
|
break;
|
|
61308
61494
|
}
|
|
61309
61495
|
}
|
|
61310
|
-
if (definesObjCClassOrCategory)
|
|
61311
|
-
|
|
61496
|
+
if (definesObjCClassOrCategory) {
|
|
61497
|
+
parsedBuildObjects.set(t, obj);
|
|
61498
|
+
eagerFiles.push(t);
|
|
61499
|
+
} else lazyBuildObjects.set(t, obj);
|
|
61312
61500
|
} else {
|
|
61313
61501
|
eagerFiles.push(t);
|
|
61314
61502
|
}
|
|
@@ -61316,7 +61504,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61316
61504
|
lazyBuildObjects.set(t, parseWasmObjectFile(t, false));
|
|
61317
61505
|
}
|
|
61318
61506
|
} else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && import_node_fs58.default.existsSync(t)) {
|
|
61319
|
-
const members2 =
|
|
61507
|
+
const members2 = readArchiveMembers(t);
|
|
61320
61508
|
for (const m of members2) {
|
|
61321
61509
|
const object9 = parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false);
|
|
61322
61510
|
extraArchiveObjs.push(object9);
|
|
@@ -61339,7 +61527,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61339
61527
|
);
|
|
61340
61528
|
const archiveOverlapsDist = (archive) => {
|
|
61341
61529
|
if (!import_node_fs58.default.existsSync(archive)) return false;
|
|
61342
|
-
const members2 =
|
|
61530
|
+
const members2 = readArchiveMembers(archive);
|
|
61343
61531
|
return members2.some((m) => distBaseNames.has(m.name));
|
|
61344
61532
|
};
|
|
61345
61533
|
for (const t of tokens2) {
|
|
@@ -61361,7 +61549,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61361
61549
|
import_node_path57.default.basename(archive)
|
|
61362
61550
|
);
|
|
61363
61551
|
const ordinals = /* @__PURE__ */ new Map();
|
|
61364
|
-
for (const m of
|
|
61552
|
+
for (const m of readArchiveMembers(archive)) {
|
|
61365
61553
|
const ordinal = (ordinals.get(m.name) ?? 0) + 1;
|
|
61366
61554
|
ordinals.set(m.name, ordinal);
|
|
61367
61555
|
if (distBaseNames.has(m.name) || writtenLeftovers.has(m.name)) continue;
|
|
@@ -61395,7 +61583,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61395
61583
|
recordTransformation(
|
|
61396
61584
|
swiftrtOrigPath,
|
|
61397
61585
|
patchedSwiftrtPath,
|
|
61398
|
-
link ? (
|
|
61586
|
+
link ? sha256Hex(input) : "",
|
|
61399
61587
|
result,
|
|
61400
61588
|
"swiftrt"
|
|
61401
61589
|
);
|
|
@@ -61882,7 +62070,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61882
62070
|
}
|
|
61883
62071
|
for (const f of eagerFiles) {
|
|
61884
62072
|
const isDist = f.startsWith(distDir);
|
|
61885
|
-
const obj = distObjs.get(f) ?? parseWasmObjectFile(f, isDist);
|
|
62073
|
+
const obj = distObjs.get(f) ?? parsedBuildObjects.get(f) ?? parseWasmObjectFile(f, isDist);
|
|
61886
62074
|
extractObject(obj);
|
|
61887
62075
|
if (isDist) {
|
|
61888
62076
|
const base2 = import_node_path57.default.basename(f);
|
|
@@ -61932,32 +62120,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
61932
62120
|
"$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZTf4nd_n"
|
|
61933
62121
|
]);
|
|
61934
62122
|
const keepObjCClassesNamedInSegment = (obj, segIdx) => {
|
|
61935
|
-
const
|
|
61936
|
-
if (!
|
|
61937
|
-
const
|
|
61938
|
-
if (rangeEnd - rangeStart < 4) return;
|
|
61939
|
-
let bytes = objectBytes.get(obj);
|
|
61940
|
-
if (!bytes) objectBytes.set(obj, bytes = import_node_fs58.default.readFileSync(obj.file));
|
|
61941
|
-
let pos = rangeStart;
|
|
61942
|
-
while (pos < rangeEnd - 3) {
|
|
61943
|
-
const at = bytes.indexOf("So", pos);
|
|
61944
|
-
if (at < 0 || at >= rangeEnd - 2) break;
|
|
61945
|
-
let digitEnd = at + 2;
|
|
61946
|
-
let length = 0;
|
|
61947
|
-
while (digitEnd < rangeEnd) {
|
|
61948
|
-
const ch = bytes[digitEnd];
|
|
61949
|
-
if (ch < 48 || ch > 57) break;
|
|
61950
|
-
length = length * 10 + (ch - 48);
|
|
61951
|
-
digitEnd++;
|
|
61952
|
-
}
|
|
61953
|
-
if (digitEnd === at + 2) {
|
|
61954
|
-
pos = at + 2;
|
|
61955
|
-
continue;
|
|
61956
|
-
}
|
|
61957
|
-
pos = digitEnd;
|
|
61958
|
-
const nameEnd = digitEnd + length;
|
|
61959
|
-
if (nameEnd >= rangeEnd || bytes[nameEnd] !== 67) continue;
|
|
61960
|
-
const symbol2 = `._OBJC_CLASS_${bytes.toString("latin1", digitEnd, nameEnd)}`;
|
|
62123
|
+
const symbols = obj.segObjCClasses.get(segIdx);
|
|
62124
|
+
if (!symbols) return;
|
|
62125
|
+
for (const symbol2 of symbols) {
|
|
61961
62126
|
for (const provider of lazyProviders.get(symbol2) ?? []) {
|
|
61962
62127
|
eagerDynamicObjects.add(provider);
|
|
61963
62128
|
extractObject(provider);
|
|
@@ -62053,7 +62218,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
62053
62218
|
const cached5 = objectBytes.get(obj);
|
|
62054
62219
|
const buf = cached5 ? new Uint8Array(cached5) : new Uint8Array(import_node_fs58.default.readFileSync(obj.file));
|
|
62055
62220
|
const rawBuf = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
62056
|
-
const inputSha256 = link ? (
|
|
62221
|
+
const inputSha256 = link ? sha256Hex(buf) : "";
|
|
62057
62222
|
const fLive = liveFuncs.get(obj);
|
|
62058
62223
|
const sLive = liveSegs.get(obj);
|
|
62059
62224
|
const dLive = liveDataSyms.get(obj);
|
|
@@ -64432,13 +64597,34 @@ function dropWasmCustomSection(bytes, name3) {
|
|
|
64432
64597
|
}
|
|
64433
64598
|
return Buffer.concat(parts2);
|
|
64434
64599
|
}
|
|
64600
|
+
function writeWasmCustomSections(bytes, entries2) {
|
|
64601
|
+
if (entries2.length === 0) return Buffer.concat([bytes]);
|
|
64602
|
+
const replaced = new Set(entries2.map(([name3]) => name3));
|
|
64603
|
+
const parts2 = [];
|
|
64604
|
+
let sliceStart = 0;
|
|
64605
|
+
let sliceEnd = 8;
|
|
64606
|
+
for (const { id, start, end } of wasmSections2(bytes)) {
|
|
64607
|
+
if (id === 0 && replaced.has(readWasmSection(bytes, start, end).name())) {
|
|
64608
|
+
if (sliceEnd > sliceStart) parts2.push(bytes.subarray(sliceStart, sliceEnd));
|
|
64609
|
+
sliceStart = end;
|
|
64610
|
+
sliceEnd = end;
|
|
64611
|
+
} else {
|
|
64612
|
+
sliceEnd = end;
|
|
64613
|
+
}
|
|
64614
|
+
}
|
|
64615
|
+
if (sliceEnd > sliceStart) parts2.push(bytes.subarray(sliceStart, sliceEnd));
|
|
64616
|
+
for (const [name3, data] of entries2) {
|
|
64617
|
+
const nameBytes = Buffer.from(encodeWasmName(name3));
|
|
64618
|
+
parts2.push(
|
|
64619
|
+
Buffer.from([0, ...encodeWasmNumber(nameBytes.length + data.length)]),
|
|
64620
|
+
nameBytes,
|
|
64621
|
+
data
|
|
64622
|
+
);
|
|
64623
|
+
}
|
|
64624
|
+
return Buffer.concat(parts2);
|
|
64625
|
+
}
|
|
64435
64626
|
function writeWasmCustomSection(bytes, name3, data) {
|
|
64436
|
-
|
|
64437
|
-
return Buffer.concat([
|
|
64438
|
-
dropWasmCustomSection(bytes, name3),
|
|
64439
|
-
Buffer.from([0, ...encodeWasmNumber(section2.length)]),
|
|
64440
|
-
section2
|
|
64441
|
-
]);
|
|
64627
|
+
return writeWasmCustomSections(bytes, [[name3, data]]);
|
|
64442
64628
|
}
|
|
64443
64629
|
function readWasmFunctionNames(bytes) {
|
|
64444
64630
|
const section2 = readWasmCustomSection(bytes, "name");
|
|
@@ -64868,6 +65054,16 @@ var init_wasm_narrow_boundary = __esm({
|
|
|
64868
65054
|
});
|
|
64869
65055
|
|
|
64870
65056
|
// src/swift-guest-dyld-table.ts
|
|
65057
|
+
function sha256Buffer(bytes) {
|
|
65058
|
+
if (typeof Bun !== "undefined")
|
|
65059
|
+
return Buffer.from(new Bun.CryptoHasher("sha256").update(bytes).digest());
|
|
65060
|
+
return (0, import_node_crypto33.createHash)("sha256").update(bytes).digest();
|
|
65061
|
+
}
|
|
65062
|
+
function sha256Hex2(bytes) {
|
|
65063
|
+
if (typeof Bun !== "undefined")
|
|
65064
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
65065
|
+
return (0, import_node_crypto33.createHash)("sha256").update(bytes).digest("hex");
|
|
65066
|
+
}
|
|
64871
65067
|
function uleb3(value) {
|
|
64872
65068
|
const bytes = [];
|
|
64873
65069
|
for (let rest = value; ; rest = Math.floor(rest / 128)) {
|
|
@@ -64902,7 +65098,7 @@ function encodeGuestDyldTable(rows) {
|
|
|
64902
65098
|
}
|
|
64903
65099
|
const file = Buffer.concat(packs);
|
|
64904
65100
|
const header = Buffer.alloc(40 + packs.length * 8);
|
|
64905
|
-
(
|
|
65101
|
+
sha256Buffer(file).copy(header, 0);
|
|
64906
65102
|
header.writeUInt32LE(file.length, 32);
|
|
64907
65103
|
header.writeUInt32LE(packs.length, 36);
|
|
64908
65104
|
let offset = 0;
|
|
@@ -64914,11 +65110,11 @@ function encodeGuestDyldTable(rows) {
|
|
|
64914
65110
|
const names = firsts.flatMap((name3) => [name3, Buffer.of(0)]);
|
|
64915
65111
|
return { index: Buffer.concat([header, ...names]), packs: file };
|
|
64916
65112
|
}
|
|
64917
|
-
function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */ new Map()) {
|
|
65113
|
+
function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */ new Map(), extraSections = []) {
|
|
64918
65114
|
const range3 = guestDyldValueRange(map2);
|
|
64919
65115
|
if (!range3) {
|
|
64920
65116
|
if (symbols.length) throw new Error("link map has no dyld values");
|
|
64921
|
-
return wasm;
|
|
65117
|
+
return extraSections.length ? writeWasmCustomSections(wasm, extraSections) : wasm;
|
|
64922
65118
|
}
|
|
64923
65119
|
if (range3.length !== symbols.length * 8)
|
|
64924
65120
|
throw new Error("linked dyld values do not match the ledger rows");
|
|
@@ -64933,11 +65129,11 @@ function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */
|
|
|
64933
65129
|
return binding === void 0 ? { name: name3, image, kind: 0, value: view.getBigUint64(index2 * 8, true) } : { name: name3, image, kind: 1, value: BigInt(binding) };
|
|
64934
65130
|
});
|
|
64935
65131
|
const { index, packs } = encodeGuestDyldTable(rows);
|
|
64936
|
-
return
|
|
64937
|
-
|
|
64938
|
-
NATIVE_DYLD_PACKS_SECTION,
|
|
64939
|
-
|
|
64940
|
-
);
|
|
65132
|
+
return writeWasmCustomSections(taken.wasm, [
|
|
65133
|
+
[NATIVE_DYLD_TABLE_SECTION, index],
|
|
65134
|
+
[NATIVE_DYLD_PACKS_SECTION, packs],
|
|
65135
|
+
...extraSections
|
|
65136
|
+
]);
|
|
64941
65137
|
}
|
|
64942
65138
|
function guestDyldValueRange(map2) {
|
|
64943
65139
|
const suffix = `:(${GUEST_DYLD_VALUES_SECTION})`;
|
|
@@ -64966,7 +65162,7 @@ function splitSwiftDyldTable(wasm) {
|
|
|
64966
65162
|
const bytes = Buffer.from(packs);
|
|
64967
65163
|
return {
|
|
64968
65164
|
module: dropWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION),
|
|
64969
|
-
table: { sha256: (
|
|
65165
|
+
table: { sha256: sha256Hex2(bytes), bytes }
|
|
64970
65166
|
};
|
|
64971
65167
|
}
|
|
64972
65168
|
var import_node_crypto33, import_node_zlib4, PACK_BYTES;
|
|
@@ -65502,6 +65698,7 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
65502
65698
|
const owner = options2.owners.get(options2.projectionObject);
|
|
65503
65699
|
if (owner === void 0) throw new Error("guest projection object has no image owner");
|
|
65504
65700
|
const ranges = [];
|
|
65701
|
+
const data = [];
|
|
65505
65702
|
const spans = guestLinkedSpans(
|
|
65506
65703
|
options2.map,
|
|
65507
65704
|
options2.linked,
|
|
@@ -65512,7 +65709,8 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
65512
65709
|
{
|
|
65513
65710
|
trackedObject: options2.projectionObject,
|
|
65514
65711
|
trackedObjectOwner: owner,
|
|
65515
|
-
trackedLinearSpans: ranges
|
|
65712
|
+
trackedLinearSpans: ranges,
|
|
65713
|
+
optimizedDataSegments: data
|
|
65516
65714
|
}
|
|
65517
65715
|
);
|
|
65518
65716
|
const images = planGuestProjectionRegions(
|
|
@@ -65521,7 +65719,6 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
65521
65719
|
options2.sdkSpans ? [...spans, ...options2.sdkSpans] : spans
|
|
65522
65720
|
);
|
|
65523
65721
|
const result = Buffer.from(options2.optimized);
|
|
65524
|
-
const data = guestWasmDataSegments(options2.optimized, options2.sdkSpans === void 0);
|
|
65525
65722
|
const locations = /* @__PURE__ */ new Map();
|
|
65526
65723
|
const counts = /* @__PURE__ */ new Map();
|
|
65527
65724
|
const uuids = /* @__PURE__ */ new Map();
|
|
@@ -66195,17 +66392,17 @@ var init_binaryen_lock = __esm({
|
|
|
66195
66392
|
"linux-x64": {
|
|
66196
66393
|
asset: "x86_64-linux",
|
|
66197
66394
|
upstreamSha256: "195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572",
|
|
66198
|
-
sha256: "
|
|
66395
|
+
sha256: "40062fb1ebbad7f04f361c1e3bb309dffb1d2318dd2e12235a0e7e820e18d6c9"
|
|
66199
66396
|
},
|
|
66200
66397
|
"linux-arm64": {
|
|
66201
66398
|
asset: "aarch64-linux",
|
|
66202
66399
|
upstreamSha256: "c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f",
|
|
66203
|
-
sha256: "
|
|
66400
|
+
sha256: "d79b09d5b66f62f9e4bb691517b174b42bcdc0b7f40769d1993b7c565b0a54c7"
|
|
66204
66401
|
},
|
|
66205
66402
|
"darwin-arm64": {
|
|
66206
66403
|
asset: "arm64-macos",
|
|
66207
66404
|
upstreamSha256: "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
|
|
66208
|
-
sha256: "
|
|
66405
|
+
sha256: "29342632a4fa52466c4feea846698fe5aa56ff46226a914d60b65b8735373d63"
|
|
66209
66406
|
}
|
|
66210
66407
|
}
|
|
66211
66408
|
};
|
|
@@ -66699,6 +66896,7 @@ function outputPath(args) {
|
|
|
66699
66896
|
}
|
|
66700
66897
|
function withOutput(args, output, discovery) {
|
|
66701
66898
|
const result = [];
|
|
66899
|
+
let stripsDebug = false;
|
|
66702
66900
|
for (let i = 0; i < args.length; i++) {
|
|
66703
66901
|
const arg = args[i];
|
|
66704
66902
|
if (arg === "-o" || arg === "--output") {
|
|
@@ -66708,9 +66906,12 @@ function withOutput(args, output, discovery) {
|
|
|
66708
66906
|
if (arg.startsWith("--output=")) continue;
|
|
66709
66907
|
if (discovery && (arg.startsWith("--why-extract=") || arg.startsWith("--Map=")))
|
|
66710
66908
|
continue;
|
|
66909
|
+
if (arg === "--strip-debug" || arg === "-S" || arg === "--strip-all" || arg === "-s")
|
|
66910
|
+
stripsDebug = true;
|
|
66711
66911
|
result.push(arg);
|
|
66712
66912
|
}
|
|
66713
66913
|
if (discovery) result.push("--allow-multiple-definition");
|
|
66914
|
+
if (!stripsDebug) result.push("--strip-debug");
|
|
66714
66915
|
result.push("-o", output);
|
|
66715
66916
|
return result;
|
|
66716
66917
|
}
|
|
@@ -66741,6 +66942,37 @@ async function linkGuestImages(options2) {
|
|
|
66741
66942
|
}
|
|
66742
66943
|
return import_node_fs63.default.readFileSync(trace, "utf8");
|
|
66743
66944
|
};
|
|
66945
|
+
const runLinkAsync = async (name3, arguments_) => {
|
|
66946
|
+
const response = import_node_path61.default.join(directory2, `${name3}.rsp`);
|
|
66947
|
+
const trace = import_node_path61.default.join(directory2, `${name3}-inputs.txt`);
|
|
66948
|
+
import_node_fs63.default.writeFileSync(
|
|
66949
|
+
response,
|
|
66950
|
+
[...arguments_, "--trace"].map((argument2) => JSON.stringify(argument2)).join(" ")
|
|
66951
|
+
);
|
|
66952
|
+
const output = import_node_fs63.default.openSync(trace, "w");
|
|
66953
|
+
try {
|
|
66954
|
+
await new Promise((resolve16, reject) => {
|
|
66955
|
+
const child = (0, import_node_child_process30.spawn)(wasmLd, [`@${response}`], {
|
|
66956
|
+
stdio: ["ignore", output, "pipe"]
|
|
66957
|
+
});
|
|
66958
|
+
const stderr = [];
|
|
66959
|
+
child.stderr?.on("data", (chunk) => stderr.push(chunk));
|
|
66960
|
+
child.once("error", reject);
|
|
66961
|
+
child.once("close", (code, signal) => {
|
|
66962
|
+
if (code === 0) resolve16();
|
|
66963
|
+
else
|
|
66964
|
+
reject(
|
|
66965
|
+
new Error(
|
|
66966
|
+
`wasm-ld (${name3}) failed (${signal ?? code}): ${Buffer.concat(stderr).toString("utf8")}`
|
|
66967
|
+
)
|
|
66968
|
+
);
|
|
66969
|
+
});
|
|
66970
|
+
});
|
|
66971
|
+
} finally {
|
|
66972
|
+
import_node_fs63.default.closeSync(output);
|
|
66973
|
+
}
|
|
66974
|
+
return import_node_fs63.default.readFileSync(trace, "utf8");
|
|
66975
|
+
};
|
|
66744
66976
|
const preselection = options2.projection && options2.preselectionDiscovery ? options2.preselectionDiscovery : void 0;
|
|
66745
66977
|
let discoveryProjection;
|
|
66746
66978
|
if (options2.projection) {
|
|
@@ -66970,6 +67202,7 @@ async function linkGuestImages(options2) {
|
|
|
66970
67202
|
};
|
|
66971
67203
|
const ledgerObjectPromise = compileLedgerAsync("ledger", ledger.llvmIR);
|
|
66972
67204
|
const appLedgerObjectPromise = options2.onSplitInputs && ledger.appLLVMIR ? compileLedgerAsync("app-ledger", ledger.appLLVMIR) : void 0;
|
|
67205
|
+
let deferredFinalLink;
|
|
66973
67206
|
try {
|
|
66974
67207
|
const replacements = /* @__PURE__ */ new Map();
|
|
66975
67208
|
const linkedOwners = /* @__PURE__ */ new Map();
|
|
@@ -67071,7 +67304,7 @@ async function linkGuestImages(options2) {
|
|
|
67071
67304
|
});
|
|
67072
67305
|
const finalOutput = import_node_path61.default.join(directory2, "final.wasm");
|
|
67073
67306
|
const finalWhy = import_node_path61.default.join(directory2, "final-why-extract.txt");
|
|
67074
|
-
const
|
|
67307
|
+
const finalLinkArgs = (projectionObject2, layoutMap) => [
|
|
67075
67308
|
...withOutput(finalArgs, finalOutput, false),
|
|
67076
67309
|
ledgerObject,
|
|
67077
67310
|
`@${lazyExports}`,
|
|
@@ -67079,10 +67312,38 @@ async function linkGuestImages(options2) {
|
|
|
67079
67312
|
...provider ? [`--undefined=${providerSymbol}`] : [],
|
|
67080
67313
|
...layoutMap ? [`--Map=${layoutMap}`] : [],
|
|
67081
67314
|
`--why-extract=${finalWhy}`
|
|
67082
|
-
]
|
|
67315
|
+
];
|
|
67316
|
+
const linkFinal = (projectionObject2, layoutMap) => runLink("final", finalLinkArgs(projectionObject2, layoutMap));
|
|
67317
|
+
const finalizeFinalLink = (trace) => {
|
|
67318
|
+
const finalSelection = selectedGuestLinkInputs(
|
|
67319
|
+
remapGuestLinkPlan(plan, replacements),
|
|
67320
|
+
finalArgs,
|
|
67321
|
+
import_node_fs63.default.readFileSync(finalWhy, "utf8"),
|
|
67322
|
+
trace,
|
|
67323
|
+
finalArchives
|
|
67324
|
+
);
|
|
67325
|
+
const original = new Map(
|
|
67326
|
+
[...replacements].map(([before2, after2]) => [after2, before2])
|
|
67327
|
+
);
|
|
67328
|
+
const key2 = (item) => JSON.stringify([original.get(item.artifact) ?? item.artifact, item.member]);
|
|
67329
|
+
const before = new Set(selected.map(key2));
|
|
67330
|
+
const after = new Set(finalSelection.map(key2));
|
|
67331
|
+
const changed2 = [...before].filter((item) => !after.has(item));
|
|
67332
|
+
changed2.push(...[...after].filter((item) => !before.has(item)));
|
|
67333
|
+
if (changed2.length)
|
|
67334
|
+
throw new Error(
|
|
67335
|
+
`guest link selected different inputs after rewriting:
|
|
67336
|
+
${changed2.join("\n")}`
|
|
67337
|
+
);
|
|
67338
|
+
import_node_fs63.default.renameSync(finalOutput, outputPath(args));
|
|
67339
|
+
if (KEEP_WASM_NAMES)
|
|
67340
|
+
import_node_fs63.default.writeFileSync(
|
|
67341
|
+
outputPath(args),
|
|
67342
|
+
nameGuestImageAliases(import_node_fs63.default.readFileSync(outputPath(args)), plan.symbols)
|
|
67343
|
+
);
|
|
67344
|
+
};
|
|
67083
67345
|
let projectionObject;
|
|
67084
67346
|
let projectionStorage;
|
|
67085
|
-
let finalTrace;
|
|
67086
67347
|
if (options2.projection) {
|
|
67087
67348
|
const projection = options2.projection;
|
|
67088
67349
|
if (!plan.images.some((image) => image.id === projection.image))
|
|
@@ -67135,8 +67396,18 @@ async function linkGuestImages(options2) {
|
|
|
67135
67396
|
[...projection.clangOptions, "-c", projectionSource, "-o", projectionObject],
|
|
67136
67397
|
{ stdio: "pipe" }
|
|
67137
67398
|
);
|
|
67138
|
-
|
|
67139
|
-
|
|
67399
|
+
if (sharedSdk && options2.onFinalLink && options2.onSplitInputs && appLedgerObjectPromise) {
|
|
67400
|
+
deferredFinalLink = runLinkAsync(
|
|
67401
|
+
"final",
|
|
67402
|
+
finalLinkArgs(projectionObject, callerMap ? void 0 : layoutMap)
|
|
67403
|
+
).then((trace) => finalizeFinalLink(trace));
|
|
67404
|
+
break;
|
|
67405
|
+
}
|
|
67406
|
+
const finalTrace = linkFinal(projectionObject, callerMap ? void 0 : layoutMap);
|
|
67407
|
+
if (sharedSdk) {
|
|
67408
|
+
finalizeFinalLink(finalTrace);
|
|
67409
|
+
break;
|
|
67410
|
+
}
|
|
67140
67411
|
const wasm = import_node_fs63.default.readFileSync(finalOutput);
|
|
67141
67412
|
const actual = guestProjectionRegionCounts(
|
|
67142
67413
|
images.length,
|
|
@@ -67148,38 +67419,17 @@ async function linkGuestImages(options2) {
|
|
|
67148
67419
|
sectionOwners
|
|
67149
67420
|
)
|
|
67150
67421
|
);
|
|
67151
|
-
if (actual.every((count, index) => count <= capacities[index].regions))
|
|
67422
|
+
if (actual.every((count, index) => count <= capacities[index].regions)) {
|
|
67423
|
+
finalizeFinalLink(finalTrace);
|
|
67424
|
+
break;
|
|
67425
|
+
}
|
|
67152
67426
|
capacities = capacities.map((capacity, index) => ({
|
|
67153
67427
|
...capacity,
|
|
67154
67428
|
regions: Math.max(actual[index], capacity.regions)
|
|
67155
67429
|
}));
|
|
67156
67430
|
}
|
|
67157
67431
|
linkedOwners.set(projectionObject, projection.image);
|
|
67158
|
-
} else
|
|
67159
|
-
const finalSelection = selectedGuestLinkInputs(
|
|
67160
|
-
remapGuestLinkPlan(plan, replacements),
|
|
67161
|
-
finalArgs,
|
|
67162
|
-
import_node_fs63.default.readFileSync(finalWhy, "utf8"),
|
|
67163
|
-
finalTrace,
|
|
67164
|
-
finalArchives
|
|
67165
|
-
);
|
|
67166
|
-
const original = new Map([...replacements].map(([before2, after2]) => [after2, before2]));
|
|
67167
|
-
const key2 = (item) => JSON.stringify([original.get(item.artifact) ?? item.artifact, item.member]);
|
|
67168
|
-
const before = new Set(selected.map(key2));
|
|
67169
|
-
const after = new Set(finalSelection.map(key2));
|
|
67170
|
-
const changed2 = [...before].filter((item) => !after.has(item));
|
|
67171
|
-
changed2.push(...[...after].filter((item) => !before.has(item)));
|
|
67172
|
-
if (changed2.length)
|
|
67173
|
-
throw new Error(
|
|
67174
|
-
`guest link selected different inputs after rewriting:
|
|
67175
|
-
${changed2.join("\n")}`
|
|
67176
|
-
);
|
|
67177
|
-
import_node_fs63.default.renameSync(finalOutput, outputPath(args));
|
|
67178
|
-
if (KEEP_WASM_NAMES)
|
|
67179
|
-
import_node_fs63.default.writeFileSync(
|
|
67180
|
-
outputPath(args),
|
|
67181
|
-
nameGuestImageAliases(import_node_fs63.default.readFileSync(outputPath(args)), plan.symbols)
|
|
67182
|
-
);
|
|
67432
|
+
} else finalizeFinalLink(linkFinal());
|
|
67183
67433
|
if (projectionStorage && projectionObject)
|
|
67184
67434
|
options2.projection.onReserved(projectionStorage, projectionObject);
|
|
67185
67435
|
options2.onLinkedOwners?.(linkedOwners);
|
|
@@ -67215,11 +67465,13 @@ ${changed2.join("\n")}`
|
|
|
67215
67465
|
appDefinedSymbols
|
|
67216
67466
|
});
|
|
67217
67467
|
}
|
|
67468
|
+
if (deferredFinalLink) options2.onFinalLink?.(deferredFinalLink);
|
|
67218
67469
|
return selected;
|
|
67219
67470
|
} catch (error) {
|
|
67220
67471
|
await Promise.allSettled([
|
|
67221
67472
|
ledgerObjectPromise,
|
|
67222
|
-
...appLedgerObjectPromise ? [appLedgerObjectPromise] : []
|
|
67473
|
+
...appLedgerObjectPromise ? [appLedgerObjectPromise] : [],
|
|
67474
|
+
...deferredFinalLink ? [deferredFinalLink] : []
|
|
67223
67475
|
]);
|
|
67224
67476
|
throw error;
|
|
67225
67477
|
}
|
|
@@ -67851,6 +68103,7 @@ async function linkPrunedGuestImages(options2) {
|
|
|
67851
68103
|
identities: aliasGuestLinkIdentities(identities, prepared.archives)
|
|
67852
68104
|
};
|
|
67853
68105
|
}
|
|
68106
|
+
let finalLinkDone;
|
|
67854
68107
|
const selected = await linkCompleteGuestImages({
|
|
67855
68108
|
plan,
|
|
67856
68109
|
args: [...linkedArgs, `--Map=${options2.mapPath}`],
|
|
@@ -67864,6 +68117,9 @@ async function linkPrunedGuestImages(options2) {
|
|
|
67864
68117
|
resolvePlan: options2.resolvePlan,
|
|
67865
68118
|
sharedSdk: options2.sharedSdk,
|
|
67866
68119
|
onSplitInputs: options2.onSplitInputs,
|
|
68120
|
+
onFinalLink: options2.deferFinalLink ? (done) => {
|
|
68121
|
+
finalLinkDone = done;
|
|
68122
|
+
} : void 0,
|
|
67867
68123
|
onDyldRows: options2.onDyldRows,
|
|
67868
68124
|
onLinkedOwners: (value) => {
|
|
67869
68125
|
owners = value;
|
|
@@ -67877,7 +68133,8 @@ async function linkPrunedGuestImages(options2) {
|
|
|
67877
68133
|
owners,
|
|
67878
68134
|
generatedSectionOwners,
|
|
67879
68135
|
sdk: sdk2,
|
|
67880
|
-
mapPath: options2.mapPath
|
|
68136
|
+
mapPath: options2.mapPath,
|
|
68137
|
+
finalLinkDone
|
|
67881
68138
|
};
|
|
67882
68139
|
}
|
|
67883
68140
|
var import_node_child_process30, import_node_fs63, import_node_path61, import_node_util6, execFileAsync, WASM_MAGIC, BITCODE_MAGIC;
|
|
@@ -67946,8 +68203,13 @@ function clangBinaryStamp(file) {
|
|
|
67946
68203
|
const stat2 = (0, import_node_fs64.statSync)(file, { bigint: true });
|
|
67947
68204
|
return [file, stat2.size, stat2.mtimeNs].join(":");
|
|
67948
68205
|
}
|
|
68206
|
+
function sha256Hex3(bytes) {
|
|
68207
|
+
if (typeof Bun !== "undefined")
|
|
68208
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
68209
|
+
return (0, import_node_crypto37.createHash)("sha256").update(bytes).digest("hex");
|
|
68210
|
+
}
|
|
67949
68211
|
function clangWrapperStamp(file) {
|
|
67950
|
-
return (
|
|
68212
|
+
return sha256Hex3((0, import_node_fs64.readFileSync)(file));
|
|
67951
68213
|
}
|
|
67952
68214
|
function clangArgsNeedCwd(args) {
|
|
67953
68215
|
const pathFlags = /* @__PURE__ */ new Set([
|
|
@@ -68097,22 +68359,35 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
68097
68359
|
"SOURCE_DATE_EPOCH"
|
|
68098
68360
|
].map((name3) => process.env[name3] ?? "");
|
|
68099
68361
|
const replays = [];
|
|
68362
|
+
const realPathCache = /* @__PURE__ */ new Map();
|
|
68363
|
+
const cachedRealpath = (file) => {
|
|
68364
|
+
let resolved = realPathCache.get(file);
|
|
68365
|
+
if (resolved === void 0) {
|
|
68366
|
+
resolved = (0, import_node_fs64.realpathSync)(file);
|
|
68367
|
+
realPathCache.set(file, resolved);
|
|
68368
|
+
}
|
|
68369
|
+
return resolved;
|
|
68370
|
+
};
|
|
68371
|
+
const resolvedSwiftCompiler = cachedRealpath(options2.swiftCompiler);
|
|
68100
68372
|
let clang;
|
|
68373
|
+
let clangWrapper;
|
|
68101
68374
|
let clangStamp;
|
|
68102
68375
|
let wrapperStamp;
|
|
68103
68376
|
for (const file of wanted) {
|
|
68104
68377
|
const command = commands.get(file);
|
|
68105
68378
|
if (!command) throw new Error(`missing source object producer ${file}`);
|
|
68106
68379
|
if (command.tool === "shell") {
|
|
68107
|
-
if (!command.args.length || (
|
|
68380
|
+
if (!command.args.length || cachedRealpath(command.args[0]) !== resolvedSwiftCompiler)
|
|
68108
68381
|
throw new Error(`unsupported source object producer ${file}`);
|
|
68109
68382
|
continue;
|
|
68110
68383
|
}
|
|
68111
|
-
const compiler = command.args[0] ? (
|
|
68112
|
-
clang ??= (
|
|
68113
|
-
if (command.tool !== "clang" || compiler !== clang && compiler !== (
|
|
68384
|
+
const compiler = command.args[0] ? cachedRealpath(command.args[0]) : "";
|
|
68385
|
+
clang ??= cachedRealpath(import_node_path62.default.join(options2.toolchainBin, "clang"));
|
|
68386
|
+
if (command.tool !== "clang" || compiler !== clang && compiler !== (clangWrapper ??= cachedRealpath(
|
|
68387
|
+
import_node_path62.default.join(options2.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)
|
|
68388
|
+
)))
|
|
68114
68389
|
throw new Error(`unsupported source object producer ${file}`);
|
|
68115
|
-
const key2 = (
|
|
68390
|
+
const key2 = sha256Hex3(
|
|
68116
68391
|
JSON.stringify([
|
|
68117
68392
|
"clang-link-options/v2",
|
|
68118
68393
|
clangArgsNeedCwd(command.args) ? process.cwd() : null,
|
|
@@ -68122,11 +68397,8 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
68122
68397
|
compiler === clang ? null : wrapperStamp ??= clangWrapperStamp(compiler),
|
|
68123
68398
|
clangProducerStamp(file)
|
|
68124
68399
|
])
|
|
68125
|
-
).digest("hex");
|
|
68126
|
-
const cacheFile = import_node_path62.default.join(
|
|
68127
|
-
cacheDirectory,
|
|
68128
|
-
(0, import_node_crypto37.createHash)("sha256").update(file).digest("hex") + ".json"
|
|
68129
68400
|
);
|
|
68401
|
+
const cacheFile = import_node_path62.default.join(cacheDirectory, sha256Hex3(file) + ".json");
|
|
68130
68402
|
const cached5 = readClangLinkOptions(cacheFile, key2);
|
|
68131
68403
|
if (cached5) {
|
|
68132
68404
|
validateClangLinkOptions(cached5);
|
|
@@ -70349,7 +70621,7 @@ function headerClosure(roots) {
|
|
|
70349
70621
|
).filter((file) => !file.endsWith(`/${j.exclude}`));
|
|
70350
70622
|
const nitroFiles = roots.nitroModules ? headerFiles2(roots.nitroModules, n.from, n.skip, new RegExp(n.keep)) : [];
|
|
70351
70623
|
const hashes = (base2, files2) => Object.fromEntries(
|
|
70352
|
-
files2.map((file) => [file,
|
|
70624
|
+
files2.map((file) => [file, sha256Hex4((0, import_node_fs68.readFileSync)(import_node_path66.default.join(base2, file)))])
|
|
70353
70625
|
);
|
|
70354
70626
|
return {
|
|
70355
70627
|
jsi: hashes(roots.reactNative, jsiFiles),
|
|
@@ -70513,11 +70785,11 @@ function verifyInstalledAdapter(family, directory2, pin2) {
|
|
|
70513
70785
|
if (JSON.stringify(recorded) !== JSON.stringify(pinned))
|
|
70514
70786
|
throw new Error(`${label} manifest does not match the lock this build carries`);
|
|
70515
70787
|
const bytes = (0, import_node_fs68.readFileSync)(import_node_path66.default.join(directory2, archive.path));
|
|
70516
|
-
if (bytes.length !== archive.size ||
|
|
70788
|
+
if (bytes.length !== archive.size || sha256Hex4(bytes) !== archive.sha256)
|
|
70517
70789
|
throw new Error(`${label} library does not match its manifest`);
|
|
70518
70790
|
return manifest;
|
|
70519
70791
|
}
|
|
70520
|
-
var import_node_crypto39, import_node_fs68, import_node_path66, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE,
|
|
70792
|
+
var import_node_crypto39, import_node_fs68, import_node_path66, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE, sha256Hex4, hex64, sameHeaders;
|
|
70521
70793
|
var init_nitroAdapterContract = __esm({
|
|
70522
70794
|
"src/nitroAdapterContract.ts"() {
|
|
70523
70795
|
"use strict";
|
|
@@ -70567,7 +70839,7 @@ void scheduleDrain();
|
|
|
70567
70839
|
to: ["core", "core/NitroModules"]
|
|
70568
70840
|
}
|
|
70569
70841
|
};
|
|
70570
|
-
|
|
70842
|
+
sha256Hex4 = (data) => (0, import_node_crypto39.createHash)("sha256").update(data).digest("hex");
|
|
70571
70843
|
hex64 = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
70572
70844
|
sameHeaders = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
70573
70845
|
}
|
|
@@ -73422,6 +73694,21 @@ var init_swift_root_lock = __esm({
|
|
|
73422
73694
|
}
|
|
73423
73695
|
});
|
|
73424
73696
|
|
|
73697
|
+
// src/swift-sdk-image-recipe.ts
|
|
73698
|
+
var import_node_crypto43, SWIFT_SDK_IMAGE_VERSION, swiftSdkImageScope, SWIFT_SDK_IMAGE_RECIPE;
|
|
73699
|
+
var init_swift_sdk_image_recipe = __esm({
|
|
73700
|
+
"src/swift-sdk-image-recipe.ts"() {
|
|
73701
|
+
"use strict";
|
|
73702
|
+
import_node_crypto43 = require("node:crypto");
|
|
73703
|
+
init_wasm_optimize();
|
|
73704
|
+
SWIFT_SDK_IMAGE_VERSION = 13;
|
|
73705
|
+
swiftSdkImageScope = (scopedLookups) => scopedLookups ? "guest image scopes 9\n" : "unscoped constructor order 1\n";
|
|
73706
|
+
SWIFT_SDK_IMAGE_RECIPE = (0, import_node_crypto43.createHash)("sha256").update(`swift-sdk-image
|
|
73707
|
+
${SWIFT_SDK_IMAGE_VERSION}
|
|
73708
|
+
`).update(WASM_LOWER_IDENTITY).update(swiftSdkImageScope(false)).update(swiftSdkImageScope(true)).digest("hex").slice(0, 16);
|
|
73709
|
+
}
|
|
73710
|
+
});
|
|
73711
|
+
|
|
73425
73712
|
// src/swift-sdk-image-producer.ts
|
|
73426
73713
|
var swift_sdk_image_producer_exports = {};
|
|
73427
73714
|
__export(swift_sdk_image_producer_exports, {
|
|
@@ -73462,7 +73749,7 @@ function applySwiftSdkProducerEnvironment(environment) {
|
|
|
73462
73749
|
}
|
|
73463
73750
|
}
|
|
73464
73751
|
function writeSwiftSdkProducerResult(file, launchId, error) {
|
|
73465
|
-
const temporary = `${file}.${(0,
|
|
73752
|
+
const temporary = `${file}.${(0, import_node_crypto44.randomUUID)()}`;
|
|
73466
73753
|
(0, import_node_fs73.writeFileSync)(temporary, JSON.stringify({ launchId, error: error ?? null }));
|
|
73467
73754
|
(0, import_node_fs73.renameSync)(temporary, file);
|
|
73468
73755
|
}
|
|
@@ -73574,7 +73861,7 @@ async function produceSwiftSdkImage(input) {
|
|
|
73574
73861
|
}
|
|
73575
73862
|
}
|
|
73576
73863
|
const repo = import_node_path71.default.resolve(input.moduleRoot, "../..");
|
|
73577
|
-
const launchId = (0,
|
|
73864
|
+
const launchId = (0, import_node_crypto44.randomUUID)();
|
|
73578
73865
|
const directory3 = import_node_path71.default.join(root, launchId);
|
|
73579
73866
|
const requestFile = import_node_path71.default.join(directory3, "request.json");
|
|
73580
73867
|
const sessionFile2 = import_node_path71.default.join(directory3, "session");
|
|
@@ -73672,12 +73959,12 @@ async function produceSwiftSdkImage(input) {
|
|
|
73672
73959
|
await (0, import_promises10.setTimeout)(2e3, void 0, { signal: input.signal });
|
|
73673
73960
|
}
|
|
73674
73961
|
}
|
|
73675
|
-
var import_node_child_process38,
|
|
73962
|
+
var import_node_child_process38, import_node_crypto44, import_node_fs73, import_node_path71, import_promises10, import_node_util9, run4, environmentNames, launcher;
|
|
73676
73963
|
var init_swift_sdk_image_producer = __esm({
|
|
73677
73964
|
"src/swift-sdk-image-producer.ts"() {
|
|
73678
73965
|
"use strict";
|
|
73679
73966
|
import_node_child_process38 = require("node:child_process");
|
|
73680
|
-
|
|
73967
|
+
import_node_crypto44 = require("node:crypto");
|
|
73681
73968
|
import_node_fs73 = require("node:fs");
|
|
73682
73969
|
import_node_path71 = __toESM(require("node:path"), 1);
|
|
73683
73970
|
import_promises10 = require("node:timers/promises");
|
|
@@ -73717,7 +74004,6 @@ __export(swift_sdk_image_exports, {
|
|
|
73717
74004
|
SWIFT_SDK_APP_TABLE_BASE: () => SWIFT_SDK_APP_TABLE_BASE,
|
|
73718
74005
|
SWIFT_SDK_IMAGE_BUNDLE: () => SWIFT_SDK_IMAGE_BUNDLE,
|
|
73719
74006
|
SWIFT_SDK_IMAGE_FILES: () => SWIFT_SDK_IMAGE_FILES,
|
|
73720
|
-
SWIFT_SDK_IMAGE_VERSION: () => SWIFT_SDK_IMAGE_VERSION,
|
|
73721
74007
|
SWIFT_SDK_MEMORY_BASE: () => SWIFT_SDK_MEMORY_BASE,
|
|
73722
74008
|
SWIFT_SDK_PIECE_FIELDS: () => SWIFT_SDK_PIECE_FIELDS,
|
|
73723
74009
|
buildSwiftSdkImage: () => buildSwiftSdkImage,
|
|
@@ -73752,9 +74038,9 @@ function swiftSdkImageProducts(moduleRoot, frameworkImports2) {
|
|
|
73752
74038
|
function swiftSdkImageKey(moduleRoot, scopedLookups = false, products = []) {
|
|
73753
74039
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
73754
74040
|
const inputs2 = distribution ? swiftSdkDistributionInputs(distribution) : swiftModuleDigest(moduleRoot);
|
|
73755
|
-
return (0,
|
|
74041
|
+
return (0, import_node_crypto45.createHash)("sha256").update(`swift-sdk-image
|
|
73756
74042
|
${SWIFT_SDK_IMAGE_VERSION}
|
|
73757
|
-
`).update(WASM_LOWER_IDENTITY).update(KEEP_WASM_NAMES ? "\nnames\n" : "\n").update(scopedLookups
|
|
74043
|
+
`).update(WASM_LOWER_IDENTITY).update(KEEP_WASM_NAMES ? "\nnames\n" : "\n").update(swiftSdkImageScope(scopedLookups)).update(inputs2).update(products.length === 0 ? "" : `
|
|
73758
74044
|
products ${products.join(" ")}`).digest("hex").slice(0, 32);
|
|
73759
74045
|
}
|
|
73760
74046
|
function swiftSdkImageEntry(key2, scopedLookups) {
|
|
@@ -73843,7 +74129,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
73843
74129
|
stage
|
|
73844
74130
|
]);
|
|
73845
74131
|
const image = cached3(stage, key2);
|
|
73846
|
-
if (!image || (0,
|
|
74132
|
+
if (!image || (0, import_node_crypto45.createHash)("sha256").update((0, import_node_fs74.readFileSync)(image.image)).digest("hex") !== image.sha256)
|
|
73847
74133
|
throw new Error(`invalid published Swift SDK image ${key2}`);
|
|
73848
74134
|
(0, import_node_fs74.rmSync)(directory2, { recursive: true, force: true });
|
|
73849
74135
|
(0, import_node_fs74.renameSync)(stage, directory2);
|
|
@@ -74052,6 +74338,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
74052
74338
|
].map((name3) => `--export=${name3}`),
|
|
74053
74339
|
`@${import_node_path72.default.join(work, "exports.rsp")}`,
|
|
74054
74340
|
"--gc-sections",
|
|
74341
|
+
"--strip-debug",
|
|
74055
74342
|
// strings stay with their objects, so an app loads only the ones its pieces reference
|
|
74056
74343
|
"-O0"
|
|
74057
74344
|
];
|
|
@@ -74112,7 +74399,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
74112
74399
|
(0, import_node_fs74.writeFileSync)(import_node_path72.default.join(work, INTERFACE_FILE), JSON.stringify(sdkInterface));
|
|
74113
74400
|
(0, import_node_fs74.writeFileSync)(
|
|
74114
74401
|
import_node_path72.default.join(work, IMAGE_DIGEST),
|
|
74115
|
-
(0,
|
|
74402
|
+
typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(image).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(image).digest("hex")
|
|
74116
74403
|
);
|
|
74117
74404
|
if (swiftSdkImageKey(
|
|
74118
74405
|
moduleRoot,
|
|
@@ -74381,12 +74668,12 @@ function readSwiftSdkManifest(image) {
|
|
|
74381
74668
|
}));
|
|
74382
74669
|
return setBoundedCache(cachedSdkManifests, cacheKey, { manifest, block: block2, segments });
|
|
74383
74670
|
}
|
|
74384
|
-
var import_node_child_process39,
|
|
74671
|
+
var import_node_child_process39, import_node_crypto45, import_node_fs74, import_node_path72, import_node_util10, run5, SWIFT_SDK_APP_MEMORY_BASE, SWIFT_SDK_MEMORY_BASE, SWIFT_SDK_APP_TABLE_BASE, EMPTY_APP, IMAGE_TABLES, IMAGE_ENTRY, imageApp, IMAGE_FILE, IMAGE_DIGEST, swiftSdkImageFile, INTERFACE_FILE, MANIFEST_FILE, MANIFEST_DATA_FILE, SWIFT_SDK_IMAGE_FILES, SWIFT_SDK_IMAGE_BUNDLE, MAX_CACHED_SDK_IMAGES, cachedSdkInterfaces, cachedSdkManifestIndices, cachedSdkManifests, SWIFT_SDK_PIECE_FIELDS, MANIFEST_BLOCKS, isManifestBlock;
|
|
74385
74672
|
var init_swift_sdk_image = __esm({
|
|
74386
74673
|
"src/swift-sdk-image.ts"() {
|
|
74387
74674
|
"use strict";
|
|
74388
74675
|
import_node_child_process39 = require("node:child_process");
|
|
74389
|
-
|
|
74676
|
+
import_node_crypto45 = require("node:crypto");
|
|
74390
74677
|
import_node_fs74 = require("node:fs");
|
|
74391
74678
|
import_node_path72 = __toESM(require("node:path"), 1);
|
|
74392
74679
|
import_node_util10 = require("node:util");
|
|
@@ -74398,13 +74685,13 @@ var init_swift_sdk_image = __esm({
|
|
|
74398
74685
|
init_swift_root_lock();
|
|
74399
74686
|
init_swift_sdk_guest_lookups();
|
|
74400
74687
|
init_swift_sdk_image_map();
|
|
74688
|
+
init_swift_sdk_image_recipe();
|
|
74401
74689
|
init_swift_sdk_image_wasm();
|
|
74402
74690
|
init_swift_toolchain();
|
|
74403
74691
|
init_swift_wasm_prune();
|
|
74404
74692
|
init_swiftTargetContract();
|
|
74405
74693
|
init_wasm_optimize();
|
|
74406
74694
|
run5 = (0, import_node_util10.promisify)(import_node_child_process39.execFile);
|
|
74407
|
-
SWIFT_SDK_IMAGE_VERSION = 13;
|
|
74408
74695
|
SWIFT_SDK_APP_MEMORY_BASE = 8372224;
|
|
74409
74696
|
SWIFT_SDK_MEMORY_BASE = 128 * 1024 * 1024;
|
|
74410
74697
|
SWIFT_SDK_APP_TABLE_BASE = 524288;
|
|
@@ -74670,6 +74957,7 @@ __export(swift_sdk_app_module_exports, {
|
|
|
74670
74957
|
readSwiftSdkUsage: () => readSwiftSdkUsage,
|
|
74671
74958
|
selectSwiftSdkData: () => selectSwiftSdkData,
|
|
74672
74959
|
swiftAppModuleInputs: () => swiftAppModuleInputs,
|
|
74960
|
+
swiftAppModuleThunkSection: () => swiftAppModuleThunkSection,
|
|
74673
74961
|
swiftSdkProjectionSpans: () => swiftSdkProjectionSpans,
|
|
74674
74962
|
writeSwiftSdkAppLink: () => writeSwiftSdkAppLink
|
|
74675
74963
|
});
|
|
@@ -74721,9 +75009,12 @@ async function buildSwiftAppModule(options2) {
|
|
|
74721
75009
|
linkage: link.linkage,
|
|
74722
75010
|
usage
|
|
74723
75011
|
});
|
|
74724
|
-
(
|
|
75012
|
+
finishSwiftAppModuleFile(options2.output);
|
|
74725
75013
|
return binding;
|
|
74726
75014
|
}
|
|
75015
|
+
function swiftAppModuleThunkSection(lowered) {
|
|
75016
|
+
return [NATIVE_SDK_THUNK_SECTION, sdkImportThunks(lowered)];
|
|
75017
|
+
}
|
|
74727
75018
|
function finishSwiftAppModule(lowered) {
|
|
74728
75019
|
return writeWasmCustomSection(
|
|
74729
75020
|
lowered,
|
|
@@ -74731,6 +75022,73 @@ function finishSwiftAppModule(lowered) {
|
|
|
74731
75022
|
sdkImportThunks(lowered)
|
|
74732
75023
|
);
|
|
74733
75024
|
}
|
|
75025
|
+
function finishSwiftAppModuleFile(file) {
|
|
75026
|
+
const fd = (0, import_node_fs75.openSync)(file, "r");
|
|
75027
|
+
let prefixEnd = 8;
|
|
75028
|
+
let hasExistingThunk = false;
|
|
75029
|
+
let prefix;
|
|
75030
|
+
try {
|
|
75031
|
+
const total = (0, import_node_fs75.fstatSync)(fd).size;
|
|
75032
|
+
const probe2 = Buffer.allocUnsafe(16);
|
|
75033
|
+
let offset = 8;
|
|
75034
|
+
while (offset < total) {
|
|
75035
|
+
const read = (0, import_node_fs75.readSync)(fd, probe2, 0, Math.min(16, total - offset), offset);
|
|
75036
|
+
if (read < 2) break;
|
|
75037
|
+
const id = probe2[0];
|
|
75038
|
+
let size2 = 0;
|
|
75039
|
+
let shift = 0;
|
|
75040
|
+
let at = 1;
|
|
75041
|
+
for (; ; ) {
|
|
75042
|
+
const byte = probe2[at++];
|
|
75043
|
+
size2 += (byte & 127) * 2 ** shift;
|
|
75044
|
+
if (!(byte & 128)) break;
|
|
75045
|
+
shift += 7;
|
|
75046
|
+
}
|
|
75047
|
+
const start = offset + at;
|
|
75048
|
+
const next = start + size2;
|
|
75049
|
+
if (id === 1 || id === 2) prefixEnd = next;
|
|
75050
|
+
else if (id === 0) {
|
|
75051
|
+
const nameBuf = Buffer.allocUnsafe(Math.min(128, size2));
|
|
75052
|
+
const nRead = (0, import_node_fs75.readSync)(fd, nameBuf, 0, nameBuf.length, start);
|
|
75053
|
+
let nLen = 0;
|
|
75054
|
+
let nShift = 0;
|
|
75055
|
+
let nAt = 0;
|
|
75056
|
+
for (; ; ) {
|
|
75057
|
+
if (nAt >= nRead) break;
|
|
75058
|
+
const byte = nameBuf[nAt++];
|
|
75059
|
+
nLen += (byte & 127) * 2 ** nShift;
|
|
75060
|
+
if (!(byte & 128)) break;
|
|
75061
|
+
nShift += 7;
|
|
75062
|
+
}
|
|
75063
|
+
if (nAt + nLen <= nRead && nameBuf.toString("utf8", nAt, nAt + nLen) === NATIVE_SDK_THUNK_SECTION) {
|
|
75064
|
+
hasExistingThunk = true;
|
|
75065
|
+
break;
|
|
75066
|
+
}
|
|
75067
|
+
}
|
|
75068
|
+
offset = next;
|
|
75069
|
+
}
|
|
75070
|
+
if (!hasExistingThunk) {
|
|
75071
|
+
prefix = Buffer.allocUnsafe(prefixEnd);
|
|
75072
|
+
let filled = 0;
|
|
75073
|
+
while (filled < prefixEnd) {
|
|
75074
|
+
const n = (0, import_node_fs75.readSync)(fd, prefix, filled, prefixEnd - filled, filled);
|
|
75075
|
+
if (n <= 0) break;
|
|
75076
|
+
filled += n;
|
|
75077
|
+
}
|
|
75078
|
+
prefix = prefix.subarray(0, filled);
|
|
75079
|
+
}
|
|
75080
|
+
} finally {
|
|
75081
|
+
(0, import_node_fs75.closeSync)(fd);
|
|
75082
|
+
}
|
|
75083
|
+
if (hasExistingThunk || !prefix) {
|
|
75084
|
+
(0, import_node_fs75.writeFileSync)(file, finishSwiftAppModule((0, import_node_fs75.readFileSync)(file)));
|
|
75085
|
+
return;
|
|
75086
|
+
}
|
|
75087
|
+
const thunks = sdkImportThunks(prefix);
|
|
75088
|
+
const nameBytes = Buffer.from(encodedName2(NATIVE_SDK_THUNK_SECTION));
|
|
75089
|
+
const header = Buffer.from([0, ...uleb4(nameBytes.length + thunks.length)]);
|
|
75090
|
+
(0, import_node_fs75.appendFileSync)(file, Buffer.concat([header, nameBytes, thunks]));
|
|
75091
|
+
}
|
|
74734
75092
|
function swiftAppModuleInputs(tokens2, buildRoot, sdkLibraries) {
|
|
74735
75093
|
const owned = (token) => import_node_path73.default.resolve(token).startsWith(`${buildRoot}/`) && (!token.includes("/.peach-pruned-objs/") || token.endsWith("/swiftrt-patched.o"));
|
|
74736
75094
|
const inputs2 = [];
|
|
@@ -74945,6 +75303,7 @@ async function linkSwiftAppModule(options2) {
|
|
|
74945
75303
|
"--unresolved-symbols=ignore-all",
|
|
74946
75304
|
"--import-undefined",
|
|
74947
75305
|
"--emit-relocs",
|
|
75306
|
+
"--strip-debug",
|
|
74948
75307
|
"--gc-sections",
|
|
74949
75308
|
"--keep-section=target_features",
|
|
74950
75309
|
"--error-limit=0",
|
|
@@ -74967,7 +75326,16 @@ async function linkSwiftAppModule(options2) {
|
|
|
74967
75326
|
const skipPasses = options2.layoutMap ? ["duplicate-function-elimination"] : void 0;
|
|
74968
75327
|
const sdkTableEnd = sdk2.sdkInterface.layout.tableEnd;
|
|
74969
75328
|
const { loweringCache } = options2;
|
|
74970
|
-
const loweringKey = loweringCache && (
|
|
75329
|
+
const loweringKey = loweringCache && (typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(
|
|
75330
|
+
JSON.stringify([
|
|
75331
|
+
loweringCache.compilerDigest,
|
|
75332
|
+
optimize,
|
|
75333
|
+
skipPasses,
|
|
75334
|
+
sdkTableEnd,
|
|
75335
|
+
lazy,
|
|
75336
|
+
KEEP_WASM_NAMES
|
|
75337
|
+
])
|
|
75338
|
+
).update(bytes).digest("hex") : (0, import_node_crypto46.createHash)("sha256").update(
|
|
74971
75339
|
JSON.stringify([
|
|
74972
75340
|
loweringCache.compilerDigest,
|
|
74973
75341
|
optimize,
|
|
@@ -74976,7 +75344,7 @@ async function linkSwiftAppModule(options2) {
|
|
|
74976
75344
|
lazy,
|
|
74977
75345
|
KEEP_WASM_NAMES
|
|
74978
75346
|
])
|
|
74979
|
-
).update(bytes).digest("hex");
|
|
75347
|
+
).update(bytes).digest("hex"));
|
|
74980
75348
|
return {
|
|
74981
75349
|
linkage,
|
|
74982
75350
|
async lower() {
|
|
@@ -75586,7 +75954,8 @@ function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
|
|
|
75586
75954
|
bindSwiftAppModule(linkage, sdk2),
|
|
75587
75955
|
selectSwiftSdkData(sdk2, usage, linkage, projection)
|
|
75588
75956
|
]);
|
|
75589
|
-
|
|
75957
|
+
const sha2565 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto46.createHash)("sha256").update(bytes).digest("hex");
|
|
75958
|
+
return { bytes, sha256: sha2565 };
|
|
75590
75959
|
}
|
|
75591
75960
|
function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
|
|
75592
75961
|
const map2 = readWasmLinkMap(mapFile, false);
|
|
@@ -76132,12 +76501,12 @@ function partitionParent(section2) {
|
|
|
76132
76501
|
"__objc_class_refs"
|
|
76133
76502
|
].find((name3) => section2 === name3 || section2.startsWith(`${name3}.`));
|
|
76134
76503
|
}
|
|
76135
|
-
var import_node_child_process40,
|
|
76504
|
+
var import_node_child_process40, import_node_crypto46, import_node_fs75, import_node_path73, import_node_util11, import_node_zlib5, run6, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, uleb4, sleb2, encodedName2, SCANNED, RUN_GAP;
|
|
76136
76505
|
var init_swift_sdk_app_module = __esm({
|
|
76137
76506
|
"src/swift-sdk-app-module.ts"() {
|
|
76138
76507
|
"use strict";
|
|
76139
76508
|
import_node_child_process40 = require("node:child_process");
|
|
76140
|
-
|
|
76509
|
+
import_node_crypto46 = require("node:crypto");
|
|
76141
76510
|
import_node_fs75 = require("node:fs");
|
|
76142
76511
|
import_node_path73 = __toESM(require("node:path"), 1);
|
|
76143
76512
|
import_node_util11 = require("node:util");
|
|
@@ -76342,6 +76711,7 @@ async function compileGuestLink(options2) {
|
|
|
76342
76711
|
onSplitInputs: sdk2 ? (value) => {
|
|
76343
76712
|
splitInputs = value;
|
|
76344
76713
|
} : void 0,
|
|
76714
|
+
deferFinalLink: Boolean(sdk2),
|
|
76345
76715
|
onDyldRows: (rows) => {
|
|
76346
76716
|
lazyFunctions = rows.lazyFunctions;
|
|
76347
76717
|
dyldSymbols = rows.dyldSymbols;
|
|
@@ -76610,156 +76980,164 @@ async function compileGuestLink(options2) {
|
|
|
76610
76980
|
});
|
|
76611
76981
|
if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
|
|
76612
76982
|
if (sdk2) {
|
|
76613
|
-
|
|
76614
|
-
|
|
76615
|
-
|
|
76616
|
-
|
|
76617
|
-
|
|
76618
|
-
|
|
76619
|
-
|
|
76620
|
-
|
|
76621
|
-
|
|
76622
|
-
|
|
76623
|
-
|
|
76624
|
-
|
|
76625
|
-
|
|
76626
|
-
|
|
76627
|
-
|
|
76628
|
-
|
|
76629
|
-
|
|
76630
|
-
|
|
76631
|
-
const
|
|
76632
|
-
|
|
76633
|
-
|
|
76634
|
-
|
|
76635
|
-
|
|
76636
|
-
|
|
76637
|
-
|
|
76638
|
-
|
|
76639
|
-
|
|
76640
|
-
|
|
76641
|
-
|
|
76642
|
-
|
|
76643
|
-
|
|
76644
|
-
|
|
76645
|
-
let storage = reserved2;
|
|
76646
|
-
if (sdkSpans.length > 0) {
|
|
76647
|
-
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
76648
|
-
storage = reserveGuestProjectionStorage(
|
|
76649
|
-
storage.images,
|
|
76650
|
-
storage.capacities.map((capacity, index) => ({
|
|
76651
|
-
...capacity,
|
|
76652
|
-
regions: capacity.regions + sdkCounts[index] + 16
|
|
76653
|
-
}))
|
|
76654
|
-
);
|
|
76655
|
-
const projectionSource = import_node_path74.default.join(work, "projection.c");
|
|
76656
|
-
(0, import_node_fs76.writeFileSync)(projectionSource, storage.source);
|
|
76657
|
-
(0, import_node_child_process41.execFileSync)(
|
|
76658
|
-
import_node_path74.default.join(options2.toolchainBin, "clang"),
|
|
76659
|
-
[...clangOptions, "-c", projectionSource, "-o", projectionObject],
|
|
76660
|
-
{ stdio: "pipe" }
|
|
76661
|
-
);
|
|
76662
|
-
}
|
|
76663
|
-
let precomputedSymbols;
|
|
76664
|
-
if (splitInputs.appReferencedSymbols && splitInputs.appDefinedSymbols) {
|
|
76665
|
-
const referenced = new Set(splitInputs.appReferencedSymbols);
|
|
76666
|
-
const defined = new Set(splitInputs.appDefinedSymbols);
|
|
76667
|
-
const projSyms = guestWasmSymbols((0, import_node_fs76.readFileSync)(projectionObject));
|
|
76668
|
-
for (const name3 of projSyms.undefined) referenced.add(name3);
|
|
76669
|
-
for (const name3 of projSyms.defined) defined.add(name3);
|
|
76670
|
-
precomputedSymbols = { referenced, defined };
|
|
76671
|
-
}
|
|
76672
|
-
for (; ; ) {
|
|
76673
|
-
const link = await linkSwiftAppModule2({
|
|
76674
|
-
objects: [...owners.keys()],
|
|
76675
|
-
lazyFunctions: splitInputs.lazyFunctions,
|
|
76676
|
-
toolchainBin: options2.toolchainBin,
|
|
76677
|
-
sdk: sdk2,
|
|
76678
|
-
work,
|
|
76679
|
-
output: options2.optimized,
|
|
76680
|
-
optimize: options2.optimize,
|
|
76681
|
-
layoutMap,
|
|
76682
|
-
project: project2,
|
|
76683
|
-
precomputedSymbols,
|
|
76684
|
-
loweringCache: project2 ? void 0 : {
|
|
76685
|
-
file: import_node_path74.default.join(
|
|
76686
|
-
options2.buildDirectory,
|
|
76687
|
-
".build",
|
|
76688
|
-
"peach-app-module-lowered.wasm"
|
|
76689
|
-
),
|
|
76690
|
-
compilerDigest: options2.compilerDigest
|
|
76691
|
-
}
|
|
76692
|
-
});
|
|
76693
|
-
const map3 = (0, import_node_fs76.readFileSync)(
|
|
76694
|
-
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
76695
|
-
"utf8"
|
|
76983
|
+
try {
|
|
76984
|
+
if (!splitInputs) throw new Error("guest link did not select shared SDK inputs");
|
|
76985
|
+
const {
|
|
76986
|
+
createSwiftSdkBinding: createSwiftSdkBinding2,
|
|
76987
|
+
linkSwiftAppModule: linkSwiftAppModule2,
|
|
76988
|
+
readSwiftSdkUsage: readSwiftSdkUsage2,
|
|
76989
|
+
swiftAppModuleThunkSection: swiftAppModuleThunkSection2,
|
|
76990
|
+
swiftSdkProjectionSpans: swiftSdkProjectionSpans2
|
|
76991
|
+
} = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
76992
|
+
const project2 = options2.project;
|
|
76993
|
+
const work = project2 ? (0, import_node_fs76.mkdtempSync)(import_node_path74.default.join(directory2, "app-module-")) : import_node_path74.default.join(directory2, "app-module");
|
|
76994
|
+
if (project2) (0, import_node_fs76.chownSync)(work, project2.uid, project2.gid);
|
|
76995
|
+
else (0, import_node_fs76.mkdirSync)(work, { recursive: true });
|
|
76996
|
+
const layoutMap = import_node_path74.default.join(work, "app.map");
|
|
76997
|
+
let appProjectionObject = projectionObject;
|
|
76998
|
+
const owners = new Map(splitInputs.appObjects).set(appProjectionObject, 0);
|
|
76999
|
+
const sdkObjectKeys = /* @__PURE__ */ new Map();
|
|
77000
|
+
const sdkObjectImages = /* @__PURE__ */ new Map();
|
|
77001
|
+
const sdkProductImages = new Map(prepared?.sdkProducts.images);
|
|
77002
|
+
for (const [file, { image, product, identity: identity2 }] of splitInputs.sdkObjects) {
|
|
77003
|
+
const key2 = sdkGuestObjectKey(identity2);
|
|
77004
|
+
sdkObjectKeys.set(file, key2);
|
|
77005
|
+
sdkObjectImages.set(key2, image);
|
|
77006
|
+
const priorImage = sdkProductImages.get(product);
|
|
77007
|
+
if (priorImage !== void 0 && priorImage !== image)
|
|
77008
|
+
throw new Error(`SDK product ${product} has several guest images`);
|
|
77009
|
+
sdkProductImages.set(product, image);
|
|
77010
|
+
}
|
|
77011
|
+
const linkedModule = import_node_path74.default.join(work, "app.wasm");
|
|
77012
|
+
const sdkSpans = swiftSdkProjectionSpans2(
|
|
77013
|
+
sdk2,
|
|
77014
|
+
(object9, product) => sdkObjectImages.get(object9) ?? sdkProductImages.get(product)
|
|
76696
77015
|
);
|
|
76697
|
-
const
|
|
76698
|
-
const bindingRows = /* @__PURE__ */ new Map();
|
|
76699
|
-
const data = [];
|
|
76700
|
-
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
76701
|
-
const address = link.linkage.data[at];
|
|
76702
|
-
const size2 = link.linkage.data[at + 1];
|
|
76703
|
-
const value = link.linkage.data[at + 2];
|
|
76704
|
-
if (values && address >= values.address && address < values.address + values.length) {
|
|
76705
|
-
if (size2 !== 8 || (address - values.address) % 8)
|
|
76706
|
-
throw new Error("sdk binding splits a dyld value");
|
|
76707
|
-
bindingRows.set((address - values.address) / 8, value);
|
|
76708
|
-
} else data.push(address, size2, value);
|
|
76709
|
-
}
|
|
76710
|
-
const linked = (0, import_node_fs76.readFileSync)(
|
|
76711
|
-
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
76712
|
-
);
|
|
76713
|
-
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
76714
|
-
...guestLinkedSpans(map3, linked, linked, owners, splitInputs.appSections, true),
|
|
76715
|
-
...sdkSpans
|
|
76716
|
-
]);
|
|
76717
|
-
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
76718
|
-
storage = reserveGuestProjectionStorage(
|
|
76719
|
-
storage.images,
|
|
76720
|
-
storage.capacities.map((capacity, index) => {
|
|
76721
|
-
const count = required[index];
|
|
76722
|
-
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
76723
|
-
})
|
|
76724
|
-
);
|
|
77016
|
+
const compileAppProjection = (source) => {
|
|
76725
77017
|
const projectionSource = import_node_path74.default.join(work, "projection.c");
|
|
76726
|
-
|
|
77018
|
+
const nextObject = import_node_path74.default.join(work, "projection.o");
|
|
77019
|
+
(0, import_node_fs76.writeFileSync)(projectionSource, source);
|
|
76727
77020
|
(0, import_node_child_process41.execFileSync)(
|
|
76728
77021
|
import_node_path74.default.join(options2.toolchainBin, "clang"),
|
|
76729
|
-
[...clangOptions, "-c", projectionSource, "-o",
|
|
77022
|
+
[...clangOptions, "-c", projectionSource, "-o", nextObject],
|
|
76730
77023
|
{ stdio: "pipe" }
|
|
76731
77024
|
);
|
|
76732
|
-
|
|
77025
|
+
if (nextObject !== appProjectionObject) {
|
|
77026
|
+
owners.delete(appProjectionObject);
|
|
77027
|
+
appProjectionObject = nextObject;
|
|
77028
|
+
owners.set(appProjectionObject, 0);
|
|
77029
|
+
}
|
|
77030
|
+
};
|
|
77031
|
+
let storage = reserved2;
|
|
77032
|
+
if (sdkSpans.length > 0) {
|
|
77033
|
+
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
77034
|
+
storage = reserveGuestProjectionStorage(
|
|
77035
|
+
storage.images,
|
|
77036
|
+
storage.capacities.map((capacity, index) => ({
|
|
77037
|
+
...capacity,
|
|
77038
|
+
regions: capacity.regions + sdkCounts[index] + 16
|
|
77039
|
+
}))
|
|
77040
|
+
);
|
|
77041
|
+
compileAppProjection(storage.source);
|
|
76733
77042
|
}
|
|
76734
|
-
|
|
76735
|
-
|
|
76736
|
-
|
|
76737
|
-
|
|
76738
|
-
|
|
76739
|
-
|
|
76740
|
-
|
|
76741
|
-
|
|
77043
|
+
let precomputedSymbols;
|
|
77044
|
+
if (splitInputs.appReferencedSymbols && splitInputs.appDefinedSymbols) {
|
|
77045
|
+
const referenced = new Set(splitInputs.appReferencedSymbols);
|
|
77046
|
+
const defined = new Set(splitInputs.appDefinedSymbols);
|
|
77047
|
+
const projSyms = guestWasmSymbols((0, import_node_fs76.readFileSync)(appProjectionObject));
|
|
77048
|
+
for (const name3 of projSyms.undefined) referenced.add(name3);
|
|
77049
|
+
for (const name3 of projSyms.defined) defined.add(name3);
|
|
77050
|
+
precomputedSymbols = { referenced, defined };
|
|
77051
|
+
}
|
|
77052
|
+
for (; ; ) {
|
|
77053
|
+
const link = await linkSwiftAppModule2({
|
|
77054
|
+
objects: [...owners.keys()],
|
|
77055
|
+
lazyFunctions: splitInputs.lazyFunctions,
|
|
77056
|
+
toolchainBin: options2.toolchainBin,
|
|
77057
|
+
sdk: sdk2,
|
|
77058
|
+
work,
|
|
77059
|
+
output: options2.optimized,
|
|
77060
|
+
optimize: options2.optimize,
|
|
77061
|
+
layoutMap,
|
|
77062
|
+
project: project2,
|
|
77063
|
+
precomputedSymbols,
|
|
77064
|
+
loweringCache: project2 ? void 0 : {
|
|
77065
|
+
file: import_node_path74.default.join(
|
|
77066
|
+
options2.buildDirectory,
|
|
77067
|
+
".build",
|
|
77068
|
+
"peach-app-module-lowered.wasm"
|
|
77069
|
+
),
|
|
77070
|
+
compilerDigest: options2.compilerDigest
|
|
77071
|
+
}
|
|
76742
77072
|
});
|
|
76743
|
-
|
|
77073
|
+
const map3 = (0, import_node_fs76.readFileSync)(
|
|
77074
|
+
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
77075
|
+
"utf8"
|
|
77076
|
+
);
|
|
77077
|
+
const values = guestDyldValueRange(map3);
|
|
77078
|
+
const bindingRows = /* @__PURE__ */ new Map();
|
|
77079
|
+
const data = [];
|
|
77080
|
+
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
77081
|
+
const address = link.linkage.data[at];
|
|
77082
|
+
const size2 = link.linkage.data[at + 1];
|
|
77083
|
+
const value = link.linkage.data[at + 2];
|
|
77084
|
+
if (values && address >= values.address && address < values.address + values.length) {
|
|
77085
|
+
if (size2 !== 8 || (address - values.address) % 8)
|
|
77086
|
+
throw new Error("sdk binding splits a dyld value");
|
|
77087
|
+
bindingRows.set((address - values.address) / 8, value);
|
|
77088
|
+
} else data.push(address, size2, value);
|
|
77089
|
+
}
|
|
77090
|
+
const linked = (0, import_node_fs76.readFileSync)(
|
|
77091
|
+
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
77092
|
+
);
|
|
77093
|
+
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
77094
|
+
...guestLinkedSpans(map3, linked, linked, owners, splitInputs.appSections, true),
|
|
77095
|
+
...sdkSpans
|
|
77096
|
+
]);
|
|
77097
|
+
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
77098
|
+
storage = reserveGuestProjectionStorage(
|
|
77099
|
+
storage.images,
|
|
77100
|
+
storage.capacities.map((capacity, index) => {
|
|
77101
|
+
const count = required[index];
|
|
77102
|
+
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
77103
|
+
})
|
|
77104
|
+
);
|
|
77105
|
+
compileAppProjection(storage.source);
|
|
77106
|
+
continue;
|
|
77107
|
+
}
|
|
77108
|
+
options2.onStage("lowering the app image");
|
|
77109
|
+
const lowerPromise = link.lower();
|
|
77110
|
+
await new Promise((resolve16) => setImmediate(resolve16));
|
|
77111
|
+
let binding;
|
|
77112
|
+
try {
|
|
77113
|
+
if (result.finalLinkDone) await result.finalLinkDone;
|
|
77114
|
+
const usage = readSwiftSdkUsage2(result.mapPath, options2.output, sdkObjectKeys);
|
|
77115
|
+
binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk2, usage);
|
|
77116
|
+
} catch (error) {
|
|
77117
|
+
await Promise.allSettled([lowerPromise]);
|
|
77118
|
+
throw error;
|
|
77119
|
+
}
|
|
77120
|
+
await lowerPromise;
|
|
77121
|
+
const finalized = finalizeGuestProjectionStorage({
|
|
77122
|
+
map: map3,
|
|
77123
|
+
linked,
|
|
77124
|
+
optimized: (0, import_node_fs76.readFileSync)(options2.optimized),
|
|
77125
|
+
owners,
|
|
77126
|
+
sectionOwners: splitInputs.appSections,
|
|
77127
|
+
projectionObject: appProjectionObject,
|
|
77128
|
+
reserved: storage,
|
|
77129
|
+
sdkSpans
|
|
77130
|
+
});
|
|
77131
|
+
(0, import_node_fs76.writeFileSync)(
|
|
77132
|
+
options2.optimized,
|
|
77133
|
+
moveGuestDyldTable(map3, finalized.wasm, splitInputs.dyldSymbols, bindingRows, [
|
|
77134
|
+
swiftAppModuleThunkSection2(finalized.wasm)
|
|
77135
|
+
])
|
|
77136
|
+
);
|
|
77137
|
+
return binding;
|
|
76744
77138
|
}
|
|
76745
|
-
|
|
76746
|
-
|
|
76747
|
-
map: map3,
|
|
76748
|
-
linked,
|
|
76749
|
-
optimized: (0, import_node_fs76.readFileSync)(options2.optimized),
|
|
76750
|
-
owners,
|
|
76751
|
-
sectionOwners: splitInputs.appSections,
|
|
76752
|
-
projectionObject,
|
|
76753
|
-
reserved: storage,
|
|
76754
|
-
sdkSpans
|
|
76755
|
-
});
|
|
76756
|
-
(0, import_node_fs76.writeFileSync)(
|
|
76757
|
-
options2.optimized,
|
|
76758
|
-
finishSwiftAppModule2(
|
|
76759
|
-
moveGuestDyldTable(map3, finalized.wasm, splitInputs.dyldSymbols, bindingRows)
|
|
76760
|
-
)
|
|
76761
|
-
);
|
|
76762
|
-
return binding;
|
|
77139
|
+
} finally {
|
|
77140
|
+
if (result.finalLinkDone) await Promise.allSettled([result.finalLinkDone]);
|
|
76763
77141
|
}
|
|
76764
77142
|
}
|
|
76765
77143
|
options2.onStage("lowering the app image");
|
|
@@ -76834,7 +77212,7 @@ function compilerCheckpoint(root, recipe2, args, header) {
|
|
|
76834
77212
|
}
|
|
76835
77213
|
if (!objects.length) return;
|
|
76836
77214
|
const outputs = [module2, header, map2[""].dependencies, ...objects];
|
|
76837
|
-
const digest3 = (0,
|
|
77215
|
+
const digest3 = (0, import_node_crypto47.createHash)("sha256").update(recipe2).update(JSON.stringify(args)).update(mapText);
|
|
76838
77216
|
for (const flag of args) {
|
|
76839
77217
|
if (!flag.startsWith("@")) continue;
|
|
76840
77218
|
const response = flag.slice(1);
|
|
@@ -76928,11 +77306,11 @@ async function withSwiftHeaderCompiler(root, toolchainBin, recipe2, producers, b
|
|
|
76928
77306
|
(0, import_node_fs77.rmSync)(directory2, { recursive: true, force: true });
|
|
76929
77307
|
}
|
|
76930
77308
|
}
|
|
76931
|
-
var
|
|
77309
|
+
var import_node_crypto47, import_node_fs77, import_node_http2, import_node_path75, SWIFT_HEADER_COMPILER_WRAPPER, argument, client;
|
|
76932
77310
|
var init_swift_header_compiler = __esm({
|
|
76933
77311
|
"src/swift-header-compiler.ts"() {
|
|
76934
77312
|
"use strict";
|
|
76935
|
-
|
|
77313
|
+
import_node_crypto47 = require("node:crypto");
|
|
76936
77314
|
import_node_fs77 = require("node:fs");
|
|
76937
77315
|
import_node_http2 = require("node:http");
|
|
76938
77316
|
import_node_path75 = __toESM(require("node:path"), 1);
|
|
@@ -77196,7 +77574,7 @@ var init_icuData = __esm({
|
|
|
77196
77574
|
|
|
77197
77575
|
// src/swift-icu.ts
|
|
77198
77576
|
async function cachedBrotli(bytes, quality, cacheKey) {
|
|
77199
|
-
const key2 = cacheKey && /^[a-f0-9]{64}$/.test(cacheKey) ? cacheKey : (0,
|
|
77577
|
+
const key2 = cacheKey && /^[a-f0-9]{64}$/.test(cacheKey) ? cacheKey : (0, import_node_crypto48.createHash)("sha256").update(bytes).digest("hex");
|
|
77200
77578
|
const cacheId = `${quality}:${key2}`;
|
|
77201
77579
|
const cached5 = brotliMemoryCache.get(cacheId);
|
|
77202
77580
|
if (cached5) return cached5;
|
|
@@ -77214,7 +77592,7 @@ async function cachedBrotli(bytes, quality, cacheKey) {
|
|
|
77214
77592
|
});
|
|
77215
77593
|
try {
|
|
77216
77594
|
await (0, import_promises11.mkdir)(dir, { recursive: true });
|
|
77217
|
-
const tmp = `${file}.${(0,
|
|
77595
|
+
const tmp = `${file}.${(0, import_node_crypto48.randomUUID)()}.tmp`;
|
|
77218
77596
|
await (0, import_promises11.writeFile)(tmp, compressed);
|
|
77219
77597
|
await (0, import_promises11.rename)(tmp, file);
|
|
77220
77598
|
} catch {
|
|
@@ -77252,7 +77630,7 @@ function swiftIcuAsset(toolchainBin, sdk2) {
|
|
|
77252
77630
|
JSON.stringify([toolchainBin, sdk2, swiftSdkOptions()]),
|
|
77253
77631
|
async () => {
|
|
77254
77632
|
const zipped = await deflate(await swiftIcuData(toolchainBin, sdk2));
|
|
77255
|
-
return { sha256: (0,
|
|
77633
|
+
return { sha256: (0, import_node_crypto48.createHash)("sha256").update(zipped).digest("hex"), gzip: zipped };
|
|
77256
77634
|
}
|
|
77257
77635
|
);
|
|
77258
77636
|
}
|
|
@@ -77354,7 +77732,7 @@ function swiftIcuPacked(icu) {
|
|
|
77354
77732
|
)
|
|
77355
77733
|
);
|
|
77356
77734
|
await (0, import_promises11.mkdir)(import_node_path77.default.dirname(file), { recursive: true });
|
|
77357
|
-
const tmp = `${file}.${(0,
|
|
77735
|
+
const tmp = `${file}.${(0, import_node_crypto48.randomUUID)()}.tmp`;
|
|
77358
77736
|
await (0, import_promises11.writeFile)(tmp, packed);
|
|
77359
77737
|
await (0, import_promises11.rename)(tmp, file);
|
|
77360
77738
|
return packed;
|
|
@@ -77367,12 +77745,12 @@ async function swiftIcuBundleAsset(icu) {
|
|
|
77367
77745
|
contentType: "application/octet-stream"
|
|
77368
77746
|
};
|
|
77369
77747
|
}
|
|
77370
|
-
var import_node_child_process42,
|
|
77748
|
+
var import_node_child_process42, import_node_crypto48, import_node_fs78, import_promises11, import_node_os16, import_node_path77, import_node_util12, import_node_zlib6, run7, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, brotliMemoryCache, packedFiles;
|
|
77371
77749
|
var init_swift_icu = __esm({
|
|
77372
77750
|
"src/swift-icu.ts"() {
|
|
77373
77751
|
"use strict";
|
|
77374
77752
|
import_node_child_process42 = require("node:child_process");
|
|
77375
|
-
|
|
77753
|
+
import_node_crypto48 = require("node:crypto");
|
|
77376
77754
|
import_node_fs78 = require("node:fs");
|
|
77377
77755
|
import_promises11 = require("node:fs/promises");
|
|
77378
77756
|
import_node_os16 = __toESM(require("node:os"), 1);
|
|
@@ -77575,7 +77953,7 @@ function swiftObjCPrebuiltCompiler(clang, root, sysroot, distribution, targets,
|
|
|
77575
77953
|
);
|
|
77576
77954
|
if (!modules.length) return [];
|
|
77577
77955
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
77578
|
-
const compiler = (0,
|
|
77956
|
+
const compiler = (0, import_node_crypto49.createHash)("sha256").update(import_node_fs79.default.readFileSync(clang)).digest("hex");
|
|
77579
77957
|
return [
|
|
77580
77958
|
'case "$module" in',
|
|
77581
77959
|
` ${modules.join("|")}) exec ${[
|
|
@@ -77593,12 +77971,12 @@ function swiftObjCPrebuiltCompiler(clang, root, sysroot, distribution, targets,
|
|
|
77593
77971
|
"esac"
|
|
77594
77972
|
];
|
|
77595
77973
|
}
|
|
77596
|
-
var import_node_child_process43,
|
|
77974
|
+
var import_node_child_process43, import_node_crypto49, import_node_fs79, import_node_path78, quote2;
|
|
77597
77975
|
var init_swift_objc_prebuilt = __esm({
|
|
77598
77976
|
"src/swift-objc-prebuilt.ts"() {
|
|
77599
77977
|
"use strict";
|
|
77600
77978
|
import_node_child_process43 = require("node:child_process");
|
|
77601
|
-
|
|
77979
|
+
import_node_crypto49 = require("node:crypto");
|
|
77602
77980
|
import_node_fs79 = __toESM(require("node:fs"), 1);
|
|
77603
77981
|
import_node_path78 = __toESM(require("node:path"), 1);
|
|
77604
77982
|
init_internal_child_contract();
|
|
@@ -77951,7 +78329,7 @@ function swiftPackagePrebuiltEntries(input, moduleRoot, toolchainBin) {
|
|
|
77951
78329
|
([file, source]) => !/\.(?:swift|c|h|inc|modulemap)$/.test(file) || file.endsWith(".swift") && swiftImportNames(source, available2).some((name4) => !available2.has(name4))
|
|
77952
78330
|
))
|
|
77953
78331
|
return [];
|
|
77954
|
-
const hash = (0,
|
|
78332
|
+
const hash = (0, import_node_crypto50.createHash)("sha256");
|
|
77955
78333
|
for (const entry of files2.sort(
|
|
77956
78334
|
([left], [right]) => left < right ? -1 : left > right ? 1 : 0
|
|
77957
78335
|
))
|
|
@@ -78018,11 +78396,11 @@ function useSwiftPackagePrebuilts(input, moduleRoot, toolchainBin) {
|
|
|
78018
78396
|
}
|
|
78019
78397
|
return resolved;
|
|
78020
78398
|
}
|
|
78021
|
-
var
|
|
78399
|
+
var import_node_crypto50, import_node_fs82, import_node_path82, PACKAGE_RECIPE;
|
|
78022
78400
|
var init_swift_package_prebuilt = __esm({
|
|
78023
78401
|
"src/swift-package-prebuilt.ts"() {
|
|
78024
78402
|
"use strict";
|
|
78025
|
-
|
|
78403
|
+
import_node_crypto50 = require("node:crypto");
|
|
78026
78404
|
import_node_fs82 = __toESM(require("node:fs"), 1);
|
|
78027
78405
|
import_node_path82 = __toESM(require("node:path"), 1);
|
|
78028
78406
|
init_native_prebuilt();
|
|
@@ -78182,7 +78560,7 @@ function swiftObjCSelectorOptions(moduleRoot) {
|
|
|
78182
78560
|
`;
|
|
78183
78561
|
if (!(0, import_node_fs83.existsSync)(map2) || (0, import_node_fs83.readFileSync)(map2, "utf8") !== content) {
|
|
78184
78562
|
(0, import_node_fs83.mkdirSync)(import_node_path83.default.dirname(map2), { recursive: true });
|
|
78185
|
-
const partial = `${map2}.${(0,
|
|
78563
|
+
const partial = `${map2}.${(0, import_node_crypto51.randomUUID)()}`;
|
|
78186
78564
|
(0, import_node_fs83.writeFileSync)(partial, content);
|
|
78187
78565
|
(0, import_node_fs83.renameSync)(partial, map2);
|
|
78188
78566
|
}
|
|
@@ -78210,7 +78588,7 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin, release, signal, lea
|
|
|
78210
78588
|
return { libraries, executables };
|
|
78211
78589
|
}
|
|
78212
78590
|
function swiftProjectBuildKey(moduleRoot, release) {
|
|
78213
|
-
return (0,
|
|
78591
|
+
return (0, import_node_crypto51.createHash)("sha256").update(`swift-framework/v2\0${release}\0${swiftModuleSdk(moduleRoot).wasmSdkId}`).update(swiftModuleDigest(moduleRoot)).digest("hex").slice(0, 32);
|
|
78214
78592
|
}
|
|
78215
78593
|
function sameStringList(left, right) {
|
|
78216
78594
|
if (left === right) return true;
|
|
@@ -78458,7 +78836,7 @@ function distributionClangModuleOptions(root, modules) {
|
|
|
78458
78836
|
function providedModulesPath(root, modules, excluded) {
|
|
78459
78837
|
if (!excluded || excluded.size === 0) return modules;
|
|
78460
78838
|
const entries2 = (0, import_node_fs83.readdirSync)(modules).filter((entry) => !excluded.has(entry.replace(/\..*$/, ""))).sort();
|
|
78461
|
-
const key2 = (0,
|
|
78839
|
+
const key2 = (0, import_node_crypto51.createHash)("sha256").update(JSON.stringify([modules, entries2])).update([...excluded].sort().join("\0")).digest("hex").slice(0, 16);
|
|
78462
78840
|
const directory2 = import_node_path83.default.join(root, `.peach-modules-${key2}`);
|
|
78463
78841
|
const complete = import_node_path83.default.join(directory2, ".complete");
|
|
78464
78842
|
if (!(0, import_node_fs83.existsSync)(complete)) {
|
|
@@ -78540,10 +78918,10 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
78540
78918
|
function sha256Digest(value) {
|
|
78541
78919
|
if (typeof Bun !== "undefined")
|
|
78542
78920
|
return new Bun.CryptoHasher("sha256").update(value).digest();
|
|
78543
|
-
return (0,
|
|
78921
|
+
return (0, import_node_crypto51.createHash)("sha256").update(value).digest();
|
|
78544
78922
|
}
|
|
78545
78923
|
function swiftCompileInputHash(input, release) {
|
|
78546
|
-
const hash = (0,
|
|
78924
|
+
const hash = (0, import_node_crypto51.createHash)("sha256");
|
|
78547
78925
|
hash.update(`swift-compile
|
|
78548
78926
|
${release}
|
|
78549
78927
|
`);
|
|
@@ -78750,7 +79128,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
78750
79128
|
].join("\n") + "\n";
|
|
78751
79129
|
distributionLinkPath = distributionLink.path.replace(
|
|
78752
79130
|
/\.rsp$/,
|
|
78753
|
-
`-${(0,
|
|
79131
|
+
`-${(0, import_node_crypto51.createHash)("sha256").update(list2).digest("hex").slice(0, 12)}.rsp`
|
|
78754
79132
|
);
|
|
78755
79133
|
distributionLink.files.set(distributionLinkPath, list2);
|
|
78756
79134
|
}
|
|
@@ -78771,7 +79149,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
78771
79149
|
const endRun = () => {
|
|
78772
79150
|
if (run18.length >= MODULE_MAP_RESPONSE_FILE_RUN) {
|
|
78773
79151
|
const lines = run18.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
78774
|
-
const digest4 = (0,
|
|
79152
|
+
const digest4 = (0, import_node_crypto51.createHash)("sha256").update(lines).digest("hex");
|
|
78775
79153
|
const file2 = import_node_path83.default.join(args.root, ".peach-clang-arguments", `${digest4}.rsp`);
|
|
78776
79154
|
args.files.set(file2, lines);
|
|
78777
79155
|
flags.push(`@${file2}`);
|
|
@@ -78795,7 +79173,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
78795
79173
|
}
|
|
78796
79174
|
endRun();
|
|
78797
79175
|
const content = JSON.stringify(flags);
|
|
78798
|
-
const digest3 = (0,
|
|
79176
|
+
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(content).digest("hex");
|
|
78799
79177
|
const file = import_node_path83.default.join(args.root, ".peach-manifest-arguments", `${digest3}.json`);
|
|
78800
79178
|
args.files.set(file, content);
|
|
78801
79179
|
return `peachCompilerArguments(${JSON.stringify(file)})`;
|
|
@@ -78807,7 +79185,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
78807
79185
|
const macros = compactSwiftClangDefines(swiftClangSearchArguments(flags));
|
|
78808
79186
|
const compact = args.coalescibleOverlays ? compactSwiftClangOverlays(macros, args.coalescibleOverlays) : macros;
|
|
78809
79187
|
const content = compact.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
78810
|
-
const digest3 = (0,
|
|
79188
|
+
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(content).digest("hex");
|
|
78811
79189
|
const file = import_node_path83.default.join(args.root, ".peach-swift-arguments", `${digest3}.rsp`);
|
|
78812
79190
|
args.files.set(file, content);
|
|
78813
79191
|
return JSON.stringify([`@${file}`]);
|
|
@@ -80396,7 +80774,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
80396
80774
|
)
|
|
80397
80775
|
];
|
|
80398
80776
|
const moduleFlag = perFile.some((flag) => flag.startsWith("-fmodule-name=")) ? [] : [`-fmodule-name=${swiftTargetModuleName(target.name)}`];
|
|
80399
|
-
const identity2 = (0,
|
|
80777
|
+
const identity2 = (0, import_node_crypto51.createHash)("sha256").update(
|
|
80400
80778
|
JSON.stringify([
|
|
80401
80779
|
cxx,
|
|
80402
80780
|
quoteDirs,
|
|
@@ -80759,7 +81137,7 @@ module ${moduleName2}.Swift {
|
|
|
80759
81137
|
])
|
|
80760
81138
|
(0, import_node_fs83.rmSync)(cache, { recursive: true, force: true });
|
|
80761
81139
|
files2.set(frameworkSearchRecord, frameworkSearch);
|
|
80762
|
-
const modulePlan = (0,
|
|
81140
|
+
const modulePlan = (0, import_node_crypto51.createHash)("sha256").update(
|
|
80763
81141
|
swiftModuleInputFiles(moduleRoot).join("\n")
|
|
80764
81142
|
);
|
|
80765
81143
|
if (!distribution) {
|
|
@@ -80768,7 +81146,7 @@ module ${moduleName2}.Swift {
|
|
|
80768
81146
|
modulePlan.update(
|
|
80769
81147
|
Object.keys(input.files).filter((file) => file.endsWith(".swift")).sort().join("\n")
|
|
80770
81148
|
);
|
|
80771
|
-
const resourcePlan = (0,
|
|
81149
|
+
const resourcePlan = (0, import_node_crypto51.createHash)("sha256").update(
|
|
80772
81150
|
JSON.stringify(
|
|
80773
81151
|
resourceTargets.filter((target) => target.resources).map((target) => [
|
|
80774
81152
|
target.name,
|
|
@@ -81076,7 +81454,7 @@ ${entry}`);
|
|
|
81076
81454
|
);
|
|
81077
81455
|
for (const [target, data] of Object.entries(input.libraries ?? {})) {
|
|
81078
81456
|
const bytes = Buffer.from(data, "base64");
|
|
81079
|
-
const digest3 = (0,
|
|
81457
|
+
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(bytes).digest("hex");
|
|
81080
81458
|
if (input.binaryModules?.[target] && packageTargets.has(target)) {
|
|
81081
81459
|
const objects = import_node_path83.default.join(
|
|
81082
81460
|
layout2.root,
|
|
@@ -81728,7 +82106,7 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
81728
82106
|
return null;
|
|
81729
82107
|
const bytes = (0, import_node_fs83.readFileSync)(import_node_path83.default.join(directory2, "app.wasm"));
|
|
81730
82108
|
const gzip2 = (0, import_node_fs83.readFileSync)(import_node_path83.default.join(directory2, "icu.gz"));
|
|
81731
|
-
if ((0,
|
|
82109
|
+
if ((0, import_node_crypto51.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto51.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
81732
82110
|
return null;
|
|
81733
82111
|
let sdk2;
|
|
81734
82112
|
if ("sdk" in receipt) {
|
|
@@ -81736,7 +82114,7 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
81736
82114
|
if (!isRecord(image) || typeof image.key !== "string" || typeof image.sha256 !== "string" || typeof image.binding !== "string")
|
|
81737
82115
|
return null;
|
|
81738
82116
|
const binding = (0, import_node_fs83.readFileSync)(import_node_path83.default.join(directory2, "sdk-binding.bin"));
|
|
81739
|
-
if ((0,
|
|
82117
|
+
if ((0, import_node_crypto51.createHash)("sha256").update(binding).digest("hex") !== image.binding)
|
|
81740
82118
|
return null;
|
|
81741
82119
|
sdk2 = {
|
|
81742
82120
|
key: image.key,
|
|
@@ -81764,7 +82142,7 @@ function saveCompiledArtifact(root, artifact) {
|
|
|
81764
82142
|
import_node_path83.default.join(pending2, "artifact.json"),
|
|
81765
82143
|
JSON.stringify({
|
|
81766
82144
|
hash: artifact.hash,
|
|
81767
|
-
wasm: (0,
|
|
82145
|
+
wasm: (0, import_node_crypto51.createHash)("sha256").update(artifact.bytes).digest("hex"),
|
|
81768
82146
|
icu: artifact.icu.sha256,
|
|
81769
82147
|
sdk: artifact.sdk && {
|
|
81770
82148
|
key: artifact.sdk.key,
|
|
@@ -82113,7 +82491,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
82113
82491
|
const unoptimized = args.input.unoptimized === true;
|
|
82114
82492
|
const sdkOptions = swiftCompileSdkOptions(args.moduleRoot, args.toolchainBin);
|
|
82115
82493
|
const selectorOptions = swiftObjCSelectorOptions(args.moduleRoot);
|
|
82116
|
-
const receiptKey = (0,
|
|
82494
|
+
const receiptKey = (0, import_node_crypto51.createHash)("sha256").update(
|
|
82117
82495
|
JSON.stringify([
|
|
82118
82496
|
"framework-products/v2",
|
|
82119
82497
|
args.frameworkKey,
|
|
@@ -82177,6 +82555,10 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
82177
82555
|
// every framework target when callers alternate --cores.
|
|
82178
82556
|
"-Xswiftc",
|
|
82179
82557
|
"-gnone",
|
|
82558
|
+
"-Xcc",
|
|
82559
|
+
"-g0",
|
|
82560
|
+
"-Xcxx",
|
|
82561
|
+
"-g0",
|
|
82180
82562
|
"-Xswiftc",
|
|
82181
82563
|
"-num-threads",
|
|
82182
82564
|
"-Xswiftc",
|
|
@@ -82276,7 +82658,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
82276
82658
|
const archiveBase = import_node_path83.default.join(scratch2, "products-lib");
|
|
82277
82659
|
(0, import_node_fs83.mkdirSync)(archiveBase, { recursive: true });
|
|
82278
82660
|
const archiveRoot = import_node_path83.default.join(archiveBase, receiptKey);
|
|
82279
|
-
const stagedArchiveRoot = `${archiveRoot}.tmp-${process.pid}-${(0,
|
|
82661
|
+
const stagedArchiveRoot = `${archiveRoot}.tmp-${process.pid}-${(0, import_node_crypto51.randomUUID)()}`;
|
|
82280
82662
|
const stagedArchive = import_node_path83.default.join(stagedArchiveRoot, "lib");
|
|
82281
82663
|
(0, import_node_fs83.mkdirSync)(stagedArchive, { recursive: true });
|
|
82282
82664
|
const archived = /* @__PURE__ */ new Map();
|
|
@@ -82319,7 +82701,7 @@ ${args.frameworkKey}`,
|
|
|
82319
82701
|
const receiptsDir = import_node_path83.default.join(scratch2, "products-ready");
|
|
82320
82702
|
(0, import_node_fs83.mkdirSync)(receiptsDir, { recursive: true });
|
|
82321
82703
|
const receiptFile2 = import_node_path83.default.join(receiptsDir, `${receiptKey}.json`);
|
|
82322
|
-
const partialReceipt = `${receiptFile2}.${process.pid}.${(0,
|
|
82704
|
+
const partialReceipt = `${receiptFile2}.${process.pid}.${(0, import_node_crypto51.randomUUID)()}`;
|
|
82323
82705
|
(0, import_node_fs83.writeFileSync)(
|
|
82324
82706
|
partialReceipt,
|
|
82325
82707
|
JSON.stringify({
|
|
@@ -82491,7 +82873,7 @@ function mirrorTree2(source, target, skip) {
|
|
|
82491
82873
|
if (existing?.isFile() && existing.size === stat2.size && (existing.mtimeMs === stat2.mtimeMs || (0, import_node_fs83.readFileSync)(from).equals((0, import_node_fs83.readFileSync)(to))))
|
|
82492
82874
|
continue;
|
|
82493
82875
|
if (existing) (0, import_node_fs83.rmSync)(to, { recursive: true, force: true });
|
|
82494
|
-
const partial = `${to}.${(0,
|
|
82876
|
+
const partial = `${to}.${(0, import_node_crypto51.randomUUID)()}`;
|
|
82495
82877
|
(0, import_node_fs83.copyFileSync)(from, partial);
|
|
82496
82878
|
if (stat2.mtimeMs > Date.now()) (0, import_node_fs83.utimesSync)(partial, stat2.atime, stat2.mtime);
|
|
82497
82879
|
(0, import_node_fs83.renameSync)(partial, to);
|
|
@@ -82551,7 +82933,7 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
|
|
|
82551
82933
|
return stagedModule;
|
|
82552
82934
|
}
|
|
82553
82935
|
function swiftLinkStamp(args) {
|
|
82554
|
-
const hash = (0,
|
|
82936
|
+
const hash = (0, import_node_crypto51.createHash)("sha256");
|
|
82555
82937
|
hash.update(`swift-link/v1
|
|
82556
82938
|
${args.frameworkKey}
|
|
82557
82939
|
`);
|
|
@@ -82679,7 +83061,7 @@ async function compileSwiftProjectOnce(sources, options2) {
|
|
|
82679
83061
|
const inputHash = swiftCompileInputHash(input, options2.release);
|
|
82680
83062
|
const moduleDigest = swiftModuleDigest(moduleRoot);
|
|
82681
83063
|
const sourceHash = inputHash.copy().update(moduleDigest).digest("hex");
|
|
82682
|
-
const hash = sdkImage ? (0,
|
|
83064
|
+
const hash = sdkImage ? (0, import_node_crypto51.createHash)("sha256").update(`${sourceHash}
|
|
82683
83065
|
sdk module ${sdkImage.key}`).digest("hex") : sourceHash;
|
|
82684
83066
|
const frameworkKey = swiftProjectBuildKey(moduleRoot, options2.release);
|
|
82685
83067
|
const sharedRoot = import_node_path83.default.join(swiftCacheDir(), "swift-projects", hash);
|
|
@@ -82776,7 +83158,7 @@ ${cap}` : "";
|
|
|
82776
83158
|
}
|
|
82777
83159
|
const baseRoot = root;
|
|
82778
83160
|
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path83.default.basename(import_node_path83.default.dirname(baseRoot)) === "swift-builds";
|
|
82779
|
-
const buildShape = canPoolBuildRoot ? (0,
|
|
83161
|
+
const buildShape = canPoolBuildRoot ? (0, import_node_crypto51.createHash)("sha256").update(
|
|
82780
83162
|
JSON.stringify([
|
|
82781
83163
|
frameworkKey,
|
|
82782
83164
|
Boolean(sdkImage),
|
|
@@ -83067,6 +83449,10 @@ ${cap}` : "";
|
|
|
83067
83449
|
// fan-out under high -j.
|
|
83068
83450
|
"-Xswiftc",
|
|
83069
83451
|
"-gnone",
|
|
83452
|
+
"-Xcc",
|
|
83453
|
+
"-g0",
|
|
83454
|
+
"-Xcxx",
|
|
83455
|
+
"-g0",
|
|
83070
83456
|
...incrementalPreview ? [] : [
|
|
83071
83457
|
"-Xswiftc",
|
|
83072
83458
|
"-num-threads",
|
|
@@ -83261,17 +83647,17 @@ ${cap}` : "";
|
|
|
83261
83647
|
}
|
|
83262
83648
|
const receipt = import_node_path83.default.join(
|
|
83263
83649
|
checkpoints,
|
|
83264
|
-
(0,
|
|
83650
|
+
(0, import_node_crypto51.createHash)("sha256").update(target).digest("hex")
|
|
83265
83651
|
);
|
|
83266
83652
|
const headers = producers.map(headerPaths);
|
|
83267
83653
|
for (const header of headers)
|
|
83268
83654
|
if ((0, import_node_fs83.existsSync)(header.original)) publishHeader(header);
|
|
83269
83655
|
const fingerprint = () => {
|
|
83270
|
-
const digest3 = (0,
|
|
83656
|
+
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(recipe2);
|
|
83271
83657
|
for (const { original, emitted } of headers) {
|
|
83272
83658
|
if (!(0, import_node_fs83.existsSync)(original) || !(0, import_node_fs83.existsSync)(emitted)) return;
|
|
83273
83659
|
digest3.update(
|
|
83274
|
-
(0,
|
|
83660
|
+
(0, import_node_crypto51.createHash)("sha256").update((0, import_node_fs83.readFileSync)(emitted)).digest()
|
|
83275
83661
|
);
|
|
83276
83662
|
}
|
|
83277
83663
|
return digest3.digest("hex");
|
|
@@ -83484,12 +83870,12 @@ ${cap}` : "";
|
|
|
83484
83870
|
options2.signal
|
|
83485
83871
|
);
|
|
83486
83872
|
}
|
|
83487
|
-
var import_node_child_process45,
|
|
83873
|
+
var import_node_child_process45, import_node_crypto51, import_node_fs83, import_node_os18, import_node_path83, v6, WASM_TRIPLE, SWIFTPM_PROGRESS, SWIFTPM_NOISE, SWIFT_COMPILER_ENV_KEYS, SYSTEM_MODULE_LIBRARIES, SYSTEM_MODULE_IMPORT, lastPartition, OPTIONAL_FRAMEWORK_DEPENDENCIES, OPTIONAL_FRAMEWORKS, availableModules, sdkOverlayFrameworks, DISTRIBUTION_CLANG_MODULES, CLANG_DISTRIBUTION_MODULES, ONE_PRODUCT, GAME_FAMILY, gameProducts, gameProduct, GAME_REACH, ONE_IMPLICIT_FLAGS, executableLinkFlags, darwinRecordsRegion, REACTOR_FLAG, MULTI_MANIFEST_VERSION, SWIFT_HEADER_PRODUCTS_TARGET, compilerSourceDigest, nativeCxxCompilerFlags, MODULE_MAP_RESPONSE_FILE_RUN, cFlagArray, cxxFlagArray, SWIFTPM_DEFAULT_IOS_DEPLOYMENT_TARGET, OS_IOS, ARCH_ARM64, NOT_ON_IOS, DELEGATE_CLASS, ARM64_MACRO, WASM_MACRO, ARCH_WASM32, C_WORDS, archEnvironments, CORE_FOUNDATION_GEOMETRY_TYPES, CORE_FOUNDATION_GRAPHICS_TYPES, CORE_FOUNDATION_HANDLE_IMPORTS, cPredefineTable, cPredefineCache, HIDDEN_UNITS, FIRST_WINS_PAIRS, LAST_WINS_PAIRS, VALUE_FLAGS, LIBXML_REFERENCE, LIBXML_SOURCE, ROOT_LOCKS, host, rootLocks, SHARED_ARTIFACT_BUDGET_BYTES, SHARED_ARTIFACT_GRACE_MS, RETIRED_PREFIX, retainedArtifacts, FRAMEWORK_LINK_TARGET, frameworkProductsReceiptSchema, SWIFT_LINK_STAMP, SWIFT_HOST_COMPILER_WRAPPER, SWIFT_FRAMEWORK_SLOTS, SWIFT_FRAMEWORK_UNOPTIMIZED_SLOTS, SWIFT_FRAMEWORK_SLOT_KEY, SWIFT_FRAMEWORK_SLOT_ORIGIN, SWIFT_FRAMEWORK_SLOT_RELEASE, SWIFT_BUILD_ROOT_SLOTS, SWIFT_BUILD_ROOT_SHAPE;
|
|
83488
83874
|
var init_swift_compile = __esm({
|
|
83489
83875
|
"src/swift-compile.ts"() {
|
|
83490
83876
|
"use strict";
|
|
83491
83877
|
import_node_child_process45 = require("node:child_process");
|
|
83492
|
-
|
|
83878
|
+
import_node_crypto51 = require("node:crypto");
|
|
83493
83879
|
import_node_fs83 = require("node:fs");
|
|
83494
83880
|
import_node_os18 = __toESM(require("node:os"), 1);
|
|
83495
83881
|
import_node_path83 = __toESM(require("node:path"), 1);
|
|
@@ -83717,7 +84103,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
83717
84103
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
83718
84104
|
MULTI_MANIFEST_VERSION = 76;
|
|
83719
84105
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
83720
|
-
compilerSourceDigest = true ? "
|
|
84106
|
+
compilerSourceDigest = true ? "169122685e250113f128b79efc78f9868f581da36ab083c174056ab99b87b629" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
83721
84107
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
83722
84108
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
83723
84109
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -83833,7 +84219,7 @@ async function podPrepareEnvironment(base2) {
|
|
|
83833
84219
|
if (process.platform !== "linux") return base2;
|
|
83834
84220
|
const { root, toolchainBin } = await resolveSwiftModule();
|
|
83835
84221
|
const { sysroot, resources } = swiftSdkPaths(root, toolchainBin);
|
|
83836
|
-
const key2 = (0,
|
|
84222
|
+
const key2 = (0, import_node_crypto52.createHash)("sha256").update(XCRUN).update(CLANG).digest("hex").slice(0, 16);
|
|
83837
84223
|
const directory2 = import_node_path84.default.join(cacheDir(), "pod-tools", key2);
|
|
83838
84224
|
if (!import_node_fs84.default.existsSync(directory2)) {
|
|
83839
84225
|
import_node_fs84.default.mkdirSync(import_node_path84.default.dirname(directory2), { recursive: true });
|
|
@@ -83874,11 +84260,11 @@ async function podPrepareEnvironment(base2) {
|
|
|
83874
84260
|
PEACH_POD_RESOURCES: resources
|
|
83875
84261
|
};
|
|
83876
84262
|
}
|
|
83877
|
-
var
|
|
84263
|
+
var import_node_crypto52, import_node_fs84, import_node_path84, XCRUN, CLANG;
|
|
83878
84264
|
var init_pod_prepare_toolchain = __esm({
|
|
83879
84265
|
"src/pod-prepare-toolchain.ts"() {
|
|
83880
84266
|
"use strict";
|
|
83881
|
-
|
|
84267
|
+
import_node_crypto52 = require("node:crypto");
|
|
83882
84268
|
import_node_fs84 = __toESM(require("node:fs"), 1);
|
|
83883
84269
|
import_node_path84 = __toESM(require("node:path"), 1);
|
|
83884
84270
|
init_home_paths();
|
|
@@ -83964,10 +84350,10 @@ async function podSourceRoot(spec, prepareEnv) {
|
|
|
83964
84350
|
`${name3}: unrecognized ${strategy} source options ${unrecognized.join(", ")}`
|
|
83965
84351
|
);
|
|
83966
84352
|
const base2 = import_node_path85.default.join(rnxHomeDir(), "pod-sources");
|
|
83967
|
-
const digest3 = (0,
|
|
84353
|
+
const digest3 = (0, import_node_crypto53.createHash)("sha256").update(canonicalJson(source)).digest("hex").slice(0, 16);
|
|
83968
84354
|
const root = import_node_path85.default.join(base2, name3, `${String(spec.version)}-${digest3}`);
|
|
83969
84355
|
if (import_node_fs85.default.existsSync(root)) return root;
|
|
83970
|
-
const stage = import_node_path85.default.join(base2, ".staging", (0,
|
|
84356
|
+
const stage = import_node_path85.default.join(base2, ".staging", (0, import_node_crypto53.randomUUID)());
|
|
83971
84357
|
import_node_fs85.default.mkdirSync(stage, { recursive: true });
|
|
83972
84358
|
try {
|
|
83973
84359
|
if (strategy === "git") await downloadGit(name3, url, options2, stage);
|
|
@@ -84142,7 +84528,7 @@ async function downloadFile(pod, url, headers, file, algorithm) {
|
|
|
84142
84528
|
}
|
|
84143
84529
|
if (!response?.ok || !response.body)
|
|
84144
84530
|
throw new Error(`${pod}: GET ${url} failed with HTTP ${response?.status ?? "error"}`);
|
|
84145
|
-
const hash = algorithm ? (0,
|
|
84531
|
+
const hash = algorithm ? (0, import_node_crypto53.createHash)(algorithm) : null;
|
|
84146
84532
|
const handle = await import_node_fs85.default.promises.open(file, "w");
|
|
84147
84533
|
try {
|
|
84148
84534
|
const reader = response.body.getReader();
|
|
@@ -84399,12 +84785,12 @@ function cleanInstalledPod(spec, root, used) {
|
|
|
84399
84785
|
(node) => used.filter((entry) => entry.specs.includes(node.name)).map((entry) => entry.platform)
|
|
84400
84786
|
);
|
|
84401
84787
|
}
|
|
84402
|
-
var import_node_child_process46,
|
|
84788
|
+
var import_node_child_process46, import_node_crypto53, import_node_fs85, import_node_os19, import_node_path85, COCOAPODS_VERSION, USER_AGENT, PLATFORMS, HEADER_EXTENSIONS, SOURCE_EXTENSIONS2, SOURCE_FILES_PATTERN, STRATEGIES, OPTIONS, ARCHIVE_TYPES, object5, RETRY_STATUSES, chomp, stringList, bracketEnd, escapeRegex;
|
|
84403
84789
|
var init_pod_sources = __esm({
|
|
84404
84790
|
"src/pod-sources.ts"() {
|
|
84405
84791
|
"use strict";
|
|
84406
84792
|
import_node_child_process46 = require("node:child_process");
|
|
84407
|
-
|
|
84793
|
+
import_node_crypto53 = require("node:crypto");
|
|
84408
84794
|
import_node_fs85 = __toESM(require("node:fs"), 1);
|
|
84409
84795
|
import_node_os19 = __toESM(require("node:os"), 1);
|
|
84410
84796
|
import_node_path85 = __toESM(require("node:path"), 1);
|
|
@@ -84488,7 +84874,7 @@ function specRepo(url, refresh) {
|
|
|
84488
84874
|
const dir = import_node_path86.default.join(
|
|
84489
84875
|
cacheDir(),
|
|
84490
84876
|
"cocoapods-repos",
|
|
84491
|
-
(0,
|
|
84877
|
+
(0, import_node_crypto54.createHash)("sha256").update(url).digest("hex").slice(0, 16)
|
|
84492
84878
|
);
|
|
84493
84879
|
if (!import_node_fs86.default.existsSync(import_node_path86.default.join(dir, ".git"))) {
|
|
84494
84880
|
const staged = `${dir}.${process.pid}`;
|
|
@@ -84518,7 +84904,7 @@ function podDir(repo, name3) {
|
|
|
84518
84904
|
const specs = import_node_fs86.default.existsSync(import_node_path86.default.join(repo, "Specs")) ? import_node_path86.default.join(repo, "Specs") : repo;
|
|
84519
84905
|
const metadata = import_node_path86.default.join(repo, "CocoaPods-version.yml");
|
|
84520
84906
|
const lengths = import_node_fs86.default.existsSync(metadata) ? browser_default.parse(import_node_fs86.default.readFileSync(metadata, "utf8"))?.prefix_lengths : void 0;
|
|
84521
|
-
const hash = (0,
|
|
84907
|
+
const hash = (0, import_node_crypto54.createHash)("md5").update(name3).digest("hex");
|
|
84522
84908
|
let at = 0;
|
|
84523
84909
|
const shards2 = (Array.isArray(lengths) ? lengths : []).map((length) => {
|
|
84524
84910
|
if (typeof length !== "number")
|
|
@@ -84551,17 +84937,17 @@ async function sourceSpecificationFile(source, name3, version2) {
|
|
|
84551
84937
|
if (!file) throw new Error(`${source} lists ${name3} ${version2} without a podspec`);
|
|
84552
84938
|
return file;
|
|
84553
84939
|
}
|
|
84554
|
-
var import_node_child_process47,
|
|
84940
|
+
var import_node_child_process47, import_node_crypto54, import_node_fs86, import_node_path86, shard, shards, TRUNK_SOURCES, refreshed, specRepoKey;
|
|
84555
84941
|
var init_cocoapods_trunk = __esm({
|
|
84556
84942
|
"src/cocoapods-trunk.ts"() {
|
|
84557
84943
|
"use strict";
|
|
84558
84944
|
import_node_child_process47 = require("node:child_process");
|
|
84559
|
-
|
|
84945
|
+
import_node_crypto54 = require("node:crypto");
|
|
84560
84946
|
import_node_fs86 = __toESM(require("node:fs"), 1);
|
|
84561
84947
|
import_node_path86 = __toESM(require("node:path"), 1);
|
|
84562
84948
|
init_browser();
|
|
84563
84949
|
init_home_paths();
|
|
84564
|
-
shard = (name3) => (0,
|
|
84950
|
+
shard = (name3) => (0, import_node_crypto54.createHash)("md5").update(name3).digest("hex").slice(0, 3).split("");
|
|
84565
84951
|
shards = /* @__PURE__ */ new Map();
|
|
84566
84952
|
TRUNK_SOURCES = /* @__PURE__ */ new Set([
|
|
84567
84953
|
"trunk",
|
|
@@ -94227,6 +94613,11 @@ end
|
|
|
94227
94613
|
});
|
|
94228
94614
|
|
|
94229
94615
|
// src/bazel-project.ts
|
|
94616
|
+
function sha256Hex5(bytes) {
|
|
94617
|
+
if (typeof Bun !== "undefined")
|
|
94618
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
94619
|
+
return (0, import_node_crypto55.createHash)("sha256").update(bytes).digest("hex");
|
|
94620
|
+
}
|
|
94230
94621
|
function isBazelPackage(input) {
|
|
94231
94622
|
return /^BUILD(?:\.bazel)?$/.test(import_node_path96.default.basename(input)) && import_node_fs95.default.statSync(input).isFile();
|
|
94232
94623
|
}
|
|
@@ -94256,7 +94647,7 @@ function bazelBinary(root) {
|
|
|
94256
94647
|
const expected = (0, import_node_child_process48.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
|
|
94257
94648
|
encoding: "utf8"
|
|
94258
94649
|
}).split(/\s/)[0];
|
|
94259
|
-
const actual = (0,
|
|
94650
|
+
const actual = (0, import_node_crypto55.createHash)("sha256").update(import_node_fs95.default.readFileSync(partial)).digest("hex");
|
|
94260
94651
|
if (actual !== expected) {
|
|
94261
94652
|
import_node_fs95.default.rmSync(partial, { force: true });
|
|
94262
94653
|
throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
|
|
@@ -94286,7 +94677,7 @@ function parseRule(raw2) {
|
|
|
94286
94677
|
};
|
|
94287
94678
|
}
|
|
94288
94679
|
function graphInputsDigest(root) {
|
|
94289
|
-
const hash = (0,
|
|
94680
|
+
const hash = (0, import_node_crypto55.createHash)("sha256");
|
|
94290
94681
|
const visit3 = (dir) => {
|
|
94291
94682
|
for (const entry of import_node_fs95.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
94292
94683
|
if (entry.name.startsWith(".") || entry.name.startsWith("bazel-")) continue;
|
|
@@ -94319,7 +94710,7 @@ function bazelGraph(root, label, configuration2) {
|
|
|
94319
94710
|
const cached5 = graphs.get(key2);
|
|
94320
94711
|
if (cached5) return cached5;
|
|
94321
94712
|
const flags = configurationFlags(configuration2);
|
|
94322
|
-
const digest3 = (0,
|
|
94713
|
+
const digest3 = (0, import_node_crypto55.createHash)("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
|
|
94323
94714
|
const file = import_node_path96.default.join(root, ".build", "peach-bazel", `graph-${digest3}.json`);
|
|
94324
94715
|
const bazel = bazelBinary(root);
|
|
94325
94716
|
const run18 = (args) => (0, import_node_child_process48.execFileSync)(bazel, args, {
|
|
@@ -94793,6 +95184,18 @@ ${published4.map(
|
|
|
94793
95184
|
`bazel application has ${missing2.length} unbuilt inputs: ${missing2.slice(0, 5).map((file) => import_node_path96.default.relative(root, file)).join(", ")}`
|
|
94794
95185
|
);
|
|
94795
95186
|
const archives = /* @__PURE__ */ new Map();
|
|
95187
|
+
let outputOwner;
|
|
95188
|
+
const ownerOfOutput = (file) => {
|
|
95189
|
+
if (!outputOwner) {
|
|
95190
|
+
outputOwner = /* @__PURE__ */ new Map();
|
|
95191
|
+
for (const item of graph.rules.values())
|
|
95192
|
+
for (const output of item.outputs) {
|
|
95193
|
+
const outputPath2 = files2.path(output);
|
|
95194
|
+
if (!outputOwner.has(outputPath2)) outputOwner.set(outputPath2, item);
|
|
95195
|
+
}
|
|
95196
|
+
}
|
|
95197
|
+
return outputOwner.get(file);
|
|
95198
|
+
};
|
|
94796
95199
|
for (const rule of order) {
|
|
94797
95200
|
for (const dep of rule.attrs.get("deps")?.list ?? []) {
|
|
94798
95201
|
const owner = ruleOf(dep, rule.label);
|
|
@@ -94810,9 +95213,7 @@ ${published4.map(
|
|
|
94810
95213
|
for (const raw2 of rule.attrs.get("srcs")?.list ?? []) {
|
|
94811
95214
|
const label2 = canonicalLabel(raw2, rule.label);
|
|
94812
95215
|
for (const archive of files2.expand([raw2], rule.label).filter((file) => file.endsWith(".a"))) {
|
|
94813
|
-
const owner =
|
|
94814
|
-
(item) => item.outputs.some((output) => files2.path(output) === archive)
|
|
94815
|
-
);
|
|
95216
|
+
const owner = ownerOfOutput(archive);
|
|
94816
95217
|
const key2 = owner?.label ?? label2;
|
|
94817
95218
|
const entry = archives.get(key2) ?? {
|
|
94818
95219
|
library: import_node_path96.default.basename(archive),
|
|
@@ -94838,6 +95239,13 @@ ${published4.map(
|
|
|
94838
95239
|
)
|
|
94839
95240
|
)
|
|
94840
95241
|
);
|
|
95242
|
+
const matchesAppInclude = (name3) => {
|
|
95243
|
+
if (appIncludes.has(name3)) return true;
|
|
95244
|
+
for (let slash = name3.indexOf("/"); slash >= 0; slash = name3.indexOf("/", slash + 1)) {
|
|
95245
|
+
if (appIncludes.has(name3.slice(slash + 1))) return true;
|
|
95246
|
+
}
|
|
95247
|
+
return false;
|
|
95248
|
+
};
|
|
94841
95249
|
let generatedBy;
|
|
94842
95250
|
const generators = () => {
|
|
94843
95251
|
if (!generatedBy) {
|
|
@@ -94918,9 +95326,7 @@ ${published4.map(
|
|
|
94918
95326
|
[...linkers].filter((rule) => rule.attrs.get("module_name")?.value).flatMap((rule) => files2.expand(rule.attrs.get("hdrs")?.list ?? [], rule.label))
|
|
94919
95327
|
);
|
|
94920
95328
|
const entries2 = headers.filter(
|
|
94921
|
-
(header) => imported.has(header.file) ||
|
|
94922
|
-
(include) => header.name === include || header.name.endsWith(`/${include}`)
|
|
94923
|
-
)
|
|
95329
|
+
(header) => imported.has(header.file) || matchesAppInclude(header.name)
|
|
94924
95330
|
);
|
|
94925
95331
|
const bundle = import_node_path96.default.join(products, "archives", `${name3}.xcframework`);
|
|
94926
95332
|
const slice = import_node_path96.default.join(bundle, "ios-arm64-simulator");
|
|
@@ -94966,14 +95372,9 @@ ${published4.map(
|
|
|
94966
95372
|
]
|
|
94967
95373
|
)
|
|
94968
95374
|
]);
|
|
94969
|
-
const digest3 = (
|
|
94970
|
-
JSON.stringify(
|
|
94971
|
-
|
|
94972
|
-
file,
|
|
94973
|
-
(0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex")
|
|
94974
|
-
])
|
|
94975
|
-
)
|
|
94976
|
-
).digest("hex");
|
|
95375
|
+
const digest3 = sha256Hex5(
|
|
95376
|
+
JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex5(bytes)]))
|
|
95377
|
+
);
|
|
94977
95378
|
const stamp = import_node_path96.default.join(bundle, ".peach-digest");
|
|
94978
95379
|
if (!import_node_fs95.default.existsSync(stamp) || import_node_fs95.default.readFileSync(stamp, "utf8") !== digest3) {
|
|
94979
95380
|
import_node_fs95.default.rmSync(bundle, { recursive: true, force: true });
|
|
@@ -95133,12 +95534,12 @@ function shellTokens(options2) {
|
|
|
95133
95534
|
return words2;
|
|
95134
95535
|
});
|
|
95135
95536
|
}
|
|
95136
|
-
var import_node_child_process48,
|
|
95537
|
+
var import_node_child_process48, import_node_crypto55, import_node_fs95, import_node_os20, import_node_path96, LIBRARY_RULES, QUERIED_RULES, NATIVE_SOURCE, HEADER4, PRODUCTS, graphs, CLANG_CONFIGURATION_FLAGS, GRAPH_FORMAT, BazelFiles, CXX_STANDARD;
|
|
95137
95538
|
var init_bazel_project = __esm({
|
|
95138
95539
|
"src/bazel-project.ts"() {
|
|
95139
95540
|
"use strict";
|
|
95140
95541
|
import_node_child_process48 = require("node:child_process");
|
|
95141
|
-
|
|
95542
|
+
import_node_crypto55 = require("node:crypto");
|
|
95142
95543
|
import_node_fs95 = __toESM(require("node:fs"), 1);
|
|
95143
95544
|
import_node_os20 = __toESM(require("node:os"), 1);
|
|
95144
95545
|
import_node_path96 = __toESM(require("node:path"), 1);
|
|
@@ -96792,7 +97193,7 @@ async function swiftBinaryModules(binary2) {
|
|
|
96792
97193
|
if (!binary2.url) return localSwiftBinaryModules(binary2.dir);
|
|
96793
97194
|
const cached5 = import_node_path97.default.join(
|
|
96794
97195
|
cacheDir3,
|
|
96795
|
-
`${(0,
|
|
97196
|
+
`${(0, import_node_crypto56.createHash)("sha256").update(`${binary2.url}\0${binary2.checksum ?? ""}`).digest("hex").slice(0, 32)}.json`
|
|
96796
97197
|
);
|
|
96797
97198
|
if (import_node_fs96.default.existsSync(cached5)) {
|
|
96798
97199
|
const value = JSON.parse(import_node_fs96.default.readFileSync(cached5, "utf8"));
|
|
@@ -96804,11 +97205,11 @@ async function swiftBinaryModules(binary2) {
|
|
|
96804
97205
|
import_node_fs96.default.writeFileSync(cached5, JSON.stringify(modules));
|
|
96805
97206
|
return modules;
|
|
96806
97207
|
}
|
|
96807
|
-
var
|
|
97208
|
+
var import_node_crypto56, import_node_fs96, import_node_path97, cacheDir3;
|
|
96808
97209
|
var init_swift_binary_modules = __esm({
|
|
96809
97210
|
"src/swift-binary-modules.ts"() {
|
|
96810
97211
|
"use strict";
|
|
96811
|
-
|
|
97212
|
+
import_node_crypto56 = require("node:crypto");
|
|
96812
97213
|
import_node_fs96 = __toESM(require("node:fs"), 1);
|
|
96813
97214
|
import_node_path97 = __toESM(require("node:path"), 1);
|
|
96814
97215
|
init_home_paths();
|
|
@@ -96818,11 +97219,11 @@ var init_swift_binary_modules = __esm({
|
|
|
96818
97219
|
});
|
|
96819
97220
|
|
|
96820
97221
|
// src/swift-coverage/provenance.ts
|
|
96821
|
-
var
|
|
97222
|
+
var import_node_crypto57, import_node_fs97, import_node_path98, swiftCoverageProvenance;
|
|
96822
97223
|
var init_provenance = __esm({
|
|
96823
97224
|
"src/swift-coverage/provenance.ts"() {
|
|
96824
97225
|
"use strict";
|
|
96825
|
-
|
|
97226
|
+
import_node_crypto57 = require("node:crypto");
|
|
96826
97227
|
import_node_fs97 = require("node:fs");
|
|
96827
97228
|
import_node_path98 = require("node:path");
|
|
96828
97229
|
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"32bf10d6f3396dd1a20ff6d415499a5990ec2550c63306fd9ef071bdf4a58f1e","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"e30510099ee19d34de62d8ae859df53f77594a4ab105fdb5bcd7e005ec9689ca","xcode-target-members.ts":"96f6a9f5567a4fbd9806252229b35b9a451a112b20f70f8c20189ffd428815fd","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path98.join)(__sootsim_import_meta_dirname, ".."));
|
|
@@ -97919,16 +98320,16 @@ function assetSymbolText(plan, root) {
|
|
|
97919
98320
|
if (source.status === "unknown") throw new Error(source.reason);
|
|
97920
98321
|
return source.text;
|
|
97921
98322
|
}
|
|
97922
|
-
var
|
|
98323
|
+
var import_node_crypto58, import_node_fs99, import_node_path100, sha2562, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
|
|
97923
98324
|
var init_xcode_assets = __esm({
|
|
97924
98325
|
"src/swift-coverage/xcode-assets.ts"() {
|
|
97925
98326
|
"use strict";
|
|
97926
|
-
|
|
98327
|
+
import_node_crypto58 = require("node:crypto");
|
|
97927
98328
|
import_node_fs99 = require("node:fs");
|
|
97928
98329
|
import_node_path100 = require("node:path");
|
|
97929
98330
|
init_provenance();
|
|
97930
98331
|
init_xcode_asset_symbols();
|
|
97931
|
-
sha2562 = (bytes) => (0,
|
|
98332
|
+
sha2562 = (bytes) => (0, import_node_crypto58.createHash)("sha256").update(bytes).digest("hex");
|
|
97932
98333
|
unprovenAssetSettings = [
|
|
97933
98334
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
|
|
97934
98335
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
|
|
@@ -98524,7 +98925,7 @@ function normalizedEnums(input) {
|
|
|
98524
98925
|
}
|
|
98525
98926
|
function localizationIdentifier(field2, key2) {
|
|
98526
98927
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
98527
|
-
const digest3 = (0,
|
|
98928
|
+
const digest3 = (0, import_node_crypto59.createHash)("sha256").update(JSON.stringify([...field2, key2])).digest();
|
|
98528
98929
|
return Array.from(
|
|
98529
98930
|
digest3.subarray(0, 6),
|
|
98530
98931
|
(byte) => alphabet[byte % alphabet.length]
|
|
@@ -98849,12 +99250,12 @@ function writeIntentDefinition(input, prefix) {
|
|
|
98849
99250
|
lines.push("</plist>", "");
|
|
98850
99251
|
return lines.join("\n");
|
|
98851
99252
|
}
|
|
98852
|
-
var import_strict4,
|
|
99253
|
+
var import_strict4, import_node_crypto59, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
|
|
98853
99254
|
var init_metadata = __esm({
|
|
98854
99255
|
"src/intent-definition/metadata.ts"() {
|
|
98855
99256
|
"use strict";
|
|
98856
99257
|
import_strict4 = __toESM(require("node:assert/strict"), 1);
|
|
98857
|
-
|
|
99258
|
+
import_node_crypto59 = require("node:crypto");
|
|
98858
99259
|
init_fields();
|
|
98859
99260
|
init_hash_input();
|
|
98860
99261
|
init_siphash();
|
|
@@ -99563,7 +99964,7 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
99563
99964
|
if (prefix) identifier(prefix);
|
|
99564
99965
|
if (module2) identifier(module2);
|
|
99565
99966
|
const source = import_node_fs100.default.readFileSync(definition2);
|
|
99566
|
-
const key2 = (0,
|
|
99967
|
+
const key2 = (0, import_node_crypto60.createHash)("sha256").update(
|
|
99567
99968
|
JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
|
|
99568
99969
|
).update("\0").update(source).digest("hex");
|
|
99569
99970
|
const cache = import_node_path101.default.join(derivedDirectory, "IntentDefinitions");
|
|
@@ -99603,11 +100004,11 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
99603
100004
|
import_node_fs100.default.rmSync(stage, { recursive: true, force: true });
|
|
99604
100005
|
}
|
|
99605
100006
|
}
|
|
99606
|
-
var
|
|
100007
|
+
var import_node_crypto60, import_node_fs100, import_node_path101, intentCompilerRevision;
|
|
99607
100008
|
var init_xcode_intents = __esm({
|
|
99608
100009
|
"src/xcode-intents.ts"() {
|
|
99609
100010
|
"use strict";
|
|
99610
|
-
|
|
100011
|
+
import_node_crypto60 = require("node:crypto");
|
|
99611
100012
|
import_node_fs100 = __toESM(require("node:fs"), 1);
|
|
99612
100013
|
import_node_path101 = __toESM(require("node:path"), 1);
|
|
99613
100014
|
init_fields();
|
|
@@ -100309,7 +100710,7 @@ function loadProject(xcodeproj) {
|
|
|
100309
100710
|
if (!projectFile)
|
|
100310
100711
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
100311
100712
|
const source = import_node_fs101.default.readFileSync(projectFile, "utf8");
|
|
100312
|
-
const digest3 = (0,
|
|
100713
|
+
const digest3 = (0, import_node_crypto61.createHash)("sha256").update(source).digest("hex");
|
|
100313
100714
|
const cached5 = loaded3.get(projectFile);
|
|
100314
100715
|
if (cached5?.digest === digest3) return cached5.project;
|
|
100315
100716
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -100361,7 +100762,7 @@ function xcodeInstallationIdentity() {
|
|
|
100361
100762
|
if (!selected) return null;
|
|
100362
100763
|
const directory2 = import_node_path103.default.extname(selected) === ".app" ? import_node_path103.default.join(selected, "Contents", "Developer") : selected;
|
|
100363
100764
|
const versionFile = `${directory2}/../version.plist`;
|
|
100364
|
-
const version2 = import_node_fs101.default.existsSync(versionFile) ? (0,
|
|
100765
|
+
const version2 = import_node_fs101.default.existsSync(versionFile) ? (0, import_node_crypto61.createHash)("sha256").update(import_node_fs101.default.readFileSync(versionFile)).digest("hex") : null;
|
|
100365
100766
|
return { directory: directory2, version: version2 };
|
|
100366
100767
|
}
|
|
100367
100768
|
function defaultConfiguration(project2) {
|
|
@@ -100829,7 +101230,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
100829
101230
|
);
|
|
100830
101231
|
});
|
|
100831
101232
|
}
|
|
100832
|
-
const signature2 = (0,
|
|
101233
|
+
const signature2 = (0, import_node_crypto61.createHash)("sha256").update(
|
|
100833
101234
|
JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
|
|
100834
101235
|
);
|
|
100835
101236
|
for (const file of inputFiles) {
|
|
@@ -100984,7 +101385,7 @@ ${output}`
|
|
|
100984
101385
|
const inputs2 = JSON.stringify([
|
|
100985
101386
|
1,
|
|
100986
101387
|
args,
|
|
100987
|
-
(0,
|
|
101388
|
+
(0, import_node_crypto61.createHash)("sha256").update(import_node_fs101.default.readFileSync(file)).digest("hex")
|
|
100988
101389
|
]);
|
|
100989
101390
|
const developer = settings("DEVELOPER_DIR");
|
|
100990
101391
|
const cached5 = import_node_fs101.default.existsSync(output) && import_node_fs101.default.existsSync(stamp) ? import_node_fs101.default.readFileSync(stamp, "utf8").split("\n") : [];
|
|
@@ -102487,12 +102888,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
102487
102888
|
cocoapods
|
|
102488
102889
|
};
|
|
102489
102890
|
}
|
|
102490
|
-
var import_node_child_process49,
|
|
102891
|
+
var import_node_child_process49, import_node_crypto61, import_node_fs101, import_node_module9, import_node_path103, 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;
|
|
102491
102892
|
var init_xcode_project = __esm({
|
|
102492
102893
|
"src/xcode-project.ts"() {
|
|
102493
102894
|
"use strict";
|
|
102494
102895
|
import_node_child_process49 = require("node:child_process");
|
|
102495
|
-
|
|
102896
|
+
import_node_crypto61 = require("node:crypto");
|
|
102496
102897
|
import_node_fs101 = __toESM(require("node:fs"), 1);
|
|
102497
102898
|
import_node_module9 = require("node:module");
|
|
102498
102899
|
import_node_path103 = __toESM(require("node:path"), 1);
|
|
@@ -102684,8 +103085,8 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
102684
103085
|
);
|
|
102685
103086
|
const appRelative = import_node_path104.default.relative(root, app);
|
|
102686
103087
|
const manifest = JSON.parse(import_node_fs102.default.readFileSync(import_node_path104.default.join(root, "package.json"), "utf8"));
|
|
102687
|
-
const hash = (0,
|
|
102688
|
-
const native = (0,
|
|
103088
|
+
const hash = (0, import_node_crypto62.createHash)("sha256");
|
|
103089
|
+
const native = (0, import_node_crypto62.createHash)("sha256");
|
|
102689
103090
|
const nativeDirectories = localPackageDirectories(root, app);
|
|
102690
103091
|
const versionFree = new Set(
|
|
102691
103092
|
nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
|
|
@@ -102769,7 +103170,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
102769
103170
|
unread.slice(start, start + 32).map(async ({ file, content }) => {
|
|
102770
103171
|
const bytes = await import_node_fs102.default.promises.readFile(file);
|
|
102771
103172
|
content.size = bytes.length;
|
|
102772
|
-
content.digest = (0,
|
|
103173
|
+
content.digest = (0, import_node_crypto62.createHash)("sha256").update(bytes).digest("hex");
|
|
102773
103174
|
fileDigests.set(file, content);
|
|
102774
103175
|
})
|
|
102775
103176
|
);
|
|
@@ -103319,7 +103720,7 @@ function stageCachedQuickCryptoOpenSsl(app) {
|
|
|
103319
103720
|
const sha2565 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
|
|
103320
103721
|
if (!sha2565) return;
|
|
103321
103722
|
const archive = import_node_path104.default.join(cacheDir(), "pod-archives", `${sha2565}.zip`);
|
|
103322
|
-
if (!import_node_fs102.default.existsSync(archive) || (0,
|
|
103723
|
+
if (!import_node_fs102.default.existsSync(archive) || (0, import_node_crypto62.createHash)("sha256").update(import_node_fs102.default.readFileSync(archive)).digest("hex") !== sha2565)
|
|
103323
103724
|
return;
|
|
103324
103725
|
import_node_fs102.default.rmSync(opensslDir, { recursive: true, force: true });
|
|
103325
103726
|
import_node_fs102.default.mkdirSync(opensslDir, { recursive: true });
|
|
@@ -103357,12 +103758,12 @@ ${failedOutputLine(command, cwd, bytes)}`
|
|
|
103357
103758
|
});
|
|
103358
103759
|
});
|
|
103359
103760
|
}
|
|
103360
|
-
var import_node_child_process50,
|
|
103761
|
+
var import_node_child_process50, import_node_crypto62, import_node_fs102, import_node_module10, import_node_os21, import_node_path104, import_node_util13, isolatedGitEnv, 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;
|
|
103361
103762
|
var init_expo_native_workspace = __esm({
|
|
103362
103763
|
"src/expo-native-workspace.ts"() {
|
|
103363
103764
|
"use strict";
|
|
103364
103765
|
import_node_child_process50 = require("node:child_process");
|
|
103365
|
-
|
|
103766
|
+
import_node_crypto62 = require("node:crypto");
|
|
103366
103767
|
import_node_fs102 = __toESM(require("node:fs"), 1);
|
|
103367
103768
|
import_node_module10 = require("node:module");
|
|
103368
103769
|
import_node_os21 = __toESM(require("node:os"), 1);
|
|
@@ -103435,7 +103836,7 @@ function run() {
|
|
|
103435
103836
|
|
|
103436
103837
|
// src/expo-discovery-cache.ts
|
|
103437
103838
|
function peachPin() {
|
|
103438
|
-
return (0,
|
|
103839
|
+
return (0, import_node_crypto63.createHash)("sha256").update(
|
|
103439
103840
|
`${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
|
|
103440
103841
|
).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
|
|
103441
103842
|
}
|
|
@@ -103449,7 +103850,7 @@ function stable(value) {
|
|
|
103449
103850
|
}
|
|
103450
103851
|
async function expoDiscoveryKey(options2) {
|
|
103451
103852
|
const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
|
|
103452
|
-
const key2 = (0,
|
|
103853
|
+
const key2 = (0, import_node_crypto63.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");
|
|
103453
103854
|
return { key: key2, root };
|
|
103454
103855
|
}
|
|
103455
103856
|
function expoDiscoveryCacheDir() {
|
|
@@ -103520,7 +103921,7 @@ function readExpoDiscovery(key2) {
|
|
|
103520
103921
|
if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
|
|
103521
103922
|
const archive = import_node_path105.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
|
|
103522
103923
|
const bytes = import_node_fs103.default.readFileSync(archive);
|
|
103523
|
-
if ((0,
|
|
103924
|
+
if ((0, import_node_crypto63.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
|
|
103524
103925
|
return void 0;
|
|
103525
103926
|
const bodies = (0, import_node_zlib7.zstdDecompressSync)(bytes);
|
|
103526
103927
|
const decoded = /* @__PURE__ */ new Map();
|
|
@@ -103594,7 +103995,7 @@ function stampedFileHash(file) {
|
|
|
103594
103995
|
const stamp = [stat2.dev, stat2.ino, stat2.size, stat2.mtimeNs, stat2.ctimeNs].join(":");
|
|
103595
103996
|
const cached5 = fileHashes.get(file);
|
|
103596
103997
|
if (cached5?.stamp === stamp) return cached5.checksum;
|
|
103597
|
-
const checksum = (0,
|
|
103998
|
+
const checksum = (0, import_node_crypto63.createHash)("sha256").update(import_node_fs103.default.readFileSync(file)).digest("hex");
|
|
103598
103999
|
fileHashes.set(file, { stamp, checksum });
|
|
103599
104000
|
fileHashesChanged = true;
|
|
103600
104001
|
return checksum;
|
|
@@ -103603,7 +104004,7 @@ function saveFileHashes() {
|
|
|
103603
104004
|
if (!fileHashesChanged) return;
|
|
103604
104005
|
fileHashesChanged = false;
|
|
103605
104006
|
const target = fileHashesPath();
|
|
103606
|
-
const temporary = `${target}.${process.pid}.${(0,
|
|
104007
|
+
const temporary = `${target}.${process.pid}.${(0, import_node_crypto63.randomUUID)()}.tmp`;
|
|
103607
104008
|
try {
|
|
103608
104009
|
import_node_fs103.default.mkdirSync(import_node_path105.default.dirname(target), { recursive: true });
|
|
103609
104010
|
import_node_fs103.default.writeFileSync(
|
|
@@ -103658,7 +104059,7 @@ function frameworkDigest(directory2, signal) {
|
|
|
103658
104059
|
if (target !== root && !target.startsWith(`${root}${import_node_path105.default.sep}`))
|
|
103659
104060
|
throw new Error(`framework link escapes its tree: ${relative7}`);
|
|
103660
104061
|
}
|
|
103661
|
-
return (0,
|
|
104062
|
+
return (0, import_node_crypto63.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
|
|
103662
104063
|
}
|
|
103663
104064
|
function rewritePreparedPaths(options2) {
|
|
103664
104065
|
const { units, sourceRoot, preparedRoot, signal } = options2;
|
|
@@ -103679,7 +104080,7 @@ function rewritePreparedPaths(options2) {
|
|
|
103679
104080
|
return null;
|
|
103680
104081
|
}
|
|
103681
104082
|
if (!preparedBytes.equals(sourceBytes)) return null;
|
|
103682
|
-
dependencies[sourceFile] = (0,
|
|
104083
|
+
dependencies[sourceFile] = (0, import_node_crypto63.createHash)("sha256").update(sourceBytes).digest("hex");
|
|
103683
104084
|
verifiedFiles.set(preparedFile, sourceFile);
|
|
103684
104085
|
return sourceFile;
|
|
103685
104086
|
};
|
|
@@ -103756,7 +104157,7 @@ function rewritePreparedPaths(options2) {
|
|
|
103756
104157
|
portableDir = import_node_path105.default.join(parent, import_node_path105.default.basename(dir));
|
|
103757
104158
|
if (!import_node_fs103.default.existsSync(portableDir)) {
|
|
103758
104159
|
import_node_fs103.default.mkdirSync(parent, { recursive: true });
|
|
103759
|
-
const tmp = import_node_path105.default.join(parent, `.${process.pid}.${(0,
|
|
104160
|
+
const tmp = import_node_path105.default.join(parent, `.${process.pid}.${(0, import_node_crypto63.randomUUID)()}.tmp`);
|
|
103760
104161
|
try {
|
|
103761
104162
|
import_node_fs103.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
|
|
103762
104163
|
if (frameworkDigest(tmp, signal) !== preparedDigest)
|
|
@@ -103785,7 +104186,7 @@ function writeExpoDiscovery(options2) {
|
|
|
103785
104186
|
try {
|
|
103786
104187
|
const dir = expoDiscoveryCacheDir();
|
|
103787
104188
|
import_node_fs103.default.mkdirSync(dir, { recursive: true });
|
|
103788
|
-
const tmp = import_node_path105.default.join(dir, `.${options2.key}.${process.pid}.${(0,
|
|
104189
|
+
const tmp = import_node_path105.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto63.randomUUID)()}.tmp`);
|
|
103789
104190
|
if (options2.units === null) {
|
|
103790
104191
|
import_node_fs103.default.writeFileSync(
|
|
103791
104192
|
tmp,
|
|
@@ -103848,8 +104249,8 @@ function writeExpoDiscovery(options2) {
|
|
|
103848
104249
|
}
|
|
103849
104250
|
);
|
|
103850
104251
|
const contents2 = (0, import_node_zlib7.zstdCompressSync)(Buffer.concat(chunks, size2));
|
|
103851
|
-
const archive = (0,
|
|
103852
|
-
const temporary = import_node_path105.default.join(blobDir, "." + (0,
|
|
104252
|
+
const archive = (0, import_node_crypto63.createHash)("sha256").update(contents2).digest("hex");
|
|
104253
|
+
const temporary = import_node_path105.default.join(blobDir, "." + (0, import_node_crypto63.randomUUID)() + ".tmp");
|
|
103853
104254
|
try {
|
|
103854
104255
|
import_node_fs103.default.writeFileSync(temporary, contents2);
|
|
103855
104256
|
import_node_fs103.default.renameSync(temporary, import_node_path105.default.join(blobDir, `${archive}.zst`));
|
|
@@ -103876,11 +104277,11 @@ function writeExpoDiscovery(options2) {
|
|
|
103876
104277
|
return error instanceof Error ? error.message : String(error);
|
|
103877
104278
|
}
|
|
103878
104279
|
}
|
|
103879
|
-
var
|
|
104280
|
+
var import_node_crypto63, import_node_fs103, import_node_path105, import_node_zlib7, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings2, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
|
|
103880
104281
|
var init_expo_discovery_cache = __esm({
|
|
103881
104282
|
"src/expo-discovery-cache.ts"() {
|
|
103882
104283
|
"use strict";
|
|
103883
|
-
|
|
104284
|
+
import_node_crypto63 = require("node:crypto");
|
|
103884
104285
|
import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
103885
104286
|
import_node_path105 = __toESM(require("node:path"), 1);
|
|
103886
104287
|
import_node_zlib7 = require("node:zlib");
|
|
@@ -104956,7 +105357,7 @@ function hashPackageTree(root, options2) {
|
|
|
104956
105357
|
}
|
|
104957
105358
|
};
|
|
104958
105359
|
walk4(root, "");
|
|
104959
|
-
const hash = (0,
|
|
105360
|
+
const hash = (0, import_node_crypto64.createHash)("sha256");
|
|
104960
105361
|
return (async () => {
|
|
104961
105362
|
for (let start = 0; start < files2.length; start += READ_AHEAD) {
|
|
104962
105363
|
const batch = files2.slice(start, start + READ_AHEAD);
|
|
@@ -104977,11 +105378,11 @@ function nativePackageTreeDigest(root) {
|
|
|
104977
105378
|
skipFile: (name3) => name3.endsWith(".d.ts") || name3.endsWith(".d.ts.map") || name3.endsWith(".js.map")
|
|
104978
105379
|
});
|
|
104979
105380
|
}
|
|
104980
|
-
var
|
|
105381
|
+
var import_node_crypto64, import_node_fs106, import_promises12, import_node_path108, READ_AHEAD;
|
|
104981
105382
|
var init_package_tree_digest = __esm({
|
|
104982
105383
|
"src/package-tree-digest.ts"() {
|
|
104983
105384
|
"use strict";
|
|
104984
|
-
|
|
105385
|
+
import_node_crypto64 = require("node:crypto");
|
|
104985
105386
|
import_node_fs106 = require("node:fs");
|
|
104986
105387
|
import_promises12 = require("node:fs/promises");
|
|
104987
105388
|
import_node_path108 = require("node:path");
|
|
@@ -105061,7 +105462,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
105061
105462
|
"swift-pin": JSON.stringify(swiftNativePin()),
|
|
105062
105463
|
answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
|
|
105063
105464
|
"pods-environment": JSON.stringify(reactNativePodsEnvironment()),
|
|
105064
|
-
fingerprint: (0,
|
|
105465
|
+
fingerprint: (0, import_node_crypto65.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
|
|
105065
105466
|
},
|
|
105066
105467
|
packages
|
|
105067
105468
|
};
|
|
@@ -105179,7 +105580,7 @@ async function managedExpoNativeAppIdentity(appRoot, iosTarget) {
|
|
|
105179
105580
|
}
|
|
105180
105581
|
function servedExpoSwift(appRoot, entry, app) {
|
|
105181
105582
|
if (!entry.expoSwift) return null;
|
|
105182
|
-
const rootId = `${(0,
|
|
105583
|
+
const rootId = `${(0, import_node_crypto65.createHash)("sha256").update(import_node_fs107.default.realpathSync(appRoot)).digest("hex")}/Expo`;
|
|
105183
105584
|
if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
|
|
105184
105585
|
const installed2 = installedInfoPlist(app.infoPlist, entry.infoPlist);
|
|
105185
105586
|
const infoPlist2 = Buffer.from(installed2).toString("base64");
|
|
@@ -105207,11 +105608,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
|
|
|
105207
105608
|
await prebuiltAppTarget(appRoot, signal, "installed")
|
|
105208
105609
|
);
|
|
105209
105610
|
}
|
|
105210
|
-
var
|
|
105611
|
+
var import_node_crypto65, import_node_fs107, import_node_module13, import_node_path109, import_node_util14, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published, lookups, answers;
|
|
105211
105612
|
var init_expo_native_prebuilt = __esm({
|
|
105212
105613
|
"src/expo-native-prebuilt.ts"() {
|
|
105213
105614
|
"use strict";
|
|
105214
|
-
|
|
105615
|
+
import_node_crypto65 = require("node:crypto");
|
|
105215
105616
|
import_node_fs107 = __toESM(require("node:fs"), 1);
|
|
105216
105617
|
import_node_module13 = require("node:module");
|
|
105217
105618
|
import_node_path109 = __toESM(require("node:path"), 1);
|
|
@@ -105263,7 +105664,7 @@ function watchNativeInputs(root) {
|
|
|
105263
105664
|
(0, import_node_timers2.clearTimeout)(expiry);
|
|
105264
105665
|
for (const watcher of watchers) watcher.close();
|
|
105265
105666
|
}
|
|
105266
|
-
const inputs2 = { expiry, revision: (0,
|
|
105667
|
+
const inputs2 = { expiry, revision: (0, import_node_crypto66.randomUUID)() };
|
|
105267
105668
|
const watch4 = (directory2, recursive, name3) => {
|
|
105268
105669
|
const watcher = import_node_fs108.default.watch(
|
|
105269
105670
|
directory2,
|
|
@@ -105308,11 +105709,11 @@ function nativeInputRevision(root) {
|
|
|
105308
105709
|
const inputs2 = watchNativeInputs(root);
|
|
105309
105710
|
if (inputs2) return JSON.stringify([inputs2.revision, resolveActiveRuntimeRoot()]);
|
|
105310
105711
|
}
|
|
105311
|
-
var
|
|
105712
|
+
var import_node_crypto66, import_node_fs108, import_node_path110, import_node_timers2, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
|
|
105312
105713
|
var init_native_preparation = __esm({
|
|
105313
105714
|
"src/native-preparation.ts"() {
|
|
105314
105715
|
"use strict";
|
|
105315
|
-
|
|
105716
|
+
import_node_crypto66 = require("node:crypto");
|
|
105316
105717
|
import_node_fs108 = __toESM(require("node:fs"), 1);
|
|
105317
105718
|
import_node_path110 = __toESM(require("node:path"), 1);
|
|
105318
105719
|
import_node_timers2 = require("node:timers");
|
|
@@ -105492,7 +105893,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk2, distribution) {
|
|
|
105492
105893
|
return { name: recipe2.name, inputs: inputs2, key: nativeEntryKey(inputs2) };
|
|
105493
105894
|
}
|
|
105494
105895
|
function nativeStaticLibraryRecipe(bytes) {
|
|
105495
|
-
const digest3 = (0,
|
|
105896
|
+
const digest3 = (0, import_node_crypto67.createHash)("sha256").update(bytes).digest("hex");
|
|
105496
105897
|
return NATIVE_STATIC_LIBRARY_RECIPES.find((item) => item.nativeSha256 === digest3);
|
|
105497
105898
|
}
|
|
105498
105899
|
function nativeStaticLibrary(file, recipe2, moduleRoot) {
|
|
@@ -105535,7 +105936,7 @@ function isRustSymbol(name3, demangled) {
|
|
|
105535
105936
|
function rustStaticLibrary(file, moduleRoot) {
|
|
105536
105937
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
105537
105938
|
const bytes = import_node_fs110.default.readFileSync(file);
|
|
105538
|
-
const key2 = (0,
|
|
105939
|
+
const key2 = (0, import_node_crypto67.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
|
|
105539
105940
|
const directory2 = import_node_path112.default.join(cacheDir(), "native-archives", key2);
|
|
105540
105941
|
const archive = import_node_path112.default.join(directory2, "library.a");
|
|
105541
105942
|
if (import_node_fs110.default.existsSync(archive)) return archive;
|
|
@@ -105564,7 +105965,7 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
105564
105965
|
const members2 = readArMembers(bytes, true);
|
|
105565
105966
|
const seen = /* @__PURE__ */ new Set();
|
|
105566
105967
|
const unique2 = members2.filter(({ name: name3, bytes: bytes2 }) => {
|
|
105567
|
-
const identity2 = name3 + "\0" + (0,
|
|
105968
|
+
const identity2 = name3 + "\0" + (0, import_node_crypto67.createHash)("sha256").update(bytes2).digest("hex");
|
|
105568
105969
|
if (seen.has(identity2)) return false;
|
|
105569
105970
|
seen.add(identity2);
|
|
105570
105971
|
return true;
|
|
@@ -105611,14 +106012,14 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
105611
106012
|
function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
105612
106013
|
if (files2.length === 1) return files2[0];
|
|
105613
106014
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
105614
|
-
const hash = (0,
|
|
106015
|
+
const hash = (0, import_node_crypto67.createHash)("sha256").update(toolchain.release);
|
|
105615
106016
|
for (const file of files2)
|
|
105616
106017
|
hash.update("\0").update(import_node_path112.default.basename(file)).update("\0").update(import_node_fs110.default.readFileSync(file));
|
|
105617
106018
|
const directory2 = import_node_path112.default.join(cacheDir(), "native-archives", hash.digest("hex"));
|
|
105618
106019
|
const archive = import_node_path112.default.join(directory2, "combined.a");
|
|
105619
106020
|
if (import_node_fs110.default.existsSync(archive)) return archive;
|
|
105620
106021
|
import_node_fs110.default.mkdirSync(directory2, { recursive: true });
|
|
105621
|
-
const temporary = import_node_path112.default.join(directory2, `combined-${(0,
|
|
106022
|
+
const temporary = import_node_path112.default.join(directory2, `combined-${(0, import_node_crypto67.randomUUID)()}.a`);
|
|
105622
106023
|
try {
|
|
105623
106024
|
(0, import_node_child_process52.execFileSync)(import_node_path112.default.join(toolchain.toolchainBin, "llvm-ar"), [
|
|
105624
106025
|
"qcsDL",
|
|
@@ -105631,12 +106032,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
|
105631
106032
|
}
|
|
105632
106033
|
return archive;
|
|
105633
106034
|
}
|
|
105634
|
-
var import_node_child_process52,
|
|
106035
|
+
var import_node_child_process52, import_node_crypto67, import_node_fs110, import_node_path112, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
|
|
105635
106036
|
var init_native_static_libraries = __esm({
|
|
105636
106037
|
"src/native-static-libraries.ts"() {
|
|
105637
106038
|
"use strict";
|
|
105638
106039
|
import_node_child_process52 = require("node:child_process");
|
|
105639
|
-
|
|
106040
|
+
import_node_crypto67 = require("node:crypto");
|
|
105640
106041
|
import_node_fs110 = __toESM(require("node:fs"), 1);
|
|
105641
106042
|
import_node_path112 = __toESM(require("node:path"), 1);
|
|
105642
106043
|
init_home_paths();
|
|
@@ -106241,13 +106642,13 @@ var init_swift_wasm64_wamr = __esm({
|
|
|
106241
106642
|
|
|
106242
106643
|
// src/swift-wasm64-native-source.ts
|
|
106243
106644
|
function deriveSource(file, bytes, backport) {
|
|
106244
|
-
if (!backport || (0,
|
|
106645
|
+
if (!backport || (0, import_node_crypto68.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
|
|
106245
106646
|
return null;
|
|
106246
106647
|
const source = bytes.toString("utf8");
|
|
106247
106648
|
const derived = Buffer.from(
|
|
106248
106649
|
"rewrite" in backport ? backport.rewrite(source) : source.replace(backport.before, backport.after)
|
|
106249
106650
|
);
|
|
106250
|
-
if ((0,
|
|
106651
|
+
if ((0, import_node_crypto68.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
|
|
106251
106652
|
throw new Error(`Native source derivation differs: ${file}`);
|
|
106252
106653
|
return {
|
|
106253
106654
|
bytes: derived,
|
|
@@ -106266,11 +106667,11 @@ function deriveWasm64NativeSource(file, bytes) {
|
|
|
106266
106667
|
sourceDerivations.get(name3) ?? headerDerivations.get(name3)
|
|
106267
106668
|
);
|
|
106268
106669
|
}
|
|
106269
|
-
var
|
|
106670
|
+
var import_node_crypto68, import_node_path114, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
|
|
106270
106671
|
var init_swift_wasm64_native_source = __esm({
|
|
106271
106672
|
"src/swift-wasm64-native-source.ts"() {
|
|
106272
106673
|
"use strict";
|
|
106273
|
-
|
|
106674
|
+
import_node_crypto68 = require("node:crypto");
|
|
106274
106675
|
import_node_path114 = __toESM(require("node:path"), 1);
|
|
106275
106676
|
init_swift_wasm64_wamr();
|
|
106276
106677
|
init_swiftWasm64ConfigContract();
|
|
@@ -106730,7 +107131,7 @@ var init_genrule_library_builds = __esm({
|
|
|
106730
107131
|
function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
106731
107132
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
106732
107133
|
const sdk2 = swiftSdkPaths(moduleRoot, toolchainBin);
|
|
106733
|
-
const identity2 = (0,
|
|
107134
|
+
const identity2 = (0, import_node_crypto69.createHash)("sha256").update(
|
|
106734
107135
|
JSON.stringify([
|
|
106735
107136
|
distribution?.id,
|
|
106736
107137
|
distribution?.link,
|
|
@@ -106756,7 +107157,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
106756
107157
|
for (const alias of product.frameworkAliases) {
|
|
106757
107158
|
if (alias.wasmSdkId !== distribution.wasmSdkId || alias.wasmSdkChecksum !== distribution.wasmSdkChecksum)
|
|
106758
107159
|
throw new Error(`framework SDK identity differs for ${alias.name}`);
|
|
106759
|
-
if ((0,
|
|
107160
|
+
if ((0, import_node_crypto69.createHash)("sha256").update(import_node_fs113.default.readFileSync(import_node_path116.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
106760
107161
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
106761
107162
|
const selected = /* @__PURE__ */ new Set();
|
|
106762
107163
|
const reach = (name3) => {
|
|
@@ -106797,7 +107198,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
106797
107198
|
for (const alias of owner.frameworkAliases) {
|
|
106798
107199
|
if (frameworkResponses[alias.name])
|
|
106799
107200
|
throw new Error(`ambiguous declared framework ${alias.name}`);
|
|
106800
|
-
if ((0,
|
|
107201
|
+
if ((0, import_node_crypto69.createHash)("sha256").update(import_node_fs113.default.readFileSync(import_node_path116.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
106801
107202
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
106802
107203
|
const file = import_node_path116.default.join(root, `${alias.name}.rsp`);
|
|
106803
107204
|
import_node_fs113.default.writeFileSync(file, aliasArtifacts.map(quote3).join("\n") + "\n");
|
|
@@ -106891,11 +107292,11 @@ exec ${shellQuote(configuration2.compiler)} "$@"
|
|
|
106891
107292
|
};
|
|
106892
107293
|
return { cc: compiler("clang"), cxx: compiler("clang++"), identity: identity2 };
|
|
106893
107294
|
}
|
|
106894
|
-
var
|
|
107295
|
+
var import_node_crypto69, import_node_fs113, import_node_path116, v7;
|
|
106895
107296
|
var init_native_framework_compiler = __esm({
|
|
106896
107297
|
"src/native-framework-compiler.ts"() {
|
|
106897
107298
|
"use strict";
|
|
106898
|
-
|
|
107299
|
+
import_node_crypto69 = require("node:crypto");
|
|
106899
107300
|
import_node_fs113 = __toESM(require("node:fs"), 1);
|
|
106900
107301
|
import_node_path116 = __toESM(require("node:path"), 1);
|
|
106901
107302
|
v7 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
@@ -106916,7 +107317,7 @@ function processAlive(pid) {
|
|
|
106916
107317
|
}
|
|
106917
107318
|
function tryAcquireNumberedLock(directory2, detail = "") {
|
|
106918
107319
|
(0, import_node_fs114.mkdirSync)(directory2, { recursive: true });
|
|
106919
|
-
const claim = (0, import_node_path117.join)(directory2, `claim-${process.pid}-${(0,
|
|
107320
|
+
const claim = (0, import_node_path117.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto70.randomUUID)()}`);
|
|
106920
107321
|
for (; ; ) {
|
|
106921
107322
|
const numbers = (0, import_node_fs114.readdirSync)(directory2).filter((name3) => /^\d+$/.test(name3)).map(Number);
|
|
106922
107323
|
const top = Math.max(-1, ...numbers);
|
|
@@ -106955,11 +107356,11 @@ ${detail}` : ""}`);
|
|
|
106955
107356
|
};
|
|
106956
107357
|
}
|
|
106957
107358
|
}
|
|
106958
|
-
var
|
|
107359
|
+
var import_node_crypto70, import_node_fs114, import_node_path117, errorCode2;
|
|
106959
107360
|
var init_numbered_lock = __esm({
|
|
106960
107361
|
"src/numbered-lock.ts"() {
|
|
106961
107362
|
"use strict";
|
|
106962
|
-
|
|
107363
|
+
import_node_crypto70 = require("node:crypto");
|
|
106963
107364
|
import_node_fs114 = require("node:fs");
|
|
106964
107365
|
import_node_path117 = require("node:path");
|
|
106965
107366
|
errorCode2 = (error) => error instanceof Error && "code" in error ? error.code : void 0;
|
|
@@ -106986,7 +107387,7 @@ function llvmIdentity(toolchainBin, release) {
|
|
|
106986
107387
|
] : ["clang", "wasm-ld", "llvm-ar", "llvm-nm", "llvm-strip"].map(
|
|
106987
107388
|
(name3) => swiftFileChecksum(import_node_path118.default.join(toolchainBin, name3))
|
|
106988
107389
|
);
|
|
106989
|
-
const identity2 = (0,
|
|
107390
|
+
const identity2 = (0, import_node_crypto71.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
|
|
106990
107391
|
toolIdentities.set(toolchainBin, identity2);
|
|
106991
107392
|
return identity2;
|
|
106992
107393
|
}
|
|
@@ -106994,7 +107395,7 @@ function cSdkIdentity(sysroot, resourceDir, frameworks) {
|
|
|
106994
107395
|
const key2 = JSON.stringify([sysroot, resourceDir, frameworks]);
|
|
106995
107396
|
const cached5 = sysrootIdentities.get(key2);
|
|
106996
107397
|
if (cached5) return cached5;
|
|
106997
|
-
const hash = (0,
|
|
107398
|
+
const hash = (0, import_node_crypto71.createHash)("sha256");
|
|
106998
107399
|
const add2 = (root, relative7) => {
|
|
106999
107400
|
const file = import_node_path118.default.join(root, relative7);
|
|
107000
107401
|
const stat2 = import_node_fs115.default.statSync(file, { throwIfNoEntry: false });
|
|
@@ -107029,7 +107430,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
107029
107430
|
import_node_fs115.default.readFileSync(import_node_path118.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
107030
107431
|
)
|
|
107031
107432
|
);
|
|
107032
|
-
const hash = (0,
|
|
107433
|
+
const hash = (0, import_node_crypto71.createHash)("sha256").update(
|
|
107033
107434
|
JSON.stringify([
|
|
107034
107435
|
headers,
|
|
107035
107436
|
distribution.link,
|
|
@@ -107039,7 +107440,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
107039
107440
|
])
|
|
107040
107441
|
);
|
|
107041
107442
|
const objects = distribution.objects.map((file) => [file, distribution.files[file]]);
|
|
107042
|
-
const objectKey = (0,
|
|
107443
|
+
const objectKey = (0, import_node_crypto71.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
|
|
107043
107444
|
const cache = import_node_path118.default.join(cacheDir4, "framework-symbols-by-object", objectKey);
|
|
107044
107445
|
if (!import_node_fs115.default.existsSync(cache)) {
|
|
107045
107446
|
import_node_fs115.default.mkdirSync(import_node_path118.default.dirname(cache), { recursive: true });
|
|
@@ -107074,7 +107475,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
107074
107475
|
const digest3 = import_node_path118.default.join(temporary, "digest");
|
|
107075
107476
|
import_node_fs115.default.writeFileSync(
|
|
107076
107477
|
digest3,
|
|
107077
|
-
(0,
|
|
107478
|
+
(0, import_node_crypto71.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
|
|
107078
107479
|
);
|
|
107079
107480
|
import_node_fs115.default.renameSync(digest3, cache);
|
|
107080
107481
|
} finally {
|
|
@@ -107129,7 +107530,7 @@ function buildable(declaration) {
|
|
|
107129
107530
|
return builderOf(declaration) !== null && declaration.dependencies.every(buildable);
|
|
107130
107531
|
}
|
|
107131
107532
|
function declarationInputs(declaration, builder, toolchain, dependencyKeys) {
|
|
107132
|
-
const hash = (0,
|
|
107533
|
+
const hash = (0, import_node_crypto71.createHash)("sha256");
|
|
107133
107534
|
const files2 = declaration.sources.filter(
|
|
107134
107535
|
(source) => !source.generator && !source.file.split(import_node_path118.default.sep).includes(".git")
|
|
107135
107536
|
).map((source) => import_node_path118.default.relative(declaration.packageDir, source.file));
|
|
@@ -107263,12 +107664,12 @@ function genruleArchive(declaration, library, moduleRoot) {
|
|
|
107263
107664
|
}
|
|
107264
107665
|
return combined;
|
|
107265
107666
|
}
|
|
107266
|
-
var import_node_child_process55,
|
|
107667
|
+
var import_node_child_process55, import_node_crypto71, import_node_fs115, import_node_os23, import_node_path118, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
|
|
107267
107668
|
var init_genrule_archives = __esm({
|
|
107268
107669
|
"src/genrule-archives.ts"() {
|
|
107269
107670
|
"use strict";
|
|
107270
107671
|
import_node_child_process55 = require("node:child_process");
|
|
107271
|
-
|
|
107672
|
+
import_node_crypto71 = require("node:crypto");
|
|
107272
107673
|
import_node_fs115 = __toESM(require("node:fs"), 1);
|
|
107273
107674
|
import_node_os23 = __toESM(require("node:os"), 1);
|
|
107274
107675
|
import_node_path118 = __toESM(require("node:path"), 1);
|
|
@@ -107376,7 +107777,7 @@ function privateSentrySlice(entry, moduleRoot) {
|
|
|
107376
107777
|
function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact) {
|
|
107377
107778
|
if (standin.module !== SENTRY_SWIFT_SLICE.name) return standin;
|
|
107378
107779
|
const native = simulatorNativeLibrary(artifact());
|
|
107379
|
-
if (!native || (0,
|
|
107780
|
+
if (!native || (0, import_node_crypto72.createHash)("sha256").update(import_node_fs116.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
|
|
107380
107781
|
return standin;
|
|
107381
107782
|
if (configured)
|
|
107382
107783
|
throw new Error(
|
|
@@ -107434,12 +107835,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
|
|
|
107434
107835
|
}
|
|
107435
107836
|
};
|
|
107436
107837
|
}
|
|
107437
|
-
var import_node_child_process56,
|
|
107838
|
+
var import_node_child_process56, import_node_crypto72, import_node_fs116, import_node_os24, import_node_path119, SENTRY_SWIFT_SLICE;
|
|
107438
107839
|
var init_native_swift_slices = __esm({
|
|
107439
107840
|
"src/native-swift-slices.ts"() {
|
|
107440
107841
|
"use strict";
|
|
107441
107842
|
import_node_child_process56 = require("node:child_process");
|
|
107442
|
-
|
|
107843
|
+
import_node_crypto72 = require("node:crypto");
|
|
107443
107844
|
import_node_fs116 = __toESM(require("node:fs"), 1);
|
|
107444
107845
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
107445
107846
|
import_node_path119 = __toESM(require("node:path"), 1);
|
|
@@ -108247,7 +108648,7 @@ function treeDigest2(root) {
|
|
|
108247
108648
|
}).join("\n");
|
|
108248
108649
|
const memo2 = digests.get(`tree\0${root}`);
|
|
108249
108650
|
if (memo2?.stamp === stamp) return memo2.digest;
|
|
108250
|
-
const hash = (0,
|
|
108651
|
+
const hash = (0, import_node_crypto73.createHash)("sha256");
|
|
108251
108652
|
for (const name3 of names) {
|
|
108252
108653
|
hash.update(`${name3}\0`);
|
|
108253
108654
|
hash.update(import_node_fs120.default.readFileSync(import_node_path122.default.join(root, name3)));
|
|
@@ -108294,7 +108695,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
108294
108695
|
const found4 = locateXcframework(import_node_path122.default.join(dir, "tree"));
|
|
108295
108696
|
if (found4) return { dir: found4, digest: stored.sha };
|
|
108296
108697
|
}
|
|
108297
|
-
const sha2 = (0,
|
|
108698
|
+
const sha2 = (0, import_node_crypto73.createHash)("sha256").update(import_node_fs120.default.readFileSync(binary2.dir)).digest("hex");
|
|
108298
108699
|
if (sha2 !== stored?.sha || !locateXcframework(import_node_path122.default.join(dir, "tree"))) {
|
|
108299
108700
|
import_node_fs120.default.rmSync(dir, { recursive: true, force: true });
|
|
108300
108701
|
import_node_fs120.default.mkdirSync(import_node_path122.default.join(dir, "tree"), { recursive: true });
|
|
@@ -108306,7 +108707,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
108306
108707
|
return { dir: found3, digest: sha2 };
|
|
108307
108708
|
}
|
|
108308
108709
|
if (stored && import_node_fs120.default.existsSync(archive)) {
|
|
108309
|
-
const sha2 = (0,
|
|
108710
|
+
const sha2 = (0, import_node_crypto73.createHash)("sha256").update(import_node_fs120.default.readFileSync(archive)).digest("hex");
|
|
108310
108711
|
if (sha2 !== expected)
|
|
108311
108712
|
throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
|
|
108312
108713
|
const found3 = locateXcframework(import_node_path122.default.join(dir, "tree"));
|
|
@@ -108315,7 +108716,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
108315
108716
|
import_node_fs120.default.rmSync(dir, { recursive: true, force: true });
|
|
108316
108717
|
import_node_fs120.default.mkdirSync(import_node_path122.default.join(dir, "tree"), { recursive: true });
|
|
108317
108718
|
exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
|
|
108318
|
-
const sha = (0,
|
|
108719
|
+
const sha = (0, import_node_crypto73.createHash)("sha256").update(import_node_fs120.default.readFileSync(archive)).digest("hex");
|
|
108319
108720
|
if (sha !== expected) {
|
|
108320
108721
|
import_node_fs120.default.rmSync(dir, { recursive: true, force: true });
|
|
108321
108722
|
throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
|
|
@@ -108440,7 +108841,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
108440
108841
|
});
|
|
108441
108842
|
}
|
|
108442
108843
|
}
|
|
108443
|
-
const declaredDigest = (0,
|
|
108844
|
+
const declaredDigest = (0, import_node_crypto73.createHash)("sha256");
|
|
108444
108845
|
for (const framework of providedFrameworks)
|
|
108445
108846
|
declaredDigest.update(`provided/${import_node_path122.default.relative(artifact.dir, framework)}\0`);
|
|
108446
108847
|
for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
|
|
@@ -108510,7 +108911,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
108510
108911
|
import_node_fs120.default.copyFileSync(surface.modulemap, modulemap);
|
|
108511
108912
|
}
|
|
108512
108913
|
}
|
|
108513
|
-
const contents2 = (0,
|
|
108914
|
+
const contents2 = (0, import_node_crypto73.createHash)("sha256");
|
|
108514
108915
|
for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
|
|
108515
108916
|
const modulemap = import_node_path122.default.join(
|
|
108516
108917
|
pending2,
|
|
@@ -109925,7 +110326,7 @@ function crateSourceRoots(manifest, searchRoot) {
|
|
|
109925
110326
|
return roots;
|
|
109926
110327
|
}
|
|
109927
110328
|
function crateSourceDigest(manifest, searchRoot) {
|
|
109928
|
-
const hash = (0,
|
|
110329
|
+
const hash = (0, import_node_crypto73.createHash)("sha256");
|
|
109929
110330
|
const walk4 = (dir, root) => {
|
|
109930
110331
|
for (const entry of import_node_fs120.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
|
|
109931
110332
|
const full = import_node_path122.default.join(dir, entry.name);
|
|
@@ -110372,7 +110773,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
110372
110773
|
...swiftSources.flags,
|
|
110373
110774
|
...swiftSources.sources.flatMap((source) => [
|
|
110374
110775
|
source,
|
|
110375
|
-
(0,
|
|
110776
|
+
(0, import_node_crypto73.createHash)("sha256").update(import_node_fs120.default.readFileSync(import_node_path122.default.join(binary2.dir, source))).digest("hex")
|
|
110376
110777
|
])
|
|
110377
110778
|
);
|
|
110378
110779
|
continue;
|
|
@@ -110408,7 +110809,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
110408
110809
|
);
|
|
110409
110810
|
}
|
|
110410
110811
|
}
|
|
110411
|
-
return (0,
|
|
110812
|
+
return (0, import_node_crypto73.createHash)("sha256").update(parts2.join("\0")).digest("hex");
|
|
110412
110813
|
}
|
|
110413
110814
|
function missingArtifactGap(binary2) {
|
|
110414
110815
|
if (swiftBinaryOnDisk(binary2)) return null;
|
|
@@ -110490,7 +110891,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
110490
110891
|
return NO_IMPORTABLE_SURFACE;
|
|
110491
110892
|
}
|
|
110492
110893
|
const configured = new Map(Object.entries(behavior));
|
|
110493
|
-
const hash = (0,
|
|
110894
|
+
const hash = (0, import_node_crypto73.createHash)("sha256").update(
|
|
110494
110895
|
standinGenerationInputs([binary2], toolchain, behavior)
|
|
110495
110896
|
);
|
|
110496
110897
|
hash.update(digest3);
|
|
@@ -110730,7 +111131,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
110730
111131
|
);
|
|
110731
111132
|
if (binary2.moduleSources !== void 0)
|
|
110732
111133
|
frameworkInputs.push(
|
|
110733
|
-
`${binary2.target}\0${(0,
|
|
111134
|
+
`${binary2.target}\0${(0, import_node_crypto73.createHash)("sha256").update(
|
|
110734
111135
|
[iosSdkId(), ...swiftSources.flags, ...swiftSources.sources, ...texts].join(
|
|
110735
111136
|
"\0"
|
|
110736
111137
|
)
|
|
@@ -110771,7 +111172,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
110771
111172
|
import_node_fs120.default.mkdirSync(sourceFrameworks);
|
|
110772
111173
|
const frameworks = {
|
|
110773
111174
|
dirs: [...frameworkDirs, sourceFrameworks].sort(),
|
|
110774
|
-
digest: (0,
|
|
111175
|
+
digest: (0, import_node_crypto73.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
|
|
110775
111176
|
surfaces: frameworkSurfaces
|
|
110776
111177
|
};
|
|
110777
111178
|
const siblings = new Map(
|
|
@@ -110890,12 +111291,12 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
110890
111291
|
import_node_fs120.default.rmSync(modules, { recursive: true, force: true });
|
|
110891
111292
|
}
|
|
110892
111293
|
}
|
|
110893
|
-
var import_node_child_process58,
|
|
111294
|
+
var import_node_child_process58, import_node_crypto73, import_node_fs120, import_node_path122, 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;
|
|
110894
111295
|
var init_swift_standins = __esm({
|
|
110895
111296
|
"src/swift-standins.ts"() {
|
|
110896
111297
|
"use strict";
|
|
110897
111298
|
import_node_child_process58 = require("node:child_process");
|
|
110898
|
-
|
|
111299
|
+
import_node_crypto73 = require("node:crypto");
|
|
110899
111300
|
import_node_fs120 = __toESM(require("node:fs"), 1);
|
|
110900
111301
|
import_node_path122 = __toESM(require("node:path"), 1);
|
|
110901
111302
|
init_forked_script_contract();
|
|
@@ -110925,7 +111326,7 @@ var init_swift_standins = __esm({
|
|
|
110925
111326
|
init_swiftTargetContract();
|
|
110926
111327
|
TRIPLE = SWIFT_WASM_TRIPLE;
|
|
110927
111328
|
cacheDir5 = import_node_path122.default.join(cacheDir(), "swift-standins");
|
|
110928
|
-
key = (...parts2) => (0,
|
|
111329
|
+
key = (...parts2) => (0, import_node_crypto73.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
|
|
110929
111330
|
digests = /* @__PURE__ */ new Map();
|
|
110930
111331
|
isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
|
|
110931
111332
|
OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
|
|
@@ -111085,10 +111486,10 @@ function compiledFrameworkImports(app, products) {
|
|
|
111085
111486
|
}
|
|
111086
111487
|
return imports2;
|
|
111087
111488
|
}
|
|
111088
|
-
function
|
|
111489
|
+
function sha256Hex6(bytes) {
|
|
111089
111490
|
if (typeof Bun !== "undefined")
|
|
111090
111491
|
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
111091
|
-
return (0,
|
|
111492
|
+
return (0, import_node_crypto74.createHash)("sha256").update(bytes).digest("hex");
|
|
111092
111493
|
}
|
|
111093
111494
|
function regularFileStamp(file) {
|
|
111094
111495
|
const stat2 = import_node_fs121.default.lstatSync(file, { bigint: true, throwIfNoEntry: false });
|
|
@@ -111103,7 +111504,7 @@ function verifyRetainedFile(work, file, hash, stamps) {
|
|
|
111103
111504
|
if (typeof expectedStamp === "string" && regularFileStamp(resolved) === expectedStamp)
|
|
111104
111505
|
return true;
|
|
111105
111506
|
if (!import_node_fs121.default.existsSync(resolved)) return false;
|
|
111106
|
-
return
|
|
111507
|
+
return sha256Hex6(readPackageFile(work, resolved, Infinity)) === hash;
|
|
111107
111508
|
}
|
|
111108
111509
|
function recordRetainedStamps(work, files2) {
|
|
111109
111510
|
const stamps = {};
|
|
@@ -111120,7 +111521,7 @@ function cachedBinaryFileDigest(file) {
|
|
|
111120
111521
|
const memory = binaryFileDigests.get(real);
|
|
111121
111522
|
if (memory?.stamp === stamp) return memory.digest;
|
|
111122
111523
|
const dir = import_node_path123.default.join(cacheDir(), "swift-binary-digests");
|
|
111123
|
-
const record6 = import_node_path123.default.join(dir, `${
|
|
111524
|
+
const record6 = import_node_path123.default.join(dir, `${sha256Hex6(real)}.json`);
|
|
111124
111525
|
if (import_node_fs121.default.existsSync(record6)) {
|
|
111125
111526
|
const saved = JSON.parse(import_node_fs121.default.readFileSync(record6, "utf8"));
|
|
111126
111527
|
if (isRecord(saved) && saved.stamp === stamp && typeof saved.digest === "string") {
|
|
@@ -111128,10 +111529,10 @@ function cachedBinaryFileDigest(file) {
|
|
|
111128
111529
|
return saved.digest;
|
|
111129
111530
|
}
|
|
111130
111531
|
}
|
|
111131
|
-
const digest3 =
|
|
111532
|
+
const digest3 = sha256Hex6(import_node_fs121.default.readFileSync(real));
|
|
111132
111533
|
binaryFileDigests.set(real, { stamp, digest: digest3 });
|
|
111133
111534
|
import_node_fs121.default.mkdirSync(dir, { recursive: true });
|
|
111134
|
-
const partial = `${record6}.${process.pid}.${(0,
|
|
111535
|
+
const partial = `${record6}.${process.pid}.${(0, import_node_crypto74.randomUUID)()}`;
|
|
111135
111536
|
import_node_fs121.default.writeFileSync(partial, JSON.stringify({ stamp, digest: digest3 }));
|
|
111136
111537
|
import_node_fs121.default.renameSync(partial, record6);
|
|
111137
111538
|
return digest3;
|
|
@@ -111663,7 +112064,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
111663
112064
|
const staged = withFrameworkCompanionImports(original);
|
|
111664
112065
|
if (staged !== original) sources.set(file, Buffer.from(staged));
|
|
111665
112066
|
}
|
|
111666
|
-
const digest3 =
|
|
112067
|
+
const digest3 = sha256Hex6;
|
|
111667
112068
|
const providers = /* @__PURE__ */ new Map();
|
|
111668
112069
|
for (const target of targets) {
|
|
111669
112070
|
if (!supplied.has(target.moduleName)) continue;
|
|
@@ -112019,7 +112420,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
112019
112420
|
products
|
|
112020
112421
|
);
|
|
112021
112422
|
const checkouts = remoteSwiftCheckouts(app.rootDir);
|
|
112022
|
-
const digest3 =
|
|
112423
|
+
const digest3 = sha256Hex6;
|
|
112023
112424
|
const inputs2 = Object.fromEntries(
|
|
112024
112425
|
[...sources].map(([file, bytes]) => [file, digest3(bytes)])
|
|
112025
112426
|
);
|
|
@@ -112301,6 +112702,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
112301
112702
|
...flags,
|
|
112302
112703
|
...target.prefix ? ["-include", staged(target.prefix)] : [],
|
|
112303
112704
|
"-Os",
|
|
112705
|
+
...purpose === "objects" ? ["-g0"] : [],
|
|
112304
112706
|
"-c",
|
|
112305
112707
|
staged(file),
|
|
112306
112708
|
"-o",
|
|
@@ -112400,12 +112802,12 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
|
|
|
112400
112802
|
import_node_fs121.default.closeSync(descriptor);
|
|
112401
112803
|
}
|
|
112402
112804
|
}
|
|
112403
|
-
var import_node_child_process59,
|
|
112805
|
+
var import_node_child_process59, import_node_crypto74, import_node_fs121, import_node_path123, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
|
|
112404
112806
|
var init_swift_objc_compile = __esm({
|
|
112405
112807
|
"src/swift-objc-compile.ts"() {
|
|
112406
112808
|
"use strict";
|
|
112407
112809
|
import_node_child_process59 = require("node:child_process");
|
|
112408
|
-
|
|
112810
|
+
import_node_crypto74 = require("node:crypto");
|
|
112409
112811
|
import_node_fs121 = __toESM(require("node:fs"), 1);
|
|
112410
112812
|
import_node_path123 = __toESM(require("node:path"), 1);
|
|
112411
112813
|
init_mapLimit();
|
|
@@ -116570,11 +116972,11 @@ function coreDataModelDirectories(files2) {
|
|
|
116570
116972
|
}
|
|
116571
116973
|
return [...models].sort();
|
|
116572
116974
|
}
|
|
116573
|
-
var
|
|
116975
|
+
var import_node_crypto75, import_node_fs125, import_node_path127, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2563;
|
|
116574
116976
|
var init_core_data_model = __esm({
|
|
116575
116977
|
"src/core-data-model.ts"() {
|
|
116576
116978
|
"use strict";
|
|
116577
|
-
|
|
116979
|
+
import_node_crypto75 = require("node:crypto");
|
|
116578
116980
|
import_node_fs125 = require("node:fs");
|
|
116579
116981
|
import_node_path127 = __toESM(require("node:path"), 1);
|
|
116580
116982
|
init_core_data_entity_classes();
|
|
@@ -116693,7 +117095,7 @@ var init_core_data_model = __esm({
|
|
|
116693
117095
|
});
|
|
116694
117096
|
}
|
|
116695
117097
|
};
|
|
116696
|
-
sha2563 = (...parts2) => (0,
|
|
117098
|
+
sha2563 = (...parts2) => (0, import_node_crypto75.createHash)("sha256").update(
|
|
116697
117099
|
Buffer.concat(
|
|
116698
117100
|
parts2.map(
|
|
116699
117101
|
(part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
|
|
@@ -118885,7 +119287,7 @@ async function buildRiveRuntimeDependencies(checkout, moduleRoot) {
|
|
|
118885
119287
|
];
|
|
118886
119288
|
const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
|
|
118887
119289
|
const xcode = (0, import_node_child_process61.execFileSync)("xcodebuild", ["-version"], { encoding: "utf8" });
|
|
118888
|
-
const key2 = (0,
|
|
119290
|
+
const key2 = (0, import_node_crypto76.createHash)("sha256").update(
|
|
118889
119291
|
JSON.stringify([
|
|
118890
119292
|
RECIPE,
|
|
118891
119293
|
(0, import_node_child_process61.execFileSync)("git", ["-C", runtime, "rev-parse", "HEAD"], {
|
|
@@ -119096,12 +119498,12 @@ exec ${quote3(import_node_path128.default.join(toolchainBin, "llvm-ar"))} rcs "$
|
|
|
119096
119498
|
);
|
|
119097
119499
|
return directory2;
|
|
119098
119500
|
}
|
|
119099
|
-
var import_node_child_process61,
|
|
119501
|
+
var import_node_child_process61, import_node_crypto76, import_node_fs126, import_node_os25, import_node_path128, import_promises14, RECIPE, CONFIG, RUNTIME_LIBRARIES;
|
|
119100
119502
|
var init_rive_runtime_dependencies = __esm({
|
|
119101
119503
|
"src/rive-runtime-dependencies.ts"() {
|
|
119102
119504
|
"use strict";
|
|
119103
119505
|
import_node_child_process61 = require("node:child_process");
|
|
119104
|
-
|
|
119506
|
+
import_node_crypto76 = require("node:crypto");
|
|
119105
119507
|
import_node_fs126 = __toESM(require("node:fs"), 1);
|
|
119106
119508
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
119107
119509
|
import_node_path128 = __toESM(require("node:path"), 1);
|
|
@@ -119958,7 +120360,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
119958
120360
|
(binary2) => binary2.publicHeaders === void 0 && binary2.placeholder === void 0 && swiftBinaryOnDisk(binary2) && binaryHeaderSearchPaths(binary2, staged, app.rootDir).headers.length === 1
|
|
119959
120361
|
))
|
|
119960
120362
|
return [...binaries];
|
|
119961
|
-
const hash = (0,
|
|
120363
|
+
const hash = (0, import_node_crypto77.createHash)("sha256");
|
|
119962
120364
|
hash.update(
|
|
119963
120365
|
JSON.stringify([
|
|
119964
120366
|
inputs2.targets,
|
|
@@ -120167,12 +120569,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
120167
120569
|
);
|
|
120168
120570
|
return result;
|
|
120169
120571
|
}
|
|
120170
|
-
var import_node_child_process63,
|
|
120572
|
+
var import_node_child_process63, import_node_crypto77, import_node_fs128, import_node_path130, cachedInputs;
|
|
120171
120573
|
var init_swift_cxx_reachable = __esm({
|
|
120172
120574
|
"src/swift-cxx-reachable.ts"() {
|
|
120173
120575
|
"use strict";
|
|
120174
120576
|
import_node_child_process63 = require("node:child_process");
|
|
120175
|
-
|
|
120577
|
+
import_node_crypto77 = require("node:crypto");
|
|
120176
120578
|
import_node_fs128 = __toESM(require("node:fs"), 1);
|
|
120177
120579
|
import_node_path130 = __toESM(require("node:path"), 1);
|
|
120178
120580
|
init_is_record();
|
|
@@ -120720,7 +121122,7 @@ function fetchSwiftSdkDataPlan({ url, dataPlan }) {
|
|
|
120720
121122
|
if (!response.ok)
|
|
120721
121123
|
throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
|
|
120722
121124
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
120723
|
-
if ((0,
|
|
121125
|
+
if ((0, import_node_crypto78.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
|
|
120724
121126
|
throw new Error(`Swift SDK data plan ${address} failed its digest check`);
|
|
120725
121127
|
return bytes;
|
|
120726
121128
|
});
|
|
@@ -120825,7 +121227,7 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
120825
121227
|
encode2(now),
|
|
120826
121228
|
encodeNativeSdkLater({
|
|
120827
121229
|
files: later.map((bytes) => ({
|
|
120828
|
-
sha256: (0,
|
|
121230
|
+
sha256: (0, import_node_crypto78.createHash)("sha256").update(bytes).digest("hex"),
|
|
120829
121231
|
byteLength: bytes.length
|
|
120830
121232
|
})),
|
|
120831
121233
|
...needs && {
|
|
@@ -120841,11 +121243,11 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
120841
121243
|
later
|
|
120842
121244
|
};
|
|
120843
121245
|
}
|
|
120844
|
-
var
|
|
121246
|
+
var import_node_crypto78, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
|
|
120845
121247
|
var init_swift_sdk_later_data = __esm({
|
|
120846
121248
|
"src/swift-sdk-later-data.ts"() {
|
|
120847
121249
|
"use strict";
|
|
120848
|
-
|
|
121250
|
+
import_node_crypto78 = require("node:crypto");
|
|
120849
121251
|
init_nativeSdkBindingContract();
|
|
120850
121252
|
init_nativeWasmContract();
|
|
120851
121253
|
init_swift_sdk_image();
|
|
@@ -122510,7 +122912,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
122510
122912
|
const part = await guard((0, import_node_path133.join)(directory2, `side-${id}.wasm`), lazy, env);
|
|
122511
122913
|
const bytes = (0, import_node_fs131.readFileSync)(part.file);
|
|
122512
122914
|
assertWasmCodeOnly(bytes);
|
|
122513
|
-
return { ...part, slots: slots2, sha256: (0,
|
|
122915
|
+
return { ...part, slots: slots2, sha256: (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex") };
|
|
122514
122916
|
}
|
|
122515
122917
|
);
|
|
122516
122918
|
const dyldGroups = parts2.flatMap(
|
|
@@ -122578,12 +122980,12 @@ function describePart(file) {
|
|
|
122578
122980
|
);
|
|
122579
122981
|
return { file, functions, byteLength: bytes.byteLength };
|
|
122580
122982
|
}
|
|
122581
|
-
var import_node_child_process66,
|
|
122983
|
+
var import_node_child_process66, import_node_crypto79, import_node_fs131, import_node_os27, import_node_path133, import_node_util16, run11, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
|
|
122582
122984
|
var init_wasm_lazy_split = __esm({
|
|
122583
122985
|
"src/wasm-lazy-split.ts"() {
|
|
122584
122986
|
"use strict";
|
|
122585
122987
|
import_node_child_process66 = require("node:child_process");
|
|
122586
|
-
|
|
122988
|
+
import_node_crypto79 = require("node:crypto");
|
|
122587
122989
|
import_node_fs131 = require("node:fs");
|
|
122588
122990
|
import_node_os27 = require("node:os");
|
|
122589
122991
|
import_node_path133 = require("node:path");
|
|
@@ -123020,11 +123422,11 @@ async function bootSwiftPreview(launch2, profile) {
|
|
|
123020
123422
|
server.close();
|
|
123021
123423
|
}
|
|
123022
123424
|
}
|
|
123023
|
-
var
|
|
123425
|
+
var import_node_crypto80, import_node_fs132, import_node_http3, import_node_https2, import_node_os28, import_node_path134, packageName, guestPath, appPath, profileWindowMs, profileQuietMs, digest2, partDigest, platform;
|
|
123024
123426
|
var init_swift_startup_split = __esm({
|
|
123025
123427
|
"src/swift-startup-split.ts"() {
|
|
123026
123428
|
"use strict";
|
|
123027
|
-
|
|
123429
|
+
import_node_crypto80 = require("node:crypto");
|
|
123028
123430
|
import_node_fs132 = require("node:fs");
|
|
123029
123431
|
import_node_http3 = require("node:http");
|
|
123030
123432
|
import_node_https2 = require("node:https");
|
|
@@ -123049,7 +123451,7 @@ var init_swift_startup_split = __esm({
|
|
|
123049
123451
|
appPath = "/__peach/swift/startup.wasm";
|
|
123050
123452
|
profileWindowMs = 3e4;
|
|
123051
123453
|
profileQuietMs = 2e3;
|
|
123052
|
-
digest2 = (bytes) => (0,
|
|
123454
|
+
digest2 = (bytes) => (0, import_node_crypto80.createHash)("sha256").update(bytes).digest("hex");
|
|
123053
123455
|
partDigest = /^[a-f0-9]{64}$/;
|
|
123054
123456
|
platform = `${process.platform}-${process.arch}`;
|
|
123055
123457
|
}
|
|
@@ -123093,7 +123495,7 @@ function* filesUnder(absolute) {
|
|
|
123093
123495
|
}
|
|
123094
123496
|
function hashFile(absolutePath) {
|
|
123095
123497
|
try {
|
|
123096
|
-
return (0,
|
|
123498
|
+
return (0, import_node_crypto81.createHash)("sha1").update((0, import_node_fs133.readFileSync)(absolutePath)).digest("hex");
|
|
123097
123499
|
} catch {
|
|
123098
123500
|
return null;
|
|
123099
123501
|
}
|
|
@@ -123227,11 +123629,11 @@ function findStaleRoutes(monorepoRoot, routes2) {
|
|
|
123227
123629
|
}
|
|
123228
123630
|
return stale;
|
|
123229
123631
|
}
|
|
123230
|
-
var
|
|
123632
|
+
var import_node_crypto81, import_node_fs133, import_node_path135, DEV_BUILD_REBUILD_COMMAND, RECORD_DIR, PEACHSIM_ENGINE_INPUTS, ENGINE_SOURCES, ROUTES, STANDALONE_ENGINE_ROUTES, EXCLUDED_DIR_NAMES;
|
|
123231
123633
|
var init_dev_build_freshness = __esm({
|
|
123232
123634
|
"cli/dev-build-freshness.ts"() {
|
|
123233
123635
|
"use strict";
|
|
123234
|
-
|
|
123636
|
+
import_node_crypto81 = require("node:crypto");
|
|
123235
123637
|
import_node_fs133 = require("node:fs");
|
|
123236
123638
|
import_node_path135 = require("node:path");
|
|
123237
123639
|
DEV_BUILD_REBUILD_COMMAND = "bun run build:peach";
|
|
@@ -123397,7 +123799,7 @@ function nativeSourceFiles(packagePath) {
|
|
|
123397
123799
|
function swiftArtifactContentDigest(bytes) {
|
|
123398
123800
|
let digest3 = swiftArtifactDigests.get(bytes);
|
|
123399
123801
|
if (!digest3) {
|
|
123400
|
-
digest3 = (0,
|
|
123802
|
+
digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
123401
123803
|
swiftArtifactDigests.set(bytes, digest3);
|
|
123402
123804
|
}
|
|
123403
123805
|
return digest3;
|
|
@@ -123548,7 +123950,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
123548
123950
|
const clang = import_node_path136.default.join(toolchainBin, "clang");
|
|
123549
123951
|
const empty = (binary2, file) => {
|
|
123550
123952
|
const source = import_node_path136.default.join(binary2.dir, file);
|
|
123551
|
-
const key2 = (0,
|
|
123953
|
+
const key2 = (0, import_node_crypto82.createHash)("sha256").update(
|
|
123552
123954
|
JSON.stringify([
|
|
123553
123955
|
clang,
|
|
123554
123956
|
sdk2.sysroot,
|
|
@@ -123593,7 +123995,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
123593
123995
|
return new Set(portable.flat());
|
|
123594
123996
|
}
|
|
123595
123997
|
async function swiftPackages(entry, app) {
|
|
123596
|
-
const stamp = (file) => import_node_fs134.default.existsSync(file) ? (0,
|
|
123998
|
+
const stamp = (file) => import_node_fs134.default.existsSync(file) ? (0, import_node_crypto82.createHash)("sha256").update(import_node_fs134.default.readFileSync(file)).digest("hex") : null;
|
|
123597
123999
|
const owners = [...app.frameworks, app].map((target) => ({
|
|
123598
124000
|
module: target.moduleName,
|
|
123599
124001
|
products: target.packageProducts ?? []
|
|
@@ -124757,7 +125159,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
124757
125159
|
const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
|
|
124758
125160
|
bytes
|
|
124759
125161
|
);
|
|
124760
|
-
const sha2565 = (0,
|
|
125162
|
+
const sha2565 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
124761
125163
|
const bundle = swiftResourceBundleForFile(bundles, key2);
|
|
124762
125164
|
if (!bundle && inputs2["Package.swift"])
|
|
124763
125165
|
throw new Error(`metal source ${key2} has no resource target bundle`);
|
|
@@ -124780,7 +125182,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
124780
125182
|
const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
|
|
124781
125183
|
pdfs.set(file, {
|
|
124782
125184
|
file: disk,
|
|
124783
|
-
sha256: (0,
|
|
125185
|
+
sha256: (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex")
|
|
124784
125186
|
});
|
|
124785
125187
|
}
|
|
124786
125188
|
const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
|
|
@@ -124826,7 +125228,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
124826
125228
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
124827
125229
|
}
|
|
124828
125230
|
imageBytes += bytes.length;
|
|
124829
|
-
const hash = (0,
|
|
125231
|
+
const hash = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
|
|
124830
125232
|
const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
|
|
124831
125233
|
const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
|
|
124832
125234
|
const variant2 = {
|
|
@@ -125136,7 +125538,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
|
|
|
125136
125538
|
hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
|
|
125137
125539
|
}
|
|
125138
125540
|
function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
125139
|
-
const hash = (0,
|
|
125541
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
125140
125542
|
hash.update(packagePath);
|
|
125141
125543
|
updateSwiftConfigStamp(hash, packagePath);
|
|
125142
125544
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -125165,7 +125567,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
|
125165
125567
|
return hash.digest("hex").slice(0, 16);
|
|
125166
125568
|
}
|
|
125167
125569
|
function sourceContentStamp(packagePath, moduleRootOverride) {
|
|
125168
|
-
const hash = (0,
|
|
125570
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
125169
125571
|
hash.update(compilerSourceDigest);
|
|
125170
125572
|
updateSwiftConfigStamp(hash, packagePath);
|
|
125171
125573
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -125197,7 +125599,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
125197
125599
|
(root) => import_node_fs134.default.existsSync(import_node_path136.default.join(root, "toolchain.json"))
|
|
125198
125600
|
);
|
|
125199
125601
|
if (!moduleRoot) return "";
|
|
125200
|
-
const hash = (0,
|
|
125602
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
125201
125603
|
hash.update(moduleRoot);
|
|
125202
125604
|
for (const relative7 of swiftModuleInputFiles(moduleRoot)) {
|
|
125203
125605
|
hash.update(relative7);
|
|
@@ -125207,7 +125609,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
125207
125609
|
}
|
|
125208
125610
|
function otherInputs(input, standalone) {
|
|
125209
125611
|
const { files: _files, ...rest } = input;
|
|
125210
|
-
return (0,
|
|
125612
|
+
return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify({ ...rest, standalone })).digest("hex");
|
|
125211
125613
|
}
|
|
125212
125614
|
function entryRootId(packagePath, file) {
|
|
125213
125615
|
const relative7 = import_node_path136.default.relative(packagePath, file).split(import_node_path136.default.sep).join(import_node_path136.default.posix.sep);
|
|
@@ -125229,7 +125631,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
|
|
|
125229
125631
|
for (const standin of standins) {
|
|
125230
125632
|
if (!standin.prebuilt) continue;
|
|
125231
125633
|
const bytes = Buffer.from(standin.prebuilt.library, "base64");
|
|
125232
|
-
const digest3 = (0,
|
|
125634
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
125233
125635
|
const dir = import_node_path136.default.join(swiftCacheDir(), "native-archives", digest3);
|
|
125234
125636
|
import_node_fs134.default.mkdirSync(dir, { recursive: true });
|
|
125235
125637
|
const library = import_node_path136.default.join(dir, `lib${standin.module}.a`);
|
|
@@ -125578,7 +125980,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
|
|
|
125578
125980
|
return import_node_path136.default.join(
|
|
125579
125981
|
swiftCacheDir(),
|
|
125580
125982
|
"swift-builds",
|
|
125581
|
-
(0,
|
|
125983
|
+
(0, import_node_crypto82.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
|
|
125582
125984
|
);
|
|
125583
125985
|
}
|
|
125584
125986
|
function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
@@ -125879,7 +126281,7 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
|
|
|
125879
126281
|
const response = await fetch(url, { signal });
|
|
125880
126282
|
if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
|
|
125881
126283
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
125882
|
-
if (bytes.length !== byteLength || (0,
|
|
126284
|
+
if (bytes.length !== byteLength || (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
|
|
125883
126285
|
throw new Error(`swift compile: ${url} does not match its module's index`);
|
|
125884
126286
|
return { dyldTable: { sha256: sha2565, bytes } };
|
|
125885
126287
|
}
|
|
@@ -126142,10 +126544,10 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
|
126142
126544
|
sdk2.binding.bytes,
|
|
126143
126545
|
plan
|
|
126144
126546
|
);
|
|
126145
|
-
const digest3 = (0,
|
|
126547
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(split.binding).digest("hex");
|
|
126146
126548
|
sdkBindingFiles.set(digest3, split.binding);
|
|
126147
126549
|
for (const later of split.later)
|
|
126148
|
-
sdkBindingFiles.set((0,
|
|
126550
|
+
sdkBindingFiles.set((0, import_node_crypto82.createHash)("sha256").update(later).digest("hex"), later);
|
|
126149
126551
|
sdkSplitBindings.set(key2, digest3);
|
|
126150
126552
|
}
|
|
126151
126553
|
function swiftCodePartAssets(origin, appParts, sdkDigest) {
|
|
@@ -126212,7 +126614,7 @@ function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
|
126212
126614
|
function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch2, runtimeRootOverride) {
|
|
126213
126615
|
const { key: key2 } = sdk2;
|
|
126214
126616
|
const normalizedPackage = normalizedSwiftPackagePath(packagePath);
|
|
126215
|
-
const app = (0,
|
|
126617
|
+
const app = (0, import_node_crypto82.createHash)("sha256").update(
|
|
126216
126618
|
JSON.stringify([
|
|
126217
126619
|
normalizedPackage,
|
|
126218
126620
|
launch2.environment,
|
|
@@ -126244,7 +126646,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch2, run
|
|
|
126244
126646
|
},
|
|
126245
126647
|
app
|
|
126246
126648
|
);
|
|
126247
|
-
const name3 = (0,
|
|
126649
|
+
const name3 = (0, import_node_crypto82.createHash)("sha256").update(split.primary).digest("hex");
|
|
126248
126650
|
sdkPieces2.set(name3, split.primary);
|
|
126249
126651
|
for (const [digest3, bytes] of split.parts) sdkPieces2.set(digest3, bytes);
|
|
126250
126652
|
sdkStartupParts.set(name3, split.parts);
|
|
@@ -126513,13 +126915,13 @@ function disposeSwiftProject(packagePath, signal) {
|
|
|
126513
126915
|
xcodeProjects().delete(packagePath);
|
|
126514
126916
|
sourceEntries().delete(packagePath);
|
|
126515
126917
|
}
|
|
126516
|
-
var import_node_async_hooks2, import_node_child_process67,
|
|
126918
|
+
var import_node_async_hooks2, import_node_child_process67, import_node_crypto82, import_node_fs134, import_node_os29, import_node_path136, 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, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
126517
126919
|
var init_swift_host = __esm({
|
|
126518
126920
|
"src/swift-host.ts"() {
|
|
126519
126921
|
"use strict";
|
|
126520
126922
|
import_node_async_hooks2 = require("node:async_hooks");
|
|
126521
126923
|
import_node_child_process67 = require("node:child_process");
|
|
126522
|
-
|
|
126924
|
+
import_node_crypto82 = require("node:crypto");
|
|
126523
126925
|
import_node_fs134 = __toESM(require("node:fs"), 1);
|
|
126524
126926
|
import_node_os29 = __toESM(require("node:os"), 1);
|
|
126525
126927
|
import_node_path136 = __toESM(require("node:path"), 1);
|
|
@@ -127278,7 +127680,7 @@ function hashTree(root) {
|
|
|
127278
127680
|
for (const entry of import_node_fs137.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
|
|
127279
127681
|
if (!entry.isFile()) continue;
|
|
127280
127682
|
const file = import_node_path139.default.join(entry.parentPath, entry.name);
|
|
127281
|
-
hashes[import_node_path139.default.relative(root, file).split(import_node_path139.default.sep).join("/")] = (0,
|
|
127683
|
+
hashes[import_node_path139.default.relative(root, file).split(import_node_path139.default.sep).join("/")] = (0, import_node_crypto83.createHash)("sha256").update(import_node_fs137.default.readFileSync(file)).digest("hex");
|
|
127282
127684
|
}
|
|
127283
127685
|
return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
|
|
127284
127686
|
}
|
|
@@ -127328,12 +127730,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
127328
127730
|
files: hashTree(generatedRoot)
|
|
127329
127731
|
};
|
|
127330
127732
|
}
|
|
127331
|
-
var import_node_child_process68,
|
|
127733
|
+
var import_node_child_process68, import_node_crypto83, import_node_fs137, import_node_module17, import_node_path139, import_node_util17, run12, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
127332
127734
|
var init_turbo_codegen_intake = __esm({
|
|
127333
127735
|
"src/turbo-codegen-intake.ts"() {
|
|
127334
127736
|
"use strict";
|
|
127335
127737
|
import_node_child_process68 = require("node:child_process");
|
|
127336
|
-
|
|
127738
|
+
import_node_crypto83 = require("node:crypto");
|
|
127337
127739
|
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
127338
127740
|
import_node_module17 = require("node:module");
|
|
127339
127741
|
import_node_path139 = __toESM(require("node:path"), 1);
|
|
@@ -131284,11 +131686,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
|
|
|
131284
131686
|
}
|
|
131285
131687
|
`;
|
|
131286
131688
|
}
|
|
131287
|
-
var
|
|
131689
|
+
var import_node_crypto84, import_node_fs138, import_node_path140, 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, sha2564, podspecList, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_HOST_INCLUDES, FABRIC_HOST_PAPER_INCLUDES, PAPER_UIKIT_BRIDGE_SWIFT;
|
|
131288
131690
|
var init_turbo_source = __esm({
|
|
131289
131691
|
"src/turbo-source.ts"() {
|
|
131290
131692
|
"use strict";
|
|
131291
|
-
|
|
131693
|
+
import_node_crypto84 = require("node:crypto");
|
|
131292
131694
|
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
131293
131695
|
import_node_path140 = __toESM(require("node:path"), 1);
|
|
131294
131696
|
init_cocoapods_trunk();
|
|
@@ -131416,7 +131818,7 @@ var init_turbo_source = __esm({
|
|
|
131416
131818
|
];
|
|
131417
131819
|
DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
|
|
131418
131820
|
EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
|
|
131419
|
-
sha2564 = (data) => (0,
|
|
131821
|
+
sha2564 = (data) => (0, import_node_crypto84.createHash)("sha256").update(data).digest("hex");
|
|
131420
131822
|
podspecList = podspecAttribute;
|
|
131421
131823
|
versionParts = (version2) => version2.split(/[.-]/).map((p) => Number(p) || 0);
|
|
131422
131824
|
iosOf = (member) => object7(member.ios) ? member.ios : null;
|
|
@@ -132216,7 +132618,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped) {
|
|
|
132216
132618
|
}
|
|
132217
132619
|
async function prepareTurboCompileInput(options2) {
|
|
132218
132620
|
await prepareTurboSourceDependencies(options2.reactNativeRoot);
|
|
132219
|
-
const key2 = (0,
|
|
132621
|
+
const key2 = (0, import_node_crypto85.createHash)("sha256").update(options2.providers.map(({ root }) => import_node_fs139.default.realpathSync(root)).join("\0")).update("\0").update(import_node_fs139.default.realpathSync(options2.moduleRoot)).digest("hex");
|
|
132220
132622
|
const scratch2 = import_node_path141.default.join(import_node_os30.default.tmpdir(), "peach-turbo-swift", key2);
|
|
132221
132623
|
import_node_fs139.default.mkdirSync(scratch2, { recursive: true });
|
|
132222
132624
|
const codegenDir = import_node_fs139.default.mkdtempSync(import_node_path141.default.join(scratch2, "codegen-"));
|
|
@@ -132417,11 +132819,11 @@ async function compileTurboModule(options2) {
|
|
|
132417
132819
|
collection
|
|
132418
132820
|
};
|
|
132419
132821
|
}
|
|
132420
|
-
var
|
|
132822
|
+
var import_node_crypto85, import_node_fs139, import_node_module18, import_node_os30, import_node_path141;
|
|
132421
132823
|
var init_turbo_compile = __esm({
|
|
132422
132824
|
"src/turbo-compile.ts"() {
|
|
132423
132825
|
"use strict";
|
|
132424
|
-
|
|
132826
|
+
import_node_crypto85 = require("node:crypto");
|
|
132425
132827
|
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
132426
132828
|
import_node_module18 = require("node:module");
|
|
132427
132829
|
import_node_os30 = __toESM(require("node:os"), 1);
|
|
@@ -132638,8 +133040,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
|
|
|
132638
133040
|
);
|
|
132639
133041
|
if (!isRecord(manifest) || typeof manifest.version !== "string")
|
|
132640
133042
|
throw new Error(`${reactNativeRoot}: react-native has no version`);
|
|
132641
|
-
const headers = (0,
|
|
132642
|
-
const sources = (0,
|
|
133043
|
+
const headers = (0, import_node_crypto86.createHash)("sha256");
|
|
133044
|
+
const sources = (0, import_node_crypto86.createHash)("sha256");
|
|
132643
133045
|
const walk4 = (relative7) => {
|
|
132644
133046
|
for (const file of import_node_fs141.default.readdirSync(import_node_path143.default.join(reactNativeRoot, relative7), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
132645
133047
|
if (file.name === "node_modules" || file.name.startsWith(".")) continue;
|
|
@@ -132746,7 +133148,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
132746
133148
|
const file = import_node_path143.default.join(
|
|
132747
133149
|
cacheDir(),
|
|
132748
133150
|
"native-archives",
|
|
132749
|
-
`${(0,
|
|
133151
|
+
`${(0, import_node_crypto86.createHash)("sha256").update(data).digest("hex")}.a`
|
|
132750
133152
|
);
|
|
132751
133153
|
import_node_fs141.default.mkdirSync(import_node_path143.default.dirname(file), { recursive: true });
|
|
132752
133154
|
if (!import_node_fs141.default.existsSync(file)) import_node_fs141.default.writeFileSync(file, Buffer.from(data, "base64"));
|
|
@@ -132756,11 +133158,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
132756
133158
|
}
|
|
132757
133159
|
}
|
|
132758
133160
|
}
|
|
132759
|
-
var
|
|
133161
|
+
var import_node_crypto86, import_node_fs141, import_node_module19, import_node_path143, import_node_util18, recipe, strings4, building;
|
|
132760
133162
|
var init_react_native_core = __esm({
|
|
132761
133163
|
"src/react-native-core.ts"() {
|
|
132762
133164
|
"use strict";
|
|
132763
|
-
|
|
133165
|
+
import_node_crypto86 = require("node:crypto");
|
|
132764
133166
|
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
132765
133167
|
import_node_module19 = require("node:module");
|
|
132766
133168
|
import_node_path143 = __toESM(require("node:path"), 1);
|
|
@@ -132785,7 +133187,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
132785
133187
|
const modules = import_node_path144.default.join(moduleRoot, "modules");
|
|
132786
133188
|
const module2 = import_node_path144.default.join(modules, `${name3}.swiftmodule`);
|
|
132787
133189
|
if (!import_node_fs142.default.existsSync(module2)) return /* @__PURE__ */ new Set();
|
|
132788
|
-
const key2 = (0,
|
|
133190
|
+
const key2 = (0, import_node_crypto87.createHash)("sha256").update(import_node_fs142.default.readFileSync(module2)).digest("hex");
|
|
132789
133191
|
const directory2 = import_node_path144.default.join(swiftCacheDir(), "swift-public-names");
|
|
132790
133192
|
const receipt = import_node_path144.default.join(directory2, `${key2}.json`);
|
|
132791
133193
|
if (import_node_fs142.default.existsSync(receipt)) {
|
|
@@ -132868,12 +133270,12 @@ function clangTypeOwnership(moduleRoot, module2) {
|
|
|
132868
133270
|
}
|
|
132869
133271
|
);
|
|
132870
133272
|
}
|
|
132871
|
-
var import_node_child_process70,
|
|
133273
|
+
var import_node_child_process70, import_node_crypto87, import_node_fs142, import_node_path144, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
|
|
132872
133274
|
var init_swift_clang_type_ownership = __esm({
|
|
132873
133275
|
"src/swift-clang-type-ownership.ts"() {
|
|
132874
133276
|
"use strict";
|
|
132875
133277
|
import_node_child_process70 = require("node:child_process");
|
|
132876
|
-
|
|
133278
|
+
import_node_crypto87 = require("node:crypto");
|
|
132877
133279
|
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
132878
133280
|
import_node_path144 = __toESM(require("node:path"), 1);
|
|
132879
133281
|
init_is_record();
|
|
@@ -134528,7 +134930,7 @@ function targetSettings2(units) {
|
|
|
134528
134930
|
}
|
|
134529
134931
|
function oneSDKStamp(oneSDK) {
|
|
134530
134932
|
if (!oneSDK) return "";
|
|
134531
|
-
const hash = (0,
|
|
134933
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
134532
134934
|
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
134533
134935
|
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
134534
134936
|
hash.update(`${name3}\0${source}\0`);
|
|
@@ -134579,7 +134981,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
|
|
|
134579
134981
|
`;
|
|
134580
134982
|
}
|
|
134581
134983
|
function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
|
|
134582
|
-
const hash = (0,
|
|
134984
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
134583
134985
|
hash.update(base2);
|
|
134584
134986
|
hash.update(reactProviderStamp);
|
|
134585
134987
|
for (const unit2 of units) {
|
|
@@ -134953,8 +135355,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
134953
135355
|
}
|
|
134954
135356
|
return provider;
|
|
134955
135357
|
})() : void 0;
|
|
134956
|
-
const reactProviderStamp = reactProvider ? (0,
|
|
134957
|
-
const key2 = (0,
|
|
135358
|
+
const reactProviderStamp = reactProvider ? (0, import_node_crypto88.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
135359
|
+
const key2 = (0, import_node_crypto88.createHash)("sha256").update(import_node_fs143.default.realpathSync(root)).digest("hex");
|
|
134958
135360
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
134959
135361
|
const failures = /* @__PURE__ */ new Map();
|
|
134960
135362
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -135396,13 +135798,13 @@ ${diagnostics}`}`
|
|
|
135396
135798
|
}
|
|
135397
135799
|
return true;
|
|
135398
135800
|
}
|
|
135399
|
-
var import_node_async_hooks3, import_node_child_process71,
|
|
135801
|
+
var import_node_async_hooks3, import_node_child_process71, import_node_crypto88, import_node_fs143, import_node_module20, import_node_os31, import_node_path145, 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;
|
|
135400
135802
|
var init_expo_swift_host = __esm({
|
|
135401
135803
|
"src/expo-swift-host.ts"() {
|
|
135402
135804
|
"use strict";
|
|
135403
135805
|
import_node_async_hooks3 = require("node:async_hooks");
|
|
135404
135806
|
import_node_child_process71 = require("node:child_process");
|
|
135405
|
-
|
|
135807
|
+
import_node_crypto88 = require("node:crypto");
|
|
135406
135808
|
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
135407
135809
|
import_node_module20 = require("node:module");
|
|
135408
135810
|
import_node_os31 = __toESM(require("node:os"), 1);
|
|
@@ -138675,7 +139077,7 @@ async function createIdentity() {
|
|
|
138675
139077
|
const keys = await crypto.subtle.generateKey(algorithm, true, ["sign", "verify"]);
|
|
138676
139078
|
const certificate = await import_x5092.X509CertificateGenerator.createSelfSigned(
|
|
138677
139079
|
{
|
|
138678
|
-
serialNumber: (0,
|
|
139080
|
+
serialNumber: (0, import_node_crypto89.randomBytes)(16).toString("hex"),
|
|
138679
139081
|
name: "CN=localhost",
|
|
138680
139082
|
notBefore: new Date(Date.now() - 6e4),
|
|
138681
139083
|
notAfter: new Date(Date.now() + 365 * 24 * 60 * 6e4),
|
|
@@ -138694,7 +139096,7 @@ async function createIdentity() {
|
|
|
138694
139096
|
${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
138695
139097
|
-----END PRIVATE KEY-----
|
|
138696
139098
|
`,
|
|
138697
|
-
spki: (0,
|
|
139099
|
+
spki: (0, import_node_crypto89.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
|
|
138698
139100
|
};
|
|
138699
139101
|
}
|
|
138700
139102
|
async function startFetchProxyTransport(identityPath, hasLiveSims = () => false) {
|
|
@@ -138768,11 +139170,11 @@ async function startFetchProxyTransport(identityPath, hasLiveSims = () => false)
|
|
|
138768
139170
|
);
|
|
138769
139171
|
}
|
|
138770
139172
|
}
|
|
138771
|
-
var
|
|
139173
|
+
var import_node_crypto89, import_node_fs147, import_node_http23, import_node_path149, import_x5092;
|
|
138772
139174
|
var init_fetch_proxy_transport = __esm({
|
|
138773
139175
|
"src/host/fetch-proxy-transport.ts"() {
|
|
138774
139176
|
"use strict";
|
|
138775
|
-
|
|
139177
|
+
import_node_crypto89 = require("node:crypto");
|
|
138776
139178
|
import_node_fs147 = require("node:fs");
|
|
138777
139179
|
import_node_http23 = require("node:http2");
|
|
138778
139180
|
import_node_path149 = __toESM(require("node:path"), 1);
|
|
@@ -140004,10 +140406,10 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
140004
140406
|
}
|
|
140005
140407
|
async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
|
|
140006
140408
|
const directory2 = prepareStagedDirectory();
|
|
140007
|
-
const inputDigest = (0,
|
|
140409
|
+
const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
|
|
140008
140410
|
const index = import_node_path153.default.join(
|
|
140009
140411
|
directory2,
|
|
140010
|
-
`derived-${(0,
|
|
140412
|
+
`derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
|
|
140011
140413
|
);
|
|
140012
140414
|
const recorded = import_node_fs151.default.existsSync(index) ? import_node_fs151.default.readFileSync(index, "utf8") : "";
|
|
140013
140415
|
if (STAGED_NAME.test(recorded) && import_node_fs151.default.existsSync(import_node_path153.default.join(directory2, recorded))) {
|
|
@@ -140018,7 +140420,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
|
|
|
140018
140420
|
return new URL(STAGED_PREFIX + recorded, origin).toString();
|
|
140019
140421
|
}
|
|
140020
140422
|
const staged = writeStagedBytes(await derive(), origin, extension, directory2);
|
|
140021
|
-
const temporary = import_node_path153.default.join(directory2, (0,
|
|
140423
|
+
const temporary = import_node_path153.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
140022
140424
|
try {
|
|
140023
140425
|
import_node_fs151.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
|
|
140024
140426
|
flag: "wx"
|
|
@@ -140045,7 +140447,7 @@ function stageHostMetroAssets(assets2, origin) {
|
|
|
140045
140447
|
const name3 = staged.pathname.slice(STAGED_PREFIX.length);
|
|
140046
140448
|
const destination = import_node_path153.default.join(directory2, index);
|
|
140047
140449
|
stagedCapture.getStore()?.add(index);
|
|
140048
|
-
const temporary = import_node_path153.default.join(directory2, (0,
|
|
140450
|
+
const temporary = import_node_path153.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
140049
140451
|
try {
|
|
140050
140452
|
import_node_fs151.default.writeFileSync(temporary, name3, { flag: "wx" });
|
|
140051
140453
|
try {
|
|
@@ -140070,7 +140472,7 @@ function metroIndexName(url) {
|
|
|
140070
140472
|
url.searchParams.get("unstable_path"),
|
|
140071
140473
|
hashes[0]
|
|
140072
140474
|
]);
|
|
140073
|
-
return `metro-${(0,
|
|
140475
|
+
return `metro-${(0, import_node_crypto90.createHash)("sha256").update(key2).digest("hex")}`;
|
|
140074
140476
|
}
|
|
140075
140477
|
function metroRequestIndex(rawUrl) {
|
|
140076
140478
|
if (!rawUrl?.startsWith("/") || rawUrl.startsWith("//")) return null;
|
|
@@ -140098,7 +140500,7 @@ function prepareStagedDirectory() {
|
|
|
140098
140500
|
return directory2;
|
|
140099
140501
|
}
|
|
140100
140502
|
function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
140101
|
-
const digest3 = (0,
|
|
140503
|
+
const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
|
|
140102
140504
|
extension = extension.toLowerCase();
|
|
140103
140505
|
const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
|
|
140104
140506
|
stagedCapture.getStore()?.add(name3);
|
|
@@ -140107,7 +140509,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
140107
140509
|
if (import_node_fs151.default.existsSync(destination)) {
|
|
140108
140510
|
import_node_fs151.default.utimesSync(destination, new Date(now), new Date(now));
|
|
140109
140511
|
} else {
|
|
140110
|
-
const temporary = import_node_path153.default.join(directory2, (0,
|
|
140512
|
+
const temporary = import_node_path153.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
140111
140513
|
try {
|
|
140112
140514
|
import_node_fs151.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
140113
140515
|
import_node_fs151.default.renameSync(temporary, destination);
|
|
@@ -140179,12 +140581,12 @@ async function handleStagedHostFileRequest(req, res) {
|
|
|
140179
140581
|
throw error;
|
|
140180
140582
|
}
|
|
140181
140583
|
}
|
|
140182
|
-
var import_node_async_hooks4,
|
|
140584
|
+
var import_node_async_hooks4, import_node_crypto90, import_node_fs151, import_node_path153, stagedCapture, STAGED_PREFIX, STAGED_NAME, METRO_INDEX_NAME, STAGED_RETENTION_MS;
|
|
140183
140585
|
var init_staged_host_files = __esm({
|
|
140184
140586
|
"src/host/staged-host-files.ts"() {
|
|
140185
140587
|
"use strict";
|
|
140186
140588
|
import_node_async_hooks4 = require("node:async_hooks");
|
|
140187
|
-
|
|
140589
|
+
import_node_crypto90 = require("node:crypto");
|
|
140188
140590
|
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
140189
140591
|
import_node_path153 = __toESM(require("node:path"), 1);
|
|
140190
140592
|
init_uttype_mime();
|
|
@@ -141073,7 +141475,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
|
|
|
141073
141475
|
""
|
|
141074
141476
|
].join("\n");
|
|
141075
141477
|
}
|
|
141076
|
-
const digest3 = (0,
|
|
141478
|
+
const digest3 = (0, import_node_crypto91.createHash)("sha256").update(manifest);
|
|
141077
141479
|
for (const [name3, source] of files2)
|
|
141078
141480
|
digest3.update(name3).update("\0").update(source).update("\0");
|
|
141079
141481
|
const key2 = digest3.digest("hex").slice(0, 16);
|
|
@@ -141095,11 +141497,11 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
|
|
|
141095
141497
|
oneSDKModules: bindings && [...bindings.modules]
|
|
141096
141498
|
};
|
|
141097
141499
|
}
|
|
141098
|
-
var
|
|
141500
|
+
var import_node_crypto91, import_node_fs153, import_node_module21, import_node_path155, import_node_url8, ONE_SDK_DEFINES, BRIDGE_SWIFT, ONE_SDK_RUNTIME_SOURCES;
|
|
141099
141501
|
var init_one_native_controls_package = __esm({
|
|
141100
141502
|
"src/one-native-controls-package.ts"() {
|
|
141101
141503
|
"use strict";
|
|
141102
|
-
|
|
141504
|
+
import_node_crypto91 = require("node:crypto");
|
|
141103
141505
|
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
141104
141506
|
import_node_module21 = require("node:module");
|
|
141105
141507
|
import_node_path155 = __toESM(require("node:path"), 1);
|
|
@@ -142337,7 +142739,7 @@ async function readOneWidgetSources(appRoot) {
|
|
|
142337
142739
|
if (!Buffer.from(text7).equals(bytes))
|
|
142338
142740
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
142339
142741
|
files2.set(name3, text7);
|
|
142340
|
-
sources[import_node_path157.default.relative(root, file).split(import_node_path157.default.sep).join("/")] = (0,
|
|
142742
|
+
sources[import_node_path157.default.relative(root, file).split(import_node_path157.default.sep).join("/")] = (0, import_node_crypto92.createHash)("sha256").update(bytes).digest("hex");
|
|
142341
142743
|
}
|
|
142342
142744
|
const contract = files2.get("OneWidgetContract.swift") ?? "";
|
|
142343
142745
|
const source = files2.get("OneWidget.swift") ?? "";
|
|
@@ -142361,17 +142763,17 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
|
|
|
142361
142763
|
return {
|
|
142362
142764
|
metadata: source.widget,
|
|
142363
142765
|
projectRoot: source.root,
|
|
142364
|
-
appIdentity: (0,
|
|
142766
|
+
appIdentity: (0, import_node_crypto92.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
|
|
142365
142767
|
bundleUrl,
|
|
142366
142768
|
packageUrl,
|
|
142367
142769
|
urlSchemes: source.urlSchemes
|
|
142368
142770
|
};
|
|
142369
142771
|
}
|
|
142370
|
-
var
|
|
142772
|
+
var import_node_crypto92, import_node_fs155, import_node_path157, ONE_WIDGET_PACKAGE, nonEmpty;
|
|
142371
142773
|
var init_one_widget_metadata = __esm({
|
|
142372
142774
|
"src/one-widget-metadata.ts"() {
|
|
142373
142775
|
"use strict";
|
|
142374
|
-
|
|
142776
|
+
import_node_crypto92 = require("node:crypto");
|
|
142375
142777
|
import_node_fs155 = __toESM(require("node:fs"), 1);
|
|
142376
142778
|
import_node_path157 = __toESM(require("node:path"), 1);
|
|
142377
142779
|
init_is_record();
|
|
@@ -142405,7 +142807,7 @@ async function oneWidgetPackage(appRoot) {
|
|
|
142405
142807
|
const packagePath = import_node_path158.default.join(
|
|
142406
142808
|
import_node_os33.default.tmpdir(),
|
|
142407
142809
|
"peach-one-widgets",
|
|
142408
|
-
(0,
|
|
142810
|
+
(0, import_node_crypto93.createHash)("sha256").update(root).digest("hex"),
|
|
142409
142811
|
ONE_WIDGET_PACKAGE
|
|
142410
142812
|
);
|
|
142411
142813
|
import_node_fs156.default.mkdirSync(packagePath, { recursive: true });
|
|
@@ -142419,11 +142821,11 @@ async function oneWidgetPackage(appRoot) {
|
|
|
142419
142821
|
widget
|
|
142420
142822
|
};
|
|
142421
142823
|
}
|
|
142422
|
-
var
|
|
142824
|
+
var import_node_crypto93, import_node_fs156, import_node_os33, import_node_path158;
|
|
142423
142825
|
var init_one_widget_package = __esm({
|
|
142424
142826
|
"src/one-widget-package.ts"() {
|
|
142425
142827
|
"use strict";
|
|
142426
|
-
|
|
142828
|
+
import_node_crypto93 = require("node:crypto");
|
|
142427
142829
|
import_node_fs156 = __toESM(require("node:fs"), 1);
|
|
142428
142830
|
import_node_os33 = __toESM(require("node:os"), 1);
|
|
142429
142831
|
import_node_path158 = __toESM(require("node:path"), 1);
|
|
@@ -142639,7 +143041,7 @@ var init_android_view_classes = __esm({
|
|
|
142639
143041
|
|
|
142640
143042
|
// src/java-module-abi.ts
|
|
142641
143043
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
142642
|
-
const digest3 = (0,
|
|
143044
|
+
const digest3 = (0, import_node_crypto94.createHash)("sha256");
|
|
142643
143045
|
const parent = import_node_path160.default.join(kotlinHome(), "java-specs");
|
|
142644
143046
|
import_node_fs158.default.mkdirSync(parent, { recursive: true });
|
|
142645
143047
|
const work = import_node_fs158.default.mkdtempSync(import_node_path160.default.join(parent, ".read-"));
|
|
@@ -142736,12 +143138,12 @@ async function compileJavaModuleAbi(input) {
|
|
|
142736
143138
|
);
|
|
142737
143139
|
return library;
|
|
142738
143140
|
}
|
|
142739
|
-
var import_node_child_process74,
|
|
143141
|
+
var import_node_child_process74, import_node_crypto94, import_node_fs158, import_node_path160, import_node_util20, run14, JAVA_BINDINGS_INITIALIZER;
|
|
142740
143142
|
var init_java_module_abi = __esm({
|
|
142741
143143
|
"src/java-module-abi.ts"() {
|
|
142742
143144
|
"use strict";
|
|
142743
143145
|
import_node_child_process74 = require("node:child_process");
|
|
142744
|
-
|
|
143146
|
+
import_node_crypto94 = require("node:crypto");
|
|
142745
143147
|
import_node_fs158 = __toESM(require("node:fs"), 1);
|
|
142746
143148
|
import_node_path160 = __toESM(require("node:path"), 1);
|
|
142747
143149
|
import_node_util20 = require("node:util");
|
|
@@ -143175,7 +143577,7 @@ function zipSources(bytes, where) {
|
|
|
143175
143577
|
return entries2;
|
|
143176
143578
|
}
|
|
143177
143579
|
function extract(bytes, where) {
|
|
143178
|
-
const key2 = (0,
|
|
143580
|
+
const key2 = (0, import_node_crypto95.createHash)("sha256").update(bytes).digest("hex");
|
|
143179
143581
|
const cached5 = pending.get(key2);
|
|
143180
143582
|
if (cached5) return cached5;
|
|
143181
143583
|
const request = (async () => {
|
|
@@ -143286,11 +143688,11 @@ async function kotlinSources(bytes, where) {
|
|
|
143286
143688
|
if (kotlin.length === 0) throw new Error(`${where}: sources jar has no Kotlin`);
|
|
143287
143689
|
return kotlin;
|
|
143288
143690
|
}
|
|
143289
|
-
var
|
|
143691
|
+
var import_node_crypto95, import_node_fs160, import_node_os34, import_node_path162, import_node_zlib9, pending, MAX_SOURCES_JAR_BYTES, MAX_SOURCE_ENTRY_BYTES, MAX_TOTAL_EXTRACTED_BYTES;
|
|
143290
143692
|
var init_kotlin_maven_sources = __esm({
|
|
143291
143693
|
"src/kotlin-maven-sources.ts"() {
|
|
143292
143694
|
"use strict";
|
|
143293
|
-
|
|
143695
|
+
import_node_crypto95 = require("node:crypto");
|
|
143294
143696
|
import_node_fs160 = __toESM(require("node:fs"), 1);
|
|
143295
143697
|
import_node_os34 = __toESM(require("node:os"), 1);
|
|
143296
143698
|
import_node_path162 = __toESM(require("node:path"), 1);
|
|
@@ -143380,7 +143782,7 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
143380
143782
|
])
|
|
143381
143783
|
];
|
|
143382
143784
|
const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
143383
|
-
const suffix = (0,
|
|
143785
|
+
const suffix = (0, import_node_crypto96.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
|
|
143384
143786
|
const klib = import_node_path163.default.join(input.output, `${name3}-${suffix}.klib`);
|
|
143385
143787
|
const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
|
|
143386
143788
|
const abiPairs = java.length ? dependencies.flatMap(
|
|
@@ -143422,11 +143824,11 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
143422
143824
|
}
|
|
143423
143825
|
return [...compiled.values()].map(({ klib }) => klib);
|
|
143424
143826
|
}
|
|
143425
|
-
var
|
|
143827
|
+
var import_node_crypto96, import_node_fs161, import_node_path163;
|
|
143426
143828
|
var init_kotlin_gradle_library_plan = __esm({
|
|
143427
143829
|
"src/kotlin-gradle-library-plan.ts"() {
|
|
143428
143830
|
"use strict";
|
|
143429
|
-
|
|
143831
|
+
import_node_crypto96 = require("node:crypto");
|
|
143430
143832
|
import_node_fs161 = __toESM(require("node:fs"), 1);
|
|
143431
143833
|
import_node_path163 = __toESM(require("node:path"), 1);
|
|
143432
143834
|
init_kotlin_library_sources();
|
|
@@ -143662,13 +144064,13 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
143662
144064
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
143663
144065
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
143664
144066
|
const bytes = import_node_fs162.default.readFileSync(target);
|
|
143665
|
-
if (bytes.length !== expected.bytes || (0,
|
|
144067
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto97.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
143666
144068
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
143667
144069
|
}
|
|
143668
144070
|
return manifest;
|
|
143669
144071
|
}
|
|
143670
144072
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
143671
|
-
const sha2565 = (0,
|
|
144073
|
+
const sha2565 = (0, import_node_crypto97.createHash)("sha256").update(archive).digest("hex");
|
|
143672
144074
|
const parent = import_node_path164.default.join(kotlinHome(), "sdk");
|
|
143673
144075
|
const root = import_node_path164.default.join(parent, sha2565);
|
|
143674
144076
|
if (import_node_fs162.default.existsSync(root))
|
|
@@ -143697,12 +144099,12 @@ async function installKotlinSdkArchive(archive, compiler) {
|
|
|
143697
144099
|
import_node_fs162.default.rmSync(work, { recursive: true, force: true });
|
|
143698
144100
|
}
|
|
143699
144101
|
}
|
|
143700
|
-
var import_node_child_process76,
|
|
144102
|
+
var import_node_child_process76, import_node_crypto97, import_node_fs162, import_node_path164, import_node_util21, run15;
|
|
143701
144103
|
var init_kotlin_sdk = __esm({
|
|
143702
144104
|
"src/kotlin-sdk.ts"() {
|
|
143703
144105
|
"use strict";
|
|
143704
144106
|
import_node_child_process76 = require("node:child_process");
|
|
143705
|
-
|
|
144107
|
+
import_node_crypto97 = require("node:crypto");
|
|
143706
144108
|
import_node_fs162 = __toESM(require("node:fs"), 1);
|
|
143707
144109
|
import_node_path164 = __toESM(require("node:path"), 1);
|
|
143708
144110
|
import_node_util21 = require("node:util");
|
|
@@ -143838,7 +144240,7 @@ function peachKotlinModuleRoot() {
|
|
|
143838
144240
|
if (!IS_STANDALONE) return import_node_path165.default.join(peachsimPackageRoot(), "kotlin");
|
|
143839
144241
|
if (installedRoot) return installedRoot;
|
|
143840
144242
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
143841
|
-
const digest3 = (0,
|
|
144243
|
+
const digest3 = (0, import_node_crypto98.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
143842
144244
|
const parent = import_node_path165.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
143843
144245
|
const root = import_node_path165.default.join(parent, digest3);
|
|
143844
144246
|
import_node_fs163.default.mkdirSync(parent, { recursive: true });
|
|
@@ -143867,11 +144269,11 @@ function peachKotlinModuleRoot() {
|
|
|
143867
144269
|
installedRoot = root;
|
|
143868
144270
|
return root;
|
|
143869
144271
|
}
|
|
143870
|
-
var
|
|
144272
|
+
var import_node_crypto98, import_node_fs163, import_node_path165, installedRoot;
|
|
143871
144273
|
var init_kotlin_module = __esm({
|
|
143872
144274
|
"src/kotlin-module.ts"() {
|
|
143873
144275
|
"use strict";
|
|
143874
|
-
|
|
144276
|
+
import_node_crypto98 = require("node:crypto");
|
|
143875
144277
|
import_node_fs163 = __toESM(require("node:fs"), 1);
|
|
143876
144278
|
import_node_path165 = __toESM(require("node:path"), 1);
|
|
143877
144279
|
init_standalone();
|
|
@@ -143905,7 +144307,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
143905
144307
|
const parent = import_node_path166.default.join(kotlinHome(), "gradle-sources");
|
|
143906
144308
|
import_node_fs164.default.mkdirSync(parent, { recursive: true });
|
|
143907
144309
|
const work = import_node_fs164.default.mkdtempSync(import_node_path166.default.join(parent, ".query-"));
|
|
143908
|
-
const task = `peachAndroidSources${(0,
|
|
144310
|
+
const task = `peachAndroidSources${(0, import_node_crypto99.randomBytes)(8).toString("hex")}`;
|
|
143909
144311
|
const script = import_node_path166.default.join(work, "sources.gradle");
|
|
143910
144312
|
const encoded = Buffer.from(
|
|
143911
144313
|
JSON.stringify({
|
|
@@ -144057,12 +144459,12 @@ function readDependencySources(value) {
|
|
|
144057
144459
|
};
|
|
144058
144460
|
});
|
|
144059
144461
|
}
|
|
144060
|
-
var import_node_child_process77,
|
|
144462
|
+
var import_node_child_process77, import_node_crypto99, import_node_fs164, import_node_path166, import_node_util22, run16, modelQuery;
|
|
144061
144463
|
var init_android_gradle_sources = __esm({
|
|
144062
144464
|
"src/android-gradle-sources.ts"() {
|
|
144063
144465
|
"use strict";
|
|
144064
144466
|
import_node_child_process77 = require("node:child_process");
|
|
144065
|
-
|
|
144467
|
+
import_node_crypto99 = require("node:crypto");
|
|
144066
144468
|
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
144067
144469
|
import_node_path166 = __toESM(require("node:path"), 1);
|
|
144068
144470
|
import_node_util22 = require("node:util");
|
|
@@ -144477,7 +144879,7 @@ function readExpoTypes(output) {
|
|
|
144477
144879
|
});
|
|
144478
144880
|
}
|
|
144479
144881
|
async function scanSources(tool, parse19, toolchain, moduleRoot, files2) {
|
|
144480
|
-
const digest3 = (0,
|
|
144882
|
+
const digest3 = (0, import_node_crypto100.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
144481
144883
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
144482
144884
|
digest3.update(import_node_fs165.default.readFileSync(import_node_path167.default.join(moduleRoot, "sdk.tar.gz")));
|
|
144483
144885
|
digest3.update(tool);
|
|
@@ -145139,7 +145541,7 @@ async function compileKotlin(input, origin) {
|
|
|
145139
145541
|
bytes: import_node_fs165.default.readFileSync(file)
|
|
145140
145542
|
}));
|
|
145141
145543
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
145142
|
-
const digest3 = (0,
|
|
145544
|
+
const digest3 = (0, import_node_crypto100.createHash)("sha256");
|
|
145143
145545
|
digest3.update(
|
|
145144
145546
|
JSON.stringify({
|
|
145145
145547
|
format: BUILD_FORMAT,
|
|
@@ -145161,7 +145563,7 @@ async function compileKotlin(input, origin) {
|
|
|
145161
145563
|
...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
|
|
145162
145564
|
]);
|
|
145163
145565
|
for (const file of files2) {
|
|
145164
|
-
digest3.update((0,
|
|
145566
|
+
digest3.update((0, import_node_crypto100.createHash)("sha256").update(import_node_fs165.default.readFileSync(file)).digest());
|
|
145165
145567
|
}
|
|
145166
145568
|
}
|
|
145167
145569
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
@@ -145453,12 +145855,12 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
145453
145855
|
}
|
|
145454
145856
|
return true;
|
|
145455
145857
|
}
|
|
145456
|
-
var import_node_child_process78,
|
|
145858
|
+
var import_node_child_process78, import_node_crypto100, import_node_fs165, import_node_module22, import_node_path167, 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;
|
|
145457
145859
|
var init_kotlin_host = __esm({
|
|
145458
145860
|
"src/kotlin-host.ts"() {
|
|
145459
145861
|
"use strict";
|
|
145460
145862
|
import_node_child_process78 = require("node:child_process");
|
|
145461
|
-
|
|
145863
|
+
import_node_crypto100 = require("node:crypto");
|
|
145462
145864
|
import_node_fs165 = __toESM(require("node:fs"), 1);
|
|
145463
145865
|
import_node_module22 = require("node:module");
|
|
145464
145866
|
import_node_path167 = __toESM(require("node:path"), 1);
|
|
@@ -145814,7 +146216,7 @@ async function readManagedExpoIdentity(root, platform3, iosTarget, bridgeOrigin)
|
|
|
145814
146216
|
url.searchParams.set("root", root);
|
|
145815
146217
|
const response = await nodeHttpFetch(url.href);
|
|
145816
146218
|
if (response.ok && response.headers.get("content-type") === revisionType) {
|
|
145817
|
-
const environment = (0,
|
|
146219
|
+
const environment = (0, import_node_crypto101.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
|
|
145818
146220
|
const inputs2 = Buffer.from(
|
|
145819
146221
|
JSON.stringify([
|
|
145820
146222
|
await response.text(),
|
|
@@ -145870,11 +146272,11 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
145870
146272
|
res.writeHead(200, { "Content-Type": revisionType });
|
|
145871
146273
|
res.end(revision);
|
|
145872
146274
|
}
|
|
145873
|
-
var
|
|
146275
|
+
var import_node_crypto101, import_node_fs167, import_node_path169, revisionType;
|
|
145874
146276
|
var init_managed_expo_identity = __esm({
|
|
145875
146277
|
"src/managed-expo-identity.ts"() {
|
|
145876
146278
|
"use strict";
|
|
145877
|
-
|
|
146279
|
+
import_node_crypto101 = require("node:crypto");
|
|
145878
146280
|
import_node_fs167 = __toESM(require("node:fs"), 1);
|
|
145879
146281
|
import_node_path169 = __toESM(require("node:path"), 1);
|
|
145880
146282
|
init_backend_origin();
|
|
@@ -146094,7 +146496,7 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
|
146094
146496
|
const ext = import_node_path172.default.extname(file);
|
|
146095
146497
|
if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
|
|
146096
146498
|
if (ext.toLowerCase() === ".pdf") {
|
|
146097
|
-
const sha2565 = (0,
|
|
146499
|
+
const sha2565 = (0, import_node_crypto102.createHash)("sha256").update(bytes).digest("hex");
|
|
146098
146500
|
const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2565 }]).get(sha2565);
|
|
146099
146501
|
return stageHostBytes(png, origin, ".png");
|
|
146100
146502
|
}
|
|
@@ -146107,11 +146509,11 @@ async function stageExpoWidgetAssets(appRoot, origin) {
|
|
|
146107
146509
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
146108
146510
|
return stagePreparedExpoWidgetAssets(prepared.app, origin);
|
|
146109
146511
|
}
|
|
146110
|
-
var
|
|
146512
|
+
var import_node_crypto102, import_node_fs169, import_node_path172;
|
|
146111
146513
|
var init_expo_widget_assets = __esm({
|
|
146112
146514
|
"src/expo-widget-assets.ts"() {
|
|
146113
146515
|
"use strict";
|
|
146114
|
-
|
|
146516
|
+
import_node_crypto102 = require("node:crypto");
|
|
146115
146517
|
import_node_fs169 = __toESM(require("node:fs"), 1);
|
|
146116
146518
|
import_node_path172 = __toESM(require("node:path"), 1);
|
|
146117
146519
|
init_app_catalog();
|
|
@@ -146166,11 +146568,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
146166
146568
|
"specifications",
|
|
146167
146569
|
`${checksum}.json`
|
|
146168
146570
|
);
|
|
146169
|
-
const sha1 = (value) => (0,
|
|
146571
|
+
const sha1 = (value) => (0, import_node_crypto103.createHash)("sha1").update(value).digest("hex");
|
|
146170
146572
|
let text7;
|
|
146171
146573
|
if (import_node_fs170.default.existsSync(file)) text7 = import_node_fs170.default.readFileSync(file, "utf8");
|
|
146172
146574
|
else {
|
|
146173
|
-
const shard2 = (0,
|
|
146575
|
+
const shard2 = (0, import_node_crypto103.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
146174
146576
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
146175
146577
|
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
146176
146578
|
if (!response.ok)
|
|
@@ -146299,7 +146701,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
146299
146701
|
"end",
|
|
146300
146702
|
""
|
|
146301
146703
|
].join("\n");
|
|
146302
|
-
const key2 = (0,
|
|
146704
|
+
const key2 = (0, import_node_crypto103.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
|
|
146303
146705
|
JSON.stringify(
|
|
146304
146706
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
146305
146707
|
)
|
|
@@ -146368,11 +146770,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
146368
146770
|
);
|
|
146369
146771
|
});
|
|
146370
146772
|
}
|
|
146371
|
-
var
|
|
146773
|
+
var import_node_crypto103, import_node_fs170, import_node_path173, APP, record5, project, podModuleName;
|
|
146372
146774
|
var init_swift_source_pods = __esm({
|
|
146373
146775
|
"src/swift-source-pods.ts"() {
|
|
146374
146776
|
"use strict";
|
|
146375
|
-
|
|
146777
|
+
import_node_crypto103 = require("node:crypto");
|
|
146376
146778
|
import_node_fs170 = __toESM(require("node:fs"), 1);
|
|
146377
146779
|
import_node_path173 = __toESM(require("node:path"), 1);
|
|
146378
146780
|
init_browser();
|
|
@@ -147049,7 +147451,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
147049
147451
|
input.libraries ??= {};
|
|
147050
147452
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
147051
147453
|
}
|
|
147052
|
-
const key2 = (0,
|
|
147454
|
+
const key2 = (0, import_node_crypto104.createHash)("sha256").update(
|
|
147053
147455
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
147054
147456
|
).update("\0").update(import_node_fs171.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
147055
147457
|
const packagePath = import_node_path174.default.join(import_node_os35.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
@@ -147106,11 +147508,11 @@ function nitrogenGeneratedSources(podDirectory) {
|
|
|
147106
147508
|
...sources(import_node_path174.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
147107
147509
|
];
|
|
147108
147510
|
}
|
|
147109
|
-
var
|
|
147511
|
+
var import_node_crypto104, import_node_fs171, import_node_os35, import_node_path174, BUNDLED_CXX_NAMESPACES, REACT_INCLUDE_PATTERN, REACT_LINKING_PATTERN, REACT_VERSION_PATTERN, RN_HEADER_DIR_MAP, RN_COMMON_ROOTS;
|
|
147110
147512
|
var init_nitro_compile = __esm({
|
|
147111
147513
|
"src/nitro-compile.ts"() {
|
|
147112
147514
|
"use strict";
|
|
147113
|
-
|
|
147515
|
+
import_node_crypto104 = require("node:crypto");
|
|
147114
147516
|
import_node_fs171 = __toESM(require("node:fs"), 1);
|
|
147115
147517
|
import_node_os35 = __toESM(require("node:os"), 1);
|
|
147116
147518
|
import_node_path174 = __toESM(require("node:path"), 1);
|
|
@@ -147187,11 +147589,11 @@ var init_nitro_compile = __esm({
|
|
|
147187
147589
|
});
|
|
147188
147590
|
|
|
147189
147591
|
// src/nitro-compiler-digest.ts
|
|
147190
|
-
var
|
|
147592
|
+
var import_node_crypto105, import_node_fs172, import_node_path175;
|
|
147191
147593
|
var init_nitro_compiler_digest = __esm({
|
|
147192
147594
|
"src/nitro-compiler-digest.ts"() {
|
|
147193
147595
|
"use strict";
|
|
147194
|
-
|
|
147596
|
+
import_node_crypto105 = require("node:crypto");
|
|
147195
147597
|
import_node_fs172 = require("node:fs");
|
|
147196
147598
|
import_node_path175 = __toESM(require("node:path"), 1);
|
|
147197
147599
|
init_swift_compiler_digest();
|
|
@@ -147329,7 +147731,7 @@ var init_nitro_superset = __esm({
|
|
|
147329
147731
|
init_nitroContract();
|
|
147330
147732
|
init_swift_standin_digest();
|
|
147331
147733
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
147332
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
147734
|
+
NITRO_COMPILER_DIGEST = true ? "bdc0f5dd61f31a5b6f5bba3db67fc29584077dfb64bd237228a11b91b9ab2730" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
147333
147735
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
147334
147736
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
147335
147737
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -147858,7 +148260,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
147858
148260
|
const packagePath = import_node_path179.default.join(
|
|
147859
148261
|
swiftCacheDir(),
|
|
147860
148262
|
"peach-one-sdk-swift",
|
|
147861
|
-
(0,
|
|
148263
|
+
(0, import_node_crypto106.createHash)("sha256").update(import_node_fs175.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
147862
148264
|
"sdk"
|
|
147863
148265
|
);
|
|
147864
148266
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -147905,11 +148307,11 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
147905
148307
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
147906
148308
|
};
|
|
147907
148309
|
}
|
|
147908
|
-
var
|
|
148310
|
+
var import_node_crypto106, import_node_fs175, import_node_path179, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
|
|
147909
148311
|
var init_one_sdk_bundle = __esm({
|
|
147910
148312
|
"src/one-sdk-bundle.ts"() {
|
|
147911
148313
|
"use strict";
|
|
147912
|
-
|
|
148314
|
+
import_node_crypto106 = require("node:crypto");
|
|
147913
148315
|
import_node_fs175 = __toESM(require("node:fs"), 1);
|
|
147914
148316
|
import_node_path179 = __toESM(require("node:path"), 1);
|
|
147915
148317
|
init_expo_native_workspace();
|
|
@@ -148599,7 +149001,7 @@ function writeSharedDesktopAuthSession(session) {
|
|
|
148599
149001
|
validatedAt: session.validatedAt ?? same?.validatedAt,
|
|
148600
149002
|
accountId: session.accountId?.trim() || same?.accountId
|
|
148601
149003
|
};
|
|
148602
|
-
const temporary = `${filepath}.${process.pid}.${(0,
|
|
149004
|
+
const temporary = `${filepath}.${process.pid}.${(0, import_node_crypto107.randomUUID)()}.tmp`;
|
|
148603
149005
|
try {
|
|
148604
149006
|
(0, import_node_fs179.writeFileSync)(temporary, JSON.stringify(normalized, null, 2) + "\n", {
|
|
148605
149007
|
mode: 384,
|
|
@@ -148651,11 +149053,11 @@ async function refreshSharedDesktopAuthSession(originOverride) {
|
|
|
148651
149053
|
return readSharedDesktopAuthSession();
|
|
148652
149054
|
}
|
|
148653
149055
|
}
|
|
148654
|
-
var
|
|
149056
|
+
var import_node_crypto107, import_node_fs179, import_node_path184, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
148655
149057
|
var init_shared_session = __esm({
|
|
148656
149058
|
"src/auth/shared-session.ts"() {
|
|
148657
149059
|
"use strict";
|
|
148658
|
-
|
|
149060
|
+
import_node_crypto107 = require("node:crypto");
|
|
148659
149061
|
import_node_fs179 = require("node:fs");
|
|
148660
149062
|
import_node_path184 = require("node:path");
|
|
148661
149063
|
init_home_paths();
|
|
@@ -148696,7 +149098,7 @@ var init_run_rnx = __esm({
|
|
|
148696
149098
|
// cli/secure-file.ts
|
|
148697
149099
|
function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
148698
149100
|
(0, import_node_fs180.mkdirSync)((0, import_node_path185.dirname)(filepath), { recursive: true });
|
|
148699
|
-
const temporary = `${filepath}.tmp-${process.pid}-${(0,
|
|
149101
|
+
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto108.randomUUID)()}`;
|
|
148700
149102
|
let descriptor = null;
|
|
148701
149103
|
try {
|
|
148702
149104
|
descriptor = (0, import_node_fs180.openSync)(temporary, "wx", 384);
|
|
@@ -148713,11 +149115,11 @@ function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
|
148713
149115
|
throw error;
|
|
148714
149116
|
}
|
|
148715
149117
|
}
|
|
148716
|
-
var
|
|
149118
|
+
var import_node_crypto108, import_node_fs180, import_node_path185;
|
|
148717
149119
|
var init_secure_file = __esm({
|
|
148718
149120
|
"cli/secure-file.ts"() {
|
|
148719
149121
|
"use strict";
|
|
148720
|
-
|
|
149122
|
+
import_node_crypto108 = require("node:crypto");
|
|
148721
149123
|
import_node_fs180 = require("node:fs");
|
|
148722
149124
|
import_node_path185 = require("node:path");
|
|
148723
149125
|
}
|
|
@@ -151226,7 +151628,7 @@ function projectSessionFile() {
|
|
|
151226
151628
|
}
|
|
151227
151629
|
dir = parent;
|
|
151228
151630
|
}
|
|
151229
|
-
const key2 = (0,
|
|
151631
|
+
const key2 = (0, import_node_crypto109.createHash)("sha256").update(dir).digest("hex").slice(0, 32);
|
|
151230
151632
|
return (0, import_node_path187.join)(rnxHomeDir(), "remote-sessions", `${key2}.json`);
|
|
151231
151633
|
}
|
|
151232
151634
|
function readCloudSession() {
|
|
@@ -151240,11 +151642,11 @@ function readCloudSession() {
|
|
|
151240
151642
|
}
|
|
151241
151643
|
return parseCloudSession(saved.session);
|
|
151242
151644
|
}
|
|
151243
|
-
var
|
|
151645
|
+
var import_node_crypto109, import_node_fs182, import_node_path187, 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;
|
|
151244
151646
|
var init_cloud_session = __esm({
|
|
151245
151647
|
"cli/cloud-session.ts"() {
|
|
151246
151648
|
"use strict";
|
|
151247
|
-
|
|
151649
|
+
import_node_crypto109 = require("node:crypto");
|
|
151248
151650
|
import_node_fs182 = require("node:fs");
|
|
151249
151651
|
import_node_path187 = require("node:path");
|
|
151250
151652
|
init_backend_origin();
|
|
@@ -152126,7 +152528,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
152126
152528
|
return { directory: directory2, files: files2, truncated };
|
|
152127
152529
|
}
|
|
152128
152530
|
function metroDescriptorHash(scaleBytes) {
|
|
152129
|
-
const hasher = (0,
|
|
152531
|
+
const hasher = (0, import_node_crypto110.createHash)("md5");
|
|
152130
152532
|
for (const bytes of scaleBytes) hasher.update(bytes);
|
|
152131
152533
|
return hasher.digest("hex");
|
|
152132
152534
|
}
|
|
@@ -152155,7 +152557,7 @@ function distinctByContent(directory2, options2) {
|
|
|
152155
152557
|
} catch {
|
|
152156
152558
|
continue;
|
|
152157
152559
|
}
|
|
152158
|
-
const digest3 = (0,
|
|
152560
|
+
const digest3 = (0, import_node_crypto110.createHash)("md5").update(bytes).digest("hex");
|
|
152159
152561
|
if (!byContent.has(digest3)) byContent.set(digest3, relative7);
|
|
152160
152562
|
}
|
|
152161
152563
|
return [...byContent.values()];
|
|
@@ -152203,7 +152605,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
152203
152605
|
continue;
|
|
152204
152606
|
}
|
|
152205
152607
|
const identical = fileHashes2 ? bytes.every((file, index) => {
|
|
152206
|
-
const digest3 = (0,
|
|
152608
|
+
const digest3 = (0, import_node_crypto110.createHash)("md5").update(file).digest("hex");
|
|
152207
152609
|
return descriptor.scales.some(
|
|
152208
152610
|
(scale, declared) => scale === scales[index] && fileHashes2[declared] === digest3
|
|
152209
152611
|
);
|
|
@@ -152228,7 +152630,7 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
152228
152630
|
const file = (0, import_node_path189.join)(dest.directory, relative7);
|
|
152229
152631
|
let digest3 = fileDigests2.get(file);
|
|
152230
152632
|
if (digest3 === void 0) {
|
|
152231
|
-
digest3 = (0,
|
|
152633
|
+
digest3 = (0, import_node_crypto110.createHash)("sha256").update((0, import_node_fs184.readFileSync)(file)).digest("hex");
|
|
152232
152634
|
fileDigests2.set(file, digest3);
|
|
152233
152635
|
}
|
|
152234
152636
|
return [scale, digest3];
|
|
@@ -152383,14 +152785,14 @@ async function producePreviewArtifact(bundlePath) {
|
|
|
152383
152785
|
prepared.code
|
|
152384
152786
|
);
|
|
152385
152787
|
const bytes = Buffer.from(annotated, "utf8");
|
|
152386
|
-
const sha2565 = (0,
|
|
152788
|
+
const sha2565 = (0, import_node_crypto110.createHash)("sha256").update(bytes).digest("hex");
|
|
152387
152789
|
return {
|
|
152388
152790
|
bytes,
|
|
152389
152791
|
sha256: sha2565,
|
|
152390
152792
|
minified: false,
|
|
152391
152793
|
receipt: {
|
|
152392
152794
|
source: {
|
|
152393
|
-
sha256: (0,
|
|
152795
|
+
sha256: (0, import_node_crypto110.createHash)("sha256").update(prepared.source).digest("hex"),
|
|
152394
152796
|
bytes: Buffer.byteLength(prepared.source, "utf8")
|
|
152395
152797
|
},
|
|
152396
152798
|
artifact: { sha256: sha2565, bytes: bytes.byteLength }
|
|
@@ -152546,7 +152948,7 @@ async function produceArtifact(prepared, maxBytes, command) {
|
|
|
152546
152948
|
}
|
|
152547
152949
|
return {
|
|
152548
152950
|
bytes,
|
|
152549
|
-
sha256: (0,
|
|
152951
|
+
sha256: (0, import_node_crypto110.createHash)("sha256").update(bytes).digest("hex"),
|
|
152550
152952
|
receipt: artifact.receipt,
|
|
152551
152953
|
assetsDirectory: prepared.dest?.directory ?? null,
|
|
152552
152954
|
warnings
|
|
@@ -153062,11 +153464,11 @@ async function closeCloudSession(session) {
|
|
|
153062
153464
|
throw responseError(response.status, text7);
|
|
153063
153465
|
}
|
|
153064
153466
|
}
|
|
153065
|
-
var
|
|
153467
|
+
var import_node_crypto110, import_node_fs184, import_node_path189, 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;
|
|
153066
153468
|
var init_cloud_client = __esm({
|
|
153067
153469
|
"cli/cloud-client.ts"() {
|
|
153068
153470
|
"use strict";
|
|
153069
|
-
|
|
153471
|
+
import_node_crypto110 = require("node:crypto");
|
|
153070
153472
|
import_node_fs184 = require("node:fs");
|
|
153071
153473
|
import_node_path189 = require("node:path");
|
|
153072
153474
|
import_node_vm = require("node:vm");
|
|
@@ -153139,7 +153541,7 @@ var init_cloud_client = __esm({
|
|
|
153139
153541
|
const timeoutMs = options2?.timeoutMs ?? this.explicitTimeoutMs ?? options2?.defaultTimeoutMs;
|
|
153140
153542
|
const agent = commandAgent(command);
|
|
153141
153543
|
const body = {
|
|
153142
|
-
id: (0,
|
|
153544
|
+
id: (0, import_node_crypto110.randomUUID)(),
|
|
153143
153545
|
claimId: this.session.claimId,
|
|
153144
153546
|
command: cloudCommand(agent ? { ...command, agent } : command)
|
|
153145
153547
|
};
|
|
@@ -153209,7 +153611,7 @@ var init_cloud_client = __esm({
|
|
|
153209
153611
|
plane = "cloud";
|
|
153210
153612
|
async send(command, options2) {
|
|
153211
153613
|
const timeoutMs = options2?.timeoutMs ?? this.explicitTimeoutMs ?? options2?.defaultTimeoutMs;
|
|
153212
|
-
const id = (0,
|
|
153614
|
+
const id = (0, import_node_crypto110.randomUUID)();
|
|
153213
153615
|
const agent = commandAgent(command);
|
|
153214
153616
|
const payload = cloudCommand(agent ? { ...command, agent } : command);
|
|
153215
153617
|
let response;
|
|
@@ -157329,11 +157731,11 @@ function splashImageUrls(spec) {
|
|
|
157329
157731
|
if (spec.dark?.backgroundImageUrl) urls.add(spec.dark.backgroundImageUrl);
|
|
157330
157732
|
return [...urls];
|
|
157331
157733
|
}
|
|
157332
|
-
var
|
|
157734
|
+
var import_node_crypto111, import_node_module28, require2;
|
|
157333
157735
|
var init_app_splash = __esm({
|
|
157334
157736
|
"cli/app-splash.ts"() {
|
|
157335
157737
|
"use strict";
|
|
157336
|
-
|
|
157738
|
+
import_node_crypto111 = require("node:crypto");
|
|
157337
157739
|
import_node_module28 = require("node:module");
|
|
157338
157740
|
init_backend_origin();
|
|
157339
157741
|
init_cli_runtime();
|
|
@@ -157387,7 +157789,7 @@ function extractAppBinaryBundle(binary2) {
|
|
|
157387
157789
|
);
|
|
157388
157790
|
const sidecar = import_node_path194.default.posix.dirname(manifestEntry);
|
|
157389
157791
|
const appRoot = import_node_path194.default.posix.dirname(sidecar);
|
|
157390
|
-
const digest3 = (0,
|
|
157792
|
+
const digest3 = (0, import_node_crypto112.createHash)("sha256").update(import_node_fs189.default.readFileSync(file)).digest("hex");
|
|
157391
157793
|
const out = import_node_path194.default.join(cacheDir(), "app-binaries", digest3);
|
|
157392
157794
|
const bundlePath = import_node_path194.default.join(out, "main.js");
|
|
157393
157795
|
const extracted = import_node_path194.default.join(out, "extracted");
|
|
@@ -157405,7 +157807,7 @@ function extractAppBinaryBundle(binary2) {
|
|
|
157405
157807
|
const bundle = (0, import_node_zlib12.brotliDecompressSync)(
|
|
157406
157808
|
import_node_fs189.default.readFileSync(import_node_path194.default.join(extracted, sidecar, PEACH_SIDECAR_BUNDLE))
|
|
157407
157809
|
);
|
|
157408
|
-
if ((0,
|
|
157810
|
+
if ((0, import_node_crypto112.createHash)("sha256").update(bundle).digest("hex") !== manifest.bundleSha256)
|
|
157409
157811
|
throw new Error(`${binary2}: the peach sidecar bundle does not match its manifest`);
|
|
157410
157812
|
const assets2 = manifest.platform === "ios" ? import_node_path194.default.join(extracted, appRoot, "assets") : import_node_path194.default.join(extracted, sidecar, PEACH_SIDECAR_ASSETS);
|
|
157411
157813
|
if (import_node_fs189.default.existsSync(assets2)) import_node_fs189.default.renameSync(assets2, import_node_path194.default.join(out, "assets"));
|
|
@@ -157425,12 +157827,12 @@ function extractAppBinaryBundle(binary2) {
|
|
|
157425
157827
|
);
|
|
157426
157828
|
return { bundlePath, platform: platform3 };
|
|
157427
157829
|
}
|
|
157428
|
-
var import_node_child_process81,
|
|
157830
|
+
var import_node_child_process81, import_node_crypto112, import_node_fs189, import_node_path194, import_node_zlib12;
|
|
157429
157831
|
var init_binary_sidecar = __esm({
|
|
157430
157832
|
"cli/binary-sidecar.ts"() {
|
|
157431
157833
|
"use strict";
|
|
157432
157834
|
import_node_child_process81 = require("node:child_process");
|
|
157433
|
-
|
|
157835
|
+
import_node_crypto112 = require("node:crypto");
|
|
157434
157836
|
import_node_fs189 = __toESM(require("node:fs"), 1);
|
|
157435
157837
|
import_node_path194 = __toESM(require("node:path"), 1);
|
|
157436
157838
|
import_node_zlib12 = require("node:zlib");
|
|
@@ -158266,7 +158668,7 @@ var init_core = __esm({
|
|
|
158266
158668
|
// cli/output-redaction.ts
|
|
158267
158669
|
function mask(value) {
|
|
158268
158670
|
if (MASKED.test(value)) return value;
|
|
158269
|
-
return `<redacted:${(0,
|
|
158671
|
+
return `<redacted:${(0, import_node_crypto113.createHash)("sha256").update(value).digest("hex").slice(0, 4)}>`;
|
|
158270
158672
|
}
|
|
158271
158673
|
function maskQuoted(quoted2) {
|
|
158272
158674
|
return `${quoted2[0]}${mask(quoted2.slice(1, -1))}${quoted2[0]}`;
|
|
@@ -158388,11 +158790,11 @@ function redactText(text7, configurationOnly, decodedString = false) {
|
|
|
158388
158790
|
(line, prefix, name3, value) => SECRET_NAME.test(name3) ? `${prefix}${mask(value)}` : line
|
|
158389
158791
|
).replace(EMAIL, mask).replace(OPAQUE_ID, mask);
|
|
158390
158792
|
}
|
|
158391
|
-
var
|
|
158793
|
+
var import_node_crypto113, 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;
|
|
158392
158794
|
var init_output_redaction = __esm({
|
|
158393
158795
|
"cli/output-redaction.ts"() {
|
|
158394
158796
|
"use strict";
|
|
158395
|
-
|
|
158797
|
+
import_node_crypto113 = require("node:crypto");
|
|
158396
158798
|
import_node_util26 = require("node:util");
|
|
158397
158799
|
init_config();
|
|
158398
158800
|
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;
|
|
@@ -158895,7 +159297,7 @@ function macDesktopLaunchHome(bridgePort) {
|
|
|
158895
159297
|
const dev = readDevBridgeLockfiles().find(
|
|
158896
159298
|
(lock) => lock.bridgePort === bridgePort && isDevBridgeLockfileFresh(lock)
|
|
158897
159299
|
);
|
|
158898
|
-
const homeKey = (0,
|
|
159300
|
+
const homeKey = (0, import_node_crypto114.createHash)("sha256").update(home).digest("hex");
|
|
158899
159301
|
const dir = (0, import_path7.join)((0, import_os4.tmpdir)(), "peach-desktop-launch", homeKey, String(bridgePort));
|
|
158900
159302
|
(0, import_fs8.mkdirSync)(dir, { recursive: true });
|
|
158901
159303
|
if ((0, import_fs8.existsSync)(home)) {
|
|
@@ -159001,13 +159403,13 @@ function buildMacLaunchUrl(url, opts, nativeApp = false) {
|
|
|
159001
159403
|
}
|
|
159002
159404
|
return deepLink.toString();
|
|
159003
159405
|
}
|
|
159004
|
-
var import_child_process6, import_fs8,
|
|
159406
|
+
var import_child_process6, import_fs8, import_node_crypto114, import_os4, import_path7, import_url2, import_meta2, _sootsimRoot;
|
|
159005
159407
|
var init_desktop_companion = __esm({
|
|
159006
159408
|
"cli/desktop-companion.ts"() {
|
|
159007
159409
|
"use strict";
|
|
159008
159410
|
import_child_process6 = require("child_process");
|
|
159009
159411
|
import_fs8 = require("fs");
|
|
159010
|
-
|
|
159412
|
+
import_node_crypto114 = require("node:crypto");
|
|
159011
159413
|
import_os4 = require("os");
|
|
159012
159414
|
import_path7 = require("path");
|
|
159013
159415
|
import_url2 = require("url");
|
|
@@ -159742,11 +160144,11 @@ function trackCliDiagnostic(diagnostic) {
|
|
|
159742
160144
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
159743
160145
|
});
|
|
159744
160146
|
}
|
|
159745
|
-
var
|
|
160147
|
+
var import_node_crypto115, import_node_fs190, import_node_os37, observedRuntimeVersion, queue, CRASH_REPORT_EVERY_MS;
|
|
159746
160148
|
var init_telemetry = __esm({
|
|
159747
160149
|
"cli/telemetry.ts"() {
|
|
159748
160150
|
"use strict";
|
|
159749
|
-
|
|
160151
|
+
import_node_crypto115 = require("node:crypto");
|
|
159750
160152
|
import_node_fs190 = require("node:fs");
|
|
159751
160153
|
import_node_os37 = require("node:os");
|
|
159752
160154
|
init_event_identity();
|
|
@@ -165501,18 +165903,18 @@ function stageAppBundleResources(appDir, origin, iosTarget, environment) {
|
|
|
165501
165903
|
const content = bytes[index];
|
|
165502
165904
|
result[base2] = {
|
|
165503
165905
|
uri: urls[index],
|
|
165504
|
-
sha256: (0,
|
|
165906
|
+
sha256: (0, import_node_crypto116.createHash)("sha256").update(content).digest("hex"),
|
|
165505
165907
|
contentType: preferredMimeType(base2) ?? "application/octet-stream",
|
|
165506
165908
|
byteLength: content.byteLength
|
|
165507
165909
|
};
|
|
165508
165910
|
});
|
|
165509
165911
|
return result;
|
|
165510
165912
|
}
|
|
165511
|
-
var
|
|
165913
|
+
var import_node_crypto116, import_node_fs193, import_node_path196;
|
|
165512
165914
|
var init_app_bundle_resources = __esm({
|
|
165513
165915
|
"cli/app-bundle-resources.ts"() {
|
|
165514
165916
|
"use strict";
|
|
165515
|
-
|
|
165917
|
+
import_node_crypto116 = require("node:crypto");
|
|
165516
165918
|
import_node_fs193 = __toESM(require("node:fs"), 1);
|
|
165517
165919
|
import_node_path196 = __toESM(require("node:path"), 1);
|
|
165518
165920
|
init_uttype_mime();
|
|
@@ -165650,7 +166052,7 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
165650
166052
|
const directory2 = import_node_path197.default.dirname(selected[0]);
|
|
165651
166053
|
const codepointsFile = import_node_path197.default.join(directory2, "MaterialSymbols.codepoints");
|
|
165652
166054
|
const mirroredFile = import_node_path197.default.join(directory2, "MaterialSymbols.mirrored");
|
|
165653
|
-
const digest3 = (0,
|
|
166055
|
+
const digest3 = (0, import_node_crypto117.createHash)("md5");
|
|
165654
166056
|
for (const asset of [...selected, codepointsFile, mirroredFile].sort(
|
|
165655
166057
|
(a, b) => import_node_path197.default.basename(a) < import_node_path197.default.basename(b) ? -1 : import_node_path197.default.basename(a) > import_node_path197.default.basename(b) ? 1 : 0
|
|
165656
166058
|
)) {
|
|
@@ -165662,11 +166064,11 @@ function materialSymbolFontAssets(fontPaths) {
|
|
|
165662
166064
|
mirroredPath: mirroredFile
|
|
165663
166065
|
};
|
|
165664
166066
|
}
|
|
165665
|
-
var
|
|
166067
|
+
var import_node_crypto117, import_node_fs194, import_node_module29, import_node_path197;
|
|
165666
166068
|
var init_material_symbol_fonts2 = __esm({
|
|
165667
166069
|
"cli/material-symbol-fonts.ts"() {
|
|
165668
166070
|
"use strict";
|
|
165669
|
-
|
|
166071
|
+
import_node_crypto117 = require("node:crypto");
|
|
165670
166072
|
import_node_fs194 = __toESM(require("node:fs"), 1);
|
|
165671
166073
|
import_node_module29 = require("node:module");
|
|
165672
166074
|
import_node_path197 = __toESM(require("node:path"), 1);
|
|
@@ -165905,11 +166307,11 @@ function discoverNativeLinkedAppFontAssets(opts) {
|
|
|
165905
166307
|
materialSymbols: materialSymbolFontAssets(materialFonts)
|
|
165906
166308
|
};
|
|
165907
166309
|
}
|
|
165908
|
-
var
|
|
166310
|
+
var import_node_crypto118, import_node_fs195, import_node_module30, import_node_path198, require3;
|
|
165909
166311
|
var init_app_fonts = __esm({
|
|
165910
166312
|
"cli/app-fonts.ts"() {
|
|
165911
166313
|
"use strict";
|
|
165912
|
-
|
|
166314
|
+
import_node_crypto118 = require("node:crypto");
|
|
165913
166315
|
import_node_fs195 = __toESM(require("node:fs"), 1);
|
|
165914
166316
|
import_node_module30 = require("node:module");
|
|
165915
166317
|
import_node_path198 = __toESM(require("node:path"), 1);
|
|
@@ -167127,11 +167529,11 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
167127
167529
|
return import_node_fs197.default.readFileSync(import_node_path200.default.join(search.dest.directory, relative7));
|
|
167128
167530
|
});
|
|
167129
167531
|
const verified2 = perFile && hashes ? bytes.every((content, i) => {
|
|
167130
|
-
const hash = (0,
|
|
167532
|
+
const hash = (0, import_node_crypto119.createHash)("md5").update(content).digest("hex");
|
|
167131
167533
|
return descriptor.scales.some(
|
|
167132
167534
|
(scale, j) => scale === scales[i] && hashes[j] === hash
|
|
167133
167535
|
);
|
|
167134
|
-
}) : scales.length === descriptor.scales.length && (0,
|
|
167536
|
+
}) : scales.length === descriptor.scales.length && (0, import_node_crypto119.createHash)("md5").update(Buffer.concat(bytes)).digest("hex") === descriptor.hash;
|
|
167135
167537
|
if (!verified2)
|
|
167136
167538
|
throw new Error(`Metro asset changed while staging: ${descriptor.name}`);
|
|
167137
167539
|
scales.forEach((scale, i) => {
|
|
@@ -167158,11 +167560,11 @@ async function stageMetroBundleAssets(bundleFile, source, origin) {
|
|
|
167158
167560
|
});
|
|
167159
167561
|
stageHostMetroAssets(staged, origin);
|
|
167160
167562
|
}
|
|
167161
|
-
var
|
|
167563
|
+
var import_node_crypto119, import_node_fs197, import_node_path200;
|
|
167162
167564
|
var init_metro_bundle_assets = __esm({
|
|
167163
167565
|
"cli/metro-bundle-assets.ts"() {
|
|
167164
167566
|
"use strict";
|
|
167165
|
-
|
|
167567
|
+
import_node_crypto119 = require("node:crypto");
|
|
167166
167568
|
import_node_fs197 = __toESM(require("node:fs"), 1);
|
|
167167
167569
|
import_node_path200 = __toESM(require("node:path"), 1);
|
|
167168
167570
|
init_metroAssetArtifact();
|
|
@@ -167327,7 +167729,7 @@ async function signIn(origin, requestedAccount, chooseLater, announce) {
|
|
|
167327
167729
|
` dev-login not available (${devResult.error}); falling back to browser`
|
|
167328
167730
|
);
|
|
167329
167731
|
}
|
|
167330
|
-
const state = (0,
|
|
167732
|
+
const state = (0, import_node_crypto120.randomBytes)(16).toString("hex");
|
|
167331
167733
|
const LOGIN_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
167332
167734
|
const result = await new Promise((resolve16) => {
|
|
167333
167735
|
let timer;
|
|
@@ -167436,11 +167838,11 @@ async function signIn(origin, requestedAccount, chooseLater, announce) {
|
|
|
167436
167838
|
dev: false
|
|
167437
167839
|
};
|
|
167438
167840
|
}
|
|
167439
|
-
var
|
|
167841
|
+
var import_node_crypto120, import_node_http4, import_promises20, REMOTE_DEFAULT_ORIGIN, DEV_LOGIN_WARMUP_MS;
|
|
167440
167842
|
var init_login = __esm({
|
|
167441
167843
|
"cli/commands/login.ts"() {
|
|
167442
167844
|
"use strict";
|
|
167443
|
-
|
|
167845
|
+
import_node_crypto120 = require("node:crypto");
|
|
167444
167846
|
import_node_http4 = __toESM(require("node:http"), 1);
|
|
167445
167847
|
import_promises20 = require("node:readline/promises");
|
|
167446
167848
|
init_shared_session();
|
|
@@ -167652,7 +168054,7 @@ async function requireAccount(commandLabel, options2 = {}, signedInAgain = false
|
|
|
167652
168054
|
if (auth.kind === "github") return;
|
|
167653
168055
|
const header = authHeaderValue(auth);
|
|
167654
168056
|
const origin = await billingOriginFor(auth);
|
|
167655
|
-
const credential = (0,
|
|
168057
|
+
const credential = (0, import_node_crypto121.createHash)("sha256").update(`${origin}
|
|
167656
168058
|
${header}`).digest("hex");
|
|
167657
168059
|
const check2 = readCheck();
|
|
167658
168060
|
const known = check2?.credential === credential ? check2 : null;
|
|
@@ -167700,11 +168102,11 @@ ${header}`).digest("hex");
|
|
|
167700
168102
|
`${name3} could not reach ${origin} to verify your account${status ? ` (${status})` : ""}; connect once and run it again`
|
|
167701
168103
|
);
|
|
167702
168104
|
}
|
|
167703
|
-
var
|
|
168105
|
+
var import_node_crypto121, import_node_fs198, import_node_path201, import_zod5, REFRESH_AFTER_MS, VALID_FOR_MS, VERIFY_TIMEOUT_MS, checkSchema, ACCOUNT_REQUIRED_HINT, waitlistedSchema;
|
|
167704
168106
|
var init_account_gate = __esm({
|
|
167705
168107
|
"cli/account-gate.ts"() {
|
|
167706
168108
|
"use strict";
|
|
167707
|
-
|
|
168109
|
+
import_node_crypto121 = require("node:crypto");
|
|
167708
168110
|
import_node_fs198 = require("node:fs");
|
|
167709
168111
|
import_node_path201 = __toESM(require("node:path"), 1);
|
|
167710
168112
|
import_zod5 = require("peachsim/vendor/zod");
|