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
|
@@ -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;
|
|
@@ -6000,13 +6000,13 @@ var init_swift_standin_digest = __esm({
|
|
|
6000
6000
|
];
|
|
6001
6001
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
6002
6002
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
6003
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
6003
|
+
STANDIN_SOURCE_DIGEST = true ? "c87e0b7f1ae69b2a4e76611266612d6218f81a3244e592800c02f78c4f8e48f6" : standinSourceDigest();
|
|
6004
6004
|
}
|
|
6005
6005
|
});
|
|
6006
6006
|
|
|
6007
6007
|
// src/expo-native-compiler-digest.ts
|
|
6008
6008
|
function expoNativeCompilerDigestValue() {
|
|
6009
|
-
return true ? "
|
|
6009
|
+
return true ? "a46618eade53d31c53a3c6377fc86635c03dbcfedd5e131d38b77d9fcc366623" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
6010
6010
|
}
|
|
6011
6011
|
var import_node_crypto11;
|
|
6012
6012
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -27673,12 +27673,13 @@ function parseSwiftDistributionLock(value) {
|
|
|
27673
27673
|
if (runtime === void 0) return void 0;
|
|
27674
27674
|
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(
|
|
27675
27675
|
runtime.url
|
|
27676
|
-
) || runtime.dataPlan !== void 0 && (typeof runtime.dataPlan !== "string" || !/^[a-f0-9]{64}$/.test(runtime.dataPlan)))
|
|
27676
|
+
) || 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)))
|
|
27677
27677
|
throw new Error("invalid shared SDK runtime publication in Swift distribution lock");
|
|
27678
27678
|
return {
|
|
27679
27679
|
source: runtime.source,
|
|
27680
27680
|
url: runtime.url,
|
|
27681
|
-
...runtime.dataPlan && { dataPlan: runtime.dataPlan }
|
|
27681
|
+
...runtime.dataPlan && { dataPlan: runtime.dataPlan },
|
|
27682
|
+
...runtime.recipe && { recipe: runtime.recipe }
|
|
27682
27683
|
};
|
|
27683
27684
|
};
|
|
27684
27685
|
const sdkRuntime = publication(value.sdkRuntime);
|
|
@@ -28709,6 +28710,15 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
|
|
|
28709
28710
|
const unchanged = before === after;
|
|
28710
28711
|
const original = layout(before, !unchanged, !importsLayout);
|
|
28711
28712
|
const optimized = unchanged ? original : layout(after, true, !importsLayout);
|
|
28713
|
+
if (extra?.optimizedDataSegments) {
|
|
28714
|
+
for (const segment2 of optimized.data) {
|
|
28715
|
+
extra.optimizedDataSegments.push({
|
|
28716
|
+
address: segment2.address,
|
|
28717
|
+
offset: segment2.bytes.byteOffset - after.byteOffset,
|
|
28718
|
+
length: segment2.bytes.length
|
|
28719
|
+
});
|
|
28720
|
+
}
|
|
28721
|
+
}
|
|
28712
28722
|
const collectSymbols = extra?.collectSymbols;
|
|
28713
28723
|
const trackedObject = extra?.trackedObject;
|
|
28714
28724
|
const trackedObjectOwner = extra?.trackedObjectOwner;
|
|
@@ -28877,12 +28887,39 @@ function guestLinkedSpans(map2, before, after, owners, sectionOwners = /* @__PUR
|
|
|
28877
28887
|
}
|
|
28878
28888
|
return result;
|
|
28879
28889
|
};
|
|
28890
|
+
const singleSegmentSlice = (module2, start, length) => {
|
|
28891
|
+
const segs = module2.dataByAddress;
|
|
28892
|
+
let low = 0;
|
|
28893
|
+
let high = segs.length;
|
|
28894
|
+
while (low < high) {
|
|
28895
|
+
const middle = low + high >> 1;
|
|
28896
|
+
if (segs[middle].maximumEnd <= start) low = middle + 1;
|
|
28897
|
+
else high = middle;
|
|
28898
|
+
}
|
|
28899
|
+
let found2;
|
|
28900
|
+
const end = start + length;
|
|
28901
|
+
for (let index = low; index < segs.length; index++) {
|
|
28902
|
+
const segment2 = segs[index];
|
|
28903
|
+
if (segment2.address >= end) break;
|
|
28904
|
+
if (segment2.address + segment2.bytes.length > start) {
|
|
28905
|
+
if (found2) return void 0;
|
|
28906
|
+
found2 = segment2;
|
|
28907
|
+
}
|
|
28908
|
+
}
|
|
28909
|
+
if (!found2 || found2.address > start || found2.address + found2.bytes.length < end)
|
|
28910
|
+
return void 0;
|
|
28911
|
+
return found2.bytes.subarray(start - found2.address, end - found2.address);
|
|
28912
|
+
};
|
|
28913
|
+
const sameDataAt = (start, length) => {
|
|
28914
|
+
const origSlice = singleSegmentSlice(original, start, length);
|
|
28915
|
+
const optSlice = origSlice ? singleSegmentSlice(optimized, start, length) : void 0;
|
|
28916
|
+
if (origSlice && optSlice) return Buffer.compare(origSlice, optSlice) === 0;
|
|
28917
|
+
return dataAt(original, start, length).equals(dataAt(optimized, start, length));
|
|
28918
|
+
};
|
|
28880
28919
|
for (const span of spans) {
|
|
28881
28920
|
if (span.address + span.length > original.memoryBytes || span.address + span.length > optimized.memoryBytes)
|
|
28882
28921
|
throw new Error(`linked data lies outside guest memory at ${span.address}`);
|
|
28883
|
-
if (!unchanged && !
|
|
28884
|
-
dataAt(optimized, span.address, span.length)
|
|
28885
|
-
))
|
|
28922
|
+
if (!unchanged && !sameDataAt(span.address, span.length))
|
|
28886
28923
|
throw new Error(`optimization changed linked data at ${span.address}`);
|
|
28887
28924
|
}
|
|
28888
28925
|
let previous;
|
|
@@ -29016,7 +29053,7 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
29016
29053
|
const bytes = new Uint8Array(length);
|
|
29017
29054
|
const emptied = /* @__PURE__ */ new Set();
|
|
29018
29055
|
let covered = 0;
|
|
29019
|
-
const
|
|
29056
|
+
const patchedBody = Buffer.from(wasm.subarray(body[0], body[1]));
|
|
29020
29057
|
for (const initializer of startupDataInitializers(wasm.subarray(...body))) {
|
|
29021
29058
|
const end = initializer.address + initializer.length;
|
|
29022
29059
|
if (end <= address || initializer.address >= address + length || !initializer.length)
|
|
@@ -29031,19 +29068,18 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
29031
29068
|
covered += segment2.length;
|
|
29032
29069
|
emptied.add(initializer.segment);
|
|
29033
29070
|
const [at, immediateEnd] = initializer.lengthImmediate;
|
|
29034
|
-
|
|
29035
|
-
|
|
29071
|
+
patchedBody.fill(128, at, immediateEnd - 1);
|
|
29072
|
+
patchedBody[immediateEnd - 1] = 0;
|
|
29036
29073
|
}
|
|
29037
29074
|
if (covered !== length)
|
|
29038
29075
|
throw new Error("guest startup data does not initialize the whole range");
|
|
29039
|
-
const
|
|
29040
|
-
const payload = [result.subarray(data[1], segments[0].header)];
|
|
29076
|
+
const payload = [wasm.subarray(data[1], segments[0].header)];
|
|
29041
29077
|
for (const [index, segment2] of segments.entries()) {
|
|
29042
29078
|
if (!emptied.has(index)) {
|
|
29043
|
-
payload.push(
|
|
29079
|
+
payload.push(wasm.subarray(segment2.header, segment2.payload + segment2.length));
|
|
29044
29080
|
continue;
|
|
29045
29081
|
}
|
|
29046
|
-
payload.push(
|
|
29082
|
+
payload.push(wasm.subarray(segment2.header, segment2.sizeAt), Uint8Array.of(0));
|
|
29047
29083
|
}
|
|
29048
29084
|
const section2 = Buffer.concat(payload);
|
|
29049
29085
|
const size2 = [];
|
|
@@ -29054,7 +29090,14 @@ function takeGuestStartupData(wasm, address, length) {
|
|
|
29054
29090
|
}
|
|
29055
29091
|
size2.push(rest % 128 | 128);
|
|
29056
29092
|
}
|
|
29057
|
-
parts2
|
|
29093
|
+
const parts2 = [
|
|
29094
|
+
wasm.subarray(0, body[0]),
|
|
29095
|
+
patchedBody,
|
|
29096
|
+
wasm.subarray(body[1], data[0]),
|
|
29097
|
+
Uint8Array.of(11, ...size2),
|
|
29098
|
+
section2,
|
|
29099
|
+
wasm.subarray(data[2])
|
|
29100
|
+
];
|
|
29058
29101
|
return { wasm: Buffer.concat(parts2), bytes };
|
|
29059
29102
|
}
|
|
29060
29103
|
var import_node_fs55, import_node_string_decoder, constant;
|
|
@@ -29363,6 +29406,32 @@ function readImports(bytes, imports2) {
|
|
|
29363
29406
|
}
|
|
29364
29407
|
return { functionTypes, importedGlobals, memoryPages };
|
|
29365
29408
|
}
|
|
29409
|
+
function countImportedFunctions(bytes, imports2) {
|
|
29410
|
+
let count = 0;
|
|
29411
|
+
if (!imports2) return count;
|
|
29412
|
+
const r = wasmReader(bytes, imports2.start);
|
|
29413
|
+
for (let n = r.u(); n > 0; n--) {
|
|
29414
|
+
r.skip(r.u());
|
|
29415
|
+
r.skip(r.u());
|
|
29416
|
+
const kind = r.byte();
|
|
29417
|
+
if (kind === 0) {
|
|
29418
|
+
r.u();
|
|
29419
|
+
count++;
|
|
29420
|
+
} else if (kind === 1) {
|
|
29421
|
+
r.byte();
|
|
29422
|
+
skipLimits(r);
|
|
29423
|
+
} else if (kind === 2) {
|
|
29424
|
+
skipLimits(r);
|
|
29425
|
+
} else if (kind === 3) {
|
|
29426
|
+
r.byte();
|
|
29427
|
+
r.byte();
|
|
29428
|
+
} else if (kind === 4) {
|
|
29429
|
+
r.byte();
|
|
29430
|
+
r.u();
|
|
29431
|
+
} else throw new Error(`unknown wasm import kind ${kind}`);
|
|
29432
|
+
}
|
|
29433
|
+
return count;
|
|
29434
|
+
}
|
|
29366
29435
|
function* readFunctionNames(bytes, names) {
|
|
29367
29436
|
for (const r = wasmReader(bytes, names.start); r.at < names.end; ) {
|
|
29368
29437
|
const id = r.byte();
|
|
@@ -29730,28 +29799,73 @@ function codeOnlySdkImage(bytes, constructorMask) {
|
|
|
29730
29799
|
return Buffer.concat(out);
|
|
29731
29800
|
}
|
|
29732
29801
|
function constructorKeys(map2, bytes) {
|
|
29733
|
-
const m = readModule(bytes);
|
|
29734
29802
|
const first = map2.code[0];
|
|
29735
|
-
if (!first
|
|
29736
|
-
const
|
|
29737
|
-
const
|
|
29738
|
-
|
|
29803
|
+
if (!first) throw new Error("link has no code");
|
|
29804
|
+
const sections = wasmSections(bytes);
|
|
29805
|
+
const code = sections.find((s) => s.id === 10);
|
|
29806
|
+
if (!code) throw new Error("link has no code");
|
|
29739
29807
|
const ctors = map2.code.find((chunk) => chunk.section === "__wasm_call_ctors");
|
|
29740
29808
|
if (!ctors) throw new Error("link has no constructors");
|
|
29741
|
-
const
|
|
29742
|
-
|
|
29743
|
-
|
|
29744
|
-
|
|
29809
|
+
const importedFuncs = countImportedFunctions(
|
|
29810
|
+
bytes,
|
|
29811
|
+
sections.find((s) => s.id === 2)
|
|
29812
|
+
);
|
|
29813
|
+
const codeReader = wasmReader(bytes, code.start);
|
|
29814
|
+
const bodyCount = codeReader.u();
|
|
29815
|
+
if (!bodyCount) throw new Error("link has no code");
|
|
29816
|
+
const prefixes = new Uint32Array(bodyCount);
|
|
29817
|
+
let delta = 0;
|
|
29818
|
+
let ctorPrefix = -1;
|
|
29819
|
+
let ctorStart = -1;
|
|
29820
|
+
let ctorEnd = -1;
|
|
29821
|
+
for (let i = 0; i < bodyCount; i++) {
|
|
29822
|
+
const prefix = codeReader.at;
|
|
29823
|
+
const size2 = codeReader.u();
|
|
29824
|
+
prefixes[i] = prefix;
|
|
29825
|
+
if (i === 0) {
|
|
29826
|
+
delta = prefix - first.offset;
|
|
29827
|
+
ctorPrefix = ctors.offset + delta;
|
|
29828
|
+
}
|
|
29829
|
+
if (prefix === ctorPrefix) {
|
|
29830
|
+
ctorStart = codeReader.at;
|
|
29831
|
+
ctorEnd = ctorStart + size2;
|
|
29832
|
+
}
|
|
29833
|
+
codeReader.skip(size2);
|
|
29834
|
+
}
|
|
29835
|
+
if (ctorStart < 0) throw new Error("constructor function not found by map offset");
|
|
29836
|
+
let sorted2 = true;
|
|
29837
|
+
for (let i = 1; i < map2.code.length; i++) {
|
|
29838
|
+
if (map2.code[i].offset < map2.code[i - 1].offset) {
|
|
29839
|
+
sorted2 = false;
|
|
29840
|
+
break;
|
|
29841
|
+
}
|
|
29842
|
+
}
|
|
29843
|
+
const byOffset = sorted2 ? void 0 : new Map(map2.code.map((chunk) => [chunk.offset + delta, chunk]));
|
|
29844
|
+
const findChunk = (targetPrefix) => {
|
|
29845
|
+
if (byOffset) return byOffset.get(targetPrefix);
|
|
29846
|
+
const targetOffset = targetPrefix - delta;
|
|
29847
|
+
let lo = 0;
|
|
29848
|
+
let hi = map2.code.length - 1;
|
|
29849
|
+
while (lo <= hi) {
|
|
29850
|
+
const mid = lo + hi >> 1;
|
|
29851
|
+
const offset = map2.code[mid].offset;
|
|
29852
|
+
if (offset < targetOffset) lo = mid + 1;
|
|
29853
|
+
else if (offset > targetOffset) hi = mid - 1;
|
|
29854
|
+
else return map2.code[mid];
|
|
29855
|
+
}
|
|
29856
|
+
return void 0;
|
|
29857
|
+
};
|
|
29858
|
+
const r = wasmReader(bytes, ctorStart);
|
|
29745
29859
|
for (let n = r.u(); n > 0; n--) {
|
|
29746
29860
|
r.u();
|
|
29747
29861
|
r.byte();
|
|
29748
29862
|
}
|
|
29749
29863
|
const keys = [];
|
|
29750
|
-
while (r.at <
|
|
29864
|
+
while (r.at < ctorEnd) {
|
|
29751
29865
|
const op = r.byte();
|
|
29752
29866
|
if (op === 16) {
|
|
29753
|
-
const callee = r.u() -
|
|
29754
|
-
const chunk =
|
|
29867
|
+
const callee = r.u() - importedFuncs;
|
|
29868
|
+
const chunk = callee >= 0 && callee < bodyCount ? findChunk(prefixes[callee]) : void 0;
|
|
29755
29869
|
if (!chunk) throw new Error("constructor without a map chunk");
|
|
29756
29870
|
keys.push(chunkKey(chunk, ""));
|
|
29757
29871
|
} else if (op !== 26 && op !== 11) throw new Error(`constructor op ${op}`);
|
|
@@ -29834,7 +29948,10 @@ function relocationEdges(bytes, segmentAddress) {
|
|
|
29834
29948
|
r.skip(r.u());
|
|
29835
29949
|
}
|
|
29836
29950
|
}
|
|
29837
|
-
const importedFunctions =
|
|
29951
|
+
const importedFunctions = countImportedFunctions(
|
|
29952
|
+
bytes,
|
|
29953
|
+
sections.find((s) => s.id === 2)
|
|
29954
|
+
);
|
|
29838
29955
|
const data = [];
|
|
29839
29956
|
const dataFunctions = [];
|
|
29840
29957
|
const bodyCount = bodyStarts.length;
|
|
@@ -29948,9 +30065,30 @@ function strongDefinitions(bytes) {
|
|
|
29948
30065
|
).map((s) => s.name);
|
|
29949
30066
|
}
|
|
29950
30067
|
function unslottedFunctions(bytes) {
|
|
29951
|
-
const
|
|
29952
|
-
const
|
|
29953
|
-
|
|
30068
|
+
const sections = wasmSections(bytes);
|
|
30069
|
+
const importedFuncs = countImportedFunctions(
|
|
30070
|
+
bytes,
|
|
30071
|
+
sections.find((s) => s.id === 2)
|
|
30072
|
+
);
|
|
30073
|
+
const code = sections.find((s) => s.id === 10);
|
|
30074
|
+
const definedFuncs = code ? wasmReader(bytes, code.start).u() : 0;
|
|
30075
|
+
const slotted = /* @__PURE__ */ new Set();
|
|
30076
|
+
const elements = sections.find((s) => s.id === 9);
|
|
30077
|
+
if (elements) {
|
|
30078
|
+
const r = wasmReader(bytes, elements.start);
|
|
30079
|
+
for (let n = r.u(); n > 0; n--) {
|
|
30080
|
+
const flags = r.u();
|
|
30081
|
+
if (flags !== 0 && flags !== 2) throw new Error(`sdk image element flags ${flags}`);
|
|
30082
|
+
if (flags === 2) r.u();
|
|
30083
|
+
constant2(r);
|
|
30084
|
+
if (flags === 2) r.byte();
|
|
30085
|
+
for (let i = 0, count = r.u(); i < count; i++) {
|
|
30086
|
+
const index = r.u();
|
|
30087
|
+
if (index >= importedFuncs) slotted.add(index);
|
|
30088
|
+
}
|
|
30089
|
+
}
|
|
30090
|
+
}
|
|
30091
|
+
return definedFuncs - slotted.size;
|
|
29954
30092
|
}
|
|
29955
30093
|
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;
|
|
29956
30094
|
var init_swift_sdk_image_wasm = __esm({
|
|
@@ -30334,6 +30472,11 @@ var init_swiftRuntimeProductContract = __esm({
|
|
|
30334
30472
|
});
|
|
30335
30473
|
|
|
30336
30474
|
// src/swift-wasm-prune.ts
|
|
30475
|
+
function sha256Hex(bytes) {
|
|
30476
|
+
if (typeof Bun !== "undefined")
|
|
30477
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
30478
|
+
return (0, import_node_crypto29.createHash)("sha256").update(bytes).digest("hex");
|
|
30479
|
+
}
|
|
30337
30480
|
function readULEB2(b, o) {
|
|
30338
30481
|
let res = 0;
|
|
30339
30482
|
let shift = 0;
|
|
@@ -31086,6 +31229,42 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
31086
31229
|
}
|
|
31087
31230
|
}
|
|
31088
31231
|
}
|
|
31232
|
+
const segObjCClasses = /* @__PURE__ */ new Map();
|
|
31233
|
+
for (let segIdx = 0; segIdx < sEnds.length; segIdx++) {
|
|
31234
|
+
const rangeStart = dataStart + sPayloadStarts[segIdx];
|
|
31235
|
+
const rangeEnd = dataStart + sEnds[segIdx];
|
|
31236
|
+
const sliceLen = rangeEnd - rangeStart;
|
|
31237
|
+
if (sliceLen < 4) continue;
|
|
31238
|
+
const slice = Buffer.from(rawBuf.buffer, rawBuf.byteOffset + rangeStart, sliceLen);
|
|
31239
|
+
let segPos = 0;
|
|
31240
|
+
let classes;
|
|
31241
|
+
while (segPos < sliceLen - 3) {
|
|
31242
|
+
const at = slice.indexOf("So", segPos);
|
|
31243
|
+
if (at < 0 || at >= sliceLen - 2) break;
|
|
31244
|
+
let digitEnd = at + 2;
|
|
31245
|
+
let length = 0;
|
|
31246
|
+
while (digitEnd < sliceLen) {
|
|
31247
|
+
const ch = slice[digitEnd];
|
|
31248
|
+
if (ch < 48 || ch > 57) break;
|
|
31249
|
+
length = length * 10 + (ch - 48);
|
|
31250
|
+
digitEnd++;
|
|
31251
|
+
}
|
|
31252
|
+
if (digitEnd === at + 2) {
|
|
31253
|
+
segPos = at + 2;
|
|
31254
|
+
continue;
|
|
31255
|
+
}
|
|
31256
|
+
segPos = digitEnd;
|
|
31257
|
+
const nameEnd = digitEnd + length;
|
|
31258
|
+
if (nameEnd >= sliceLen || slice[nameEnd] !== 67) continue;
|
|
31259
|
+
const symbol2 = `._OBJC_CLASS_${slice.toString("latin1", digitEnd, nameEnd)}`;
|
|
31260
|
+
if (!classes) {
|
|
31261
|
+
classes = [symbol2];
|
|
31262
|
+
segObjCClasses.set(segIdx, classes);
|
|
31263
|
+
} else if (!classes.includes(symbol2)) {
|
|
31264
|
+
classes.push(symbol2);
|
|
31265
|
+
}
|
|
31266
|
+
}
|
|
31267
|
+
}
|
|
31089
31268
|
return {
|
|
31090
31269
|
file,
|
|
31091
31270
|
isDist,
|
|
@@ -31115,10 +31294,7 @@ function parseWasmObjectBytes(file, buf, isDist, symbolFlagOffsets) {
|
|
|
31115
31294
|
objcCategoryTargets,
|
|
31116
31295
|
rootFuncs,
|
|
31117
31296
|
rootSegs,
|
|
31118
|
-
|
|
31119
|
-
dataStart + sPayloadStarts[i],
|
|
31120
|
-
dataStart + end
|
|
31121
|
-
])
|
|
31297
|
+
segObjCClasses
|
|
31122
31298
|
};
|
|
31123
31299
|
}
|
|
31124
31300
|
function parseWasmObjectFile(file, isDist) {
|
|
@@ -31486,16 +31662,26 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31486
31662
|
transformations.set(file, {
|
|
31487
31663
|
output,
|
|
31488
31664
|
inputSha256,
|
|
31489
|
-
outputSha256: (
|
|
31665
|
+
outputSha256: sha256Hex(result),
|
|
31490
31666
|
kind
|
|
31491
31667
|
});
|
|
31492
31668
|
};
|
|
31493
31669
|
const distFiles = [];
|
|
31494
31670
|
const distBaseNames = /* @__PURE__ */ new Set();
|
|
31495
31671
|
const eagerFiles = [];
|
|
31672
|
+
const parsedBuildObjects = /* @__PURE__ */ new Map();
|
|
31496
31673
|
const lazyBuildObjects = /* @__PURE__ */ new Map();
|
|
31497
31674
|
const extraArchiveObjs = [];
|
|
31498
31675
|
const objectBytes = /* @__PURE__ */ new Map();
|
|
31676
|
+
const archiveMembers = /* @__PURE__ */ new Map();
|
|
31677
|
+
const readArchiveMembers = (archive) => {
|
|
31678
|
+
let members2 = archiveMembers.get(archive);
|
|
31679
|
+
if (!members2) {
|
|
31680
|
+
members2 = readArMembers(new Uint8Array(import_node_fs56.default.readFileSync(archive)));
|
|
31681
|
+
archiveMembers.set(archive, members2);
|
|
31682
|
+
}
|
|
31683
|
+
return members2;
|
|
31684
|
+
};
|
|
31499
31685
|
let inStartLib = false;
|
|
31500
31686
|
let swiftrtOrigPath = "";
|
|
31501
31687
|
for (const t of tokens2) {
|
|
@@ -31532,8 +31718,10 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31532
31718
|
break;
|
|
31533
31719
|
}
|
|
31534
31720
|
}
|
|
31535
|
-
if (definesObjCClassOrCategory)
|
|
31536
|
-
|
|
31721
|
+
if (definesObjCClassOrCategory) {
|
|
31722
|
+
parsedBuildObjects.set(t, obj);
|
|
31723
|
+
eagerFiles.push(t);
|
|
31724
|
+
} else lazyBuildObjects.set(t, obj);
|
|
31537
31725
|
} else {
|
|
31538
31726
|
eagerFiles.push(t);
|
|
31539
31727
|
}
|
|
@@ -31541,7 +31729,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31541
31729
|
lazyBuildObjects.set(t, parseWasmObjectFile(t, false));
|
|
31542
31730
|
}
|
|
31543
31731
|
} else if (!inStartLib && t.endsWith(".a") && !t.endsWith("libclang_rt.builtins-wasm64.a") && import_node_fs56.default.existsSync(t)) {
|
|
31544
|
-
const members2 =
|
|
31732
|
+
const members2 = readArchiveMembers(t);
|
|
31545
31733
|
for (const m of members2) {
|
|
31546
31734
|
const object9 = parseWasmObjectBytes(`${t}(${m.name})`, m.bytes, false);
|
|
31547
31735
|
extraArchiveObjs.push(object9);
|
|
@@ -31564,7 +31752,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31564
31752
|
);
|
|
31565
31753
|
const archiveOverlapsDist = (archive) => {
|
|
31566
31754
|
if (!import_node_fs56.default.existsSync(archive)) return false;
|
|
31567
|
-
const members2 =
|
|
31755
|
+
const members2 = readArchiveMembers(archive);
|
|
31568
31756
|
return members2.some((m) => distBaseNames.has(m.name));
|
|
31569
31757
|
};
|
|
31570
31758
|
for (const t of tokens2) {
|
|
@@ -31586,7 +31774,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31586
31774
|
import_node_path57.default.basename(archive)
|
|
31587
31775
|
);
|
|
31588
31776
|
const ordinals = /* @__PURE__ */ new Map();
|
|
31589
|
-
for (const m of
|
|
31777
|
+
for (const m of readArchiveMembers(archive)) {
|
|
31590
31778
|
const ordinal = (ordinals.get(m.name) ?? 0) + 1;
|
|
31591
31779
|
ordinals.set(m.name, ordinal);
|
|
31592
31780
|
if (distBaseNames.has(m.name) || writtenLeftovers.has(m.name)) continue;
|
|
@@ -31620,7 +31808,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
31620
31808
|
recordTransformation(
|
|
31621
31809
|
swiftrtOrigPath,
|
|
31622
31810
|
patchedSwiftrtPath,
|
|
31623
|
-
link ? (
|
|
31811
|
+
link ? sha256Hex(input) : "",
|
|
31624
31812
|
result,
|
|
31625
31813
|
"swiftrt"
|
|
31626
31814
|
);
|
|
@@ -32107,7 +32295,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
32107
32295
|
}
|
|
32108
32296
|
for (const f of eagerFiles) {
|
|
32109
32297
|
const isDist = f.startsWith(distDir);
|
|
32110
|
-
const obj = distObjs.get(f) ?? parseWasmObjectFile(f, isDist);
|
|
32298
|
+
const obj = distObjs.get(f) ?? parsedBuildObjects.get(f) ?? parseWasmObjectFile(f, isDist);
|
|
32111
32299
|
extractObject(obj);
|
|
32112
32300
|
if (isDist) {
|
|
32113
32301
|
const base2 = import_node_path57.default.basename(f);
|
|
@@ -32157,32 +32345,9 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
32157
32345
|
"$s10Foundation6BundleC22preferredLocalizations4fromSaySSGAF_tFZTf4nd_n"
|
|
32158
32346
|
]);
|
|
32159
32347
|
const keepObjCClassesNamedInSegment = (obj, segIdx) => {
|
|
32160
|
-
const
|
|
32161
|
-
if (!
|
|
32162
|
-
const
|
|
32163
|
-
if (rangeEnd - rangeStart < 4) return;
|
|
32164
|
-
let bytes = objectBytes.get(obj);
|
|
32165
|
-
if (!bytes) objectBytes.set(obj, bytes = import_node_fs56.default.readFileSync(obj.file));
|
|
32166
|
-
let pos = rangeStart;
|
|
32167
|
-
while (pos < rangeEnd - 3) {
|
|
32168
|
-
const at = bytes.indexOf("So", pos);
|
|
32169
|
-
if (at < 0 || at >= rangeEnd - 2) break;
|
|
32170
|
-
let digitEnd = at + 2;
|
|
32171
|
-
let length = 0;
|
|
32172
|
-
while (digitEnd < rangeEnd) {
|
|
32173
|
-
const ch = bytes[digitEnd];
|
|
32174
|
-
if (ch < 48 || ch > 57) break;
|
|
32175
|
-
length = length * 10 + (ch - 48);
|
|
32176
|
-
digitEnd++;
|
|
32177
|
-
}
|
|
32178
|
-
if (digitEnd === at + 2) {
|
|
32179
|
-
pos = at + 2;
|
|
32180
|
-
continue;
|
|
32181
|
-
}
|
|
32182
|
-
pos = digitEnd;
|
|
32183
|
-
const nameEnd = digitEnd + length;
|
|
32184
|
-
if (nameEnd >= rangeEnd || bytes[nameEnd] !== 67) continue;
|
|
32185
|
-
const symbol2 = `._OBJC_CLASS_${bytes.toString("latin1", digitEnd, nameEnd)}`;
|
|
32348
|
+
const symbols = obj.segObjCClasses.get(segIdx);
|
|
32349
|
+
if (!symbols) return;
|
|
32350
|
+
for (const symbol2 of symbols) {
|
|
32186
32351
|
for (const provider of lazyProviders.get(symbol2) ?? []) {
|
|
32187
32352
|
eagerDynamicObjects.add(provider);
|
|
32188
32353
|
extractObject(provider);
|
|
@@ -32278,7 +32443,7 @@ function pruneSwiftWasmLink(directory2, toolchainBin, moduleRoot, staticClangTar
|
|
|
32278
32443
|
const cached4 = objectBytes.get(obj);
|
|
32279
32444
|
const buf = cached4 ? new Uint8Array(cached4) : new Uint8Array(import_node_fs56.default.readFileSync(obj.file));
|
|
32280
32445
|
const rawBuf = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
32281
|
-
const inputSha256 = link ? (
|
|
32446
|
+
const inputSha256 = link ? sha256Hex(buf) : "";
|
|
32282
32447
|
const fLive = liveFuncs.get(obj);
|
|
32283
32448
|
const sLive = liveSegs.get(obj);
|
|
32284
32449
|
const dLive = liveDataSyms.get(obj);
|
|
@@ -34657,13 +34822,34 @@ function dropWasmCustomSection(bytes, name3) {
|
|
|
34657
34822
|
}
|
|
34658
34823
|
return Buffer.concat(parts2);
|
|
34659
34824
|
}
|
|
34825
|
+
function writeWasmCustomSections(bytes, entries2) {
|
|
34826
|
+
if (entries2.length === 0) return Buffer.concat([bytes]);
|
|
34827
|
+
const replaced = new Set(entries2.map(([name3]) => name3));
|
|
34828
|
+
const parts2 = [];
|
|
34829
|
+
let sliceStart = 0;
|
|
34830
|
+
let sliceEnd = 8;
|
|
34831
|
+
for (const { id, start, end } of wasmSections2(bytes)) {
|
|
34832
|
+
if (id === 0 && replaced.has(readWasmSection(bytes, start, end).name())) {
|
|
34833
|
+
if (sliceEnd > sliceStart) parts2.push(bytes.subarray(sliceStart, sliceEnd));
|
|
34834
|
+
sliceStart = end;
|
|
34835
|
+
sliceEnd = end;
|
|
34836
|
+
} else {
|
|
34837
|
+
sliceEnd = end;
|
|
34838
|
+
}
|
|
34839
|
+
}
|
|
34840
|
+
if (sliceEnd > sliceStart) parts2.push(bytes.subarray(sliceStart, sliceEnd));
|
|
34841
|
+
for (const [name3, data] of entries2) {
|
|
34842
|
+
const nameBytes = Buffer.from(encodeWasmName(name3));
|
|
34843
|
+
parts2.push(
|
|
34844
|
+
Buffer.from([0, ...encodeWasmNumber(nameBytes.length + data.length)]),
|
|
34845
|
+
nameBytes,
|
|
34846
|
+
data
|
|
34847
|
+
);
|
|
34848
|
+
}
|
|
34849
|
+
return Buffer.concat(parts2);
|
|
34850
|
+
}
|
|
34660
34851
|
function writeWasmCustomSection(bytes, name3, data) {
|
|
34661
|
-
|
|
34662
|
-
return Buffer.concat([
|
|
34663
|
-
dropWasmCustomSection(bytes, name3),
|
|
34664
|
-
Buffer.from([0, ...encodeWasmNumber(section2.length)]),
|
|
34665
|
-
section2
|
|
34666
|
-
]);
|
|
34852
|
+
return writeWasmCustomSections(bytes, [[name3, data]]);
|
|
34667
34853
|
}
|
|
34668
34854
|
function readWasmFunctionNames(bytes) {
|
|
34669
34855
|
const section2 = readWasmCustomSection(bytes, "name");
|
|
@@ -35093,6 +35279,16 @@ var init_wasm_narrow_boundary = __esm({
|
|
|
35093
35279
|
});
|
|
35094
35280
|
|
|
35095
35281
|
// src/swift-guest-dyld-table.ts
|
|
35282
|
+
function sha256Buffer(bytes) {
|
|
35283
|
+
if (typeof Bun !== "undefined")
|
|
35284
|
+
return Buffer.from(new Bun.CryptoHasher("sha256").update(bytes).digest());
|
|
35285
|
+
return (0, import_node_crypto32.createHash)("sha256").update(bytes).digest();
|
|
35286
|
+
}
|
|
35287
|
+
function sha256Hex2(bytes) {
|
|
35288
|
+
if (typeof Bun !== "undefined")
|
|
35289
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
35290
|
+
return (0, import_node_crypto32.createHash)("sha256").update(bytes).digest("hex");
|
|
35291
|
+
}
|
|
35096
35292
|
function uleb3(value) {
|
|
35097
35293
|
const bytes = [];
|
|
35098
35294
|
for (let rest = value; ; rest = Math.floor(rest / 128)) {
|
|
@@ -35127,7 +35323,7 @@ function encodeGuestDyldTable(rows) {
|
|
|
35127
35323
|
}
|
|
35128
35324
|
const file = Buffer.concat(packs);
|
|
35129
35325
|
const header = Buffer.alloc(40 + packs.length * 8);
|
|
35130
|
-
(
|
|
35326
|
+
sha256Buffer(file).copy(header, 0);
|
|
35131
35327
|
header.writeUInt32LE(file.length, 32);
|
|
35132
35328
|
header.writeUInt32LE(packs.length, 36);
|
|
35133
35329
|
let offset = 0;
|
|
@@ -35139,11 +35335,11 @@ function encodeGuestDyldTable(rows) {
|
|
|
35139
35335
|
const names = firsts.flatMap((name3) => [name3, Buffer.of(0)]);
|
|
35140
35336
|
return { index: Buffer.concat([header, ...names]), packs: file };
|
|
35141
35337
|
}
|
|
35142
|
-
function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */ new Map()) {
|
|
35338
|
+
function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */ new Map(), extraSections = []) {
|
|
35143
35339
|
const range3 = guestDyldValueRange(map2);
|
|
35144
35340
|
if (!range3) {
|
|
35145
35341
|
if (symbols.length) throw new Error("link map has no dyld values");
|
|
35146
|
-
return wasm;
|
|
35342
|
+
return extraSections.length ? writeWasmCustomSections(wasm, extraSections) : wasm;
|
|
35147
35343
|
}
|
|
35148
35344
|
if (range3.length !== symbols.length * 8)
|
|
35149
35345
|
throw new Error("linked dyld values do not match the ledger rows");
|
|
@@ -35158,11 +35354,11 @@ function moveGuestDyldTable(map2, wasm, symbols, bindingValues = /* @__PURE__ */
|
|
|
35158
35354
|
return binding === void 0 ? { name: name3, image, kind: 0, value: view.getBigUint64(index2 * 8, true) } : { name: name3, image, kind: 1, value: BigInt(binding) };
|
|
35159
35355
|
});
|
|
35160
35356
|
const { index, packs } = encodeGuestDyldTable(rows);
|
|
35161
|
-
return
|
|
35162
|
-
|
|
35163
|
-
NATIVE_DYLD_PACKS_SECTION,
|
|
35164
|
-
|
|
35165
|
-
);
|
|
35357
|
+
return writeWasmCustomSections(taken.wasm, [
|
|
35358
|
+
[NATIVE_DYLD_TABLE_SECTION, index],
|
|
35359
|
+
[NATIVE_DYLD_PACKS_SECTION, packs],
|
|
35360
|
+
...extraSections
|
|
35361
|
+
]);
|
|
35166
35362
|
}
|
|
35167
35363
|
function guestDyldValueRange(map2) {
|
|
35168
35364
|
const suffix = `:(${GUEST_DYLD_VALUES_SECTION})`;
|
|
@@ -35191,7 +35387,7 @@ function splitSwiftDyldTable(wasm) {
|
|
|
35191
35387
|
const bytes = Buffer.from(packs);
|
|
35192
35388
|
return {
|
|
35193
35389
|
module: dropWasmCustomSection(wasm, NATIVE_DYLD_PACKS_SECTION),
|
|
35194
|
-
table: { sha256: (
|
|
35390
|
+
table: { sha256: sha256Hex2(bytes), bytes }
|
|
35195
35391
|
};
|
|
35196
35392
|
}
|
|
35197
35393
|
var import_node_crypto32, import_node_zlib4, PACK_BYTES;
|
|
@@ -35727,6 +35923,7 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
35727
35923
|
const owner = options2.owners.get(options2.projectionObject);
|
|
35728
35924
|
if (owner === void 0) throw new Error("guest projection object has no image owner");
|
|
35729
35925
|
const ranges = [];
|
|
35926
|
+
const data = [];
|
|
35730
35927
|
const spans = guestLinkedSpans(
|
|
35731
35928
|
options2.map,
|
|
35732
35929
|
options2.linked,
|
|
@@ -35737,7 +35934,8 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
35737
35934
|
{
|
|
35738
35935
|
trackedObject: options2.projectionObject,
|
|
35739
35936
|
trackedObjectOwner: owner,
|
|
35740
|
-
trackedLinearSpans: ranges
|
|
35937
|
+
trackedLinearSpans: ranges,
|
|
35938
|
+
optimizedDataSegments: data
|
|
35741
35939
|
}
|
|
35742
35940
|
);
|
|
35743
35941
|
const images = planGuestProjectionRegions(
|
|
@@ -35746,7 +35944,6 @@ function finalizeGuestProjectionStorage(options2) {
|
|
|
35746
35944
|
options2.sdkSpans ? [...spans, ...options2.sdkSpans] : spans
|
|
35747
35945
|
);
|
|
35748
35946
|
const result = Buffer.from(options2.optimized);
|
|
35749
|
-
const data = guestWasmDataSegments(options2.optimized, options2.sdkSpans === void 0);
|
|
35750
35947
|
const locations = /* @__PURE__ */ new Map();
|
|
35751
35948
|
const counts = /* @__PURE__ */ new Map();
|
|
35752
35949
|
const uuids = /* @__PURE__ */ new Map();
|
|
@@ -36420,17 +36617,17 @@ var init_binaryen_lock = __esm({
|
|
|
36420
36617
|
"linux-x64": {
|
|
36421
36618
|
asset: "x86_64-linux",
|
|
36422
36619
|
upstreamSha256: "195ddc94f9bc89f45abdabb0b9eea86023d727ba90eac8b35b80f2544fc30572",
|
|
36423
|
-
sha256: "
|
|
36620
|
+
sha256: "40062fb1ebbad7f04f361c1e3bb309dffb1d2318dd2e12235a0e7e820e18d6c9"
|
|
36424
36621
|
},
|
|
36425
36622
|
"linux-arm64": {
|
|
36426
36623
|
asset: "aarch64-linux",
|
|
36427
36624
|
upstreamSha256: "c58562417836c5d0493d89bdefc434933bdc097db641b483df86bcfa557a107f",
|
|
36428
|
-
sha256: "
|
|
36625
|
+
sha256: "d79b09d5b66f62f9e4bb691517b174b42bcdc0b7f40769d1993b7c565b0a54c7"
|
|
36429
36626
|
},
|
|
36430
36627
|
"darwin-arm64": {
|
|
36431
36628
|
asset: "arm64-macos",
|
|
36432
36629
|
upstreamSha256: "98aad827847af7ef990ed7098d885725c8e5b5aae75073403635617ae4e259aa",
|
|
36433
|
-
sha256: "
|
|
36630
|
+
sha256: "29342632a4fa52466c4feea846698fe5aa56ff46226a914d60b65b8735373d63"
|
|
36434
36631
|
}
|
|
36435
36632
|
}
|
|
36436
36633
|
};
|
|
@@ -36924,6 +37121,7 @@ function outputPath(args) {
|
|
|
36924
37121
|
}
|
|
36925
37122
|
function withOutput(args, output, discovery) {
|
|
36926
37123
|
const result = [];
|
|
37124
|
+
let stripsDebug = false;
|
|
36927
37125
|
for (let i = 0; i < args.length; i++) {
|
|
36928
37126
|
const arg = args[i];
|
|
36929
37127
|
if (arg === "-o" || arg === "--output") {
|
|
@@ -36933,9 +37131,12 @@ function withOutput(args, output, discovery) {
|
|
|
36933
37131
|
if (arg.startsWith("--output=")) continue;
|
|
36934
37132
|
if (discovery && (arg.startsWith("--why-extract=") || arg.startsWith("--Map=")))
|
|
36935
37133
|
continue;
|
|
37134
|
+
if (arg === "--strip-debug" || arg === "-S" || arg === "--strip-all" || arg === "-s")
|
|
37135
|
+
stripsDebug = true;
|
|
36936
37136
|
result.push(arg);
|
|
36937
37137
|
}
|
|
36938
37138
|
if (discovery) result.push("--allow-multiple-definition");
|
|
37139
|
+
if (!stripsDebug) result.push("--strip-debug");
|
|
36939
37140
|
result.push("-o", output);
|
|
36940
37141
|
return result;
|
|
36941
37142
|
}
|
|
@@ -36966,6 +37167,37 @@ async function linkGuestImages(options2) {
|
|
|
36966
37167
|
}
|
|
36967
37168
|
return import_node_fs61.default.readFileSync(trace, "utf8");
|
|
36968
37169
|
};
|
|
37170
|
+
const runLinkAsync = async (name3, arguments_) => {
|
|
37171
|
+
const response = import_node_path61.default.join(directory2, `${name3}.rsp`);
|
|
37172
|
+
const trace = import_node_path61.default.join(directory2, `${name3}-inputs.txt`);
|
|
37173
|
+
import_node_fs61.default.writeFileSync(
|
|
37174
|
+
response,
|
|
37175
|
+
[...arguments_, "--trace"].map((argument2) => JSON.stringify(argument2)).join(" ")
|
|
37176
|
+
);
|
|
37177
|
+
const output = import_node_fs61.default.openSync(trace, "w");
|
|
37178
|
+
try {
|
|
37179
|
+
await new Promise((resolve11, reject) => {
|
|
37180
|
+
const child = (0, import_node_child_process28.spawn)(wasmLd, [`@${response}`], {
|
|
37181
|
+
stdio: ["ignore", output, "pipe"]
|
|
37182
|
+
});
|
|
37183
|
+
const stderr = [];
|
|
37184
|
+
child.stderr?.on("data", (chunk) => stderr.push(chunk));
|
|
37185
|
+
child.once("error", reject);
|
|
37186
|
+
child.once("close", (code, signal) => {
|
|
37187
|
+
if (code === 0) resolve11();
|
|
37188
|
+
else
|
|
37189
|
+
reject(
|
|
37190
|
+
new Error(
|
|
37191
|
+
`wasm-ld (${name3}) failed (${signal ?? code}): ${Buffer.concat(stderr).toString("utf8")}`
|
|
37192
|
+
)
|
|
37193
|
+
);
|
|
37194
|
+
});
|
|
37195
|
+
});
|
|
37196
|
+
} finally {
|
|
37197
|
+
import_node_fs61.default.closeSync(output);
|
|
37198
|
+
}
|
|
37199
|
+
return import_node_fs61.default.readFileSync(trace, "utf8");
|
|
37200
|
+
};
|
|
36969
37201
|
const preselection = options2.projection && options2.preselectionDiscovery ? options2.preselectionDiscovery : void 0;
|
|
36970
37202
|
let discoveryProjection;
|
|
36971
37203
|
if (options2.projection) {
|
|
@@ -37195,6 +37427,7 @@ async function linkGuestImages(options2) {
|
|
|
37195
37427
|
};
|
|
37196
37428
|
const ledgerObjectPromise = compileLedgerAsync("ledger", ledger.llvmIR);
|
|
37197
37429
|
const appLedgerObjectPromise = options2.onSplitInputs && ledger.appLLVMIR ? compileLedgerAsync("app-ledger", ledger.appLLVMIR) : void 0;
|
|
37430
|
+
let deferredFinalLink;
|
|
37198
37431
|
try {
|
|
37199
37432
|
const replacements = /* @__PURE__ */ new Map();
|
|
37200
37433
|
const linkedOwners = /* @__PURE__ */ new Map();
|
|
@@ -37296,7 +37529,7 @@ async function linkGuestImages(options2) {
|
|
|
37296
37529
|
});
|
|
37297
37530
|
const finalOutput = import_node_path61.default.join(directory2, "final.wasm");
|
|
37298
37531
|
const finalWhy = import_node_path61.default.join(directory2, "final-why-extract.txt");
|
|
37299
|
-
const
|
|
37532
|
+
const finalLinkArgs = (projectionObject2, layoutMap) => [
|
|
37300
37533
|
...withOutput(finalArgs, finalOutput, false),
|
|
37301
37534
|
ledgerObject,
|
|
37302
37535
|
`@${lazyExports}`,
|
|
@@ -37304,10 +37537,38 @@ async function linkGuestImages(options2) {
|
|
|
37304
37537
|
...provider ? [`--undefined=${providerSymbol}`] : [],
|
|
37305
37538
|
...layoutMap ? [`--Map=${layoutMap}`] : [],
|
|
37306
37539
|
`--why-extract=${finalWhy}`
|
|
37307
|
-
]
|
|
37540
|
+
];
|
|
37541
|
+
const linkFinal = (projectionObject2, layoutMap) => runLink("final", finalLinkArgs(projectionObject2, layoutMap));
|
|
37542
|
+
const finalizeFinalLink = (trace) => {
|
|
37543
|
+
const finalSelection = selectedGuestLinkInputs(
|
|
37544
|
+
remapGuestLinkPlan(plan, replacements),
|
|
37545
|
+
finalArgs,
|
|
37546
|
+
import_node_fs61.default.readFileSync(finalWhy, "utf8"),
|
|
37547
|
+
trace,
|
|
37548
|
+
finalArchives
|
|
37549
|
+
);
|
|
37550
|
+
const original = new Map(
|
|
37551
|
+
[...replacements].map(([before2, after2]) => [after2, before2])
|
|
37552
|
+
);
|
|
37553
|
+
const key2 = (item) => JSON.stringify([original.get(item.artifact) ?? item.artifact, item.member]);
|
|
37554
|
+
const before = new Set(selected.map(key2));
|
|
37555
|
+
const after = new Set(finalSelection.map(key2));
|
|
37556
|
+
const changed2 = [...before].filter((item) => !after.has(item));
|
|
37557
|
+
changed2.push(...[...after].filter((item) => !before.has(item)));
|
|
37558
|
+
if (changed2.length)
|
|
37559
|
+
throw new Error(
|
|
37560
|
+
`guest link selected different inputs after rewriting:
|
|
37561
|
+
${changed2.join("\n")}`
|
|
37562
|
+
);
|
|
37563
|
+
import_node_fs61.default.renameSync(finalOutput, outputPath(args));
|
|
37564
|
+
if (KEEP_WASM_NAMES)
|
|
37565
|
+
import_node_fs61.default.writeFileSync(
|
|
37566
|
+
outputPath(args),
|
|
37567
|
+
nameGuestImageAliases(import_node_fs61.default.readFileSync(outputPath(args)), plan.symbols)
|
|
37568
|
+
);
|
|
37569
|
+
};
|
|
37308
37570
|
let projectionObject;
|
|
37309
37571
|
let projectionStorage;
|
|
37310
|
-
let finalTrace;
|
|
37311
37572
|
if (options2.projection) {
|
|
37312
37573
|
const projection = options2.projection;
|
|
37313
37574
|
if (!plan.images.some((image) => image.id === projection.image))
|
|
@@ -37360,8 +37621,18 @@ async function linkGuestImages(options2) {
|
|
|
37360
37621
|
[...projection.clangOptions, "-c", projectionSource, "-o", projectionObject],
|
|
37361
37622
|
{ stdio: "pipe" }
|
|
37362
37623
|
);
|
|
37363
|
-
|
|
37364
|
-
|
|
37624
|
+
if (sharedSdk && options2.onFinalLink && options2.onSplitInputs && appLedgerObjectPromise) {
|
|
37625
|
+
deferredFinalLink = runLinkAsync(
|
|
37626
|
+
"final",
|
|
37627
|
+
finalLinkArgs(projectionObject, callerMap ? void 0 : layoutMap)
|
|
37628
|
+
).then((trace) => finalizeFinalLink(trace));
|
|
37629
|
+
break;
|
|
37630
|
+
}
|
|
37631
|
+
const finalTrace = linkFinal(projectionObject, callerMap ? void 0 : layoutMap);
|
|
37632
|
+
if (sharedSdk) {
|
|
37633
|
+
finalizeFinalLink(finalTrace);
|
|
37634
|
+
break;
|
|
37635
|
+
}
|
|
37365
37636
|
const wasm = import_node_fs61.default.readFileSync(finalOutput);
|
|
37366
37637
|
const actual = guestProjectionRegionCounts(
|
|
37367
37638
|
images.length,
|
|
@@ -37373,38 +37644,17 @@ async function linkGuestImages(options2) {
|
|
|
37373
37644
|
sectionOwners
|
|
37374
37645
|
)
|
|
37375
37646
|
);
|
|
37376
|
-
if (actual.every((count, index) => count <= capacities[index].regions))
|
|
37647
|
+
if (actual.every((count, index) => count <= capacities[index].regions)) {
|
|
37648
|
+
finalizeFinalLink(finalTrace);
|
|
37649
|
+
break;
|
|
37650
|
+
}
|
|
37377
37651
|
capacities = capacities.map((capacity, index) => ({
|
|
37378
37652
|
...capacity,
|
|
37379
37653
|
regions: Math.max(actual[index], capacity.regions)
|
|
37380
37654
|
}));
|
|
37381
37655
|
}
|
|
37382
37656
|
linkedOwners.set(projectionObject, projection.image);
|
|
37383
|
-
} else
|
|
37384
|
-
const finalSelection = selectedGuestLinkInputs(
|
|
37385
|
-
remapGuestLinkPlan(plan, replacements),
|
|
37386
|
-
finalArgs,
|
|
37387
|
-
import_node_fs61.default.readFileSync(finalWhy, "utf8"),
|
|
37388
|
-
finalTrace,
|
|
37389
|
-
finalArchives
|
|
37390
|
-
);
|
|
37391
|
-
const original = new Map([...replacements].map(([before2, after2]) => [after2, before2]));
|
|
37392
|
-
const key2 = (item) => JSON.stringify([original.get(item.artifact) ?? item.artifact, item.member]);
|
|
37393
|
-
const before = new Set(selected.map(key2));
|
|
37394
|
-
const after = new Set(finalSelection.map(key2));
|
|
37395
|
-
const changed2 = [...before].filter((item) => !after.has(item));
|
|
37396
|
-
changed2.push(...[...after].filter((item) => !before.has(item)));
|
|
37397
|
-
if (changed2.length)
|
|
37398
|
-
throw new Error(
|
|
37399
|
-
`guest link selected different inputs after rewriting:
|
|
37400
|
-
${changed2.join("\n")}`
|
|
37401
|
-
);
|
|
37402
|
-
import_node_fs61.default.renameSync(finalOutput, outputPath(args));
|
|
37403
|
-
if (KEEP_WASM_NAMES)
|
|
37404
|
-
import_node_fs61.default.writeFileSync(
|
|
37405
|
-
outputPath(args),
|
|
37406
|
-
nameGuestImageAliases(import_node_fs61.default.readFileSync(outputPath(args)), plan.symbols)
|
|
37407
|
-
);
|
|
37657
|
+
} else finalizeFinalLink(linkFinal());
|
|
37408
37658
|
if (projectionStorage && projectionObject)
|
|
37409
37659
|
options2.projection.onReserved(projectionStorage, projectionObject);
|
|
37410
37660
|
options2.onLinkedOwners?.(linkedOwners);
|
|
@@ -37440,11 +37690,13 @@ ${changed2.join("\n")}`
|
|
|
37440
37690
|
appDefinedSymbols
|
|
37441
37691
|
});
|
|
37442
37692
|
}
|
|
37693
|
+
if (deferredFinalLink) options2.onFinalLink?.(deferredFinalLink);
|
|
37443
37694
|
return selected;
|
|
37444
37695
|
} catch (error) {
|
|
37445
37696
|
await Promise.allSettled([
|
|
37446
37697
|
ledgerObjectPromise,
|
|
37447
|
-
...appLedgerObjectPromise ? [appLedgerObjectPromise] : []
|
|
37698
|
+
...appLedgerObjectPromise ? [appLedgerObjectPromise] : [],
|
|
37699
|
+
...deferredFinalLink ? [deferredFinalLink] : []
|
|
37448
37700
|
]);
|
|
37449
37701
|
throw error;
|
|
37450
37702
|
}
|
|
@@ -38076,6 +38328,7 @@ async function linkPrunedGuestImages(options2) {
|
|
|
38076
38328
|
identities: aliasGuestLinkIdentities(identities, prepared.archives)
|
|
38077
38329
|
};
|
|
38078
38330
|
}
|
|
38331
|
+
let finalLinkDone;
|
|
38079
38332
|
const selected = await linkCompleteGuestImages({
|
|
38080
38333
|
plan,
|
|
38081
38334
|
args: [...linkedArgs, `--Map=${options2.mapPath}`],
|
|
@@ -38089,6 +38342,9 @@ async function linkPrunedGuestImages(options2) {
|
|
|
38089
38342
|
resolvePlan: options2.resolvePlan,
|
|
38090
38343
|
sharedSdk: options2.sharedSdk,
|
|
38091
38344
|
onSplitInputs: options2.onSplitInputs,
|
|
38345
|
+
onFinalLink: options2.deferFinalLink ? (done) => {
|
|
38346
|
+
finalLinkDone = done;
|
|
38347
|
+
} : void 0,
|
|
38092
38348
|
onDyldRows: options2.onDyldRows,
|
|
38093
38349
|
onLinkedOwners: (value) => {
|
|
38094
38350
|
owners = value;
|
|
@@ -38102,7 +38358,8 @@ async function linkPrunedGuestImages(options2) {
|
|
|
38102
38358
|
owners,
|
|
38103
38359
|
generatedSectionOwners,
|
|
38104
38360
|
sdk: sdk2,
|
|
38105
|
-
mapPath: options2.mapPath
|
|
38361
|
+
mapPath: options2.mapPath,
|
|
38362
|
+
finalLinkDone
|
|
38106
38363
|
};
|
|
38107
38364
|
}
|
|
38108
38365
|
var import_node_child_process28, import_node_fs61, import_node_path61, import_node_util6, execFileAsync, WASM_MAGIC, BITCODE_MAGIC;
|
|
@@ -38171,8 +38428,13 @@ function clangBinaryStamp(file) {
|
|
|
38171
38428
|
const stat2 = (0, import_node_fs62.statSync)(file, { bigint: true });
|
|
38172
38429
|
return [file, stat2.size, stat2.mtimeNs].join(":");
|
|
38173
38430
|
}
|
|
38431
|
+
function sha256Hex3(bytes) {
|
|
38432
|
+
if (typeof Bun !== "undefined")
|
|
38433
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
38434
|
+
return (0, import_node_crypto36.createHash)("sha256").update(bytes).digest("hex");
|
|
38435
|
+
}
|
|
38174
38436
|
function clangWrapperStamp(file) {
|
|
38175
|
-
return (
|
|
38437
|
+
return sha256Hex3((0, import_node_fs62.readFileSync)(file));
|
|
38176
38438
|
}
|
|
38177
38439
|
function clangArgsNeedCwd(args) {
|
|
38178
38440
|
const pathFlags = /* @__PURE__ */ new Set([
|
|
@@ -38322,22 +38584,35 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
38322
38584
|
"SOURCE_DATE_EPOCH"
|
|
38323
38585
|
].map((name3) => process.env[name3] ?? "");
|
|
38324
38586
|
const replays = [];
|
|
38587
|
+
const realPathCache = /* @__PURE__ */ new Map();
|
|
38588
|
+
const cachedRealpath = (file) => {
|
|
38589
|
+
let resolved = realPathCache.get(file);
|
|
38590
|
+
if (resolved === void 0) {
|
|
38591
|
+
resolved = (0, import_node_fs62.realpathSync)(file);
|
|
38592
|
+
realPathCache.set(file, resolved);
|
|
38593
|
+
}
|
|
38594
|
+
return resolved;
|
|
38595
|
+
};
|
|
38596
|
+
const resolvedSwiftCompiler = cachedRealpath(options2.swiftCompiler);
|
|
38325
38597
|
let clang;
|
|
38598
|
+
let clangWrapper;
|
|
38326
38599
|
let clangStamp;
|
|
38327
38600
|
let wrapperStamp;
|
|
38328
38601
|
for (const file of wanted) {
|
|
38329
38602
|
const command = commands.get(file);
|
|
38330
38603
|
if (!command) throw new Error(`missing source object producer ${file}`);
|
|
38331
38604
|
if (command.tool === "shell") {
|
|
38332
|
-
if (!command.args.length || (
|
|
38605
|
+
if (!command.args.length || cachedRealpath(command.args[0]) !== resolvedSwiftCompiler)
|
|
38333
38606
|
throw new Error(`unsupported source object producer ${file}`);
|
|
38334
38607
|
continue;
|
|
38335
38608
|
}
|
|
38336
|
-
const compiler = command.args[0] ? (
|
|
38337
|
-
clang ??= (
|
|
38338
|
-
if (command.tool !== "clang" || compiler !== clang && compiler !== (
|
|
38609
|
+
const compiler = command.args[0] ? cachedRealpath(command.args[0]) : "";
|
|
38610
|
+
clang ??= cachedRealpath(import_node_path62.default.join(options2.toolchainBin, "clang"));
|
|
38611
|
+
if (command.tool !== "clang" || compiler !== clang && compiler !== (clangWrapper ??= cachedRealpath(
|
|
38612
|
+
import_node_path62.default.join(options2.buildDirectory, CLANG_TARGET_MODULE_WRAPPER)
|
|
38613
|
+
)))
|
|
38339
38614
|
throw new Error(`unsupported source object producer ${file}`);
|
|
38340
|
-
const key2 = (
|
|
38615
|
+
const key2 = sha256Hex3(
|
|
38341
38616
|
JSON.stringify([
|
|
38342
38617
|
"clang-link-options/v2",
|
|
38343
38618
|
clangArgsNeedCwd(command.args) ? process.cwd() : null,
|
|
@@ -38347,11 +38622,8 @@ function sourceGuestClangLinkOptions(options2) {
|
|
|
38347
38622
|
compiler === clang ? null : wrapperStamp ??= clangWrapperStamp(compiler),
|
|
38348
38623
|
clangProducerStamp(file)
|
|
38349
38624
|
])
|
|
38350
|
-
).digest("hex");
|
|
38351
|
-
const cacheFile = import_node_path62.default.join(
|
|
38352
|
-
cacheDirectory,
|
|
38353
|
-
(0, import_node_crypto36.createHash)("sha256").update(file).digest("hex") + ".json"
|
|
38354
38625
|
);
|
|
38626
|
+
const cacheFile = import_node_path62.default.join(cacheDirectory, sha256Hex3(file) + ".json");
|
|
38355
38627
|
const cached4 = readClangLinkOptions(cacheFile, key2);
|
|
38356
38628
|
if (cached4) {
|
|
38357
38629
|
validateClangLinkOptions(cached4);
|
|
@@ -40574,7 +40846,7 @@ function headerClosure(roots) {
|
|
|
40574
40846
|
).filter((file) => !file.endsWith(`/${j.exclude}`));
|
|
40575
40847
|
const nitroFiles = roots.nitroModules ? headerFiles2(roots.nitroModules, n.from, n.skip, new RegExp(n.keep)) : [];
|
|
40576
40848
|
const hashes = (base2, files2) => Object.fromEntries(
|
|
40577
|
-
files2.map((file) => [file,
|
|
40849
|
+
files2.map((file) => [file, sha256Hex4((0, import_node_fs66.readFileSync)(import_node_path66.default.join(base2, file)))])
|
|
40578
40850
|
);
|
|
40579
40851
|
return {
|
|
40580
40852
|
jsi: hashes(roots.reactNative, jsiFiles),
|
|
@@ -40738,11 +41010,11 @@ function verifyInstalledAdapter(family, directory2, pin2) {
|
|
|
40738
41010
|
if (JSON.stringify(recorded) !== JSON.stringify(pinned))
|
|
40739
41011
|
throw new Error(`${label} manifest does not match the lock this build carries`);
|
|
40740
41012
|
const bytes = (0, import_node_fs66.readFileSync)(import_node_path66.default.join(directory2, archive.path));
|
|
40741
|
-
if (bytes.length !== archive.size ||
|
|
41013
|
+
if (bytes.length !== archive.size || sha256Hex4(bytes) !== archive.sha256)
|
|
40742
41014
|
throw new Error(`${label} library does not match its manifest`);
|
|
40743
41015
|
return manifest;
|
|
40744
41016
|
}
|
|
40745
|
-
var import_node_crypto38, import_node_fs66, import_node_path66, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE,
|
|
41017
|
+
var import_node_crypto38, import_node_fs66, import_node_path66, ADAPTER_MANIFEST, ADAPTER_FAMILIES, TURBO_RUNTIME_HEADER, HEADER_STAGE, sha256Hex4, hex64, sameHeaders;
|
|
40746
41018
|
var init_nitroAdapterContract = __esm({
|
|
40747
41019
|
"src/nitroAdapterContract.ts"() {
|
|
40748
41020
|
"use strict";
|
|
@@ -40792,7 +41064,7 @@ void scheduleDrain();
|
|
|
40792
41064
|
to: ["core", "core/NitroModules"]
|
|
40793
41065
|
}
|
|
40794
41066
|
};
|
|
40795
|
-
|
|
41067
|
+
sha256Hex4 = (data) => (0, import_node_crypto38.createHash)("sha256").update(data).digest("hex");
|
|
40796
41068
|
hex64 = (value) => typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
40797
41069
|
sameHeaders = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
40798
41070
|
}
|
|
@@ -43647,6 +43919,21 @@ var init_swift_root_lock = __esm({
|
|
|
43647
43919
|
}
|
|
43648
43920
|
});
|
|
43649
43921
|
|
|
43922
|
+
// src/swift-sdk-image-recipe.ts
|
|
43923
|
+
var import_node_crypto42, SWIFT_SDK_IMAGE_VERSION, swiftSdkImageScope, SWIFT_SDK_IMAGE_RECIPE;
|
|
43924
|
+
var init_swift_sdk_image_recipe = __esm({
|
|
43925
|
+
"src/swift-sdk-image-recipe.ts"() {
|
|
43926
|
+
"use strict";
|
|
43927
|
+
import_node_crypto42 = require("node:crypto");
|
|
43928
|
+
init_wasm_optimize();
|
|
43929
|
+
SWIFT_SDK_IMAGE_VERSION = 13;
|
|
43930
|
+
swiftSdkImageScope = (scopedLookups) => scopedLookups ? "guest image scopes 9\n" : "unscoped constructor order 1\n";
|
|
43931
|
+
SWIFT_SDK_IMAGE_RECIPE = (0, import_node_crypto42.createHash)("sha256").update(`swift-sdk-image
|
|
43932
|
+
${SWIFT_SDK_IMAGE_VERSION}
|
|
43933
|
+
`).update(WASM_LOWER_IDENTITY).update(swiftSdkImageScope(false)).update(swiftSdkImageScope(true)).digest("hex").slice(0, 16);
|
|
43934
|
+
}
|
|
43935
|
+
});
|
|
43936
|
+
|
|
43650
43937
|
// src/swift-sdk-image-producer.ts
|
|
43651
43938
|
var swift_sdk_image_producer_exports = {};
|
|
43652
43939
|
__export(swift_sdk_image_producer_exports, {
|
|
@@ -43687,7 +43974,7 @@ function applySwiftSdkProducerEnvironment(environment) {
|
|
|
43687
43974
|
}
|
|
43688
43975
|
}
|
|
43689
43976
|
function writeSwiftSdkProducerResult(file, launchId, error) {
|
|
43690
|
-
const temporary = `${file}.${(0,
|
|
43977
|
+
const temporary = `${file}.${(0, import_node_crypto43.randomUUID)()}`;
|
|
43691
43978
|
(0, import_node_fs71.writeFileSync)(temporary, JSON.stringify({ launchId, error: error ?? null }));
|
|
43692
43979
|
(0, import_node_fs71.renameSync)(temporary, file);
|
|
43693
43980
|
}
|
|
@@ -43799,7 +44086,7 @@ async function produceSwiftSdkImage(input) {
|
|
|
43799
44086
|
}
|
|
43800
44087
|
}
|
|
43801
44088
|
const repo = import_node_path71.default.resolve(input.moduleRoot, "../..");
|
|
43802
|
-
const launchId = (0,
|
|
44089
|
+
const launchId = (0, import_node_crypto43.randomUUID)();
|
|
43803
44090
|
const directory3 = import_node_path71.default.join(root, launchId);
|
|
43804
44091
|
const requestFile = import_node_path71.default.join(directory3, "request.json");
|
|
43805
44092
|
const sessionFile2 = import_node_path71.default.join(directory3, "session");
|
|
@@ -43897,12 +44184,12 @@ async function produceSwiftSdkImage(input) {
|
|
|
43897
44184
|
await (0, import_promises10.setTimeout)(2e3, void 0, { signal: input.signal });
|
|
43898
44185
|
}
|
|
43899
44186
|
}
|
|
43900
|
-
var import_node_child_process36,
|
|
44187
|
+
var import_node_child_process36, import_node_crypto43, import_node_fs71, import_node_path71, import_promises10, import_node_util9, run3, environmentNames, launcher;
|
|
43901
44188
|
var init_swift_sdk_image_producer = __esm({
|
|
43902
44189
|
"src/swift-sdk-image-producer.ts"() {
|
|
43903
44190
|
"use strict";
|
|
43904
44191
|
import_node_child_process36 = require("node:child_process");
|
|
43905
|
-
|
|
44192
|
+
import_node_crypto43 = require("node:crypto");
|
|
43906
44193
|
import_node_fs71 = require("node:fs");
|
|
43907
44194
|
import_node_path71 = __toESM(require("node:path"), 1);
|
|
43908
44195
|
import_promises10 = require("node:timers/promises");
|
|
@@ -43942,7 +44229,6 @@ __export(swift_sdk_image_exports, {
|
|
|
43942
44229
|
SWIFT_SDK_APP_TABLE_BASE: () => SWIFT_SDK_APP_TABLE_BASE,
|
|
43943
44230
|
SWIFT_SDK_IMAGE_BUNDLE: () => SWIFT_SDK_IMAGE_BUNDLE,
|
|
43944
44231
|
SWIFT_SDK_IMAGE_FILES: () => SWIFT_SDK_IMAGE_FILES,
|
|
43945
|
-
SWIFT_SDK_IMAGE_VERSION: () => SWIFT_SDK_IMAGE_VERSION,
|
|
43946
44232
|
SWIFT_SDK_MEMORY_BASE: () => SWIFT_SDK_MEMORY_BASE,
|
|
43947
44233
|
SWIFT_SDK_PIECE_FIELDS: () => SWIFT_SDK_PIECE_FIELDS,
|
|
43948
44234
|
buildSwiftSdkImage: () => buildSwiftSdkImage,
|
|
@@ -43977,9 +44263,9 @@ function swiftSdkImageProducts(moduleRoot, frameworkImports2) {
|
|
|
43977
44263
|
function swiftSdkImageKey(moduleRoot, scopedLookups = false, products = []) {
|
|
43978
44264
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
43979
44265
|
const inputs2 = distribution ? swiftSdkDistributionInputs(distribution) : swiftModuleDigest(moduleRoot);
|
|
43980
|
-
return (0,
|
|
44266
|
+
return (0, import_node_crypto44.createHash)("sha256").update(`swift-sdk-image
|
|
43981
44267
|
${SWIFT_SDK_IMAGE_VERSION}
|
|
43982
|
-
`).update(WASM_LOWER_IDENTITY).update(KEEP_WASM_NAMES ? "\nnames\n" : "\n").update(scopedLookups
|
|
44268
|
+
`).update(WASM_LOWER_IDENTITY).update(KEEP_WASM_NAMES ? "\nnames\n" : "\n").update(swiftSdkImageScope(scopedLookups)).update(inputs2).update(products.length === 0 ? "" : `
|
|
43983
44269
|
products ${products.join(" ")}`).digest("hex").slice(0, 32);
|
|
43984
44270
|
}
|
|
43985
44271
|
function swiftSdkImageEntry(key2, scopedLookups) {
|
|
@@ -44068,7 +44354,7 @@ async function buildSwiftSdkImage(moduleRoot, scopedLookups = false, frameworkIm
|
|
|
44068
44354
|
stage
|
|
44069
44355
|
]);
|
|
44070
44356
|
const image = cached3(stage, key2);
|
|
44071
|
-
if (!image || (0,
|
|
44357
|
+
if (!image || (0, import_node_crypto44.createHash)("sha256").update((0, import_node_fs72.readFileSync)(image.image)).digest("hex") !== image.sha256)
|
|
44072
44358
|
throw new Error(`invalid published Swift SDK image ${key2}`);
|
|
44073
44359
|
(0, import_node_fs72.rmSync)(directory2, { recursive: true, force: true });
|
|
44074
44360
|
(0, import_node_fs72.renameSync)(stage, directory2);
|
|
@@ -44277,6 +44563,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
44277
44563
|
].map((name3) => `--export=${name3}`),
|
|
44278
44564
|
`@${import_node_path72.default.join(work, "exports.rsp")}`,
|
|
44279
44565
|
"--gc-sections",
|
|
44566
|
+
"--strip-debug",
|
|
44280
44567
|
// strings stay with their objects, so an app loads only the ones its pieces reference
|
|
44281
44568
|
"-O0"
|
|
44282
44569
|
];
|
|
@@ -44337,7 +44624,7 @@ async function linkSwiftSdkImage(moduleRoot, key2, directory2, work, scopedLooku
|
|
|
44337
44624
|
(0, import_node_fs72.writeFileSync)(import_node_path72.default.join(work, INTERFACE_FILE), JSON.stringify(sdkInterface));
|
|
44338
44625
|
(0, import_node_fs72.writeFileSync)(
|
|
44339
44626
|
import_node_path72.default.join(work, IMAGE_DIGEST),
|
|
44340
|
-
(0,
|
|
44627
|
+
typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(image).digest("hex") : (0, import_node_crypto44.createHash)("sha256").update(image).digest("hex")
|
|
44341
44628
|
);
|
|
44342
44629
|
if (swiftSdkImageKey(
|
|
44343
44630
|
moduleRoot,
|
|
@@ -44606,12 +44893,12 @@ function readSwiftSdkManifest(image) {
|
|
|
44606
44893
|
}));
|
|
44607
44894
|
return setBoundedCache(cachedSdkManifests, cacheKey, { manifest, block: block2, segments });
|
|
44608
44895
|
}
|
|
44609
|
-
var import_node_child_process37,
|
|
44896
|
+
var import_node_child_process37, import_node_crypto44, import_node_fs72, import_node_path72, import_node_util10, run4, 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;
|
|
44610
44897
|
var init_swift_sdk_image = __esm({
|
|
44611
44898
|
"src/swift-sdk-image.ts"() {
|
|
44612
44899
|
"use strict";
|
|
44613
44900
|
import_node_child_process37 = require("node:child_process");
|
|
44614
|
-
|
|
44901
|
+
import_node_crypto44 = require("node:crypto");
|
|
44615
44902
|
import_node_fs72 = require("node:fs");
|
|
44616
44903
|
import_node_path72 = __toESM(require("node:path"), 1);
|
|
44617
44904
|
import_node_util10 = require("node:util");
|
|
@@ -44623,13 +44910,13 @@ var init_swift_sdk_image = __esm({
|
|
|
44623
44910
|
init_swift_root_lock();
|
|
44624
44911
|
init_swift_sdk_guest_lookups();
|
|
44625
44912
|
init_swift_sdk_image_map();
|
|
44913
|
+
init_swift_sdk_image_recipe();
|
|
44626
44914
|
init_swift_sdk_image_wasm();
|
|
44627
44915
|
init_swift_toolchain();
|
|
44628
44916
|
init_swift_wasm_prune();
|
|
44629
44917
|
init_swiftTargetContract();
|
|
44630
44918
|
init_wasm_optimize();
|
|
44631
44919
|
run4 = (0, import_node_util10.promisify)(import_node_child_process37.execFile);
|
|
44632
|
-
SWIFT_SDK_IMAGE_VERSION = 13;
|
|
44633
44920
|
SWIFT_SDK_APP_MEMORY_BASE = 8372224;
|
|
44634
44921
|
SWIFT_SDK_MEMORY_BASE = 128 * 1024 * 1024;
|
|
44635
44922
|
SWIFT_SDK_APP_TABLE_BASE = 524288;
|
|
@@ -44895,6 +45182,7 @@ __export(swift_sdk_app_module_exports, {
|
|
|
44895
45182
|
readSwiftSdkUsage: () => readSwiftSdkUsage,
|
|
44896
45183
|
selectSwiftSdkData: () => selectSwiftSdkData,
|
|
44897
45184
|
swiftAppModuleInputs: () => swiftAppModuleInputs,
|
|
45185
|
+
swiftAppModuleThunkSection: () => swiftAppModuleThunkSection,
|
|
44898
45186
|
swiftSdkProjectionSpans: () => swiftSdkProjectionSpans,
|
|
44899
45187
|
writeSwiftSdkAppLink: () => writeSwiftSdkAppLink
|
|
44900
45188
|
});
|
|
@@ -44946,9 +45234,12 @@ async function buildSwiftAppModule(options2) {
|
|
|
44946
45234
|
linkage: link.linkage,
|
|
44947
45235
|
usage
|
|
44948
45236
|
});
|
|
44949
|
-
(
|
|
45237
|
+
finishSwiftAppModuleFile(options2.output);
|
|
44950
45238
|
return binding;
|
|
44951
45239
|
}
|
|
45240
|
+
function swiftAppModuleThunkSection(lowered) {
|
|
45241
|
+
return [NATIVE_SDK_THUNK_SECTION, sdkImportThunks(lowered)];
|
|
45242
|
+
}
|
|
44952
45243
|
function finishSwiftAppModule(lowered) {
|
|
44953
45244
|
return writeWasmCustomSection(
|
|
44954
45245
|
lowered,
|
|
@@ -44956,6 +45247,73 @@ function finishSwiftAppModule(lowered) {
|
|
|
44956
45247
|
sdkImportThunks(lowered)
|
|
44957
45248
|
);
|
|
44958
45249
|
}
|
|
45250
|
+
function finishSwiftAppModuleFile(file) {
|
|
45251
|
+
const fd = (0, import_node_fs73.openSync)(file, "r");
|
|
45252
|
+
let prefixEnd = 8;
|
|
45253
|
+
let hasExistingThunk = false;
|
|
45254
|
+
let prefix;
|
|
45255
|
+
try {
|
|
45256
|
+
const total = (0, import_node_fs73.fstatSync)(fd).size;
|
|
45257
|
+
const probe = Buffer.allocUnsafe(16);
|
|
45258
|
+
let offset = 8;
|
|
45259
|
+
while (offset < total) {
|
|
45260
|
+
const read = (0, import_node_fs73.readSync)(fd, probe, 0, Math.min(16, total - offset), offset);
|
|
45261
|
+
if (read < 2) break;
|
|
45262
|
+
const id = probe[0];
|
|
45263
|
+
let size2 = 0;
|
|
45264
|
+
let shift = 0;
|
|
45265
|
+
let at = 1;
|
|
45266
|
+
for (; ; ) {
|
|
45267
|
+
const byte = probe[at++];
|
|
45268
|
+
size2 += (byte & 127) * 2 ** shift;
|
|
45269
|
+
if (!(byte & 128)) break;
|
|
45270
|
+
shift += 7;
|
|
45271
|
+
}
|
|
45272
|
+
const start = offset + at;
|
|
45273
|
+
const next = start + size2;
|
|
45274
|
+
if (id === 1 || id === 2) prefixEnd = next;
|
|
45275
|
+
else if (id === 0) {
|
|
45276
|
+
const nameBuf = Buffer.allocUnsafe(Math.min(128, size2));
|
|
45277
|
+
const nRead = (0, import_node_fs73.readSync)(fd, nameBuf, 0, nameBuf.length, start);
|
|
45278
|
+
let nLen = 0;
|
|
45279
|
+
let nShift = 0;
|
|
45280
|
+
let nAt = 0;
|
|
45281
|
+
for (; ; ) {
|
|
45282
|
+
if (nAt >= nRead) break;
|
|
45283
|
+
const byte = nameBuf[nAt++];
|
|
45284
|
+
nLen += (byte & 127) * 2 ** nShift;
|
|
45285
|
+
if (!(byte & 128)) break;
|
|
45286
|
+
nShift += 7;
|
|
45287
|
+
}
|
|
45288
|
+
if (nAt + nLen <= nRead && nameBuf.toString("utf8", nAt, nAt + nLen) === NATIVE_SDK_THUNK_SECTION) {
|
|
45289
|
+
hasExistingThunk = true;
|
|
45290
|
+
break;
|
|
45291
|
+
}
|
|
45292
|
+
}
|
|
45293
|
+
offset = next;
|
|
45294
|
+
}
|
|
45295
|
+
if (!hasExistingThunk) {
|
|
45296
|
+
prefix = Buffer.allocUnsafe(prefixEnd);
|
|
45297
|
+
let filled = 0;
|
|
45298
|
+
while (filled < prefixEnd) {
|
|
45299
|
+
const n = (0, import_node_fs73.readSync)(fd, prefix, filled, prefixEnd - filled, filled);
|
|
45300
|
+
if (n <= 0) break;
|
|
45301
|
+
filled += n;
|
|
45302
|
+
}
|
|
45303
|
+
prefix = prefix.subarray(0, filled);
|
|
45304
|
+
}
|
|
45305
|
+
} finally {
|
|
45306
|
+
(0, import_node_fs73.closeSync)(fd);
|
|
45307
|
+
}
|
|
45308
|
+
if (hasExistingThunk || !prefix) {
|
|
45309
|
+
(0, import_node_fs73.writeFileSync)(file, finishSwiftAppModule((0, import_node_fs73.readFileSync)(file)));
|
|
45310
|
+
return;
|
|
45311
|
+
}
|
|
45312
|
+
const thunks = sdkImportThunks(prefix);
|
|
45313
|
+
const nameBytes = Buffer.from(encodedName2(NATIVE_SDK_THUNK_SECTION));
|
|
45314
|
+
const header = Buffer.from([0, ...uleb4(nameBytes.length + thunks.length)]);
|
|
45315
|
+
(0, import_node_fs73.appendFileSync)(file, Buffer.concat([header, nameBytes, thunks]));
|
|
45316
|
+
}
|
|
44959
45317
|
function swiftAppModuleInputs(tokens2, buildRoot, sdkLibraries) {
|
|
44960
45318
|
const owned = (token) => import_node_path73.default.resolve(token).startsWith(`${buildRoot}/`) && (!token.includes("/.peach-pruned-objs/") || token.endsWith("/swiftrt-patched.o"));
|
|
44961
45319
|
const inputs2 = [];
|
|
@@ -45170,6 +45528,7 @@ async function linkSwiftAppModule(options2) {
|
|
|
45170
45528
|
"--unresolved-symbols=ignore-all",
|
|
45171
45529
|
"--import-undefined",
|
|
45172
45530
|
"--emit-relocs",
|
|
45531
|
+
"--strip-debug",
|
|
45173
45532
|
"--gc-sections",
|
|
45174
45533
|
"--keep-section=target_features",
|
|
45175
45534
|
"--error-limit=0",
|
|
@@ -45192,7 +45551,16 @@ async function linkSwiftAppModule(options2) {
|
|
|
45192
45551
|
const skipPasses = options2.layoutMap ? ["duplicate-function-elimination"] : void 0;
|
|
45193
45552
|
const sdkTableEnd = sdk2.sdkInterface.layout.tableEnd;
|
|
45194
45553
|
const { loweringCache } = options2;
|
|
45195
|
-
const loweringKey = loweringCache && (
|
|
45554
|
+
const loweringKey = loweringCache && (typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(
|
|
45555
|
+
JSON.stringify([
|
|
45556
|
+
loweringCache.compilerDigest,
|
|
45557
|
+
optimize,
|
|
45558
|
+
skipPasses,
|
|
45559
|
+
sdkTableEnd,
|
|
45560
|
+
lazy,
|
|
45561
|
+
KEEP_WASM_NAMES
|
|
45562
|
+
])
|
|
45563
|
+
).update(bytes).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(
|
|
45196
45564
|
JSON.stringify([
|
|
45197
45565
|
loweringCache.compilerDigest,
|
|
45198
45566
|
optimize,
|
|
@@ -45201,7 +45569,7 @@ async function linkSwiftAppModule(options2) {
|
|
|
45201
45569
|
lazy,
|
|
45202
45570
|
KEEP_WASM_NAMES
|
|
45203
45571
|
])
|
|
45204
|
-
).update(bytes).digest("hex");
|
|
45572
|
+
).update(bytes).digest("hex"));
|
|
45205
45573
|
return {
|
|
45206
45574
|
linkage,
|
|
45207
45575
|
async lower() {
|
|
@@ -45811,7 +46179,8 @@ function createSwiftSdkBinding(linkage, sdk2, usage, projection) {
|
|
|
45811
46179
|
bindSwiftAppModule(linkage, sdk2),
|
|
45812
46180
|
selectSwiftSdkData(sdk2, usage, linkage, projection)
|
|
45813
46181
|
]);
|
|
45814
|
-
|
|
46182
|
+
const sha2565 = typeof Bun !== "undefined" ? new Bun.CryptoHasher("sha256").update(bytes).digest("hex") : (0, import_node_crypto45.createHash)("sha256").update(bytes).digest("hex");
|
|
46183
|
+
return { bytes, sha256: sha2565 };
|
|
45815
46184
|
}
|
|
45816
46185
|
function readSwiftSdkUsage(mapFile, linkedFile, sdkObjects) {
|
|
45817
46186
|
const map2 = readWasmLinkMap(mapFile, false);
|
|
@@ -46357,12 +46726,12 @@ function partitionParent(section2) {
|
|
|
46357
46726
|
"__objc_class_refs"
|
|
46358
46727
|
].find((name3) => section2 === name3 || section2.startsWith(`${name3}.`));
|
|
46359
46728
|
}
|
|
46360
|
-
var import_node_child_process38,
|
|
46729
|
+
var import_node_child_process38, import_node_crypto45, import_node_fs73, import_node_path73, import_node_util11, import_node_zlib5, run5, RELOCATION_WIDTHS, GLOBAL_INDEX, TLS_SLEB64, SDK_TLS_HELPER, SDK_TLS_DELTA, OBJC_SECTION_BOUNDARY, uleb4, sleb2, encodedName2, SCANNED, RUN_GAP;
|
|
46361
46730
|
var init_swift_sdk_app_module = __esm({
|
|
46362
46731
|
"src/swift-sdk-app-module.ts"() {
|
|
46363
46732
|
"use strict";
|
|
46364
46733
|
import_node_child_process38 = require("node:child_process");
|
|
46365
|
-
|
|
46734
|
+
import_node_crypto45 = require("node:crypto");
|
|
46366
46735
|
import_node_fs73 = require("node:fs");
|
|
46367
46736
|
import_node_path73 = __toESM(require("node:path"), 1);
|
|
46368
46737
|
import_node_util11 = require("node:util");
|
|
@@ -46567,6 +46936,7 @@ async function compileGuestLink(options2) {
|
|
|
46567
46936
|
onSplitInputs: sdk2 ? (value) => {
|
|
46568
46937
|
splitInputs = value;
|
|
46569
46938
|
} : void 0,
|
|
46939
|
+
deferFinalLink: Boolean(sdk2),
|
|
46570
46940
|
onDyldRows: (rows) => {
|
|
46571
46941
|
lazyFunctions = rows.lazyFunctions;
|
|
46572
46942
|
dyldSymbols = rows.dyldSymbols;
|
|
@@ -46835,156 +47205,164 @@ async function compileGuestLink(options2) {
|
|
|
46835
47205
|
});
|
|
46836
47206
|
if (!reserved2 || !projectionObject) throw new Error("guest projection was not reserved");
|
|
46837
47207
|
if (sdk2) {
|
|
46838
|
-
|
|
46839
|
-
|
|
46840
|
-
|
|
46841
|
-
|
|
46842
|
-
|
|
46843
|
-
|
|
46844
|
-
|
|
46845
|
-
|
|
46846
|
-
|
|
46847
|
-
|
|
46848
|
-
|
|
46849
|
-
|
|
46850
|
-
|
|
46851
|
-
|
|
46852
|
-
|
|
46853
|
-
|
|
46854
|
-
|
|
46855
|
-
|
|
46856
|
-
const
|
|
46857
|
-
|
|
46858
|
-
|
|
46859
|
-
|
|
46860
|
-
|
|
46861
|
-
|
|
46862
|
-
|
|
46863
|
-
|
|
46864
|
-
|
|
46865
|
-
|
|
46866
|
-
|
|
46867
|
-
|
|
46868
|
-
|
|
46869
|
-
|
|
46870
|
-
let storage = reserved2;
|
|
46871
|
-
if (sdkSpans.length > 0) {
|
|
46872
|
-
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
46873
|
-
storage = reserveGuestProjectionStorage(
|
|
46874
|
-
storage.images,
|
|
46875
|
-
storage.capacities.map((capacity, index) => ({
|
|
46876
|
-
...capacity,
|
|
46877
|
-
regions: capacity.regions + sdkCounts[index] + 16
|
|
46878
|
-
}))
|
|
46879
|
-
);
|
|
46880
|
-
const projectionSource = import_node_path74.default.join(work, "projection.c");
|
|
46881
|
-
(0, import_node_fs74.writeFileSync)(projectionSource, storage.source);
|
|
46882
|
-
(0, import_node_child_process39.execFileSync)(
|
|
46883
|
-
import_node_path74.default.join(options2.toolchainBin, "clang"),
|
|
46884
|
-
[...clangOptions, "-c", projectionSource, "-o", projectionObject],
|
|
46885
|
-
{ stdio: "pipe" }
|
|
46886
|
-
);
|
|
46887
|
-
}
|
|
46888
|
-
let precomputedSymbols;
|
|
46889
|
-
if (splitInputs.appReferencedSymbols && splitInputs.appDefinedSymbols) {
|
|
46890
|
-
const referenced = new Set(splitInputs.appReferencedSymbols);
|
|
46891
|
-
const defined = new Set(splitInputs.appDefinedSymbols);
|
|
46892
|
-
const projSyms = guestWasmSymbols((0, import_node_fs74.readFileSync)(projectionObject));
|
|
46893
|
-
for (const name3 of projSyms.undefined) referenced.add(name3);
|
|
46894
|
-
for (const name3 of projSyms.defined) defined.add(name3);
|
|
46895
|
-
precomputedSymbols = { referenced, defined };
|
|
46896
|
-
}
|
|
46897
|
-
for (; ; ) {
|
|
46898
|
-
const link = await linkSwiftAppModule2({
|
|
46899
|
-
objects: [...owners.keys()],
|
|
46900
|
-
lazyFunctions: splitInputs.lazyFunctions,
|
|
46901
|
-
toolchainBin: options2.toolchainBin,
|
|
46902
|
-
sdk: sdk2,
|
|
46903
|
-
work,
|
|
46904
|
-
output: options2.optimized,
|
|
46905
|
-
optimize: options2.optimize,
|
|
46906
|
-
layoutMap,
|
|
46907
|
-
project: project2,
|
|
46908
|
-
precomputedSymbols,
|
|
46909
|
-
loweringCache: project2 ? void 0 : {
|
|
46910
|
-
file: import_node_path74.default.join(
|
|
46911
|
-
options2.buildDirectory,
|
|
46912
|
-
".build",
|
|
46913
|
-
"peach-app-module-lowered.wasm"
|
|
46914
|
-
),
|
|
46915
|
-
compilerDigest: options2.compilerDigest
|
|
46916
|
-
}
|
|
46917
|
-
});
|
|
46918
|
-
const map3 = (0, import_node_fs74.readFileSync)(
|
|
46919
|
-
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
46920
|
-
"utf8"
|
|
47208
|
+
try {
|
|
47209
|
+
if (!splitInputs) throw new Error("guest link did not select shared SDK inputs");
|
|
47210
|
+
const {
|
|
47211
|
+
createSwiftSdkBinding: createSwiftSdkBinding2,
|
|
47212
|
+
linkSwiftAppModule: linkSwiftAppModule2,
|
|
47213
|
+
readSwiftSdkUsage: readSwiftSdkUsage2,
|
|
47214
|
+
swiftAppModuleThunkSection: swiftAppModuleThunkSection2,
|
|
47215
|
+
swiftSdkProjectionSpans: swiftSdkProjectionSpans2
|
|
47216
|
+
} = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
47217
|
+
const project2 = options2.project;
|
|
47218
|
+
const work = project2 ? (0, import_node_fs74.mkdtempSync)(import_node_path74.default.join(directory2, "app-module-")) : import_node_path74.default.join(directory2, "app-module");
|
|
47219
|
+
if (project2) (0, import_node_fs74.chownSync)(work, project2.uid, project2.gid);
|
|
47220
|
+
else (0, import_node_fs74.mkdirSync)(work, { recursive: true });
|
|
47221
|
+
const layoutMap = import_node_path74.default.join(work, "app.map");
|
|
47222
|
+
let appProjectionObject = projectionObject;
|
|
47223
|
+
const owners = new Map(splitInputs.appObjects).set(appProjectionObject, 0);
|
|
47224
|
+
const sdkObjectKeys = /* @__PURE__ */ new Map();
|
|
47225
|
+
const sdkObjectImages = /* @__PURE__ */ new Map();
|
|
47226
|
+
const sdkProductImages = new Map(prepared?.sdkProducts.images);
|
|
47227
|
+
for (const [file, { image, product, identity: identity2 }] of splitInputs.sdkObjects) {
|
|
47228
|
+
const key2 = sdkGuestObjectKey(identity2);
|
|
47229
|
+
sdkObjectKeys.set(file, key2);
|
|
47230
|
+
sdkObjectImages.set(key2, image);
|
|
47231
|
+
const priorImage = sdkProductImages.get(product);
|
|
47232
|
+
if (priorImage !== void 0 && priorImage !== image)
|
|
47233
|
+
throw new Error(`SDK product ${product} has several guest images`);
|
|
47234
|
+
sdkProductImages.set(product, image);
|
|
47235
|
+
}
|
|
47236
|
+
const linkedModule = import_node_path74.default.join(work, "app.wasm");
|
|
47237
|
+
const sdkSpans = swiftSdkProjectionSpans2(
|
|
47238
|
+
sdk2,
|
|
47239
|
+
(object9, product) => sdkObjectImages.get(object9) ?? sdkProductImages.get(product)
|
|
46921
47240
|
);
|
|
46922
|
-
const
|
|
46923
|
-
const bindingRows = /* @__PURE__ */ new Map();
|
|
46924
|
-
const data = [];
|
|
46925
|
-
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
46926
|
-
const address = link.linkage.data[at];
|
|
46927
|
-
const size2 = link.linkage.data[at + 1];
|
|
46928
|
-
const value = link.linkage.data[at + 2];
|
|
46929
|
-
if (values && address >= values.address && address < values.address + values.length) {
|
|
46930
|
-
if (size2 !== 8 || (address - values.address) % 8)
|
|
46931
|
-
throw new Error("sdk binding splits a dyld value");
|
|
46932
|
-
bindingRows.set((address - values.address) / 8, value);
|
|
46933
|
-
} else data.push(address, size2, value);
|
|
46934
|
-
}
|
|
46935
|
-
const linked = (0, import_node_fs74.readFileSync)(
|
|
46936
|
-
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
46937
|
-
);
|
|
46938
|
-
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
46939
|
-
...guestLinkedSpans(map3, linked, linked, owners, splitInputs.appSections, true),
|
|
46940
|
-
...sdkSpans
|
|
46941
|
-
]);
|
|
46942
|
-
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
46943
|
-
storage = reserveGuestProjectionStorage(
|
|
46944
|
-
storage.images,
|
|
46945
|
-
storage.capacities.map((capacity, index) => {
|
|
46946
|
-
const count = required[index];
|
|
46947
|
-
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
46948
|
-
})
|
|
46949
|
-
);
|
|
47241
|
+
const compileAppProjection = (source) => {
|
|
46950
47242
|
const projectionSource = import_node_path74.default.join(work, "projection.c");
|
|
46951
|
-
|
|
47243
|
+
const nextObject = import_node_path74.default.join(work, "projection.o");
|
|
47244
|
+
(0, import_node_fs74.writeFileSync)(projectionSource, source);
|
|
46952
47245
|
(0, import_node_child_process39.execFileSync)(
|
|
46953
47246
|
import_node_path74.default.join(options2.toolchainBin, "clang"),
|
|
46954
|
-
[...clangOptions, "-c", projectionSource, "-o",
|
|
47247
|
+
[...clangOptions, "-c", projectionSource, "-o", nextObject],
|
|
46955
47248
|
{ stdio: "pipe" }
|
|
46956
47249
|
);
|
|
46957
|
-
|
|
47250
|
+
if (nextObject !== appProjectionObject) {
|
|
47251
|
+
owners.delete(appProjectionObject);
|
|
47252
|
+
appProjectionObject = nextObject;
|
|
47253
|
+
owners.set(appProjectionObject, 0);
|
|
47254
|
+
}
|
|
47255
|
+
};
|
|
47256
|
+
let storage = reserved2;
|
|
47257
|
+
if (sdkSpans.length > 0) {
|
|
47258
|
+
const sdkCounts = guestProjectionRegionCounts(storage.images.length, sdkSpans);
|
|
47259
|
+
storage = reserveGuestProjectionStorage(
|
|
47260
|
+
storage.images,
|
|
47261
|
+
storage.capacities.map((capacity, index) => ({
|
|
47262
|
+
...capacity,
|
|
47263
|
+
regions: capacity.regions + sdkCounts[index] + 16
|
|
47264
|
+
}))
|
|
47265
|
+
);
|
|
47266
|
+
compileAppProjection(storage.source);
|
|
46958
47267
|
}
|
|
46959
|
-
|
|
46960
|
-
|
|
46961
|
-
|
|
46962
|
-
|
|
46963
|
-
|
|
46964
|
-
|
|
46965
|
-
|
|
46966
|
-
|
|
47268
|
+
let precomputedSymbols;
|
|
47269
|
+
if (splitInputs.appReferencedSymbols && splitInputs.appDefinedSymbols) {
|
|
47270
|
+
const referenced = new Set(splitInputs.appReferencedSymbols);
|
|
47271
|
+
const defined = new Set(splitInputs.appDefinedSymbols);
|
|
47272
|
+
const projSyms = guestWasmSymbols((0, import_node_fs74.readFileSync)(appProjectionObject));
|
|
47273
|
+
for (const name3 of projSyms.undefined) referenced.add(name3);
|
|
47274
|
+
for (const name3 of projSyms.defined) defined.add(name3);
|
|
47275
|
+
precomputedSymbols = { referenced, defined };
|
|
47276
|
+
}
|
|
47277
|
+
for (; ; ) {
|
|
47278
|
+
const link = await linkSwiftAppModule2({
|
|
47279
|
+
objects: [...owners.keys()],
|
|
47280
|
+
lazyFunctions: splitInputs.lazyFunctions,
|
|
47281
|
+
toolchainBin: options2.toolchainBin,
|
|
47282
|
+
sdk: sdk2,
|
|
47283
|
+
work,
|
|
47284
|
+
output: options2.optimized,
|
|
47285
|
+
optimize: options2.optimize,
|
|
47286
|
+
layoutMap,
|
|
47287
|
+
project: project2,
|
|
47288
|
+
precomputedSymbols,
|
|
47289
|
+
loweringCache: project2 ? void 0 : {
|
|
47290
|
+
file: import_node_path74.default.join(
|
|
47291
|
+
options2.buildDirectory,
|
|
47292
|
+
".build",
|
|
47293
|
+
"peach-app-module-lowered.wasm"
|
|
47294
|
+
),
|
|
47295
|
+
compilerDigest: options2.compilerDigest
|
|
47296
|
+
}
|
|
46967
47297
|
});
|
|
46968
|
-
|
|
47298
|
+
const map3 = (0, import_node_fs74.readFileSync)(
|
|
47299
|
+
project2 ? projectOutputFile(work, layoutMap, project2) : layoutMap,
|
|
47300
|
+
"utf8"
|
|
47301
|
+
);
|
|
47302
|
+
const values = guestDyldValueRange(map3);
|
|
47303
|
+
const bindingRows = /* @__PURE__ */ new Map();
|
|
47304
|
+
const data = [];
|
|
47305
|
+
for (let at = 0; at < link.linkage.data.length; at += 3) {
|
|
47306
|
+
const address = link.linkage.data[at];
|
|
47307
|
+
const size2 = link.linkage.data[at + 1];
|
|
47308
|
+
const value = link.linkage.data[at + 2];
|
|
47309
|
+
if (values && address >= values.address && address < values.address + values.length) {
|
|
47310
|
+
if (size2 !== 8 || (address - values.address) % 8)
|
|
47311
|
+
throw new Error("sdk binding splits a dyld value");
|
|
47312
|
+
bindingRows.set((address - values.address) / 8, value);
|
|
47313
|
+
} else data.push(address, size2, value);
|
|
47314
|
+
}
|
|
47315
|
+
const linked = (0, import_node_fs74.readFileSync)(
|
|
47316
|
+
project2 ? projectOutputFile(work, linkedModule, project2) : linkedModule
|
|
47317
|
+
);
|
|
47318
|
+
const required = guestProjectionRegionCounts(storage.images.length, [
|
|
47319
|
+
...guestLinkedSpans(map3, linked, linked, owners, splitInputs.appSections, true),
|
|
47320
|
+
...sdkSpans
|
|
47321
|
+
]);
|
|
47322
|
+
if (storage.capacities.some(({ regions }, index) => required[index] > regions)) {
|
|
47323
|
+
storage = reserveGuestProjectionStorage(
|
|
47324
|
+
storage.images,
|
|
47325
|
+
storage.capacities.map((capacity, index) => {
|
|
47326
|
+
const count = required[index];
|
|
47327
|
+
return count > capacity.regions ? { ...capacity, regions: Math.max(count, capacity.regions * 2) } : capacity;
|
|
47328
|
+
})
|
|
47329
|
+
);
|
|
47330
|
+
compileAppProjection(storage.source);
|
|
47331
|
+
continue;
|
|
47332
|
+
}
|
|
47333
|
+
options2.onStage("lowering the app image");
|
|
47334
|
+
const lowerPromise = link.lower();
|
|
47335
|
+
await new Promise((resolve11) => setImmediate(resolve11));
|
|
47336
|
+
let binding;
|
|
47337
|
+
try {
|
|
47338
|
+
if (result.finalLinkDone) await result.finalLinkDone;
|
|
47339
|
+
const usage = readSwiftSdkUsage2(result.mapPath, options2.output, sdkObjectKeys);
|
|
47340
|
+
binding = createSwiftSdkBinding2({ ...link.linkage, data }, sdk2, usage);
|
|
47341
|
+
} catch (error) {
|
|
47342
|
+
await Promise.allSettled([lowerPromise]);
|
|
47343
|
+
throw error;
|
|
47344
|
+
}
|
|
47345
|
+
await lowerPromise;
|
|
47346
|
+
const finalized = finalizeGuestProjectionStorage({
|
|
47347
|
+
map: map3,
|
|
47348
|
+
linked,
|
|
47349
|
+
optimized: (0, import_node_fs74.readFileSync)(options2.optimized),
|
|
47350
|
+
owners,
|
|
47351
|
+
sectionOwners: splitInputs.appSections,
|
|
47352
|
+
projectionObject: appProjectionObject,
|
|
47353
|
+
reserved: storage,
|
|
47354
|
+
sdkSpans
|
|
47355
|
+
});
|
|
47356
|
+
(0, import_node_fs74.writeFileSync)(
|
|
47357
|
+
options2.optimized,
|
|
47358
|
+
moveGuestDyldTable(map3, finalized.wasm, splitInputs.dyldSymbols, bindingRows, [
|
|
47359
|
+
swiftAppModuleThunkSection2(finalized.wasm)
|
|
47360
|
+
])
|
|
47361
|
+
);
|
|
47362
|
+
return binding;
|
|
46969
47363
|
}
|
|
46970
|
-
|
|
46971
|
-
|
|
46972
|
-
map: map3,
|
|
46973
|
-
linked,
|
|
46974
|
-
optimized: (0, import_node_fs74.readFileSync)(options2.optimized),
|
|
46975
|
-
owners,
|
|
46976
|
-
sectionOwners: splitInputs.appSections,
|
|
46977
|
-
projectionObject,
|
|
46978
|
-
reserved: storage,
|
|
46979
|
-
sdkSpans
|
|
46980
|
-
});
|
|
46981
|
-
(0, import_node_fs74.writeFileSync)(
|
|
46982
|
-
options2.optimized,
|
|
46983
|
-
finishSwiftAppModule2(
|
|
46984
|
-
moveGuestDyldTable(map3, finalized.wasm, splitInputs.dyldSymbols, bindingRows)
|
|
46985
|
-
)
|
|
46986
|
-
);
|
|
46987
|
-
return binding;
|
|
47364
|
+
} finally {
|
|
47365
|
+
if (result.finalLinkDone) await Promise.allSettled([result.finalLinkDone]);
|
|
46988
47366
|
}
|
|
46989
47367
|
}
|
|
46990
47368
|
options2.onStage("lowering the app image");
|
|
@@ -47059,7 +47437,7 @@ function compilerCheckpoint(root, recipe2, args, header) {
|
|
|
47059
47437
|
}
|
|
47060
47438
|
if (!objects.length) return;
|
|
47061
47439
|
const outputs = [module2, header, map2[""].dependencies, ...objects];
|
|
47062
|
-
const digest3 = (0,
|
|
47440
|
+
const digest3 = (0, import_node_crypto46.createHash)("sha256").update(recipe2).update(JSON.stringify(args)).update(mapText);
|
|
47063
47441
|
for (const flag of args) {
|
|
47064
47442
|
if (!flag.startsWith("@")) continue;
|
|
47065
47443
|
const response = flag.slice(1);
|
|
@@ -47153,11 +47531,11 @@ async function withSwiftHeaderCompiler(root, toolchainBin, recipe2, producers, b
|
|
|
47153
47531
|
(0, import_node_fs75.rmSync)(directory2, { recursive: true, force: true });
|
|
47154
47532
|
}
|
|
47155
47533
|
}
|
|
47156
|
-
var
|
|
47534
|
+
var import_node_crypto46, import_node_fs75, import_node_http2, import_node_path75, SWIFT_HEADER_COMPILER_WRAPPER, argument, client;
|
|
47157
47535
|
var init_swift_header_compiler = __esm({
|
|
47158
47536
|
"src/swift-header-compiler.ts"() {
|
|
47159
47537
|
"use strict";
|
|
47160
|
-
|
|
47538
|
+
import_node_crypto46 = require("node:crypto");
|
|
47161
47539
|
import_node_fs75 = require("node:fs");
|
|
47162
47540
|
import_node_http2 = require("node:http");
|
|
47163
47541
|
import_node_path75 = __toESM(require("node:path"), 1);
|
|
@@ -47421,7 +47799,7 @@ var init_icuData = __esm({
|
|
|
47421
47799
|
|
|
47422
47800
|
// src/swift-icu.ts
|
|
47423
47801
|
async function cachedBrotli(bytes, quality, cacheKey) {
|
|
47424
|
-
const key2 = cacheKey && /^[a-f0-9]{64}$/.test(cacheKey) ? cacheKey : (0,
|
|
47802
|
+
const key2 = cacheKey && /^[a-f0-9]{64}$/.test(cacheKey) ? cacheKey : (0, import_node_crypto47.createHash)("sha256").update(bytes).digest("hex");
|
|
47425
47803
|
const cacheId = `${quality}:${key2}`;
|
|
47426
47804
|
const cached4 = brotliMemoryCache.get(cacheId);
|
|
47427
47805
|
if (cached4) return cached4;
|
|
@@ -47439,7 +47817,7 @@ async function cachedBrotli(bytes, quality, cacheKey) {
|
|
|
47439
47817
|
});
|
|
47440
47818
|
try {
|
|
47441
47819
|
await (0, import_promises11.mkdir)(dir, { recursive: true });
|
|
47442
|
-
const tmp = `${file}.${(0,
|
|
47820
|
+
const tmp = `${file}.${(0, import_node_crypto47.randomUUID)()}.tmp`;
|
|
47443
47821
|
await (0, import_promises11.writeFile)(tmp, compressed);
|
|
47444
47822
|
await (0, import_promises11.rename)(tmp, file);
|
|
47445
47823
|
} catch {
|
|
@@ -47477,7 +47855,7 @@ function swiftIcuAsset(toolchainBin, sdk2) {
|
|
|
47477
47855
|
JSON.stringify([toolchainBin, sdk2, swiftSdkOptions()]),
|
|
47478
47856
|
async () => {
|
|
47479
47857
|
const zipped = await deflate(await swiftIcuData(toolchainBin, sdk2));
|
|
47480
|
-
return { sha256: (0,
|
|
47858
|
+
return { sha256: (0, import_node_crypto47.createHash)("sha256").update(zipped).digest("hex"), gzip: zipped };
|
|
47481
47859
|
}
|
|
47482
47860
|
);
|
|
47483
47861
|
}
|
|
@@ -47579,7 +47957,7 @@ function swiftIcuPacked(icu) {
|
|
|
47579
47957
|
)
|
|
47580
47958
|
);
|
|
47581
47959
|
await (0, import_promises11.mkdir)(import_node_path77.default.dirname(file), { recursive: true });
|
|
47582
|
-
const tmp = `${file}.${(0,
|
|
47960
|
+
const tmp = `${file}.${(0, import_node_crypto47.randomUUID)()}.tmp`;
|
|
47583
47961
|
await (0, import_promises11.writeFile)(tmp, packed);
|
|
47584
47962
|
await (0, import_promises11.rename)(tmp, file);
|
|
47585
47963
|
return packed;
|
|
@@ -47592,12 +47970,12 @@ async function swiftIcuBundleAsset(icu) {
|
|
|
47592
47970
|
contentType: "application/octet-stream"
|
|
47593
47971
|
};
|
|
47594
47972
|
}
|
|
47595
|
-
var import_node_child_process40,
|
|
47973
|
+
var import_node_child_process40, import_node_crypto47, import_node_fs76, import_promises11, import_node_os16, import_node_path77, import_node_util12, import_node_zlib6, run6, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, brotliMemoryCache, packedFiles;
|
|
47596
47974
|
var init_swift_icu = __esm({
|
|
47597
47975
|
"src/swift-icu.ts"() {
|
|
47598
47976
|
"use strict";
|
|
47599
47977
|
import_node_child_process40 = require("node:child_process");
|
|
47600
|
-
|
|
47978
|
+
import_node_crypto47 = require("node:crypto");
|
|
47601
47979
|
import_node_fs76 = require("node:fs");
|
|
47602
47980
|
import_promises11 = require("node:fs/promises");
|
|
47603
47981
|
import_node_os16 = __toESM(require("node:os"), 1);
|
|
@@ -47800,7 +48178,7 @@ function swiftObjCPrebuiltCompiler(clang, root, sysroot, distribution, targets,
|
|
|
47800
48178
|
);
|
|
47801
48179
|
if (!modules.length) return [];
|
|
47802
48180
|
const { executable, prefixArgs } = rnxSelfInvocation();
|
|
47803
|
-
const compiler = (0,
|
|
48181
|
+
const compiler = (0, import_node_crypto48.createHash)("sha256").update(import_node_fs77.default.readFileSync(clang)).digest("hex");
|
|
47804
48182
|
return [
|
|
47805
48183
|
'case "$module" in',
|
|
47806
48184
|
` ${modules.join("|")}) exec ${[
|
|
@@ -47818,12 +48196,12 @@ function swiftObjCPrebuiltCompiler(clang, root, sysroot, distribution, targets,
|
|
|
47818
48196
|
"esac"
|
|
47819
48197
|
];
|
|
47820
48198
|
}
|
|
47821
|
-
var import_node_child_process41,
|
|
48199
|
+
var import_node_child_process41, import_node_crypto48, import_node_fs77, import_node_path78, quote2;
|
|
47822
48200
|
var init_swift_objc_prebuilt = __esm({
|
|
47823
48201
|
"src/swift-objc-prebuilt.ts"() {
|
|
47824
48202
|
"use strict";
|
|
47825
48203
|
import_node_child_process41 = require("node:child_process");
|
|
47826
|
-
|
|
48204
|
+
import_node_crypto48 = require("node:crypto");
|
|
47827
48205
|
import_node_fs77 = __toESM(require("node:fs"), 1);
|
|
47828
48206
|
import_node_path78 = __toESM(require("node:path"), 1);
|
|
47829
48207
|
init_internal_child_contract();
|
|
@@ -48176,7 +48554,7 @@ function swiftPackagePrebuiltEntries(input, moduleRoot, toolchainBin) {
|
|
|
48176
48554
|
([file, source]) => !/\.(?:swift|c|h|inc|modulemap)$/.test(file) || file.endsWith(".swift") && swiftImportNames(source, available2).some((name4) => !available2.has(name4))
|
|
48177
48555
|
))
|
|
48178
48556
|
return [];
|
|
48179
|
-
const hash = (0,
|
|
48557
|
+
const hash = (0, import_node_crypto49.createHash)("sha256");
|
|
48180
48558
|
for (const entry of files2.sort(
|
|
48181
48559
|
([left], [right]) => left < right ? -1 : left > right ? 1 : 0
|
|
48182
48560
|
))
|
|
@@ -48243,11 +48621,11 @@ function useSwiftPackagePrebuilts(input, moduleRoot, toolchainBin) {
|
|
|
48243
48621
|
}
|
|
48244
48622
|
return resolved;
|
|
48245
48623
|
}
|
|
48246
|
-
var
|
|
48624
|
+
var import_node_crypto49, import_node_fs80, import_node_path82, PACKAGE_RECIPE;
|
|
48247
48625
|
var init_swift_package_prebuilt = __esm({
|
|
48248
48626
|
"src/swift-package-prebuilt.ts"() {
|
|
48249
48627
|
"use strict";
|
|
48250
|
-
|
|
48628
|
+
import_node_crypto49 = require("node:crypto");
|
|
48251
48629
|
import_node_fs80 = __toESM(require("node:fs"), 1);
|
|
48252
48630
|
import_node_path82 = __toESM(require("node:path"), 1);
|
|
48253
48631
|
init_native_prebuilt();
|
|
@@ -48407,7 +48785,7 @@ function swiftObjCSelectorOptions(moduleRoot) {
|
|
|
48407
48785
|
`;
|
|
48408
48786
|
if (!(0, import_node_fs81.existsSync)(map2) || (0, import_node_fs81.readFileSync)(map2, "utf8") !== content) {
|
|
48409
48787
|
(0, import_node_fs81.mkdirSync)(import_node_path83.default.dirname(map2), { recursive: true });
|
|
48410
|
-
const partial = `${map2}.${(0,
|
|
48788
|
+
const partial = `${map2}.${(0, import_node_crypto50.randomUUID)()}`;
|
|
48411
48789
|
(0, import_node_fs81.writeFileSync)(partial, content);
|
|
48412
48790
|
(0, import_node_fs81.renameSync)(partial, map2);
|
|
48413
48791
|
}
|
|
@@ -48435,7 +48813,7 @@ async function ensureMacroPlugins(moduleRoot, toolchainBin, release, signal, lea
|
|
|
48435
48813
|
return { libraries, executables };
|
|
48436
48814
|
}
|
|
48437
48815
|
function swiftProjectBuildKey(moduleRoot, release) {
|
|
48438
|
-
return (0,
|
|
48816
|
+
return (0, import_node_crypto50.createHash)("sha256").update(`swift-framework/v2\0${release}\0${swiftModuleSdk(moduleRoot).wasmSdkId}`).update(swiftModuleDigest(moduleRoot)).digest("hex").slice(0, 32);
|
|
48439
48817
|
}
|
|
48440
48818
|
function sameStringList(left, right) {
|
|
48441
48819
|
if (left === right) return true;
|
|
@@ -48683,7 +49061,7 @@ function distributionClangModuleOptions(root, modules) {
|
|
|
48683
49061
|
function providedModulesPath(root, modules, excluded) {
|
|
48684
49062
|
if (!excluded || excluded.size === 0) return modules;
|
|
48685
49063
|
const entries2 = (0, import_node_fs81.readdirSync)(modules).filter((entry) => !excluded.has(entry.replace(/\..*$/, ""))).sort();
|
|
48686
|
-
const key2 = (0,
|
|
49064
|
+
const key2 = (0, import_node_crypto50.createHash)("sha256").update(JSON.stringify([modules, entries2])).update([...excluded].sort().join("\0")).digest("hex").slice(0, 16);
|
|
48687
49065
|
const directory2 = import_node_path83.default.join(root, `.peach-modules-${key2}`);
|
|
48688
49066
|
const complete = import_node_path83.default.join(directory2, ".complete");
|
|
48689
49067
|
if (!(0, import_node_fs81.existsSync)(complete)) {
|
|
@@ -48765,10 +49143,10 @@ function swiftTargetDependencies(files2, targets, frameworks = OPTIONAL_FRAMEWOR
|
|
|
48765
49143
|
function sha256Digest(value) {
|
|
48766
49144
|
if (typeof Bun !== "undefined")
|
|
48767
49145
|
return new Bun.CryptoHasher("sha256").update(value).digest();
|
|
48768
|
-
return (0,
|
|
49146
|
+
return (0, import_node_crypto50.createHash)("sha256").update(value).digest();
|
|
48769
49147
|
}
|
|
48770
49148
|
function swiftCompileInputHash(input, release) {
|
|
48771
|
-
const hash = (0,
|
|
49149
|
+
const hash = (0, import_node_crypto50.createHash)("sha256");
|
|
48772
49150
|
hash.update(`swift-compile
|
|
48773
49151
|
${release}
|
|
48774
49152
|
`);
|
|
@@ -48975,7 +49353,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
48975
49353
|
].join("\n") + "\n";
|
|
48976
49354
|
distributionLinkPath = distributionLink.path.replace(
|
|
48977
49355
|
/\.rsp$/,
|
|
48978
|
-
`-${(0,
|
|
49356
|
+
`-${(0, import_node_crypto50.createHash)("sha256").update(list2).digest("hex").slice(0, 12)}.rsp`
|
|
48979
49357
|
);
|
|
48980
49358
|
distributionLink.files.set(distributionLinkPath, list2);
|
|
48981
49359
|
}
|
|
@@ -48996,7 +49374,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
48996
49374
|
const endRun = () => {
|
|
48997
49375
|
if (run17.length >= MODULE_MAP_RESPONSE_FILE_RUN) {
|
|
48998
49376
|
const lines = run17.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
48999
|
-
const digest4 = (0,
|
|
49377
|
+
const digest4 = (0, import_node_crypto50.createHash)("sha256").update(lines).digest("hex");
|
|
49000
49378
|
const file2 = import_node_path83.default.join(args.root, ".peach-clang-arguments", `${digest4}.rsp`);
|
|
49001
49379
|
args.files.set(file2, lines);
|
|
49002
49380
|
flags.push(`@${file2}`);
|
|
@@ -49020,7 +49398,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
49020
49398
|
}
|
|
49021
49399
|
endRun();
|
|
49022
49400
|
const content = JSON.stringify(flags);
|
|
49023
|
-
const digest3 = (0,
|
|
49401
|
+
const digest3 = (0, import_node_crypto50.createHash)("sha256").update(content).digest("hex");
|
|
49024
49402
|
const file = import_node_path83.default.join(args.root, ".peach-manifest-arguments", `${digest3}.json`);
|
|
49025
49403
|
args.files.set(file, content);
|
|
49026
49404
|
return `peachCompilerArguments(${JSON.stringify(file)})`;
|
|
@@ -49032,7 +49410,7 @@ function emitSwiftPackageManifest(args) {
|
|
|
49032
49410
|
const macros = compactSwiftClangDefines(swiftClangSearchArguments(flags));
|
|
49033
49411
|
const compact = args.coalescibleOverlays ? compactSwiftClangOverlays(macros, args.coalescibleOverlays) : macros;
|
|
49034
49412
|
const content = compact.map((flag) => JSON.stringify(flag)).join("\n") + "\n";
|
|
49035
|
-
const digest3 = (0,
|
|
49413
|
+
const digest3 = (0, import_node_crypto50.createHash)("sha256").update(content).digest("hex");
|
|
49036
49414
|
const file = import_node_path83.default.join(args.root, ".peach-swift-arguments", `${digest3}.rsp`);
|
|
49037
49415
|
args.files.set(file, content);
|
|
49038
49416
|
return JSON.stringify([`@${file}`]);
|
|
@@ -50621,7 +50999,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
50621
50999
|
)
|
|
50622
51000
|
];
|
|
50623
51001
|
const moduleFlag = perFile.some((flag) => flag.startsWith("-fmodule-name=")) ? [] : [`-fmodule-name=${swiftTargetModuleName(target.name)}`];
|
|
50624
|
-
const identity2 = (0,
|
|
51002
|
+
const identity2 = (0, import_node_crypto50.createHash)("sha256").update(
|
|
50625
51003
|
JSON.stringify([
|
|
50626
51004
|
cxx,
|
|
50627
51005
|
quoteDirs,
|
|
@@ -50984,7 +51362,7 @@ module ${moduleName2}.Swift {
|
|
|
50984
51362
|
])
|
|
50985
51363
|
(0, import_node_fs81.rmSync)(cache, { recursive: true, force: true });
|
|
50986
51364
|
files2.set(frameworkSearchRecord, frameworkSearch);
|
|
50987
|
-
const modulePlan = (0,
|
|
51365
|
+
const modulePlan = (0, import_node_crypto50.createHash)("sha256").update(
|
|
50988
51366
|
swiftModuleInputFiles(moduleRoot).join("\n")
|
|
50989
51367
|
);
|
|
50990
51368
|
if (!distribution) {
|
|
@@ -50993,7 +51371,7 @@ module ${moduleName2}.Swift {
|
|
|
50993
51371
|
modulePlan.update(
|
|
50994
51372
|
Object.keys(input.files).filter((file) => file.endsWith(".swift")).sort().join("\n")
|
|
50995
51373
|
);
|
|
50996
|
-
const resourcePlan = (0,
|
|
51374
|
+
const resourcePlan = (0, import_node_crypto50.createHash)("sha256").update(
|
|
50997
51375
|
JSON.stringify(
|
|
50998
51376
|
resourceTargets.filter((target) => target.resources).map((target) => [
|
|
50999
51377
|
target.name,
|
|
@@ -51301,7 +51679,7 @@ ${entry}`);
|
|
|
51301
51679
|
);
|
|
51302
51680
|
for (const [target, data] of Object.entries(input.libraries ?? {})) {
|
|
51303
51681
|
const bytes = Buffer.from(data, "base64");
|
|
51304
|
-
const digest3 = (0,
|
|
51682
|
+
const digest3 = (0, import_node_crypto50.createHash)("sha256").update(bytes).digest("hex");
|
|
51305
51683
|
if (input.binaryModules?.[target] && packageTargets.has(target)) {
|
|
51306
51684
|
const objects = import_node_path83.default.join(
|
|
51307
51685
|
layout2.root,
|
|
@@ -51953,7 +52331,7 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
51953
52331
|
return null;
|
|
51954
52332
|
const bytes = (0, import_node_fs81.readFileSync)(import_node_path83.default.join(directory2, "app.wasm"));
|
|
51955
52333
|
const gzip2 = (0, import_node_fs81.readFileSync)(import_node_path83.default.join(directory2, "icu.gz"));
|
|
51956
|
-
if ((0,
|
|
52334
|
+
if ((0, import_node_crypto50.createHash)("sha256").update(bytes).digest("hex") !== receipt.wasm || (0, import_node_crypto50.createHash)("sha256").update(gzip2).digest("hex") !== receipt.icu || bytes.length <= 8 || bytes.readUInt32LE(0) !== 1836278016 || bytes.readUInt32LE(4) !== 1)
|
|
51957
52335
|
return null;
|
|
51958
52336
|
let sdk2;
|
|
51959
52337
|
if ("sdk" in receipt) {
|
|
@@ -51961,7 +52339,7 @@ function readCompiledArtifact(directory2, hash) {
|
|
|
51961
52339
|
if (!isRecord(image) || typeof image.key !== "string" || typeof image.sha256 !== "string" || typeof image.binding !== "string")
|
|
51962
52340
|
return null;
|
|
51963
52341
|
const binding = (0, import_node_fs81.readFileSync)(import_node_path83.default.join(directory2, "sdk-binding.bin"));
|
|
51964
|
-
if ((0,
|
|
52342
|
+
if ((0, import_node_crypto50.createHash)("sha256").update(binding).digest("hex") !== image.binding)
|
|
51965
52343
|
return null;
|
|
51966
52344
|
sdk2 = {
|
|
51967
52345
|
key: image.key,
|
|
@@ -51989,7 +52367,7 @@ function saveCompiledArtifact(root, artifact) {
|
|
|
51989
52367
|
import_node_path83.default.join(pending2, "artifact.json"),
|
|
51990
52368
|
JSON.stringify({
|
|
51991
52369
|
hash: artifact.hash,
|
|
51992
|
-
wasm: (0,
|
|
52370
|
+
wasm: (0, import_node_crypto50.createHash)("sha256").update(artifact.bytes).digest("hex"),
|
|
51993
52371
|
icu: artifact.icu.sha256,
|
|
51994
52372
|
sdk: artifact.sdk && {
|
|
51995
52373
|
key: artifact.sdk.key,
|
|
@@ -52338,7 +52716,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
52338
52716
|
const unoptimized = args.input.unoptimized === true;
|
|
52339
52717
|
const sdkOptions = swiftCompileSdkOptions(args.moduleRoot, args.toolchainBin);
|
|
52340
52718
|
const selectorOptions = swiftObjCSelectorOptions(args.moduleRoot);
|
|
52341
|
-
const receiptKey = (0,
|
|
52719
|
+
const receiptKey = (0, import_node_crypto50.createHash)("sha256").update(
|
|
52342
52720
|
JSON.stringify([
|
|
52343
52721
|
"framework-products/v2",
|
|
52344
52722
|
args.frameworkKey,
|
|
@@ -52402,6 +52780,10 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
52402
52780
|
// every framework target when callers alternate --cores.
|
|
52403
52781
|
"-Xswiftc",
|
|
52404
52782
|
"-gnone",
|
|
52783
|
+
"-Xcc",
|
|
52784
|
+
"-g0",
|
|
52785
|
+
"-Xcxx",
|
|
52786
|
+
"-g0",
|
|
52405
52787
|
"-Xswiftc",
|
|
52406
52788
|
"-num-threads",
|
|
52407
52789
|
"-Xswiftc",
|
|
@@ -52501,7 +52883,7 @@ async function buildFrameworkProducts(scratch2, args) {
|
|
|
52501
52883
|
const archiveBase = import_node_path83.default.join(scratch2, "products-lib");
|
|
52502
52884
|
(0, import_node_fs81.mkdirSync)(archiveBase, { recursive: true });
|
|
52503
52885
|
const archiveRoot = import_node_path83.default.join(archiveBase, receiptKey);
|
|
52504
|
-
const stagedArchiveRoot = `${archiveRoot}.tmp-${process.pid}-${(0,
|
|
52886
|
+
const stagedArchiveRoot = `${archiveRoot}.tmp-${process.pid}-${(0, import_node_crypto50.randomUUID)()}`;
|
|
52505
52887
|
const stagedArchive = import_node_path83.default.join(stagedArchiveRoot, "lib");
|
|
52506
52888
|
(0, import_node_fs81.mkdirSync)(stagedArchive, { recursive: true });
|
|
52507
52889
|
const archived = /* @__PURE__ */ new Map();
|
|
@@ -52544,7 +52926,7 @@ ${args.frameworkKey}`,
|
|
|
52544
52926
|
const receiptsDir = import_node_path83.default.join(scratch2, "products-ready");
|
|
52545
52927
|
(0, import_node_fs81.mkdirSync)(receiptsDir, { recursive: true });
|
|
52546
52928
|
const receiptFile2 = import_node_path83.default.join(receiptsDir, `${receiptKey}.json`);
|
|
52547
|
-
const partialReceipt = `${receiptFile2}.${process.pid}.${(0,
|
|
52929
|
+
const partialReceipt = `${receiptFile2}.${process.pid}.${(0, import_node_crypto50.randomUUID)()}`;
|
|
52548
52930
|
(0, import_node_fs81.writeFileSync)(
|
|
52549
52931
|
partialReceipt,
|
|
52550
52932
|
JSON.stringify({
|
|
@@ -52716,7 +53098,7 @@ function mirrorTree2(source, target, skip) {
|
|
|
52716
53098
|
if (existing?.isFile() && existing.size === stat2.size && (existing.mtimeMs === stat2.mtimeMs || (0, import_node_fs81.readFileSync)(from).equals((0, import_node_fs81.readFileSync)(to))))
|
|
52717
53099
|
continue;
|
|
52718
53100
|
if (existing) (0, import_node_fs81.rmSync)(to, { recursive: true, force: true });
|
|
52719
|
-
const partial = `${to}.${(0,
|
|
53101
|
+
const partial = `${to}.${(0, import_node_crypto50.randomUUID)()}`;
|
|
52720
53102
|
(0, import_node_fs81.copyFileSync)(from, partial);
|
|
52721
53103
|
if (stat2.mtimeMs > Date.now()) (0, import_node_fs81.utimesSync)(partial, stat2.atime, stat2.mtime);
|
|
52722
53104
|
(0, import_node_fs81.renameSync)(partial, to);
|
|
@@ -52776,7 +53158,7 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
|
|
|
52776
53158
|
return stagedModule;
|
|
52777
53159
|
}
|
|
52778
53160
|
function swiftLinkStamp(args) {
|
|
52779
|
-
const hash = (0,
|
|
53161
|
+
const hash = (0, import_node_crypto50.createHash)("sha256");
|
|
52780
53162
|
hash.update(`swift-link/v1
|
|
52781
53163
|
${args.frameworkKey}
|
|
52782
53164
|
`);
|
|
@@ -52904,7 +53286,7 @@ async function compileSwiftProjectOnce(sources, options2) {
|
|
|
52904
53286
|
const inputHash = swiftCompileInputHash(input, options2.release);
|
|
52905
53287
|
const moduleDigest = swiftModuleDigest(moduleRoot);
|
|
52906
53288
|
const sourceHash = inputHash.copy().update(moduleDigest).digest("hex");
|
|
52907
|
-
const hash = sdkImage ? (0,
|
|
53289
|
+
const hash = sdkImage ? (0, import_node_crypto50.createHash)("sha256").update(`${sourceHash}
|
|
52908
53290
|
sdk module ${sdkImage.key}`).digest("hex") : sourceHash;
|
|
52909
53291
|
const frameworkKey = swiftProjectBuildKey(moduleRoot, options2.release);
|
|
52910
53292
|
const sharedRoot = import_node_path83.default.join(swiftCacheDir(), "swift-projects", hash);
|
|
@@ -53001,7 +53383,7 @@ ${cap}` : "";
|
|
|
53001
53383
|
}
|
|
53002
53384
|
const baseRoot = root;
|
|
53003
53385
|
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path83.default.basename(import_node_path83.default.dirname(baseRoot)) === "swift-builds";
|
|
53004
|
-
const buildShape = canPoolBuildRoot ? (0,
|
|
53386
|
+
const buildShape = canPoolBuildRoot ? (0, import_node_crypto50.createHash)("sha256").update(
|
|
53005
53387
|
JSON.stringify([
|
|
53006
53388
|
frameworkKey,
|
|
53007
53389
|
Boolean(sdkImage),
|
|
@@ -53292,6 +53674,10 @@ ${cap}` : "";
|
|
|
53292
53674
|
// fan-out under high -j.
|
|
53293
53675
|
"-Xswiftc",
|
|
53294
53676
|
"-gnone",
|
|
53677
|
+
"-Xcc",
|
|
53678
|
+
"-g0",
|
|
53679
|
+
"-Xcxx",
|
|
53680
|
+
"-g0",
|
|
53295
53681
|
...incrementalPreview ? [] : [
|
|
53296
53682
|
"-Xswiftc",
|
|
53297
53683
|
"-num-threads",
|
|
@@ -53486,17 +53872,17 @@ ${cap}` : "";
|
|
|
53486
53872
|
}
|
|
53487
53873
|
const receipt = import_node_path83.default.join(
|
|
53488
53874
|
checkpoints,
|
|
53489
|
-
(0,
|
|
53875
|
+
(0, import_node_crypto50.createHash)("sha256").update(target).digest("hex")
|
|
53490
53876
|
);
|
|
53491
53877
|
const headers = producers.map(headerPaths);
|
|
53492
53878
|
for (const header of headers)
|
|
53493
53879
|
if ((0, import_node_fs81.existsSync)(header.original)) publishHeader(header);
|
|
53494
53880
|
const fingerprint = () => {
|
|
53495
|
-
const digest3 = (0,
|
|
53881
|
+
const digest3 = (0, import_node_crypto50.createHash)("sha256").update(recipe2);
|
|
53496
53882
|
for (const { original, emitted } of headers) {
|
|
53497
53883
|
if (!(0, import_node_fs81.existsSync)(original) || !(0, import_node_fs81.existsSync)(emitted)) return;
|
|
53498
53884
|
digest3.update(
|
|
53499
|
-
(0,
|
|
53885
|
+
(0, import_node_crypto50.createHash)("sha256").update((0, import_node_fs81.readFileSync)(emitted)).digest()
|
|
53500
53886
|
);
|
|
53501
53887
|
}
|
|
53502
53888
|
return digest3.digest("hex");
|
|
@@ -53709,12 +54095,12 @@ ${cap}` : "";
|
|
|
53709
54095
|
options2.signal
|
|
53710
54096
|
);
|
|
53711
54097
|
}
|
|
53712
|
-
var import_node_child_process43,
|
|
54098
|
+
var import_node_child_process43, import_node_crypto50, import_node_fs81, 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;
|
|
53713
54099
|
var init_swift_compile = __esm({
|
|
53714
54100
|
"src/swift-compile.ts"() {
|
|
53715
54101
|
"use strict";
|
|
53716
54102
|
import_node_child_process43 = require("node:child_process");
|
|
53717
|
-
|
|
54103
|
+
import_node_crypto50 = require("node:crypto");
|
|
53718
54104
|
import_node_fs81 = require("node:fs");
|
|
53719
54105
|
import_node_os18 = __toESM(require("node:os"), 1);
|
|
53720
54106
|
import_node_path83 = __toESM(require("node:path"), 1);
|
|
@@ -53942,7 +54328,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
53942
54328
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
53943
54329
|
MULTI_MANIFEST_VERSION = 76;
|
|
53944
54330
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
53945
|
-
compilerSourceDigest = true ? "
|
|
54331
|
+
compilerSourceDigest = true ? "169122685e250113f128b79efc78f9868f581da36ab083c174056ab99b87b629" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
53946
54332
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
53947
54333
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
53948
54334
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -54058,7 +54444,7 @@ async function podPrepareEnvironment(base2) {
|
|
|
54058
54444
|
if (process.platform !== "linux") return base2;
|
|
54059
54445
|
const { root, toolchainBin } = await resolveSwiftModule();
|
|
54060
54446
|
const { sysroot, resources } = swiftSdkPaths(root, toolchainBin);
|
|
54061
|
-
const key2 = (0,
|
|
54447
|
+
const key2 = (0, import_node_crypto51.createHash)("sha256").update(XCRUN).update(CLANG).digest("hex").slice(0, 16);
|
|
54062
54448
|
const directory2 = import_node_path84.default.join(cacheDir(), "pod-tools", key2);
|
|
54063
54449
|
if (!import_node_fs82.default.existsSync(directory2)) {
|
|
54064
54450
|
import_node_fs82.default.mkdirSync(import_node_path84.default.dirname(directory2), { recursive: true });
|
|
@@ -54099,11 +54485,11 @@ async function podPrepareEnvironment(base2) {
|
|
|
54099
54485
|
PEACH_POD_RESOURCES: resources
|
|
54100
54486
|
};
|
|
54101
54487
|
}
|
|
54102
|
-
var
|
|
54488
|
+
var import_node_crypto51, import_node_fs82, import_node_path84, XCRUN, CLANG;
|
|
54103
54489
|
var init_pod_prepare_toolchain = __esm({
|
|
54104
54490
|
"src/pod-prepare-toolchain.ts"() {
|
|
54105
54491
|
"use strict";
|
|
54106
|
-
|
|
54492
|
+
import_node_crypto51 = require("node:crypto");
|
|
54107
54493
|
import_node_fs82 = __toESM(require("node:fs"), 1);
|
|
54108
54494
|
import_node_path84 = __toESM(require("node:path"), 1);
|
|
54109
54495
|
init_home_paths();
|
|
@@ -54189,10 +54575,10 @@ async function podSourceRoot(spec, prepareEnv) {
|
|
|
54189
54575
|
`${name3}: unrecognized ${strategy} source options ${unrecognized.join(", ")}`
|
|
54190
54576
|
);
|
|
54191
54577
|
const base2 = import_node_path85.default.join(rnxHomeDir(), "pod-sources");
|
|
54192
|
-
const digest3 = (0,
|
|
54578
|
+
const digest3 = (0, import_node_crypto52.createHash)("sha256").update(canonicalJson(source)).digest("hex").slice(0, 16);
|
|
54193
54579
|
const root = import_node_path85.default.join(base2, name3, `${String(spec.version)}-${digest3}`);
|
|
54194
54580
|
if (import_node_fs83.default.existsSync(root)) return root;
|
|
54195
|
-
const stage = import_node_path85.default.join(base2, ".staging", (0,
|
|
54581
|
+
const stage = import_node_path85.default.join(base2, ".staging", (0, import_node_crypto52.randomUUID)());
|
|
54196
54582
|
import_node_fs83.default.mkdirSync(stage, { recursive: true });
|
|
54197
54583
|
try {
|
|
54198
54584
|
if (strategy === "git") await downloadGit(name3, url, options2, stage);
|
|
@@ -54367,7 +54753,7 @@ async function downloadFile(pod, url, headers, file, algorithm) {
|
|
|
54367
54753
|
}
|
|
54368
54754
|
if (!response?.ok || !response.body)
|
|
54369
54755
|
throw new Error(`${pod}: GET ${url} failed with HTTP ${response?.status ?? "error"}`);
|
|
54370
|
-
const hash = algorithm ? (0,
|
|
54756
|
+
const hash = algorithm ? (0, import_node_crypto52.createHash)(algorithm) : null;
|
|
54371
54757
|
const handle = await import_node_fs83.default.promises.open(file, "w");
|
|
54372
54758
|
try {
|
|
54373
54759
|
const reader = response.body.getReader();
|
|
@@ -54624,12 +55010,12 @@ function cleanInstalledPod(spec, root, used) {
|
|
|
54624
55010
|
(node) => used.filter((entry) => entry.specs.includes(node.name)).map((entry) => entry.platform)
|
|
54625
55011
|
);
|
|
54626
55012
|
}
|
|
54627
|
-
var import_node_child_process44,
|
|
55013
|
+
var import_node_child_process44, import_node_crypto52, import_node_fs83, 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;
|
|
54628
55014
|
var init_pod_sources = __esm({
|
|
54629
55015
|
"src/pod-sources.ts"() {
|
|
54630
55016
|
"use strict";
|
|
54631
55017
|
import_node_child_process44 = require("node:child_process");
|
|
54632
|
-
|
|
55018
|
+
import_node_crypto52 = require("node:crypto");
|
|
54633
55019
|
import_node_fs83 = __toESM(require("node:fs"), 1);
|
|
54634
55020
|
import_node_os19 = __toESM(require("node:os"), 1);
|
|
54635
55021
|
import_node_path85 = __toESM(require("node:path"), 1);
|
|
@@ -61883,7 +62269,7 @@ function specRepo(url, refresh) {
|
|
|
61883
62269
|
const dir = import_node_path86.default.join(
|
|
61884
62270
|
cacheDir(),
|
|
61885
62271
|
"cocoapods-repos",
|
|
61886
|
-
(0,
|
|
62272
|
+
(0, import_node_crypto53.createHash)("sha256").update(url).digest("hex").slice(0, 16)
|
|
61887
62273
|
);
|
|
61888
62274
|
if (!import_node_fs84.default.existsSync(import_node_path86.default.join(dir, ".git"))) {
|
|
61889
62275
|
const staged = `${dir}.${process.pid}`;
|
|
@@ -61913,7 +62299,7 @@ function podDir(repo, name3) {
|
|
|
61913
62299
|
const specs = import_node_fs84.default.existsSync(import_node_path86.default.join(repo, "Specs")) ? import_node_path86.default.join(repo, "Specs") : repo;
|
|
61914
62300
|
const metadata = import_node_path86.default.join(repo, "CocoaPods-version.yml");
|
|
61915
62301
|
const lengths = import_node_fs84.default.existsSync(metadata) ? browser_default.parse(import_node_fs84.default.readFileSync(metadata, "utf8"))?.prefix_lengths : void 0;
|
|
61916
|
-
const hash = (0,
|
|
62302
|
+
const hash = (0, import_node_crypto53.createHash)("md5").update(name3).digest("hex");
|
|
61917
62303
|
let at = 0;
|
|
61918
62304
|
const shards2 = (Array.isArray(lengths) ? lengths : []).map((length) => {
|
|
61919
62305
|
if (typeof length !== "number")
|
|
@@ -61946,17 +62332,17 @@ async function sourceSpecificationFile(source, name3, version2) {
|
|
|
61946
62332
|
if (!file) throw new Error(`${source} lists ${name3} ${version2} without a podspec`);
|
|
61947
62333
|
return file;
|
|
61948
62334
|
}
|
|
61949
|
-
var import_node_child_process45,
|
|
62335
|
+
var import_node_child_process45, import_node_crypto53, import_node_fs84, import_node_path86, shard, shards, TRUNK_SOURCES, refreshed, specRepoKey;
|
|
61950
62336
|
var init_cocoapods_trunk = __esm({
|
|
61951
62337
|
"src/cocoapods-trunk.ts"() {
|
|
61952
62338
|
"use strict";
|
|
61953
62339
|
import_node_child_process45 = require("node:child_process");
|
|
61954
|
-
|
|
62340
|
+
import_node_crypto53 = require("node:crypto");
|
|
61955
62341
|
import_node_fs84 = __toESM(require("node:fs"), 1);
|
|
61956
62342
|
import_node_path86 = __toESM(require("node:path"), 1);
|
|
61957
62343
|
init_browser();
|
|
61958
62344
|
init_home_paths();
|
|
61959
|
-
shard = (name3) => (0,
|
|
62345
|
+
shard = (name3) => (0, import_node_crypto53.createHash)("md5").update(name3).digest("hex").slice(0, 3).split("");
|
|
61960
62346
|
shards = /* @__PURE__ */ new Map();
|
|
61961
62347
|
TRUNK_SOURCES = /* @__PURE__ */ new Set([
|
|
61962
62348
|
"trunk",
|
|
@@ -71622,6 +72008,11 @@ end
|
|
|
71622
72008
|
});
|
|
71623
72009
|
|
|
71624
72010
|
// src/bazel-project.ts
|
|
72011
|
+
function sha256Hex5(bytes) {
|
|
72012
|
+
if (typeof Bun !== "undefined")
|
|
72013
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
72014
|
+
return (0, import_node_crypto54.createHash)("sha256").update(bytes).digest("hex");
|
|
72015
|
+
}
|
|
71625
72016
|
function isBazelPackage(input) {
|
|
71626
72017
|
return /^BUILD(?:\.bazel)?$/.test(import_node_path96.default.basename(input)) && import_node_fs93.default.statSync(input).isFile();
|
|
71627
72018
|
}
|
|
@@ -71651,7 +72042,7 @@ function bazelBinary(root) {
|
|
|
71651
72042
|
const expected = (0, import_node_child_process46.execFileSync)("curl", ["-fsSL", `${url}.sha256`], {
|
|
71652
72043
|
encoding: "utf8"
|
|
71653
72044
|
}).split(/\s/)[0];
|
|
71654
|
-
const actual = (0,
|
|
72045
|
+
const actual = (0, import_node_crypto54.createHash)("sha256").update(import_node_fs93.default.readFileSync(partial)).digest("hex");
|
|
71655
72046
|
if (actual !== expected) {
|
|
71656
72047
|
import_node_fs93.default.rmSync(partial, { force: true });
|
|
71657
72048
|
throw new Error(`${url} digest ${actual} differs from its release ${expected}`);
|
|
@@ -71681,7 +72072,7 @@ function parseRule(raw2) {
|
|
|
71681
72072
|
};
|
|
71682
72073
|
}
|
|
71683
72074
|
function graphInputsDigest(root) {
|
|
71684
|
-
const hash = (0,
|
|
72075
|
+
const hash = (0, import_node_crypto54.createHash)("sha256");
|
|
71685
72076
|
const visit3 = (dir) => {
|
|
71686
72077
|
for (const entry of import_node_fs93.default.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
71687
72078
|
if (entry.name.startsWith(".") || entry.name.startsWith("bazel-")) continue;
|
|
@@ -71714,7 +72105,7 @@ function bazelGraph(root, label, configuration2) {
|
|
|
71714
72105
|
const cached4 = graphs.get(key2);
|
|
71715
72106
|
if (cached4) return cached4;
|
|
71716
72107
|
const flags = configurationFlags(configuration2);
|
|
71717
|
-
const digest3 = (0,
|
|
72108
|
+
const digest3 = (0, import_node_crypto54.createHash)("sha256").update(JSON.stringify([GRAPH_FORMAT, label, flags, QUERIED_RULES])).update(graphInputsDigest(root)).digest("hex").slice(0, 24);
|
|
71718
72109
|
const file = import_node_path96.default.join(root, ".build", "peach-bazel", `graph-${digest3}.json`);
|
|
71719
72110
|
const bazel = bazelBinary(root);
|
|
71720
72111
|
const run17 = (args) => (0, import_node_child_process46.execFileSync)(bazel, args, {
|
|
@@ -72188,6 +72579,18 @@ ${published4.map(
|
|
|
72188
72579
|
`bazel application has ${missing2.length} unbuilt inputs: ${missing2.slice(0, 5).map((file) => import_node_path96.default.relative(root, file)).join(", ")}`
|
|
72189
72580
|
);
|
|
72190
72581
|
const archives = /* @__PURE__ */ new Map();
|
|
72582
|
+
let outputOwner;
|
|
72583
|
+
const ownerOfOutput = (file) => {
|
|
72584
|
+
if (!outputOwner) {
|
|
72585
|
+
outputOwner = /* @__PURE__ */ new Map();
|
|
72586
|
+
for (const item of graph.rules.values())
|
|
72587
|
+
for (const output of item.outputs) {
|
|
72588
|
+
const outputPath2 = files2.path(output);
|
|
72589
|
+
if (!outputOwner.has(outputPath2)) outputOwner.set(outputPath2, item);
|
|
72590
|
+
}
|
|
72591
|
+
}
|
|
72592
|
+
return outputOwner.get(file);
|
|
72593
|
+
};
|
|
72191
72594
|
for (const rule of order) {
|
|
72192
72595
|
for (const dep of rule.attrs.get("deps")?.list ?? []) {
|
|
72193
72596
|
const owner = ruleOf(dep, rule.label);
|
|
@@ -72205,9 +72608,7 @@ ${published4.map(
|
|
|
72205
72608
|
for (const raw2 of rule.attrs.get("srcs")?.list ?? []) {
|
|
72206
72609
|
const label2 = canonicalLabel(raw2, rule.label);
|
|
72207
72610
|
for (const archive of files2.expand([raw2], rule.label).filter((file) => file.endsWith(".a"))) {
|
|
72208
|
-
const owner =
|
|
72209
|
-
(item) => item.outputs.some((output) => files2.path(output) === archive)
|
|
72210
|
-
);
|
|
72611
|
+
const owner = ownerOfOutput(archive);
|
|
72211
72612
|
const key2 = owner?.label ?? label2;
|
|
72212
72613
|
const entry = archives.get(key2) ?? {
|
|
72213
72614
|
library: import_node_path96.default.basename(archive),
|
|
@@ -72233,6 +72634,13 @@ ${published4.map(
|
|
|
72233
72634
|
)
|
|
72234
72635
|
)
|
|
72235
72636
|
);
|
|
72637
|
+
const matchesAppInclude = (name3) => {
|
|
72638
|
+
if (appIncludes.has(name3)) return true;
|
|
72639
|
+
for (let slash = name3.indexOf("/"); slash >= 0; slash = name3.indexOf("/", slash + 1)) {
|
|
72640
|
+
if (appIncludes.has(name3.slice(slash + 1))) return true;
|
|
72641
|
+
}
|
|
72642
|
+
return false;
|
|
72643
|
+
};
|
|
72236
72644
|
let generatedBy;
|
|
72237
72645
|
const generators = () => {
|
|
72238
72646
|
if (!generatedBy) {
|
|
@@ -72313,9 +72721,7 @@ ${published4.map(
|
|
|
72313
72721
|
[...linkers].filter((rule) => rule.attrs.get("module_name")?.value).flatMap((rule) => files2.expand(rule.attrs.get("hdrs")?.list ?? [], rule.label))
|
|
72314
72722
|
);
|
|
72315
72723
|
const entries2 = headers.filter(
|
|
72316
|
-
(header) => imported.has(header.file) ||
|
|
72317
|
-
(include) => header.name === include || header.name.endsWith(`/${include}`)
|
|
72318
|
-
)
|
|
72724
|
+
(header) => imported.has(header.file) || matchesAppInclude(header.name)
|
|
72319
72725
|
);
|
|
72320
72726
|
const bundle = import_node_path96.default.join(products, "archives", `${name3}.xcframework`);
|
|
72321
72727
|
const slice = import_node_path96.default.join(bundle, "ios-arm64-simulator");
|
|
@@ -72361,14 +72767,9 @@ ${published4.map(
|
|
|
72361
72767
|
]
|
|
72362
72768
|
)
|
|
72363
72769
|
]);
|
|
72364
|
-
const digest3 = (
|
|
72365
|
-
JSON.stringify(
|
|
72366
|
-
|
|
72367
|
-
file,
|
|
72368
|
-
(0, import_node_crypto53.createHash)("sha256").update(bytes).digest("hex")
|
|
72369
|
-
])
|
|
72370
|
-
)
|
|
72371
|
-
).digest("hex");
|
|
72770
|
+
const digest3 = sha256Hex5(
|
|
72771
|
+
JSON.stringify([...contents2].map(([file, bytes]) => [file, sha256Hex5(bytes)]))
|
|
72772
|
+
);
|
|
72372
72773
|
const stamp = import_node_path96.default.join(bundle, ".peach-digest");
|
|
72373
72774
|
if (!import_node_fs93.default.existsSync(stamp) || import_node_fs93.default.readFileSync(stamp, "utf8") !== digest3) {
|
|
72374
72775
|
import_node_fs93.default.rmSync(bundle, { recursive: true, force: true });
|
|
@@ -72528,12 +72929,12 @@ function shellTokens(options2) {
|
|
|
72528
72929
|
return words2;
|
|
72529
72930
|
});
|
|
72530
72931
|
}
|
|
72531
|
-
var import_node_child_process46,
|
|
72932
|
+
var import_node_child_process46, import_node_crypto54, import_node_fs93, import_node_os20, import_node_path96, LIBRARY_RULES, QUERIED_RULES, NATIVE_SOURCE, HEADER4, PRODUCTS, graphs, CLANG_CONFIGURATION_FLAGS, GRAPH_FORMAT, BazelFiles, CXX_STANDARD;
|
|
72532
72933
|
var init_bazel_project = __esm({
|
|
72533
72934
|
"src/bazel-project.ts"() {
|
|
72534
72935
|
"use strict";
|
|
72535
72936
|
import_node_child_process46 = require("node:child_process");
|
|
72536
|
-
|
|
72937
|
+
import_node_crypto54 = require("node:crypto");
|
|
72537
72938
|
import_node_fs93 = __toESM(require("node:fs"), 1);
|
|
72538
72939
|
import_node_os20 = __toESM(require("node:os"), 1);
|
|
72539
72940
|
import_node_path96 = __toESM(require("node:path"), 1);
|
|
@@ -73511,7 +73912,7 @@ async function swiftBinaryModules(binary2) {
|
|
|
73511
73912
|
if (!binary2.url) return localSwiftBinaryModules(binary2.dir);
|
|
73512
73913
|
const cached4 = import_node_path97.default.join(
|
|
73513
73914
|
cacheDir3,
|
|
73514
|
-
`${(0,
|
|
73915
|
+
`${(0, import_node_crypto55.createHash)("sha256").update(`${binary2.url}\0${binary2.checksum ?? ""}`).digest("hex").slice(0, 32)}.json`
|
|
73515
73916
|
);
|
|
73516
73917
|
if (import_node_fs94.default.existsSync(cached4)) {
|
|
73517
73918
|
const value = JSON.parse(import_node_fs94.default.readFileSync(cached4, "utf8"));
|
|
@@ -73523,11 +73924,11 @@ async function swiftBinaryModules(binary2) {
|
|
|
73523
73924
|
import_node_fs94.default.writeFileSync(cached4, JSON.stringify(modules));
|
|
73524
73925
|
return modules;
|
|
73525
73926
|
}
|
|
73526
|
-
var
|
|
73927
|
+
var import_node_crypto55, import_node_fs94, import_node_path97, cacheDir3;
|
|
73527
73928
|
var init_swift_binary_modules = __esm({
|
|
73528
73929
|
"src/swift-binary-modules.ts"() {
|
|
73529
73930
|
"use strict";
|
|
73530
|
-
|
|
73931
|
+
import_node_crypto55 = require("node:crypto");
|
|
73531
73932
|
import_node_fs94 = __toESM(require("node:fs"), 1);
|
|
73532
73933
|
import_node_path97 = __toESM(require("node:path"), 1);
|
|
73533
73934
|
init_home_paths();
|
|
@@ -73537,11 +73938,11 @@ var init_swift_binary_modules = __esm({
|
|
|
73537
73938
|
});
|
|
73538
73939
|
|
|
73539
73940
|
// src/swift-coverage/provenance.ts
|
|
73540
|
-
var
|
|
73941
|
+
var import_node_crypto56, import_node_fs95, import_node_path98, swiftCoverageProvenance;
|
|
73541
73942
|
var init_provenance = __esm({
|
|
73542
73943
|
"src/swift-coverage/provenance.ts"() {
|
|
73543
73944
|
"use strict";
|
|
73544
|
-
|
|
73945
|
+
import_node_crypto56 = require("node:crypto");
|
|
73545
73946
|
import_node_fs95 = require("node:fs");
|
|
73546
73947
|
import_node_path98 = require("node:path");
|
|
73547
73948
|
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, ".."));
|
|
@@ -74638,16 +75039,16 @@ function assetSymbolText(plan, root) {
|
|
|
74638
75039
|
if (source.status === "unknown") throw new Error(source.reason);
|
|
74639
75040
|
return source.text;
|
|
74640
75041
|
}
|
|
74641
|
-
var
|
|
75042
|
+
var import_node_crypto57, import_node_fs97, import_node_path100, sha2562, unprovenAssetSettings, assetSymbolSettingKeys, provenOtherAssetFlags, symbolTexts;
|
|
74642
75043
|
var init_xcode_assets = __esm({
|
|
74643
75044
|
"src/swift-coverage/xcode-assets.ts"() {
|
|
74644
75045
|
"use strict";
|
|
74645
|
-
|
|
75046
|
+
import_node_crypto57 = require("node:crypto");
|
|
74646
75047
|
import_node_fs97 = require("node:fs");
|
|
74647
75048
|
import_node_path100 = require("node:path");
|
|
74648
75049
|
init_provenance();
|
|
74649
75050
|
init_xcode_asset_symbols();
|
|
74650
|
-
sha2562 = (bytes) => (0,
|
|
75051
|
+
sha2562 = (bytes) => (0, import_node_crypto57.createHash)("sha256").update(bytes).digest("hex");
|
|
74651
75052
|
unprovenAssetSettings = [
|
|
74652
75053
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_FRAMEWORKS",
|
|
74653
75054
|
"ASSETCATALOG_COMPILER_GENERATE_ASSET_SYMBOL_WARNINGS",
|
|
@@ -75243,7 +75644,7 @@ function normalizedEnums(input) {
|
|
|
75243
75644
|
}
|
|
75244
75645
|
function localizationIdentifier(field, key2) {
|
|
75245
75646
|
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
75246
|
-
const digest3 = (0,
|
|
75647
|
+
const digest3 = (0, import_node_crypto58.createHash)("sha256").update(JSON.stringify([...field, key2])).digest();
|
|
75247
75648
|
return Array.from(
|
|
75248
75649
|
digest3.subarray(0, 6),
|
|
75249
75650
|
(byte) => alphabet[byte % alphabet.length]
|
|
@@ -75568,12 +75969,12 @@ function writeIntentDefinition(input, prefix) {
|
|
|
75568
75969
|
lines.push("</plist>", "");
|
|
75569
75970
|
return lines.join("\n");
|
|
75570
75971
|
}
|
|
75571
|
-
var import_strict4,
|
|
75972
|
+
var import_strict4, import_node_crypto58, typeMetadata, initializeMetadata, widgetArraySizes, defaultReasonMessages;
|
|
75572
75973
|
var init_metadata = __esm({
|
|
75573
75974
|
"src/intent-definition/metadata.ts"() {
|
|
75574
75975
|
"use strict";
|
|
75575
75976
|
import_strict4 = __toESM(require("node:assert/strict"), 1);
|
|
75576
|
-
|
|
75977
|
+
import_node_crypto58 = require("node:crypto");
|
|
75577
75978
|
init_fields();
|
|
75578
75979
|
init_hash_input();
|
|
75579
75980
|
init_siphash();
|
|
@@ -76282,7 +76683,7 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
76282
76683
|
if (prefix) identifier(prefix);
|
|
76283
76684
|
if (module2) identifier(module2);
|
|
76284
76685
|
const source = import_node_fs98.default.readFileSync(definition2);
|
|
76285
|
-
const key2 = (0,
|
|
76686
|
+
const key2 = (0, import_node_crypto59.createHash)("sha256").update(
|
|
76286
76687
|
JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
|
|
76287
76688
|
).update("\0").update(source).digest("hex");
|
|
76288
76689
|
const cache = import_node_path101.default.join(derivedDirectory, "IntentDefinitions");
|
|
@@ -76322,11 +76723,11 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
76322
76723
|
import_node_fs98.default.rmSync(stage, { recursive: true, force: true });
|
|
76323
76724
|
}
|
|
76324
76725
|
}
|
|
76325
|
-
var
|
|
76726
|
+
var import_node_crypto59, import_node_fs98, import_node_path101, intentCompilerRevision;
|
|
76326
76727
|
var init_xcode_intents = __esm({
|
|
76327
76728
|
"src/xcode-intents.ts"() {
|
|
76328
76729
|
"use strict";
|
|
76329
|
-
|
|
76730
|
+
import_node_crypto59 = require("node:crypto");
|
|
76330
76731
|
import_node_fs98 = __toESM(require("node:fs"), 1);
|
|
76331
76732
|
import_node_path101 = __toESM(require("node:path"), 1);
|
|
76332
76733
|
init_fields();
|
|
@@ -77028,7 +77429,7 @@ function loadProject(xcodeproj) {
|
|
|
77028
77429
|
if (!projectFile)
|
|
77029
77430
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
77030
77431
|
const source = import_node_fs99.default.readFileSync(projectFile, "utf8");
|
|
77031
|
-
const digest3 = (0,
|
|
77432
|
+
const digest3 = (0, import_node_crypto60.createHash)("sha256").update(source).digest("hex");
|
|
77032
77433
|
const cached4 = loaded3.get(projectFile);
|
|
77033
77434
|
if (cached4?.digest === digest3) return cached4.project;
|
|
77034
77435
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -77080,7 +77481,7 @@ function xcodeInstallationIdentity() {
|
|
|
77080
77481
|
if (!selected) return null;
|
|
77081
77482
|
const directory2 = import_node_path103.default.extname(selected) === ".app" ? import_node_path103.default.join(selected, "Contents", "Developer") : selected;
|
|
77082
77483
|
const versionFile = `${directory2}/../version.plist`;
|
|
77083
|
-
const version2 = import_node_fs99.default.existsSync(versionFile) ? (0,
|
|
77484
|
+
const version2 = import_node_fs99.default.existsSync(versionFile) ? (0, import_node_crypto60.createHash)("sha256").update(import_node_fs99.default.readFileSync(versionFile)).digest("hex") : null;
|
|
77084
77485
|
return { directory: directory2, version: version2 };
|
|
77085
77486
|
}
|
|
77086
77487
|
function defaultConfiguration(project2) {
|
|
@@ -77548,7 +77949,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
77548
77949
|
);
|
|
77549
77950
|
});
|
|
77550
77951
|
}
|
|
77551
|
-
const signature2 = (0,
|
|
77952
|
+
const signature2 = (0, import_node_crypto60.createHash)("sha256").update(
|
|
77552
77953
|
JSON.stringify([phase, [...settingKeys].map((key3) => [key3, settings(key3)])])
|
|
77553
77954
|
);
|
|
77554
77955
|
for (const file of inputFiles) {
|
|
@@ -77703,7 +78104,7 @@ ${output}`
|
|
|
77703
78104
|
const inputs2 = JSON.stringify([
|
|
77704
78105
|
1,
|
|
77705
78106
|
args,
|
|
77706
|
-
(0,
|
|
78107
|
+
(0, import_node_crypto60.createHash)("sha256").update(import_node_fs99.default.readFileSync(file)).digest("hex")
|
|
77707
78108
|
]);
|
|
77708
78109
|
const developer = settings("DEVELOPER_DIR");
|
|
77709
78110
|
const cached4 = import_node_fs99.default.existsSync(output) && import_node_fs99.default.existsSync(stamp) ? import_node_fs99.default.readFileSync(stamp, "utf8").split("\n") : [];
|
|
@@ -79206,12 +79607,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
79206
79607
|
cocoapods
|
|
79207
79608
|
};
|
|
79208
79609
|
}
|
|
79209
|
-
var import_node_child_process47,
|
|
79610
|
+
var import_node_child_process47, import_node_crypto60, import_node_fs99, 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;
|
|
79210
79611
|
var init_xcode_project = __esm({
|
|
79211
79612
|
"src/xcode-project.ts"() {
|
|
79212
79613
|
"use strict";
|
|
79213
79614
|
import_node_child_process47 = require("node:child_process");
|
|
79214
|
-
|
|
79615
|
+
import_node_crypto60 = require("node:crypto");
|
|
79215
79616
|
import_node_fs99 = __toESM(require("node:fs"), 1);
|
|
79216
79617
|
import_node_module9 = require("node:module");
|
|
79217
79618
|
import_node_path103 = __toESM(require("node:path"), 1);
|
|
@@ -79403,8 +79804,8 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
79403
79804
|
);
|
|
79404
79805
|
const appRelative = import_node_path104.default.relative(root, app);
|
|
79405
79806
|
const manifest = JSON.parse(import_node_fs100.default.readFileSync(import_node_path104.default.join(root, "package.json"), "utf8"));
|
|
79406
|
-
const hash = (0,
|
|
79407
|
-
const native = (0,
|
|
79807
|
+
const hash = (0, import_node_crypto61.createHash)("sha256");
|
|
79808
|
+
const native = (0, import_node_crypto61.createHash)("sha256");
|
|
79408
79809
|
const nativeDirectories = localPackageDirectories(root, app);
|
|
79409
79810
|
const versionFree = new Set(
|
|
79410
79811
|
nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
|
|
@@ -79488,7 +79889,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
79488
79889
|
unread.slice(start, start + 32).map(async ({ file, content }) => {
|
|
79489
79890
|
const bytes = await import_node_fs100.default.promises.readFile(file);
|
|
79490
79891
|
content.size = bytes.length;
|
|
79491
|
-
content.digest = (0,
|
|
79892
|
+
content.digest = (0, import_node_crypto61.createHash)("sha256").update(bytes).digest("hex");
|
|
79492
79893
|
fileDigests.set(file, content);
|
|
79493
79894
|
})
|
|
79494
79895
|
);
|
|
@@ -80038,7 +80439,7 @@ function stageCachedQuickCryptoOpenSsl(app) {
|
|
|
80038
80439
|
const sha2565 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
|
|
80039
80440
|
if (!sha2565) return;
|
|
80040
80441
|
const archive = import_node_path104.default.join(cacheDir(), "pod-archives", `${sha2565}.zip`);
|
|
80041
|
-
if (!import_node_fs100.default.existsSync(archive) || (0,
|
|
80442
|
+
if (!import_node_fs100.default.existsSync(archive) || (0, import_node_crypto61.createHash)("sha256").update(import_node_fs100.default.readFileSync(archive)).digest("hex") !== sha2565)
|
|
80042
80443
|
return;
|
|
80043
80444
|
import_node_fs100.default.rmSync(opensslDir, { recursive: true, force: true });
|
|
80044
80445
|
import_node_fs100.default.mkdirSync(opensslDir, { recursive: true });
|
|
@@ -80076,12 +80477,12 @@ ${failedOutputLine(command, cwd, bytes)}`
|
|
|
80076
80477
|
});
|
|
80077
80478
|
});
|
|
80078
80479
|
}
|
|
80079
|
-
var import_node_child_process48,
|
|
80480
|
+
var import_node_child_process48, import_node_crypto61, import_node_fs100, 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;
|
|
80080
80481
|
var init_expo_native_workspace = __esm({
|
|
80081
80482
|
"src/expo-native-workspace.ts"() {
|
|
80082
80483
|
"use strict";
|
|
80083
80484
|
import_node_child_process48 = require("node:child_process");
|
|
80084
|
-
|
|
80485
|
+
import_node_crypto61 = require("node:crypto");
|
|
80085
80486
|
import_node_fs100 = __toESM(require("node:fs"), 1);
|
|
80086
80487
|
import_node_module10 = require("node:module");
|
|
80087
80488
|
import_node_os21 = __toESM(require("node:os"), 1);
|
|
@@ -80154,7 +80555,7 @@ function run() {
|
|
|
80154
80555
|
|
|
80155
80556
|
// src/expo-discovery-cache.ts
|
|
80156
80557
|
function peachPin() {
|
|
80157
|
-
return (0,
|
|
80558
|
+
return (0, import_node_crypto62.createHash)("sha256").update(
|
|
80158
80559
|
`${FORMAT}\0${expoNativeCompilerDigestValue()}\0${swiftNativePin().distribution.id}\0`
|
|
80159
80560
|
).update(JSON.stringify([...EXPO_EAGER_NATIVE_VIEWS])).update(JSON.stringify([...peachAnsweredNativePackages()].sort())).digest("hex");
|
|
80160
80561
|
}
|
|
@@ -80168,7 +80569,7 @@ function stable(value) {
|
|
|
80168
80569
|
}
|
|
80169
80570
|
async function expoDiscoveryKey(options2) {
|
|
80170
80571
|
const { root, hash } = await hashExpoWorkspace(options2.appRoot, options2.signal);
|
|
80171
|
-
const key2 = (0,
|
|
80572
|
+
const key2 = (0, import_node_crypto62.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable(JSON.parse(options2.searchText))}\0`).update(`${stable(options2.configuration)}\0`).update(stable(JSON.parse(options2.resolveText))).digest("hex");
|
|
80172
80573
|
return { key: key2, root };
|
|
80173
80574
|
}
|
|
80174
80575
|
function expoDiscoveryCacheDir() {
|
|
@@ -80239,7 +80640,7 @@ function readExpoDiscovery(key2) {
|
|
|
80239
80640
|
if (typeof parsed2.archive !== "string" || !isDigest(parsed2.archive)) return void 0;
|
|
80240
80641
|
const archive = import_node_path105.default.join(expoDiscoveryCacheDir(), "blobs", `${parsed2.archive}.zst`);
|
|
80241
80642
|
const bytes = import_node_fs101.default.readFileSync(archive);
|
|
80242
|
-
if ((0,
|
|
80643
|
+
if ((0, import_node_crypto62.createHash)("sha256").update(bytes).digest("hex") !== parsed2.archive)
|
|
80243
80644
|
return void 0;
|
|
80244
80645
|
const bodies = (0, import_node_zlib7.zstdDecompressSync)(bytes);
|
|
80245
80646
|
const decoded = /* @__PURE__ */ new Map();
|
|
@@ -80313,7 +80714,7 @@ function stampedFileHash(file) {
|
|
|
80313
80714
|
const stamp = [stat2.dev, stat2.ino, stat2.size, stat2.mtimeNs, stat2.ctimeNs].join(":");
|
|
80314
80715
|
const cached4 = fileHashes.get(file);
|
|
80315
80716
|
if (cached4?.stamp === stamp) return cached4.checksum;
|
|
80316
|
-
const checksum = (0,
|
|
80717
|
+
const checksum = (0, import_node_crypto62.createHash)("sha256").update(import_node_fs101.default.readFileSync(file)).digest("hex");
|
|
80317
80718
|
fileHashes.set(file, { stamp, checksum });
|
|
80318
80719
|
fileHashesChanged = true;
|
|
80319
80720
|
return checksum;
|
|
@@ -80322,7 +80723,7 @@ function saveFileHashes() {
|
|
|
80322
80723
|
if (!fileHashesChanged) return;
|
|
80323
80724
|
fileHashesChanged = false;
|
|
80324
80725
|
const target = fileHashesPath();
|
|
80325
|
-
const temporary = `${target}.${process.pid}.${(0,
|
|
80726
|
+
const temporary = `${target}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`;
|
|
80326
80727
|
try {
|
|
80327
80728
|
import_node_fs101.default.mkdirSync(import_node_path105.default.dirname(target), { recursive: true });
|
|
80328
80729
|
import_node_fs101.default.writeFileSync(
|
|
@@ -80377,7 +80778,7 @@ function frameworkDigest(directory2, signal) {
|
|
|
80377
80778
|
if (target !== root && !target.startsWith(`${root}${import_node_path105.default.sep}`))
|
|
80378
80779
|
throw new Error(`framework link escapes its tree: ${relative6}`);
|
|
80379
80780
|
}
|
|
80380
|
-
return (0,
|
|
80781
|
+
return (0, import_node_crypto62.createHash)("sha256").update(JSON.stringify([...entries2])).digest("hex");
|
|
80381
80782
|
}
|
|
80382
80783
|
function rewritePreparedPaths(options2) {
|
|
80383
80784
|
const { units, sourceRoot, preparedRoot, signal } = options2;
|
|
@@ -80398,7 +80799,7 @@ function rewritePreparedPaths(options2) {
|
|
|
80398
80799
|
return null;
|
|
80399
80800
|
}
|
|
80400
80801
|
if (!preparedBytes.equals(sourceBytes)) return null;
|
|
80401
|
-
dependencies[sourceFile] = (0,
|
|
80802
|
+
dependencies[sourceFile] = (0, import_node_crypto62.createHash)("sha256").update(sourceBytes).digest("hex");
|
|
80402
80803
|
verifiedFiles.set(preparedFile, sourceFile);
|
|
80403
80804
|
return sourceFile;
|
|
80404
80805
|
};
|
|
@@ -80475,7 +80876,7 @@ function rewritePreparedPaths(options2) {
|
|
|
80475
80876
|
portableDir = import_node_path105.default.join(parent, import_node_path105.default.basename(dir));
|
|
80476
80877
|
if (!import_node_fs101.default.existsSync(portableDir)) {
|
|
80477
80878
|
import_node_fs101.default.mkdirSync(parent, { recursive: true });
|
|
80478
|
-
const tmp = import_node_path105.default.join(parent, `.${process.pid}.${(0,
|
|
80879
|
+
const tmp = import_node_path105.default.join(parent, `.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
|
|
80479
80880
|
try {
|
|
80480
80881
|
import_node_fs101.default.cpSync(dir, tmp, { recursive: true, verbatimSymlinks: true });
|
|
80481
80882
|
if (frameworkDigest(tmp, signal) !== preparedDigest)
|
|
@@ -80504,7 +80905,7 @@ function writeExpoDiscovery(options2) {
|
|
|
80504
80905
|
try {
|
|
80505
80906
|
const dir = expoDiscoveryCacheDir();
|
|
80506
80907
|
import_node_fs101.default.mkdirSync(dir, { recursive: true });
|
|
80507
|
-
const tmp = import_node_path105.default.join(dir, `.${options2.key}.${process.pid}.${(0,
|
|
80908
|
+
const tmp = import_node_path105.default.join(dir, `.${options2.key}.${process.pid}.${(0, import_node_crypto62.randomUUID)()}.tmp`);
|
|
80508
80909
|
if (options2.units === null) {
|
|
80509
80910
|
import_node_fs101.default.writeFileSync(
|
|
80510
80911
|
tmp,
|
|
@@ -80567,8 +80968,8 @@ function writeExpoDiscovery(options2) {
|
|
|
80567
80968
|
}
|
|
80568
80969
|
);
|
|
80569
80970
|
const contents2 = (0, import_node_zlib7.zstdCompressSync)(Buffer.concat(chunks, size2));
|
|
80570
|
-
const archive = (0,
|
|
80571
|
-
const temporary = import_node_path105.default.join(blobDir, "." + (0,
|
|
80971
|
+
const archive = (0, import_node_crypto62.createHash)("sha256").update(contents2).digest("hex");
|
|
80972
|
+
const temporary = import_node_path105.default.join(blobDir, "." + (0, import_node_crypto62.randomUUID)() + ".tmp");
|
|
80572
80973
|
try {
|
|
80573
80974
|
import_node_fs101.default.writeFileSync(temporary, contents2);
|
|
80574
80975
|
import_node_fs101.default.renameSync(temporary, import_node_path105.default.join(blobDir, `${archive}.zst`));
|
|
@@ -80595,11 +80996,11 @@ function writeExpoDiscovery(options2) {
|
|
|
80595
80996
|
return error instanceof Error ? error.message : String(error);
|
|
80596
80997
|
}
|
|
80597
80998
|
}
|
|
80598
|
-
var
|
|
80999
|
+
var import_node_crypto62, import_node_fs101, import_node_path105, import_node_zlib7, FORMAT, EXPIRY_MS, ORPHAN_TEMPORARY_MS, strings2, stringRecord, isDigest, digestRecord, isBodyOffset, isBodyOffsets, sourceLocationLine, fileHashes, fileHashesLoaded, fileHashesChanged, MISSING_TREE;
|
|
80599
81000
|
var init_expo_discovery_cache = __esm({
|
|
80600
81001
|
"src/expo-discovery-cache.ts"() {
|
|
80601
81002
|
"use strict";
|
|
80602
|
-
|
|
81003
|
+
import_node_crypto62 = require("node:crypto");
|
|
80603
81004
|
import_node_fs101 = __toESM(require("node:fs"), 1);
|
|
80604
81005
|
import_node_path105 = __toESM(require("node:path"), 1);
|
|
80605
81006
|
import_node_zlib7 = require("node:zlib");
|
|
@@ -81047,7 +81448,7 @@ function hashPackageTree(root, options2) {
|
|
|
81047
81448
|
}
|
|
81048
81449
|
};
|
|
81049
81450
|
walk4(root, "");
|
|
81050
|
-
const hash = (0,
|
|
81451
|
+
const hash = (0, import_node_crypto63.createHash)("sha256");
|
|
81051
81452
|
return (async () => {
|
|
81052
81453
|
for (let start = 0; start < files2.length; start += READ_AHEAD) {
|
|
81053
81454
|
const batch = files2.slice(start, start + READ_AHEAD);
|
|
@@ -81068,11 +81469,11 @@ function nativePackageTreeDigest(root) {
|
|
|
81068
81469
|
skipFile: (name3) => name3.endsWith(".d.ts") || name3.endsWith(".d.ts.map") || name3.endsWith(".js.map")
|
|
81069
81470
|
});
|
|
81070
81471
|
}
|
|
81071
|
-
var
|
|
81472
|
+
var import_node_crypto63, import_node_fs104, import_promises12, import_node_path108, READ_AHEAD;
|
|
81072
81473
|
var init_package_tree_digest = __esm({
|
|
81073
81474
|
"src/package-tree-digest.ts"() {
|
|
81074
81475
|
"use strict";
|
|
81075
|
-
|
|
81476
|
+
import_node_crypto63 = require("node:crypto");
|
|
81076
81477
|
import_node_fs104 = require("node:fs");
|
|
81077
81478
|
import_promises12 = require("node:fs/promises");
|
|
81078
81479
|
import_node_path108 = require("node:path");
|
|
@@ -81152,7 +81553,7 @@ async function expoNativeInputs(appRoot) {
|
|
|
81152
81553
|
"swift-pin": JSON.stringify(swiftNativePin()),
|
|
81153
81554
|
answered: JSON.stringify([...peachAnsweredNativePackages()].sort()),
|
|
81154
81555
|
"pods-environment": JSON.stringify(reactNativePodsEnvironment()),
|
|
81155
|
-
fingerprint: (0,
|
|
81556
|
+
fingerprint: (0, import_node_crypto64.createHash)("sha256").update(lines.sort().join("\n")).digest("hex")
|
|
81156
81557
|
},
|
|
81157
81558
|
packages
|
|
81158
81559
|
};
|
|
@@ -81270,7 +81671,7 @@ async function managedExpoNativeAppIdentity(appRoot, iosTarget) {
|
|
|
81270
81671
|
}
|
|
81271
81672
|
function servedExpoSwift(appRoot, entry, app) {
|
|
81272
81673
|
if (!entry.expoSwift) return null;
|
|
81273
|
-
const rootId = `${(0,
|
|
81674
|
+
const rootId = `${(0, import_node_crypto64.createHash)("sha256").update(import_node_fs105.default.realpathSync(appRoot)).digest("hex")}/Expo`;
|
|
81274
81675
|
if (app.infoPlist === null) throw new Error("the prebuilt app target has no Info.plist");
|
|
81275
81676
|
const installed2 = installedInfoPlist(app.infoPlist, entry.infoPlist);
|
|
81276
81677
|
const infoPlist2 = Buffer.from(installed2).toString("base64");
|
|
@@ -81298,11 +81699,11 @@ async function prebuiltExpoSwiftResult(appRoot, entry, signal) {
|
|
|
81298
81699
|
await prebuiltAppTarget(appRoot, signal, "installed")
|
|
81299
81700
|
);
|
|
81300
81701
|
}
|
|
81301
|
-
var
|
|
81702
|
+
var import_node_crypto64, import_node_fs105, import_node_module13, import_node_path109, import_node_util14, EXPO_NATIVE_ENTRY_NAME, IDENTITY_SOURCE_SKIPS, expoNativeEntryUrl, isStringRecord, isPlistArray, published, lookups, answers;
|
|
81302
81703
|
var init_expo_native_prebuilt = __esm({
|
|
81303
81704
|
"src/expo-native-prebuilt.ts"() {
|
|
81304
81705
|
"use strict";
|
|
81305
|
-
|
|
81706
|
+
import_node_crypto64 = require("node:crypto");
|
|
81306
81707
|
import_node_fs105 = __toESM(require("node:fs"), 1);
|
|
81307
81708
|
import_node_module13 = require("node:module");
|
|
81308
81709
|
import_node_path109 = __toESM(require("node:path"), 1);
|
|
@@ -81354,7 +81755,7 @@ function watchNativeInputs(root) {
|
|
|
81354
81755
|
(0, import_node_timers2.clearTimeout)(expiry);
|
|
81355
81756
|
for (const watcher of watchers) watcher.close();
|
|
81356
81757
|
}
|
|
81357
|
-
const inputs2 = { expiry, revision: (0,
|
|
81758
|
+
const inputs2 = { expiry, revision: (0, import_node_crypto65.randomUUID)() };
|
|
81358
81759
|
const watch3 = (directory2, recursive, name3) => {
|
|
81359
81760
|
const watcher = import_node_fs106.default.watch(
|
|
81360
81761
|
directory2,
|
|
@@ -81399,11 +81800,11 @@ function nativeInputRevision(root) {
|
|
|
81399
81800
|
const inputs2 = watchNativeInputs(root);
|
|
81400
81801
|
if (inputs2) return JSON.stringify([inputs2.revision, resolveActiveRuntimeRoot()]);
|
|
81401
81802
|
}
|
|
81402
|
-
var
|
|
81803
|
+
var import_node_crypto65, import_node_fs106, import_node_path110, import_node_timers2, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
|
|
81403
81804
|
var init_native_preparation = __esm({
|
|
81404
81805
|
"src/native-preparation.ts"() {
|
|
81405
81806
|
"use strict";
|
|
81406
|
-
|
|
81807
|
+
import_node_crypto65 = require("node:crypto");
|
|
81407
81808
|
import_node_fs106 = __toESM(require("node:fs"), 1);
|
|
81408
81809
|
import_node_path110 = __toESM(require("node:path"), 1);
|
|
81409
81810
|
import_node_timers2 = require("node:timers");
|
|
@@ -81583,7 +81984,7 @@ function nativeStaticLibraryEntry(recipe2, compiler, sdk2, distribution) {
|
|
|
81583
81984
|
return { name: recipe2.name, inputs: inputs2, key: nativeEntryKey(inputs2) };
|
|
81584
81985
|
}
|
|
81585
81986
|
function nativeStaticLibraryRecipe(bytes) {
|
|
81586
|
-
const digest3 = (0,
|
|
81987
|
+
const digest3 = (0, import_node_crypto66.createHash)("sha256").update(bytes).digest("hex");
|
|
81587
81988
|
return NATIVE_STATIC_LIBRARY_RECIPES.find((item) => item.nativeSha256 === digest3);
|
|
81588
81989
|
}
|
|
81589
81990
|
function nativeStaticLibrary(file, recipe2, moduleRoot) {
|
|
@@ -81626,7 +82027,7 @@ function isRustSymbol(name3, demangled) {
|
|
|
81626
82027
|
function rustStaticLibrary(file, moduleRoot) {
|
|
81627
82028
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
81628
82029
|
const bytes = import_node_fs108.default.readFileSync(file);
|
|
81629
|
-
const key2 = (0,
|
|
82030
|
+
const key2 = (0, import_node_crypto66.createHash)("sha256").update("rust-c-abi-v4\0").update(toolchain.release).update("\0").update(bytes).digest("hex");
|
|
81630
82031
|
const directory2 = import_node_path112.default.join(cacheDir(), "native-archives", key2);
|
|
81631
82032
|
const archive = import_node_path112.default.join(directory2, "library.a");
|
|
81632
82033
|
if (import_node_fs108.default.existsSync(archive)) return archive;
|
|
@@ -81655,7 +82056,7 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
81655
82056
|
const members2 = readArMembers(bytes, true);
|
|
81656
82057
|
const seen = /* @__PURE__ */ new Set();
|
|
81657
82058
|
const unique2 = members2.filter(({ name: name3, bytes: bytes2 }) => {
|
|
81658
|
-
const identity2 = name3 + "\0" + (0,
|
|
82059
|
+
const identity2 = name3 + "\0" + (0, import_node_crypto66.createHash)("sha256").update(bytes2).digest("hex");
|
|
81659
82060
|
if (seen.has(identity2)) return false;
|
|
81660
82061
|
seen.add(identity2);
|
|
81661
82062
|
return true;
|
|
@@ -81702,14 +82103,14 @@ function rustStaticLibrary(file, moduleRoot) {
|
|
|
81702
82103
|
function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
81703
82104
|
if (files2.length === 1) return files2[0];
|
|
81704
82105
|
const toolchain = swiftModuleToolchain(moduleRoot);
|
|
81705
|
-
const hash = (0,
|
|
82106
|
+
const hash = (0, import_node_crypto66.createHash)("sha256").update(toolchain.release);
|
|
81706
82107
|
for (const file of files2)
|
|
81707
82108
|
hash.update("\0").update(import_node_path112.default.basename(file)).update("\0").update(import_node_fs108.default.readFileSync(file));
|
|
81708
82109
|
const directory2 = import_node_path112.default.join(cacheDir(), "native-archives", hash.digest("hex"));
|
|
81709
82110
|
const archive = import_node_path112.default.join(directory2, "combined.a");
|
|
81710
82111
|
if (import_node_fs108.default.existsSync(archive)) return archive;
|
|
81711
82112
|
import_node_fs108.default.mkdirSync(directory2, { recursive: true });
|
|
81712
|
-
const temporary = import_node_path112.default.join(directory2, `combined-${(0,
|
|
82113
|
+
const temporary = import_node_path112.default.join(directory2, `combined-${(0, import_node_crypto66.randomUUID)()}.a`);
|
|
81713
82114
|
try {
|
|
81714
82115
|
(0, import_node_child_process50.execFileSync)(import_node_path112.default.join(toolchain.toolchainBin, "llvm-ar"), [
|
|
81715
82116
|
"qcsDL",
|
|
@@ -81722,12 +82123,12 @@ function combineNativeStaticLibraries(files2, moduleRoot) {
|
|
|
81722
82123
|
}
|
|
81723
82124
|
return archive;
|
|
81724
82125
|
}
|
|
81725
|
-
var import_node_child_process50,
|
|
82126
|
+
var import_node_child_process50, import_node_crypto66, import_node_fs108, import_node_path112, WEBRTC_NATIVE_FRAMEWORK, SIGNAL_WEBRTC_NATIVE_FRAMEWORK, WEBRTC_NATIVE_FRAMEWORK_RECIPES, NATIVE_STATIC_LIBRARY_RECIPES;
|
|
81726
82127
|
var init_native_static_libraries = __esm({
|
|
81727
82128
|
"src/native-static-libraries.ts"() {
|
|
81728
82129
|
"use strict";
|
|
81729
82130
|
import_node_child_process50 = require("node:child_process");
|
|
81730
|
-
|
|
82131
|
+
import_node_crypto66 = require("node:crypto");
|
|
81731
82132
|
import_node_fs108 = __toESM(require("node:fs"), 1);
|
|
81732
82133
|
import_node_path112 = __toESM(require("node:path"), 1);
|
|
81733
82134
|
init_home_paths();
|
|
@@ -82332,13 +82733,13 @@ var init_swift_wasm64_wamr = __esm({
|
|
|
82332
82733
|
|
|
82333
82734
|
// src/swift-wasm64-native-source.ts
|
|
82334
82735
|
function deriveSource(file, bytes, backport) {
|
|
82335
|
-
if (!backport || (0,
|
|
82736
|
+
if (!backport || (0, import_node_crypto67.createHash)("sha256").update(bytes).digest("hex") !== backport.originalSha256)
|
|
82336
82737
|
return null;
|
|
82337
82738
|
const source = bytes.toString("utf8");
|
|
82338
82739
|
const derived = Buffer.from(
|
|
82339
82740
|
"rewrite" in backport ? backport.rewrite(source) : source.replace(backport.before, backport.after)
|
|
82340
82741
|
);
|
|
82341
|
-
if ((0,
|
|
82742
|
+
if ((0, import_node_crypto67.createHash)("sha256").update(derived).digest("hex") !== backport.derivedSha256)
|
|
82342
82743
|
throw new Error(`Native source derivation differs: ${file}`);
|
|
82343
82744
|
return {
|
|
82344
82745
|
bytes: derived,
|
|
@@ -82357,11 +82758,11 @@ function deriveWasm64NativeSource(file, bytes) {
|
|
|
82357
82758
|
sourceDerivations.get(name3) ?? headerDerivations.get(name3)
|
|
82358
82759
|
);
|
|
82359
82760
|
}
|
|
82360
|
-
var
|
|
82761
|
+
var import_node_crypto67, import_node_path114, webrtcUnknownArchitecture, boringsslWordSize2, wamrCommit, headerDerivations, sourceDerivations;
|
|
82361
82762
|
var init_swift_wasm64_native_source = __esm({
|
|
82362
82763
|
"src/swift-wasm64-native-source.ts"() {
|
|
82363
82764
|
"use strict";
|
|
82364
|
-
|
|
82765
|
+
import_node_crypto67 = require("node:crypto");
|
|
82365
82766
|
import_node_path114 = __toESM(require("node:path"), 1);
|
|
82366
82767
|
init_swift_wasm64_wamr();
|
|
82367
82768
|
init_swiftWasm64ConfigContract();
|
|
@@ -82821,7 +83222,7 @@ var init_genrule_library_builds = __esm({
|
|
|
82821
83222
|
function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
82822
83223
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
82823
83224
|
const sdk2 = swiftSdkPaths(moduleRoot, toolchainBin);
|
|
82824
|
-
const identity2 = (0,
|
|
83225
|
+
const identity2 = (0, import_node_crypto68.createHash)("sha256").update(
|
|
82825
83226
|
JSON.stringify([
|
|
82826
83227
|
distribution?.id,
|
|
82827
83228
|
distribution?.link,
|
|
@@ -82847,7 +83248,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
82847
83248
|
for (const alias of product.frameworkAliases) {
|
|
82848
83249
|
if (alias.wasmSdkId !== distribution.wasmSdkId || alias.wasmSdkChecksum !== distribution.wasmSdkChecksum)
|
|
82849
83250
|
throw new Error(`framework SDK identity differs for ${alias.name}`);
|
|
82850
|
-
if ((0,
|
|
83251
|
+
if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs111.default.readFileSync(import_node_path116.default.join(moduleRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
82851
83252
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
82852
83253
|
const selected = /* @__PURE__ */ new Set();
|
|
82853
83254
|
const reach = (name3) => {
|
|
@@ -82888,7 +83289,7 @@ function nativeFrameworkCompiler(moduleRoot, toolchainBin, directory2) {
|
|
|
82888
83289
|
for (const alias of owner.frameworkAliases) {
|
|
82889
83290
|
if (frameworkResponses[alias.name])
|
|
82890
83291
|
throw new Error(`ambiguous declared framework ${alias.name}`);
|
|
82891
|
-
if ((0,
|
|
83292
|
+
if ((0, import_node_crypto68.createHash)("sha256").update(import_node_fs111.default.readFileSync(import_node_path116.default.join(sdkRoot, alias.moduleMap))).digest("hex") !== alias.moduleMapSha256)
|
|
82892
83293
|
throw new Error(`framework module map changed ${alias.moduleMap}`);
|
|
82893
83294
|
const file = import_node_path116.default.join(root, `${alias.name}.rsp`);
|
|
82894
83295
|
import_node_fs111.default.writeFileSync(file, aliasArtifacts.map(quote3).join("\n") + "\n");
|
|
@@ -82982,11 +83383,11 @@ exec ${shellQuote(configuration2.compiler)} "$@"
|
|
|
82982
83383
|
};
|
|
82983
83384
|
return { cc: compiler("clang"), cxx: compiler("clang++"), identity: identity2 };
|
|
82984
83385
|
}
|
|
82985
|
-
var
|
|
83386
|
+
var import_node_crypto68, import_node_fs111, import_node_path116, v7;
|
|
82986
83387
|
var init_native_framework_compiler = __esm({
|
|
82987
83388
|
"src/native-framework-compiler.ts"() {
|
|
82988
83389
|
"use strict";
|
|
82989
|
-
|
|
83390
|
+
import_node_crypto68 = require("node:crypto");
|
|
82990
83391
|
import_node_fs111 = __toESM(require("node:fs"), 1);
|
|
82991
83392
|
import_node_path116 = __toESM(require("node:path"), 1);
|
|
82992
83393
|
v7 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
@@ -83007,7 +83408,7 @@ function processAlive(pid) {
|
|
|
83007
83408
|
}
|
|
83008
83409
|
function tryAcquireNumberedLock(directory2, detail = "") {
|
|
83009
83410
|
(0, import_node_fs112.mkdirSync)(directory2, { recursive: true });
|
|
83010
|
-
const claim = (0, import_node_path117.join)(directory2, `claim-${process.pid}-${(0,
|
|
83411
|
+
const claim = (0, import_node_path117.join)(directory2, `claim-${process.pid}-${(0, import_node_crypto69.randomUUID)()}`);
|
|
83011
83412
|
for (; ; ) {
|
|
83012
83413
|
const numbers = (0, import_node_fs112.readdirSync)(directory2).filter((name3) => /^\d+$/.test(name3)).map(Number);
|
|
83013
83414
|
const top = Math.max(-1, ...numbers);
|
|
@@ -83046,11 +83447,11 @@ ${detail}` : ""}`);
|
|
|
83046
83447
|
};
|
|
83047
83448
|
}
|
|
83048
83449
|
}
|
|
83049
|
-
var
|
|
83450
|
+
var import_node_crypto69, import_node_fs112, import_node_path117, errorCode2;
|
|
83050
83451
|
var init_numbered_lock = __esm({
|
|
83051
83452
|
"src/numbered-lock.ts"() {
|
|
83052
83453
|
"use strict";
|
|
83053
|
-
|
|
83454
|
+
import_node_crypto69 = require("node:crypto");
|
|
83054
83455
|
import_node_fs112 = require("node:fs");
|
|
83055
83456
|
import_node_path117 = require("node:path");
|
|
83056
83457
|
errorCode2 = (error) => error instanceof Error && "code" in error ? error.code : void 0;
|
|
@@ -83077,7 +83478,7 @@ function llvmIdentity(toolchainBin, release) {
|
|
|
83077
83478
|
] : ["clang", "wasm-ld", "llvm-ar", "llvm-nm", "llvm-strip"].map(
|
|
83078
83479
|
(name3) => swiftFileChecksum(import_node_path118.default.join(toolchainBin, name3))
|
|
83079
83480
|
);
|
|
83080
|
-
const identity2 = (0,
|
|
83481
|
+
const identity2 = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(components)).digest("hex");
|
|
83081
83482
|
toolIdentities.set(toolchainBin, identity2);
|
|
83082
83483
|
return identity2;
|
|
83083
83484
|
}
|
|
@@ -83085,7 +83486,7 @@ function cSdkIdentity(sysroot, resourceDir, frameworks) {
|
|
|
83085
83486
|
const key2 = JSON.stringify([sysroot, resourceDir, frameworks]);
|
|
83086
83487
|
const cached4 = sysrootIdentities.get(key2);
|
|
83087
83488
|
if (cached4) return cached4;
|
|
83088
|
-
const hash = (0,
|
|
83489
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
83089
83490
|
const add = (root, relative6) => {
|
|
83090
83491
|
const file = import_node_path118.default.join(root, relative6);
|
|
83091
83492
|
const stat2 = import_node_fs113.default.statSync(file, { throwIfNoEntry: false });
|
|
@@ -83120,7 +83521,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
83120
83521
|
import_node_fs113.default.readFileSync(import_node_path118.default.join(moduleRoot, SWIFT_FRAMEWORK_PRODUCT_FILE), "utf8")
|
|
83121
83522
|
)
|
|
83122
83523
|
);
|
|
83123
|
-
const hash = (0,
|
|
83524
|
+
const hash = (0, import_node_crypto70.createHash)("sha256").update(
|
|
83124
83525
|
JSON.stringify([
|
|
83125
83526
|
headers,
|
|
83126
83527
|
distribution.link,
|
|
@@ -83130,7 +83531,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
83130
83531
|
])
|
|
83131
83532
|
);
|
|
83132
83533
|
const objects = distribution.objects.map((file) => [file, distribution.files[file]]);
|
|
83133
|
-
const objectKey = (0,
|
|
83534
|
+
const objectKey = (0, import_node_crypto70.createHash)("sha256").update(JSON.stringify(objects)).digest("hex");
|
|
83134
83535
|
const cache = import_node_path118.default.join(cacheDir4, "framework-symbols-by-object", objectKey);
|
|
83135
83536
|
if (!import_node_fs113.default.existsSync(cache)) {
|
|
83136
83537
|
import_node_fs113.default.mkdirSync(import_node_path118.default.dirname(cache), { recursive: true });
|
|
@@ -83165,7 +83566,7 @@ function frameworkProbeIdentity(moduleRoot, toolchainBin) {
|
|
|
83165
83566
|
const digest3 = import_node_path118.default.join(temporary, "digest");
|
|
83166
83567
|
import_node_fs113.default.writeFileSync(
|
|
83167
83568
|
digest3,
|
|
83168
|
-
(0,
|
|
83569
|
+
(0, import_node_crypto70.createHash)("sha256").update(symbols.sort().join("\n")).digest("hex")
|
|
83169
83570
|
);
|
|
83170
83571
|
import_node_fs113.default.renameSync(digest3, cache);
|
|
83171
83572
|
} finally {
|
|
@@ -83220,7 +83621,7 @@ function buildable(declaration) {
|
|
|
83220
83621
|
return builderOf(declaration) !== null && declaration.dependencies.every(buildable);
|
|
83221
83622
|
}
|
|
83222
83623
|
function declarationInputs(declaration, builder, toolchain, dependencyKeys) {
|
|
83223
|
-
const hash = (0,
|
|
83624
|
+
const hash = (0, import_node_crypto70.createHash)("sha256");
|
|
83224
83625
|
const files2 = declaration.sources.filter(
|
|
83225
83626
|
(source) => !source.generator && !source.file.split(import_node_path118.default.sep).includes(".git")
|
|
83226
83627
|
).map((source) => import_node_path118.default.relative(declaration.packageDir, source.file));
|
|
@@ -83354,12 +83755,12 @@ function genruleArchive(declaration, library, moduleRoot) {
|
|
|
83354
83755
|
}
|
|
83355
83756
|
return combined;
|
|
83356
83757
|
}
|
|
83357
|
-
var import_node_child_process53,
|
|
83758
|
+
var import_node_child_process53, import_node_crypto70, import_node_fs113, import_node_os23, import_node_path118, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
|
|
83358
83759
|
var init_genrule_archives = __esm({
|
|
83359
83760
|
"src/genrule-archives.ts"() {
|
|
83360
83761
|
"use strict";
|
|
83361
83762
|
import_node_child_process53 = require("node:child_process");
|
|
83362
|
-
|
|
83763
|
+
import_node_crypto70 = require("node:crypto");
|
|
83363
83764
|
import_node_fs113 = __toESM(require("node:fs"), 1);
|
|
83364
83765
|
import_node_os23 = __toESM(require("node:os"), 1);
|
|
83365
83766
|
import_node_path118 = __toESM(require("node:path"), 1);
|
|
@@ -83467,7 +83868,7 @@ function privateSentrySlice(entry, moduleRoot) {
|
|
|
83467
83868
|
function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact) {
|
|
83468
83869
|
if (standin.module !== SENTRY_SWIFT_SLICE.name) return standin;
|
|
83469
83870
|
const native = simulatorNativeLibrary(artifact());
|
|
83470
|
-
if (!native || (0,
|
|
83871
|
+
if (!native || (0, import_node_crypto71.createHash)("sha256").update(import_node_fs114.default.readFileSync(native.file)).digest("hex") !== SENTRY_SWIFT_SLICE.nativeSha256)
|
|
83471
83872
|
return standin;
|
|
83472
83873
|
if (configured)
|
|
83473
83874
|
throw new Error(
|
|
@@ -83525,12 +83926,12 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
|
|
|
83525
83926
|
}
|
|
83526
83927
|
};
|
|
83527
83928
|
}
|
|
83528
|
-
var import_node_child_process54,
|
|
83929
|
+
var import_node_child_process54, import_node_crypto71, import_node_fs114, import_node_os24, import_node_path119, SENTRY_SWIFT_SLICE;
|
|
83529
83930
|
var init_native_swift_slices = __esm({
|
|
83530
83931
|
"src/native-swift-slices.ts"() {
|
|
83531
83932
|
"use strict";
|
|
83532
83933
|
import_node_child_process54 = require("node:child_process");
|
|
83533
|
-
|
|
83934
|
+
import_node_crypto71 = require("node:crypto");
|
|
83534
83935
|
import_node_fs114 = __toESM(require("node:fs"), 1);
|
|
83535
83936
|
import_node_os24 = __toESM(require("node:os"), 1);
|
|
83536
83937
|
import_node_path119 = __toESM(require("node:path"), 1);
|
|
@@ -84338,7 +84739,7 @@ function treeDigest2(root) {
|
|
|
84338
84739
|
}).join("\n");
|
|
84339
84740
|
const memo2 = digests.get(`tree\0${root}`);
|
|
84340
84741
|
if (memo2?.stamp === stamp) return memo2.digest;
|
|
84341
|
-
const hash = (0,
|
|
84742
|
+
const hash = (0, import_node_crypto72.createHash)("sha256");
|
|
84342
84743
|
for (const name3 of names) {
|
|
84343
84744
|
hash.update(`${name3}\0`);
|
|
84344
84745
|
hash.update(import_node_fs118.default.readFileSync(import_node_path122.default.join(root, name3)));
|
|
@@ -84385,7 +84786,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
84385
84786
|
const found4 = locateXcframework(import_node_path122.default.join(dir, "tree"));
|
|
84386
84787
|
if (found4) return { dir: found4, digest: stored.sha };
|
|
84387
84788
|
}
|
|
84388
|
-
const sha2 = (0,
|
|
84789
|
+
const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs118.default.readFileSync(binary2.dir)).digest("hex");
|
|
84389
84790
|
if (sha2 !== stored?.sha || !locateXcframework(import_node_path122.default.join(dir, "tree"))) {
|
|
84390
84791
|
import_node_fs118.default.rmSync(dir, { recursive: true, force: true });
|
|
84391
84792
|
import_node_fs118.default.mkdirSync(import_node_path122.default.join(dir, "tree"), { recursive: true });
|
|
@@ -84397,7 +84798,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
84397
84798
|
return { dir: found3, digest: sha2 };
|
|
84398
84799
|
}
|
|
84399
84800
|
if (stored && import_node_fs118.default.existsSync(archive)) {
|
|
84400
|
-
const sha2 = (0,
|
|
84801
|
+
const sha2 = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs118.default.readFileSync(archive)).digest("hex");
|
|
84401
84802
|
if (sha2 !== expected)
|
|
84402
84803
|
throw new Error(`archive checksum ${sha2} is not the declared checksum ${expected}`);
|
|
84403
84804
|
const found3 = locateXcframework(import_node_path122.default.join(dir, "tree"));
|
|
@@ -84406,7 +84807,7 @@ function swiftBinaryFramework(binary2) {
|
|
|
84406
84807
|
import_node_fs118.default.rmSync(dir, { recursive: true, force: true });
|
|
84407
84808
|
import_node_fs118.default.mkdirSync(import_node_path122.default.join(dir, "tree"), { recursive: true });
|
|
84408
84809
|
exec("curl", ["-fsSL", "--retry", "2", "-o", archive, binary2.url]);
|
|
84409
|
-
const sha = (0,
|
|
84810
|
+
const sha = (0, import_node_crypto72.createHash)("sha256").update(import_node_fs118.default.readFileSync(archive)).digest("hex");
|
|
84410
84811
|
if (sha !== expected) {
|
|
84411
84812
|
import_node_fs118.default.rmSync(dir, { recursive: true, force: true });
|
|
84412
84813
|
throw new Error(`archive checksum ${sha} is not the declared checksum ${expected}`);
|
|
@@ -84531,7 +84932,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
84531
84932
|
});
|
|
84532
84933
|
}
|
|
84533
84934
|
}
|
|
84534
|
-
const declaredDigest = (0,
|
|
84935
|
+
const declaredDigest = (0, import_node_crypto72.createHash)("sha256");
|
|
84535
84936
|
for (const framework of providedFrameworks)
|
|
84536
84937
|
declaredDigest.update(`provided/${import_node_path122.default.relative(artifact.dir, framework)}\0`);
|
|
84537
84938
|
for (const [framework, { declared: names, imports: imports2, sdkHeader }] of declared)
|
|
@@ -84601,7 +85002,7 @@ function binaryHeaderSearchPaths(binary2, root, workspaceRoot2, declaredFramewor
|
|
|
84601
85002
|
import_node_fs118.default.copyFileSync(surface.modulemap, modulemap);
|
|
84602
85003
|
}
|
|
84603
85004
|
}
|
|
84604
|
-
const contents2 = (0,
|
|
85005
|
+
const contents2 = (0, import_node_crypto72.createHash)("sha256");
|
|
84605
85006
|
for (const framework of providedFrameworks.filter((item) => !declared.has(item))) {
|
|
84606
85007
|
const modulemap = import_node_path122.default.join(
|
|
84607
85008
|
pending2,
|
|
@@ -86016,7 +86417,7 @@ function crateSourceRoots(manifest, searchRoot) {
|
|
|
86016
86417
|
return roots;
|
|
86017
86418
|
}
|
|
86018
86419
|
function crateSourceDigest(manifest, searchRoot) {
|
|
86019
|
-
const hash = (0,
|
|
86420
|
+
const hash = (0, import_node_crypto72.createHash)("sha256");
|
|
86020
86421
|
const walk4 = (dir, root) => {
|
|
86021
86422
|
for (const entry of import_node_fs118.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name < right.name ? -1 : 1)) {
|
|
86022
86423
|
const full = import_node_path122.default.join(dir, entry.name);
|
|
@@ -86463,7 +86864,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
86463
86864
|
...swiftSources.flags,
|
|
86464
86865
|
...swiftSources.sources.flatMap((source) => [
|
|
86465
86866
|
source,
|
|
86466
|
-
(0,
|
|
86867
|
+
(0, import_node_crypto72.createHash)("sha256").update(import_node_fs118.default.readFileSync(import_node_path122.default.join(binary2.dir, source))).digest("hex")
|
|
86467
86868
|
])
|
|
86468
86869
|
);
|
|
86469
86870
|
continue;
|
|
@@ -86499,7 +86900,7 @@ function standinGenerationInputs(binaries, toolchain, configuredBehavior = {}, s
|
|
|
86499
86900
|
);
|
|
86500
86901
|
}
|
|
86501
86902
|
}
|
|
86502
|
-
return (0,
|
|
86903
|
+
return (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex");
|
|
86503
86904
|
}
|
|
86504
86905
|
function missingArtifactGap(binary2) {
|
|
86505
86906
|
if (swiftBinaryOnDisk(binary2)) return null;
|
|
@@ -86581,7 +86982,7 @@ ${roots.map((file) => ` header "${file}"`).join("\n")}
|
|
|
86581
86982
|
return NO_IMPORTABLE_SURFACE;
|
|
86582
86983
|
}
|
|
86583
86984
|
const configured = new Map(Object.entries(behavior));
|
|
86584
|
-
const hash = (0,
|
|
86985
|
+
const hash = (0, import_node_crypto72.createHash)("sha256").update(
|
|
86585
86986
|
standinGenerationInputs([binary2], toolchain, behavior)
|
|
86586
86987
|
);
|
|
86587
86988
|
hash.update(digest3);
|
|
@@ -86821,7 +87222,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
86821
87222
|
);
|
|
86822
87223
|
if (binary2.moduleSources !== void 0)
|
|
86823
87224
|
frameworkInputs.push(
|
|
86824
|
-
`${binary2.target}\0${(0,
|
|
87225
|
+
`${binary2.target}\0${(0, import_node_crypto72.createHash)("sha256").update(
|
|
86825
87226
|
[iosSdkId(), ...swiftSources.flags, ...swiftSources.sources, ...texts].join(
|
|
86826
87227
|
"\0"
|
|
86827
87228
|
)
|
|
@@ -86862,7 +87263,7 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
86862
87263
|
import_node_fs118.default.mkdirSync(sourceFrameworks);
|
|
86863
87264
|
const frameworks = {
|
|
86864
87265
|
dirs: [...frameworkDirs, sourceFrameworks].sort(),
|
|
86865
|
-
digest: (0,
|
|
87266
|
+
digest: (0, import_node_crypto72.createHash)("sha256").update(frameworkInputs.sort().join("\0")).digest("hex"),
|
|
86866
87267
|
surfaces: frameworkSurfaces
|
|
86867
87268
|
};
|
|
86868
87269
|
const siblings = new Map(
|
|
@@ -86981,12 +87382,12 @@ async function buildStandins(binaries, toolchain, provided, behavior) {
|
|
|
86981
87382
|
import_node_fs118.default.rmSync(modules, { recursive: true, force: true });
|
|
86982
87383
|
}
|
|
86983
87384
|
}
|
|
86984
|
-
var import_node_child_process56,
|
|
87385
|
+
var import_node_child_process56, import_node_crypto72, import_node_fs118, 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;
|
|
86985
87386
|
var init_swift_standins = __esm({
|
|
86986
87387
|
"src/swift-standins.ts"() {
|
|
86987
87388
|
"use strict";
|
|
86988
87389
|
import_node_child_process56 = require("node:child_process");
|
|
86989
|
-
|
|
87390
|
+
import_node_crypto72 = require("node:crypto");
|
|
86990
87391
|
import_node_fs118 = __toESM(require("node:fs"), 1);
|
|
86991
87392
|
import_node_path122 = __toESM(require("node:path"), 1);
|
|
86992
87393
|
init_forked_script_contract();
|
|
@@ -87016,7 +87417,7 @@ var init_swift_standins = __esm({
|
|
|
87016
87417
|
init_swiftTargetContract();
|
|
87017
87418
|
TRIPLE = SWIFT_WASM_TRIPLE;
|
|
87018
87419
|
cacheDir5 = import_node_path122.default.join(cacheDir(), "swift-standins");
|
|
87019
|
-
key = (...parts2) => (0,
|
|
87420
|
+
key = (...parts2) => (0, import_node_crypto72.createHash)("sha256").update(parts2.join("\0")).digest("hex").slice(0, 32);
|
|
87020
87421
|
digests = /* @__PURE__ */ new Map();
|
|
87021
87422
|
isBinaryLibraryFile = (file) => /\.(?:a|dylib|o|tbd)$/i.test(file);
|
|
87022
87423
|
OBJC_IMPORT = /#\s*(?:import|include)\s*[<"](?:[\w+-]+\/)?([\w+.-]+\.h)[>"]/g;
|
|
@@ -87176,10 +87577,10 @@ function compiledFrameworkImports(app, products) {
|
|
|
87176
87577
|
}
|
|
87177
87578
|
return imports2;
|
|
87178
87579
|
}
|
|
87179
|
-
function
|
|
87580
|
+
function sha256Hex6(bytes) {
|
|
87180
87581
|
if (typeof Bun !== "undefined")
|
|
87181
87582
|
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
87182
|
-
return (0,
|
|
87583
|
+
return (0, import_node_crypto73.createHash)("sha256").update(bytes).digest("hex");
|
|
87183
87584
|
}
|
|
87184
87585
|
function regularFileStamp(file) {
|
|
87185
87586
|
const stat2 = import_node_fs119.default.lstatSync(file, { bigint: true, throwIfNoEntry: false });
|
|
@@ -87194,7 +87595,7 @@ function verifyRetainedFile(work, file, hash, stamps) {
|
|
|
87194
87595
|
if (typeof expectedStamp === "string" && regularFileStamp(resolved) === expectedStamp)
|
|
87195
87596
|
return true;
|
|
87196
87597
|
if (!import_node_fs119.default.existsSync(resolved)) return false;
|
|
87197
|
-
return
|
|
87598
|
+
return sha256Hex6(readPackageFile(work, resolved, Infinity)) === hash;
|
|
87198
87599
|
}
|
|
87199
87600
|
function recordRetainedStamps(work, files2) {
|
|
87200
87601
|
const stamps = {};
|
|
@@ -87211,7 +87612,7 @@ function cachedBinaryFileDigest(file) {
|
|
|
87211
87612
|
const memory = binaryFileDigests.get(real);
|
|
87212
87613
|
if (memory?.stamp === stamp) return memory.digest;
|
|
87213
87614
|
const dir = import_node_path123.default.join(cacheDir(), "swift-binary-digests");
|
|
87214
|
-
const record6 = import_node_path123.default.join(dir, `${
|
|
87615
|
+
const record6 = import_node_path123.default.join(dir, `${sha256Hex6(real)}.json`);
|
|
87215
87616
|
if (import_node_fs119.default.existsSync(record6)) {
|
|
87216
87617
|
const saved = JSON.parse(import_node_fs119.default.readFileSync(record6, "utf8"));
|
|
87217
87618
|
if (isRecord(saved) && saved.stamp === stamp && typeof saved.digest === "string") {
|
|
@@ -87219,10 +87620,10 @@ function cachedBinaryFileDigest(file) {
|
|
|
87219
87620
|
return saved.digest;
|
|
87220
87621
|
}
|
|
87221
87622
|
}
|
|
87222
|
-
const digest3 =
|
|
87623
|
+
const digest3 = sha256Hex6(import_node_fs119.default.readFileSync(real));
|
|
87223
87624
|
binaryFileDigests.set(real, { stamp, digest: digest3 });
|
|
87224
87625
|
import_node_fs119.default.mkdirSync(dir, { recursive: true });
|
|
87225
|
-
const partial = `${record6}.${process.pid}.${(0,
|
|
87626
|
+
const partial = `${record6}.${process.pid}.${(0, import_node_crypto73.randomUUID)()}`;
|
|
87226
87627
|
import_node_fs119.default.writeFileSync(partial, JSON.stringify({ stamp, digest: digest3 }));
|
|
87227
87628
|
import_node_fs119.default.renameSync(partial, record6);
|
|
87228
87629
|
return digest3;
|
|
@@ -87754,7 +88155,7 @@ function prepareXcodeSwiftProducts(app, binaries, moduleRoot) {
|
|
|
87754
88155
|
const staged = withFrameworkCompanionImports(original);
|
|
87755
88156
|
if (staged !== original) sources.set(file, Buffer.from(staged));
|
|
87756
88157
|
}
|
|
87757
|
-
const digest3 =
|
|
88158
|
+
const digest3 = sha256Hex6;
|
|
87758
88159
|
const providers = /* @__PURE__ */ new Map();
|
|
87759
88160
|
for (const target of targets) {
|
|
87760
88161
|
if (!supplied.has(target.moduleName)) continue;
|
|
@@ -88110,7 +88511,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
88110
88511
|
products
|
|
88111
88512
|
);
|
|
88112
88513
|
const checkouts = remoteSwiftCheckouts(app.rootDir);
|
|
88113
|
-
const digest3 =
|
|
88514
|
+
const digest3 = sha256Hex6;
|
|
88114
88515
|
const inputs2 = Object.fromEntries(
|
|
88115
88516
|
[...sources].map(([file, bytes]) => [file, digest3(bytes)])
|
|
88116
88517
|
);
|
|
@@ -88392,6 +88793,7 @@ async function prepareXcodeNativeInputs(app, binaries, moduleRoot, purpose) {
|
|
|
88392
88793
|
...flags,
|
|
88393
88794
|
...target.prefix ? ["-include", staged(target.prefix)] : [],
|
|
88394
88795
|
"-Os",
|
|
88796
|
+
...purpose === "objects" ? ["-g0"] : [],
|
|
88395
88797
|
"-c",
|
|
88396
88798
|
staged(file),
|
|
88397
88799
|
"-o",
|
|
@@ -88491,12 +88893,12 @@ ${reported.trimEnd() || `Clang exited with status ${result.status}`}`;
|
|
|
88491
88893
|
import_node_fs119.default.closeSync(descriptor);
|
|
88492
88894
|
}
|
|
88493
88895
|
}
|
|
88494
|
-
var import_node_child_process57,
|
|
88896
|
+
var import_node_child_process57, import_node_crypto73, import_node_fs119, import_node_path123, SwiftObjCCompilationError, isDirectory4, isSdkInclude, FRAMEWORK_IMPORT, OWN_IMPORT, binaryFileDigests, objcInputSnapshots;
|
|
88495
88897
|
var init_swift_objc_compile = __esm({
|
|
88496
88898
|
"src/swift-objc-compile.ts"() {
|
|
88497
88899
|
"use strict";
|
|
88498
88900
|
import_node_child_process57 = require("node:child_process");
|
|
88499
|
-
|
|
88901
|
+
import_node_crypto73 = require("node:crypto");
|
|
88500
88902
|
import_node_fs119 = __toESM(require("node:fs"), 1);
|
|
88501
88903
|
import_node_path123 = __toESM(require("node:path"), 1);
|
|
88502
88904
|
init_mapLimit();
|
|
@@ -92661,11 +93063,11 @@ function coreDataModelDirectories(files2) {
|
|
|
92661
93063
|
}
|
|
92662
93064
|
return [...models].sort();
|
|
92663
93065
|
}
|
|
92664
|
-
var
|
|
93066
|
+
var import_node_crypto74, import_node_fs123, import_node_path127, attributeTypes, deleteRules, EXTERNAL_BINARY, PRESERVE_AFTER_DELETION, yes, common, uid, NULL, classChains, KeyedArchive, sha2563;
|
|
92665
93067
|
var init_core_data_model = __esm({
|
|
92666
93068
|
"src/core-data-model.ts"() {
|
|
92667
93069
|
"use strict";
|
|
92668
|
-
|
|
93070
|
+
import_node_crypto74 = require("node:crypto");
|
|
92669
93071
|
import_node_fs123 = require("node:fs");
|
|
92670
93072
|
import_node_path127 = __toESM(require("node:path"), 1);
|
|
92671
93073
|
init_core_data_entity_classes();
|
|
@@ -92784,7 +93186,7 @@ var init_core_data_model = __esm({
|
|
|
92784
93186
|
});
|
|
92785
93187
|
}
|
|
92786
93188
|
};
|
|
92787
|
-
sha2563 = (...parts2) => (0,
|
|
93189
|
+
sha2563 = (...parts2) => (0, import_node_crypto74.createHash)("sha256").update(
|
|
92788
93190
|
Buffer.concat(
|
|
92789
93191
|
parts2.map(
|
|
92790
93192
|
(part) => Array.isArray(part) ? Buffer.from(part) : Buffer.from(part)
|
|
@@ -94976,7 +95378,7 @@ async function buildRiveRuntimeDependencies(checkout, moduleRoot) {
|
|
|
94976
95378
|
];
|
|
94977
95379
|
const objc = [...swiftObjCRuntimeFlags, "-fobjc-exceptions"];
|
|
94978
95380
|
const xcode = (0, import_node_child_process59.execFileSync)("xcodebuild", ["-version"], { encoding: "utf8" });
|
|
94979
|
-
const key2 = (0,
|
|
95381
|
+
const key2 = (0, import_node_crypto75.createHash)("sha256").update(
|
|
94980
95382
|
JSON.stringify([
|
|
94981
95383
|
RECIPE,
|
|
94982
95384
|
(0, import_node_child_process59.execFileSync)("git", ["-C", runtime, "rev-parse", "HEAD"], {
|
|
@@ -95187,12 +95589,12 @@ exec ${quote3(import_node_path128.default.join(toolchainBin, "llvm-ar"))} rcs "$
|
|
|
95187
95589
|
);
|
|
95188
95590
|
return directory2;
|
|
95189
95591
|
}
|
|
95190
|
-
var import_node_child_process59,
|
|
95592
|
+
var import_node_child_process59, import_node_crypto75, import_node_fs124, import_node_os25, import_node_path128, import_promises14, RECIPE, CONFIG, RUNTIME_LIBRARIES;
|
|
95191
95593
|
var init_rive_runtime_dependencies = __esm({
|
|
95192
95594
|
"src/rive-runtime-dependencies.ts"() {
|
|
95193
95595
|
"use strict";
|
|
95194
95596
|
import_node_child_process59 = require("node:child_process");
|
|
95195
|
-
|
|
95597
|
+
import_node_crypto75 = require("node:crypto");
|
|
95196
95598
|
import_node_fs124 = __toESM(require("node:fs"), 1);
|
|
95197
95599
|
import_node_os25 = __toESM(require("node:os"), 1);
|
|
95198
95600
|
import_node_path128 = __toESM(require("node:path"), 1);
|
|
@@ -96049,7 +96451,7 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
96049
96451
|
(binary2) => binary2.publicHeaders === void 0 && binary2.placeholder === void 0 && swiftBinaryOnDisk(binary2) && binaryHeaderSearchPaths(binary2, staged, app.rootDir).headers.length === 1
|
|
96050
96452
|
))
|
|
96051
96453
|
return [...binaries];
|
|
96052
|
-
const hash = (0,
|
|
96454
|
+
const hash = (0, import_node_crypto76.createHash)("sha256");
|
|
96053
96455
|
hash.update(
|
|
96054
96456
|
JSON.stringify([
|
|
96055
96457
|
inputs2.targets,
|
|
@@ -96258,12 +96660,12 @@ async function xcodeCxxReachable(app, binaries, moduleRoot, clang) {
|
|
|
96258
96660
|
);
|
|
96259
96661
|
return result;
|
|
96260
96662
|
}
|
|
96261
|
-
var import_node_child_process61,
|
|
96663
|
+
var import_node_child_process61, import_node_crypto76, import_node_fs126, import_node_path130, cachedInputs;
|
|
96262
96664
|
var init_swift_cxx_reachable = __esm({
|
|
96263
96665
|
"src/swift-cxx-reachable.ts"() {
|
|
96264
96666
|
"use strict";
|
|
96265
96667
|
import_node_child_process61 = require("node:child_process");
|
|
96266
|
-
|
|
96668
|
+
import_node_crypto76 = require("node:crypto");
|
|
96267
96669
|
import_node_fs126 = __toESM(require("node:fs"), 1);
|
|
96268
96670
|
import_node_path130 = __toESM(require("node:path"), 1);
|
|
96269
96671
|
init_is_record();
|
|
@@ -96754,7 +97156,7 @@ function fetchSwiftSdkDataPlan({ url, dataPlan }) {
|
|
|
96754
97156
|
if (!response.ok)
|
|
96755
97157
|
throw new Error(`Swift SDK data plan ${address} answered ${response.status}`);
|
|
96756
97158
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
96757
|
-
if ((0,
|
|
97159
|
+
if ((0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex") !== dataPlan)
|
|
96758
97160
|
throw new Error(`Swift SDK data plan ${address} failed its digest check`);
|
|
96759
97161
|
return bytes;
|
|
96760
97162
|
});
|
|
@@ -96859,7 +97261,7 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
96859
97261
|
encode2(now),
|
|
96860
97262
|
encodeNativeSdkLater({
|
|
96861
97263
|
files: later.map((bytes) => ({
|
|
96862
|
-
sha256: (0,
|
|
97264
|
+
sha256: (0, import_node_crypto77.createHash)("sha256").update(bytes).digest("hex"),
|
|
96863
97265
|
byteLength: bytes.length
|
|
96864
97266
|
})),
|
|
96865
97267
|
...needs && {
|
|
@@ -96875,11 +97277,11 @@ function splitSwiftSdkLaterData(directory2, binding, plan) {
|
|
|
96875
97277
|
later
|
|
96876
97278
|
};
|
|
96877
97279
|
}
|
|
96878
|
-
var
|
|
97280
|
+
var import_node_crypto77, ADDRESS_REACH, sdkPieces, firstAtOrAfter, pieceAt, LATER_GROUP_BYTES, MAX_LATER_GROUPS, publishedPlans;
|
|
96879
97281
|
var init_swift_sdk_later_data = __esm({
|
|
96880
97282
|
"src/swift-sdk-later-data.ts"() {
|
|
96881
97283
|
"use strict";
|
|
96882
|
-
|
|
97284
|
+
import_node_crypto77 = require("node:crypto");
|
|
96883
97285
|
init_nativeSdkBindingContract();
|
|
96884
97286
|
init_nativeWasmContract();
|
|
96885
97287
|
init_swift_sdk_image();
|
|
@@ -97477,7 +97879,7 @@ function gpuChromeLaunchOptions(opts = {}, runtime = currentRuntime()) {
|
|
|
97477
97879
|
async function launchWithPauseAwareDeadline(launch, opts) {
|
|
97478
97880
|
const budget = typeof opts.timeout === "number" ? opts.timeout : DEFAULT_LAUNCH_TIMEOUT_MS;
|
|
97479
97881
|
if (budget === 0) return launch(opts);
|
|
97480
|
-
const marker = `--peach-launch-id=${(0,
|
|
97882
|
+
const marker = `--peach-launch-id=${(0, import_node_crypto78.randomUUID)()}`;
|
|
97481
97883
|
let expired = false;
|
|
97482
97884
|
const cleanupAttempted = [];
|
|
97483
97885
|
const lookupFailed = [];
|
|
@@ -97634,13 +98036,13 @@ async function launchReapedChrome(launch, opts = {}, rendererTarget, policy = {}
|
|
|
97634
98036
|
policy.admission
|
|
97635
98037
|
);
|
|
97636
98038
|
}
|
|
97637
|
-
var childProcess, import_node_child_process64,
|
|
98039
|
+
var childProcess, import_node_child_process64, import_node_crypto78, fs79, os22, path115, LINUX_CHROME_SCOPE_ENV, discoveredChromePids, discoveredChromeProcesses, reapPids, installed, signalShutdownClaimed, PLAYWRIGHT_DISABLED_FEATURES, PLAYWRIGHT_ENABLED_FEATURES, DISABLED_FEATURES, DEFAULT_LAUNCH_TIMEOUT_MS;
|
|
97638
98040
|
var init_reap_browser = __esm({
|
|
97639
98041
|
"src/reap-browser.ts"() {
|
|
97640
98042
|
"use strict";
|
|
97641
98043
|
childProcess = __toESM(require("node:child_process"), 1);
|
|
97642
98044
|
import_node_child_process64 = require("node:child_process");
|
|
97643
|
-
|
|
98045
|
+
import_node_crypto78 = require("node:crypto");
|
|
97644
98046
|
fs79 = __toESM(require("node:fs"), 1);
|
|
97645
98047
|
os22 = __toESM(require("node:os"), 1);
|
|
97646
98048
|
path115 = __toESM(require("node:path"), 1);
|
|
@@ -99148,7 +99550,7 @@ async function splitNativeWasm(input, directory2, profile, binaryen, shared, kee
|
|
|
99148
99550
|
const part = await guard((0, import_node_path133.join)(directory2, `side-${id}.wasm`), lazy, env);
|
|
99149
99551
|
const bytes = (0, import_node_fs131.readFileSync)(part.file);
|
|
99150
99552
|
assertWasmCodeOnly(bytes);
|
|
99151
|
-
return { ...part, slots: slots2, sha256: (0,
|
|
99553
|
+
return { ...part, slots: slots2, sha256: (0, import_node_crypto79.createHash)("sha256").update(bytes).digest("hex") };
|
|
99152
99554
|
}
|
|
99153
99555
|
);
|
|
99154
99556
|
const dyldGroups = parts2.flatMap(
|
|
@@ -99216,12 +99618,12 @@ function describePart(file) {
|
|
|
99216
99618
|
);
|
|
99217
99619
|
return { file, functions, byteLength: bytes.byteLength };
|
|
99218
99620
|
}
|
|
99219
|
-
var import_node_child_process66,
|
|
99621
|
+
var import_node_child_process66, import_node_crypto79, import_node_fs131, import_node_os27, import_node_path133, import_node_util16, run10, MAX_MODULE_FUNCTIONS, MAX_START_FUNCTIONS, SIDE_FUNCTIONS, SIDE_CODE_BYTES, FEATURES2, featuresOf;
|
|
99220
99622
|
var init_wasm_lazy_split = __esm({
|
|
99221
99623
|
"src/wasm-lazy-split.ts"() {
|
|
99222
99624
|
"use strict";
|
|
99223
99625
|
import_node_child_process66 = require("node:child_process");
|
|
99224
|
-
|
|
99626
|
+
import_node_crypto79 = require("node:crypto");
|
|
99225
99627
|
import_node_fs131 = require("node:fs");
|
|
99226
99628
|
import_node_os27 = require("node:os");
|
|
99227
99629
|
import_node_path133 = require("node:path");
|
|
@@ -99658,11 +100060,11 @@ async function bootSwiftPreview(launch, profile) {
|
|
|
99658
100060
|
server.close();
|
|
99659
100061
|
}
|
|
99660
100062
|
}
|
|
99661
|
-
var
|
|
100063
|
+
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;
|
|
99662
100064
|
var init_swift_startup_split = __esm({
|
|
99663
100065
|
"src/swift-startup-split.ts"() {
|
|
99664
100066
|
"use strict";
|
|
99665
|
-
|
|
100067
|
+
import_node_crypto80 = require("node:crypto");
|
|
99666
100068
|
import_node_fs132 = require("node:fs");
|
|
99667
100069
|
import_node_http3 = require("node:http");
|
|
99668
100070
|
import_node_https2 = require("node:https");
|
|
@@ -99687,7 +100089,7 @@ var init_swift_startup_split = __esm({
|
|
|
99687
100089
|
appPath = "/__peach/swift/startup.wasm";
|
|
99688
100090
|
profileWindowMs = 3e4;
|
|
99689
100091
|
profileQuietMs = 2e3;
|
|
99690
|
-
digest2 = (bytes) => (0,
|
|
100092
|
+
digest2 = (bytes) => (0, import_node_crypto80.createHash)("sha256").update(bytes).digest("hex");
|
|
99691
100093
|
partDigest = /^[a-f0-9]{64}$/;
|
|
99692
100094
|
platform = `${process.platform}-${process.arch}`;
|
|
99693
100095
|
}
|
|
@@ -99731,7 +100133,7 @@ function* filesUnder(absolute) {
|
|
|
99731
100133
|
}
|
|
99732
100134
|
function hashFile(absolutePath) {
|
|
99733
100135
|
try {
|
|
99734
|
-
return (0,
|
|
100136
|
+
return (0, import_node_crypto81.createHash)("sha1").update((0, import_node_fs133.readFileSync)(absolutePath)).digest("hex");
|
|
99735
100137
|
} catch {
|
|
99736
100138
|
return null;
|
|
99737
100139
|
}
|
|
@@ -99865,11 +100267,11 @@ function findStaleRoutes(monorepoRoot, routes2) {
|
|
|
99865
100267
|
}
|
|
99866
100268
|
return stale;
|
|
99867
100269
|
}
|
|
99868
|
-
var
|
|
100270
|
+
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;
|
|
99869
100271
|
var init_dev_build_freshness = __esm({
|
|
99870
100272
|
"cli/dev-build-freshness.ts"() {
|
|
99871
100273
|
"use strict";
|
|
99872
|
-
|
|
100274
|
+
import_node_crypto81 = require("node:crypto");
|
|
99873
100275
|
import_node_fs133 = require("node:fs");
|
|
99874
100276
|
import_node_path135 = require("node:path");
|
|
99875
100277
|
DEV_BUILD_REBUILD_COMMAND = "bun run build:peach";
|
|
@@ -99996,7 +100398,7 @@ function nativeSourceFiles(packagePath) {
|
|
|
99996
100398
|
function swiftArtifactContentDigest(bytes) {
|
|
99997
100399
|
let digest3 = swiftArtifactDigests.get(bytes);
|
|
99998
100400
|
if (!digest3) {
|
|
99999
|
-
digest3 = (0,
|
|
100401
|
+
digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
100000
100402
|
swiftArtifactDigests.set(bytes, digest3);
|
|
100001
100403
|
}
|
|
100002
100404
|
return digest3;
|
|
@@ -100124,7 +100526,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
100124
100526
|
const clang = import_node_path136.default.join(toolchainBin, "clang");
|
|
100125
100527
|
const empty = (binary2, file) => {
|
|
100126
100528
|
const source = import_node_path136.default.join(binary2.dir, file);
|
|
100127
|
-
const key2 = (0,
|
|
100529
|
+
const key2 = (0, import_node_crypto82.createHash)("sha256").update(
|
|
100128
100530
|
JSON.stringify([
|
|
100129
100531
|
clang,
|
|
100130
100532
|
sdk2.sysroot,
|
|
@@ -100169,7 +100571,7 @@ async function wasmPortableAssembly(binaries, toolchainBin, moduleRoot) {
|
|
|
100169
100571
|
return new Set(portable.flat());
|
|
100170
100572
|
}
|
|
100171
100573
|
async function swiftPackages(entry, app) {
|
|
100172
|
-
const stamp = (file) => import_node_fs134.default.existsSync(file) ? (0,
|
|
100574
|
+
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;
|
|
100173
100575
|
const owners = [...app.frameworks, app].map((target) => ({
|
|
100174
100576
|
module: target.moduleName,
|
|
100175
100577
|
products: target.packageProducts ?? []
|
|
@@ -101333,7 +101735,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
101333
101735
|
const source = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(
|
|
101334
101736
|
bytes
|
|
101335
101737
|
);
|
|
101336
|
-
const sha2565 = (0,
|
|
101738
|
+
const sha2565 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
101337
101739
|
const bundle = swiftResourceBundleForFile(bundles, key2);
|
|
101338
101740
|
if (!bundle && inputs2["Package.swift"])
|
|
101339
101741
|
throw new Error(`metal source ${key2} has no resource target bundle`);
|
|
@@ -101356,7 +101758,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
101356
101758
|
const bytes = readPackageFile2(project2.packagePath, disk, limits.imageBytes);
|
|
101357
101759
|
pdfs.set(file, {
|
|
101358
101760
|
file: disk,
|
|
101359
|
-
sha256: (0,
|
|
101761
|
+
sha256: (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex")
|
|
101360
101762
|
});
|
|
101361
101763
|
}
|
|
101362
101764
|
const pdfRasters = rasterizePdfFiles([...pdfs.values()], limits);
|
|
@@ -101402,7 +101804,7 @@ async function buildSwiftResourceTable(project2, baseUrl, inputs2) {
|
|
|
101402
101804
|
throw new Error("swift image pack exceeds the compile service caps");
|
|
101403
101805
|
}
|
|
101404
101806
|
imageBytes += bytes.length;
|
|
101405
|
-
const hash = (0,
|
|
101807
|
+
const hash = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex").slice(0, 16);
|
|
101406
101808
|
const bundle = table[bundlePath] ?? /* @__PURE__ */ Object.create(null);
|
|
101407
101809
|
const pixelSize = ext === ".png" ? readPngDimensions(bytes) : null;
|
|
101408
101810
|
const variant2 = {
|
|
@@ -101712,7 +102114,7 @@ function updateSwiftConfigStamp(hash, packagePath) {
|
|
|
101712
102114
|
hash.update(JSON.stringify(gates.map((name3) => swiftWasm64PlatformGates[name3])));
|
|
101713
102115
|
}
|
|
101714
102116
|
function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
101715
|
-
const hash = (0,
|
|
102117
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
101716
102118
|
hash.update(packagePath);
|
|
101717
102119
|
updateSwiftConfigStamp(hash, packagePath);
|
|
101718
102120
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -101741,7 +102143,7 @@ function sourceStamp(packagePath, moduleRootOverride, hosted = false) {
|
|
|
101741
102143
|
return hash.digest("hex").slice(0, 16);
|
|
101742
102144
|
}
|
|
101743
102145
|
function sourceContentStamp(packagePath, moduleRootOverride) {
|
|
101744
|
-
const hash = (0,
|
|
102146
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
101745
102147
|
hash.update(compilerSourceDigest);
|
|
101746
102148
|
updateSwiftConfigStamp(hash, packagePath);
|
|
101747
102149
|
const libraries = projects().get(packagePath)?.libraries;
|
|
@@ -101773,7 +102175,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
101773
102175
|
(root) => import_node_fs134.default.existsSync(import_node_path136.default.join(root, "toolchain.json"))
|
|
101774
102176
|
);
|
|
101775
102177
|
if (!moduleRoot) return "";
|
|
101776
|
-
const hash = (0,
|
|
102178
|
+
const hash = (0, import_node_crypto82.createHash)("sha256");
|
|
101777
102179
|
hash.update(moduleRoot);
|
|
101778
102180
|
for (const relative6 of swiftModuleInputFiles(moduleRoot)) {
|
|
101779
102181
|
hash.update(relative6);
|
|
@@ -101783,7 +102185,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
101783
102185
|
}
|
|
101784
102186
|
function otherInputs(input, standalone) {
|
|
101785
102187
|
const { files: _files, ...rest } = input;
|
|
101786
|
-
return (0,
|
|
102188
|
+
return (0, import_node_crypto82.createHash)("sha256").update(JSON.stringify({ ...rest, standalone })).digest("hex");
|
|
101787
102189
|
}
|
|
101788
102190
|
function icuUrl(origin, artifact) {
|
|
101789
102191
|
return "url" in artifact.icu ? artifact.icu.url : `${origin}${ICU_PATH}${swiftIcuAddress(artifact.icu)}`;
|
|
@@ -101798,7 +102200,7 @@ function standinLibraries(binaries, standins, rootDir, toolchain, rustWasm64) {
|
|
|
101798
102200
|
for (const standin of standins) {
|
|
101799
102201
|
if (!standin.prebuilt) continue;
|
|
101800
102202
|
const bytes = Buffer.from(standin.prebuilt.library, "base64");
|
|
101801
|
-
const digest3 = (0,
|
|
102203
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex");
|
|
101802
102204
|
const dir = import_node_path136.default.join(swiftCacheDir(), "native-archives", digest3);
|
|
101803
102205
|
import_node_fs134.default.mkdirSync(dir, { recursive: true });
|
|
101804
102206
|
const library = import_node_path136.default.join(dir, `lib${standin.module}.a`);
|
|
@@ -102147,7 +102549,7 @@ function swiftBuildRoot(packagePath, moduleRoot) {
|
|
|
102147
102549
|
return import_node_path136.default.join(
|
|
102148
102550
|
swiftCacheDir(),
|
|
102149
102551
|
"swift-builds",
|
|
102150
|
-
(0,
|
|
102552
|
+
(0, import_node_crypto82.createHash)("sha256").update(`${compilerKey}\0${buildKeyPath}`).digest("hex").slice(0, 16)
|
|
102151
102553
|
);
|
|
102152
102554
|
}
|
|
102153
102555
|
function installedWorkspaceInput(packagePath, entry, moduleRoot) {
|
|
@@ -102448,7 +102850,7 @@ async function fetchSwiftDyldTable(moduleUrl, module2, signal) {
|
|
|
102448
102850
|
const response = await fetch(url, { signal });
|
|
102449
102851
|
if (!response.ok) throw new Error(`swift compile: ${url} answered ${response.status}`);
|
|
102450
102852
|
const bytes = Buffer.from(await response.arrayBuffer());
|
|
102451
|
-
if (bytes.length !== byteLength || (0,
|
|
102853
|
+
if (bytes.length !== byteLength || (0, import_node_crypto82.createHash)("sha256").update(bytes).digest("hex") !== sha2565)
|
|
102452
102854
|
throw new Error(`swift compile: ${url} does not match its module's index`);
|
|
102453
102855
|
return { dyldTable: { sha256: sha2565, bytes } };
|
|
102454
102856
|
}
|
|
@@ -102711,10 +103113,10 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
|
102711
103113
|
sdk2.binding.bytes,
|
|
102712
103114
|
plan
|
|
102713
103115
|
);
|
|
102714
|
-
const digest3 = (0,
|
|
103116
|
+
const digest3 = (0, import_node_crypto82.createHash)("sha256").update(split.binding).digest("hex");
|
|
102715
103117
|
sdkBindingFiles.set(digest3, split.binding);
|
|
102716
103118
|
for (const later of split.later)
|
|
102717
|
-
sdkBindingFiles.set((0,
|
|
103119
|
+
sdkBindingFiles.set((0, import_node_crypto82.createHash)("sha256").update(later).digest("hex"), later);
|
|
102718
103120
|
sdkSplitBindings.set(key2, digest3);
|
|
102719
103121
|
}
|
|
102720
103122
|
function swiftCodePartAssets(origin, appParts, sdkDigest) {
|
|
@@ -102781,7 +103183,7 @@ function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
|
102781
103183
|
function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch, runtimeRootOverride) {
|
|
102782
103184
|
const { key: key2 } = sdk2;
|
|
102783
103185
|
const normalizedPackage = normalizedSwiftPackagePath(packagePath);
|
|
102784
|
-
const app = (0,
|
|
103186
|
+
const app = (0, import_node_crypto82.createHash)("sha256").update(
|
|
102785
103187
|
JSON.stringify([
|
|
102786
103188
|
normalizedPackage,
|
|
102787
103189
|
launch.environment,
|
|
@@ -102813,7 +103215,7 @@ function swiftSdkStartup(sdk2, packagePath, artifactHash, metadata, launch, runt
|
|
|
102813
103215
|
},
|
|
102814
103216
|
app
|
|
102815
103217
|
);
|
|
102816
|
-
const name3 = (0,
|
|
103218
|
+
const name3 = (0, import_node_crypto82.createHash)("sha256").update(split.primary).digest("hex");
|
|
102817
103219
|
sdkPieces2.set(name3, split.primary);
|
|
102818
103220
|
for (const [digest3, bytes] of split.parts) sdkPieces2.set(digest3, bytes);
|
|
102819
103221
|
sdkStartupParts.set(name3, split.parts);
|
|
@@ -102987,13 +103389,13 @@ async function serveSwiftPackageAsset(pathname, res) {
|
|
|
102987
103389
|
res.end("swift artifact is stale");
|
|
102988
103390
|
return true;
|
|
102989
103391
|
}
|
|
102990
|
-
var import_node_async_hooks2, import_node_child_process67,
|
|
103392
|
+
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;
|
|
102991
103393
|
var init_swift_host = __esm({
|
|
102992
103394
|
"src/swift-host.ts"() {
|
|
102993
103395
|
"use strict";
|
|
102994
103396
|
import_node_async_hooks2 = require("node:async_hooks");
|
|
102995
103397
|
import_node_child_process67 = require("node:child_process");
|
|
102996
|
-
|
|
103398
|
+
import_node_crypto82 = require("node:crypto");
|
|
102997
103399
|
import_node_fs134 = __toESM(require("node:fs"), 1);
|
|
102998
103400
|
import_node_os29 = __toESM(require("node:os"), 1);
|
|
102999
103401
|
import_node_path136 = __toESM(require("node:path"), 1);
|
|
@@ -103752,7 +104154,7 @@ function hashTree(root) {
|
|
|
103752
104154
|
for (const entry of import_node_fs137.default.readdirSync(root, { recursive: true, withFileTypes: true })) {
|
|
103753
104155
|
if (!entry.isFile()) continue;
|
|
103754
104156
|
const file = import_node_path139.default.join(entry.parentPath, entry.name);
|
|
103755
|
-
hashes[import_node_path139.default.relative(root, file).split(import_node_path139.default.sep).join("/")] = (0,
|
|
104157
|
+
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");
|
|
103756
104158
|
}
|
|
103757
104159
|
return Object.fromEntries(Object.entries(hashes).sort(([a], [b]) => a < b ? -1 : 1));
|
|
103758
104160
|
}
|
|
@@ -103802,12 +104204,12 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
103802
104204
|
files: hashTree(generatedRoot)
|
|
103803
104205
|
};
|
|
103804
104206
|
}
|
|
103805
|
-
var import_node_child_process68,
|
|
104207
|
+
var import_node_child_process68, import_node_crypto83, import_node_fs137, import_node_module17, import_node_path139, import_node_util17, run11, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
103806
104208
|
var init_turbo_codegen_intake = __esm({
|
|
103807
104209
|
"src/turbo-codegen-intake.ts"() {
|
|
103808
104210
|
"use strict";
|
|
103809
104211
|
import_node_child_process68 = require("node:child_process");
|
|
103810
|
-
|
|
104212
|
+
import_node_crypto83 = require("node:crypto");
|
|
103811
104213
|
import_node_fs137 = __toESM(require("node:fs"), 1);
|
|
103812
104214
|
import_node_module17 = require("node:module");
|
|
103813
104215
|
import_node_path139 = __toESM(require("node:path"), 1);
|
|
@@ -107758,11 +108160,11 @@ extern "C" __attribute__((export_name("peach_fabric_component_names"))) const ch
|
|
|
107758
108160
|
}
|
|
107759
108161
|
`;
|
|
107760
108162
|
}
|
|
107761
|
-
var
|
|
108163
|
+
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;
|
|
107762
108164
|
var init_turbo_source = __esm({
|
|
107763
108165
|
"src/turbo-source.ts"() {
|
|
107764
108166
|
"use strict";
|
|
107765
|
-
|
|
108167
|
+
import_node_crypto84 = require("node:crypto");
|
|
107766
108168
|
import_node_fs138 = __toESM(require("node:fs"), 1);
|
|
107767
108169
|
import_node_path140 = __toESM(require("node:path"), 1);
|
|
107768
108170
|
init_cocoapods_trunk();
|
|
@@ -107890,7 +108292,7 @@ var init_turbo_source = __esm({
|
|
|
107890
108292
|
];
|
|
107891
108293
|
DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g;
|
|
107892
108294
|
EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g;
|
|
107893
|
-
sha2564 = (data) => (0,
|
|
108295
|
+
sha2564 = (data) => (0, import_node_crypto84.createHash)("sha256").update(data).digest("hex");
|
|
107894
108296
|
podspecList = podspecAttribute;
|
|
107895
108297
|
versionParts = (version2) => version2.split(/[.-]/).map((p) => Number(p) || 0);
|
|
107896
108298
|
iosOf = (member) => object7(member.ios) ? member.ios : null;
|
|
@@ -108690,7 +109092,7 @@ function retainInstalledReactNativeDeclarations(snapshot, options2, skipped) {
|
|
|
108690
109092
|
}
|
|
108691
109093
|
async function prepareTurboCompileInput(options2) {
|
|
108692
109094
|
await prepareTurboSourceDependencies(options2.reactNativeRoot);
|
|
108693
|
-
const key2 = (0,
|
|
109095
|
+
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");
|
|
108694
109096
|
const scratch2 = import_node_path141.default.join(import_node_os30.default.tmpdir(), "peach-turbo-swift", key2);
|
|
108695
109097
|
import_node_fs139.default.mkdirSync(scratch2, { recursive: true });
|
|
108696
109098
|
const codegenDir = import_node_fs139.default.mkdtempSync(import_node_path141.default.join(scratch2, "codegen-"));
|
|
@@ -108891,11 +109293,11 @@ async function compileTurboModule(options2) {
|
|
|
108891
109293
|
collection
|
|
108892
109294
|
};
|
|
108893
109295
|
}
|
|
108894
|
-
var
|
|
109296
|
+
var import_node_crypto85, import_node_fs139, import_node_module18, import_node_os30, import_node_path141;
|
|
108895
109297
|
var init_turbo_compile = __esm({
|
|
108896
109298
|
"src/turbo-compile.ts"() {
|
|
108897
109299
|
"use strict";
|
|
108898
|
-
|
|
109300
|
+
import_node_crypto85 = require("node:crypto");
|
|
108899
109301
|
import_node_fs139 = __toESM(require("node:fs"), 1);
|
|
108900
109302
|
import_node_module18 = require("node:module");
|
|
108901
109303
|
import_node_os30 = __toESM(require("node:os"), 1);
|
|
@@ -109112,8 +109514,8 @@ function reactNativeCoreEntry(reactNativeRoot, moduleRoot, mode) {
|
|
|
109112
109514
|
);
|
|
109113
109515
|
if (!isRecord(manifest) || typeof manifest.version !== "string")
|
|
109114
109516
|
throw new Error(`${reactNativeRoot}: react-native has no version`);
|
|
109115
|
-
const headers = (0,
|
|
109116
|
-
const sources = (0,
|
|
109517
|
+
const headers = (0, import_node_crypto86.createHash)("sha256");
|
|
109518
|
+
const sources = (0, import_node_crypto86.createHash)("sha256");
|
|
109117
109519
|
const walk4 = (relative6) => {
|
|
109118
109520
|
for (const file of import_node_fs141.default.readdirSync(import_node_path143.default.join(reactNativeRoot, relative6), { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
109119
109521
|
if (file.name === "node_modules" || file.name.startsWith(".")) continue;
|
|
@@ -109220,7 +109622,7 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
109220
109622
|
const file = import_node_path143.default.join(
|
|
109221
109623
|
cacheDir(),
|
|
109222
109624
|
"native-archives",
|
|
109223
|
-
`${(0,
|
|
109625
|
+
`${(0, import_node_crypto86.createHash)("sha256").update(data).digest("hex")}.a`
|
|
109224
109626
|
);
|
|
109225
109627
|
import_node_fs141.default.mkdirSync(import_node_path143.default.dirname(file), { recursive: true });
|
|
109226
109628
|
if (!import_node_fs141.default.existsSync(file)) import_node_fs141.default.writeFileSync(file, Buffer.from(data, "base64"));
|
|
@@ -109230,11 +109632,11 @@ function linkReactNativeCore(collection, core, moduleRoot) {
|
|
|
109230
109632
|
}
|
|
109231
109633
|
}
|
|
109232
109634
|
}
|
|
109233
|
-
var
|
|
109635
|
+
var import_node_crypto86, import_node_fs141, import_node_module19, import_node_path143, import_node_util18, recipe, strings4, building;
|
|
109234
109636
|
var init_react_native_core = __esm({
|
|
109235
109637
|
"src/react-native-core.ts"() {
|
|
109236
109638
|
"use strict";
|
|
109237
|
-
|
|
109639
|
+
import_node_crypto86 = require("node:crypto");
|
|
109238
109640
|
import_node_fs141 = __toESM(require("node:fs"), 1);
|
|
109239
109641
|
import_node_module19 = require("node:module");
|
|
109240
109642
|
import_node_path143 = __toESM(require("node:path"), 1);
|
|
@@ -109259,7 +109661,7 @@ function exportedNames(moduleRoot, name3) {
|
|
|
109259
109661
|
const modules = import_node_path144.default.join(moduleRoot, "modules");
|
|
109260
109662
|
const module2 = import_node_path144.default.join(modules, `${name3}.swiftmodule`);
|
|
109261
109663
|
if (!import_node_fs142.default.existsSync(module2)) return /* @__PURE__ */ new Set();
|
|
109262
|
-
const key2 = (0,
|
|
109664
|
+
const key2 = (0, import_node_crypto87.createHash)("sha256").update(import_node_fs142.default.readFileSync(module2)).digest("hex");
|
|
109263
109665
|
const directory2 = import_node_path144.default.join(swiftCacheDir(), "swift-public-names");
|
|
109264
109666
|
const receipt = import_node_path144.default.join(directory2, `${key2}.json`);
|
|
109265
109667
|
if (import_node_fs142.default.existsSync(receipt)) {
|
|
@@ -109342,12 +109744,12 @@ function clangTypeOwnership(moduleRoot, module2) {
|
|
|
109342
109744
|
}
|
|
109343
109745
|
);
|
|
109344
109746
|
}
|
|
109345
|
-
var import_node_child_process70,
|
|
109747
|
+
var import_node_child_process70, import_node_crypto87, import_node_fs142, import_node_path144, blockTypedef, enumTypedef, enumConstant, swiftPrivate;
|
|
109346
109748
|
var init_swift_clang_type_ownership = __esm({
|
|
109347
109749
|
"src/swift-clang-type-ownership.ts"() {
|
|
109348
109750
|
"use strict";
|
|
109349
109751
|
import_node_child_process70 = require("node:child_process");
|
|
109350
|
-
|
|
109752
|
+
import_node_crypto87 = require("node:crypto");
|
|
109351
109753
|
import_node_fs142 = __toESM(require("node:fs"), 1);
|
|
109352
109754
|
import_node_path144 = __toESM(require("node:path"), 1);
|
|
109353
109755
|
init_is_record();
|
|
@@ -111002,7 +111404,7 @@ function targetSettings2(units) {
|
|
|
111002
111404
|
}
|
|
111003
111405
|
function oneSDKStamp(oneSDK) {
|
|
111004
111406
|
if (!oneSDK) return "";
|
|
111005
|
-
const hash = (0,
|
|
111407
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
111006
111408
|
for (const files2 of [oneSDK.targets, oneSDK.entry])
|
|
111007
111409
|
for (const [name3, source] of [...files2].sort(([a], [b]) => a.localeCompare(b)))
|
|
111008
111410
|
hash.update(`${name3}\0${source}\0`);
|
|
@@ -111053,7 +111455,7 @@ ${bridgeModules.length ? "import React\n" : ""}${oneSDK ? "import One\nimport On
|
|
|
111053
111455
|
`;
|
|
111054
111456
|
}
|
|
111055
111457
|
function expoSwiftPreparedKey(base2, units, reactProviderStamp) {
|
|
111056
|
-
const hash = (0,
|
|
111458
|
+
const hash = (0, import_node_crypto88.createHash)("sha256");
|
|
111057
111459
|
hash.update(base2);
|
|
111058
111460
|
hash.update(reactProviderStamp);
|
|
111059
111461
|
for (const unit2 of units) {
|
|
@@ -111427,8 +111829,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
111427
111829
|
}
|
|
111428
111830
|
return provider;
|
|
111429
111831
|
})() : void 0;
|
|
111430
|
-
const reactProviderStamp = reactProvider ? (0,
|
|
111431
|
-
const key2 = (0,
|
|
111832
|
+
const reactProviderStamp = reactProvider ? (0, import_node_crypto88.createHash)("sha256").update(JSON.stringify(reactProvider)).digest("hex") : "";
|
|
111833
|
+
const key2 = (0, import_node_crypto88.createHash)("sha256").update(import_node_fs143.default.realpathSync(root)).digest("hex");
|
|
111432
111834
|
const unitContentStamp = (unit2) => sourceContentStamp(expoSwiftPackage(key2, unit2.moduleId), module2.root) + (unit2.reactNativeProvider ? `:${reactProviderStamp}` : "");
|
|
111433
111835
|
const failures = /* @__PURE__ */ new Map();
|
|
111434
111836
|
const failureRecords = /* @__PURE__ */ new Map();
|
|
@@ -111870,13 +112272,13 @@ ${diagnostics}`}`
|
|
|
111870
112272
|
}
|
|
111871
112273
|
return true;
|
|
111872
112274
|
}
|
|
111873
|
-
var import_node_async_hooks3, import_node_child_process71,
|
|
112275
|
+
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, run12, scriptEnv, EXPO_SWIFT_ROUTE, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
111874
112276
|
var init_expo_swift_host = __esm({
|
|
111875
112277
|
"src/expo-swift-host.ts"() {
|
|
111876
112278
|
"use strict";
|
|
111877
112279
|
import_node_async_hooks3 = require("node:async_hooks");
|
|
111878
112280
|
import_node_child_process71 = require("node:child_process");
|
|
111879
|
-
|
|
112281
|
+
import_node_crypto88 = require("node:crypto");
|
|
111880
112282
|
import_node_fs143 = __toESM(require("node:fs"), 1);
|
|
111881
112283
|
import_node_module20 = require("node:module");
|
|
111882
112284
|
import_node_os31 = __toESM(require("node:os"), 1);
|
|
@@ -115801,10 +116203,10 @@ function stageHostBytes(bytes, origin, extension = "") {
|
|
|
115801
116203
|
}
|
|
115802
116204
|
async function stageHostDerivedBytes(input, producer, origin, extension, derive) {
|
|
115803
116205
|
const directory2 = prepareStagedDirectory();
|
|
115804
|
-
const inputDigest = (0,
|
|
116206
|
+
const inputDigest = (0, import_node_crypto90.createHash)("sha256").update(input).digest("hex");
|
|
115805
116207
|
const index = import_node_path153.default.join(
|
|
115806
116208
|
directory2,
|
|
115807
|
-
`derived-${(0,
|
|
116209
|
+
`derived-${(0, import_node_crypto90.createHash)("sha256").update(`${producer}\0${inputDigest}`).digest("hex")}`
|
|
115808
116210
|
);
|
|
115809
116211
|
const recorded = import_node_fs151.default.existsSync(index) ? import_node_fs151.default.readFileSync(index, "utf8") : "";
|
|
115810
116212
|
if (STAGED_NAME.test(recorded) && import_node_fs151.default.existsSync(import_node_path153.default.join(directory2, recorded))) {
|
|
@@ -115815,7 +116217,7 @@ async function stageHostDerivedBytes(input, producer, origin, extension, derive)
|
|
|
115815
116217
|
return new URL(STAGED_PREFIX + recorded, origin).toString();
|
|
115816
116218
|
}
|
|
115817
116219
|
const staged = writeStagedBytes(await derive(), origin, extension, directory2);
|
|
115818
|
-
const temporary = import_node_path153.default.join(directory2, (0,
|
|
116220
|
+
const temporary = import_node_path153.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
115819
116221
|
try {
|
|
115820
116222
|
import_node_fs151.default.writeFileSync(temporary, new URL(staged).pathname.slice(STAGED_PREFIX.length), {
|
|
115821
116223
|
flag: "wx"
|
|
@@ -115834,7 +116236,7 @@ function metroIndexName(url) {
|
|
|
115834
116236
|
url.searchParams.get("unstable_path"),
|
|
115835
116237
|
hashes[0]
|
|
115836
116238
|
]);
|
|
115837
|
-
return `metro-${(0,
|
|
116239
|
+
return `metro-${(0, import_node_crypto90.createHash)("sha256").update(key2).digest("hex")}`;
|
|
115838
116240
|
}
|
|
115839
116241
|
function metroRequestIndex(rawUrl) {
|
|
115840
116242
|
if (!rawUrl?.startsWith("/") || rawUrl.startsWith("//")) return null;
|
|
@@ -115862,7 +116264,7 @@ function prepareStagedDirectory() {
|
|
|
115862
116264
|
return directory2;
|
|
115863
116265
|
}
|
|
115864
116266
|
function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
115865
|
-
const digest3 = (0,
|
|
116267
|
+
const digest3 = (0, import_node_crypto90.createHash)("sha256").update(bytes).digest("hex");
|
|
115866
116268
|
extension = extension.toLowerCase();
|
|
115867
116269
|
const name3 = STAGED_NAME.test(digest3 + extension) ? digest3 + extension : digest3;
|
|
115868
116270
|
stagedCapture.getStore()?.add(name3);
|
|
@@ -115871,7 +116273,7 @@ function writeStagedBytes(bytes, origin, extension, directory2) {
|
|
|
115871
116273
|
if (import_node_fs151.default.existsSync(destination)) {
|
|
115872
116274
|
import_node_fs151.default.utimesSync(destination, new Date(now), new Date(now));
|
|
115873
116275
|
} else {
|
|
115874
|
-
const temporary = import_node_path153.default.join(directory2, (0,
|
|
116276
|
+
const temporary = import_node_path153.default.join(directory2, (0, import_node_crypto90.randomUUID)());
|
|
115875
116277
|
try {
|
|
115876
116278
|
import_node_fs151.default.writeFileSync(temporary, bytes, { flag: "wx" });
|
|
115877
116279
|
import_node_fs151.default.renameSync(temporary, destination);
|
|
@@ -115943,12 +116345,12 @@ async function handleStagedHostFileRequest(req, res) {
|
|
|
115943
116345
|
throw error;
|
|
115944
116346
|
}
|
|
115945
116347
|
}
|
|
115946
|
-
var import_node_async_hooks4,
|
|
116348
|
+
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;
|
|
115947
116349
|
var init_staged_host_files = __esm({
|
|
115948
116350
|
"src/host/staged-host-files.ts"() {
|
|
115949
116351
|
"use strict";
|
|
115950
116352
|
import_node_async_hooks4 = require("node:async_hooks");
|
|
115951
|
-
|
|
116353
|
+
import_node_crypto90 = require("node:crypto");
|
|
115952
116354
|
import_node_fs151 = __toESM(require("node:fs"), 1);
|
|
115953
116355
|
import_node_path153 = __toESM(require("node:path"), 1);
|
|
115954
116356
|
init_uttype_mime();
|
|
@@ -116837,7 +117239,7 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
|
|
|
116837
117239
|
""
|
|
116838
117240
|
].join("\n");
|
|
116839
117241
|
}
|
|
116840
|
-
const digest3 = (0,
|
|
117242
|
+
const digest3 = (0, import_node_crypto91.createHash)("sha256").update(manifest);
|
|
116841
117243
|
for (const [name3, source] of files2)
|
|
116842
117244
|
digest3.update(name3).update("\0").update(source).update("\0");
|
|
116843
117245
|
const key2 = digest3.digest("hex").slice(0, 16);
|
|
@@ -116859,11 +117261,11 @@ async function oneNativeControlsPackage(appRoot, linkedGroups, sdk2) {
|
|
|
116859
117261
|
oneSDKModules: bindings && [...bindings.modules]
|
|
116860
117262
|
};
|
|
116861
117263
|
}
|
|
116862
|
-
var
|
|
117264
|
+
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;
|
|
116863
117265
|
var init_one_native_controls_package = __esm({
|
|
116864
117266
|
"src/one-native-controls-package.ts"() {
|
|
116865
117267
|
"use strict";
|
|
116866
|
-
|
|
117268
|
+
import_node_crypto91 = require("node:crypto");
|
|
116867
117269
|
import_node_fs153 = __toESM(require("node:fs"), 1);
|
|
116868
117270
|
import_node_module21 = require("node:module");
|
|
116869
117271
|
import_node_path155 = __toESM(require("node:path"), 1);
|
|
@@ -118101,7 +118503,7 @@ async function readOneWidgetSources(appRoot) {
|
|
|
118101
118503
|
if (!Buffer.from(text7).equals(bytes))
|
|
118102
118504
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
118103
118505
|
files2.set(name3, text7);
|
|
118104
|
-
sources[import_node_path157.default.relative(root, file).split(import_node_path157.default.sep).join("/")] = (0,
|
|
118506
|
+
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");
|
|
118105
118507
|
}
|
|
118106
118508
|
const contract = files2.get("OneWidgetContract.swift") ?? "";
|
|
118107
118509
|
const source = files2.get("OneWidget.swift") ?? "";
|
|
@@ -118125,17 +118527,17 @@ async function configuredOneWidget(appRoot, bundleUrl, packageUrl) {
|
|
|
118125
118527
|
return {
|
|
118126
118528
|
metadata: source.widget,
|
|
118127
118529
|
projectRoot: source.root,
|
|
118128
|
-
appIdentity: (0,
|
|
118530
|
+
appIdentity: (0, import_node_crypto92.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
|
|
118129
118531
|
bundleUrl,
|
|
118130
118532
|
packageUrl,
|
|
118131
118533
|
urlSchemes: source.urlSchemes
|
|
118132
118534
|
};
|
|
118133
118535
|
}
|
|
118134
|
-
var
|
|
118536
|
+
var import_node_crypto92, import_node_fs155, import_node_path157, ONE_WIDGET_PACKAGE, nonEmpty;
|
|
118135
118537
|
var init_one_widget_metadata = __esm({
|
|
118136
118538
|
"src/one-widget-metadata.ts"() {
|
|
118137
118539
|
"use strict";
|
|
118138
|
-
|
|
118540
|
+
import_node_crypto92 = require("node:crypto");
|
|
118139
118541
|
import_node_fs155 = __toESM(require("node:fs"), 1);
|
|
118140
118542
|
import_node_path157 = __toESM(require("node:path"), 1);
|
|
118141
118543
|
init_is_record();
|
|
@@ -118169,7 +118571,7 @@ async function oneWidgetPackage(appRoot) {
|
|
|
118169
118571
|
const packagePath = import_node_path158.default.join(
|
|
118170
118572
|
import_node_os33.default.tmpdir(),
|
|
118171
118573
|
"peach-one-widgets",
|
|
118172
|
-
(0,
|
|
118574
|
+
(0, import_node_crypto93.createHash)("sha256").update(root).digest("hex"),
|
|
118173
118575
|
ONE_WIDGET_PACKAGE
|
|
118174
118576
|
);
|
|
118175
118577
|
import_node_fs156.default.mkdirSync(packagePath, { recursive: true });
|
|
@@ -118183,11 +118585,11 @@ async function oneWidgetPackage(appRoot) {
|
|
|
118183
118585
|
widget
|
|
118184
118586
|
};
|
|
118185
118587
|
}
|
|
118186
|
-
var
|
|
118588
|
+
var import_node_crypto93, import_node_fs156, import_node_os33, import_node_path158;
|
|
118187
118589
|
var init_one_widget_package = __esm({
|
|
118188
118590
|
"src/one-widget-package.ts"() {
|
|
118189
118591
|
"use strict";
|
|
118190
|
-
|
|
118592
|
+
import_node_crypto93 = require("node:crypto");
|
|
118191
118593
|
import_node_fs156 = __toESM(require("node:fs"), 1);
|
|
118192
118594
|
import_node_os33 = __toESM(require("node:os"), 1);
|
|
118193
118595
|
import_node_path158 = __toESM(require("node:path"), 1);
|
|
@@ -118403,7 +118805,7 @@ var init_android_view_classes = __esm({
|
|
|
118403
118805
|
|
|
118404
118806
|
// src/java-module-abi.ts
|
|
118405
118807
|
async function readJavaModuleSpecs(files2, sdkRoot, toolchain) {
|
|
118406
|
-
const digest3 = (0,
|
|
118808
|
+
const digest3 = (0, import_node_crypto94.createHash)("sha256");
|
|
118407
118809
|
const parent = import_node_path160.default.join(kotlinHome(), "java-specs");
|
|
118408
118810
|
import_node_fs158.default.mkdirSync(parent, { recursive: true });
|
|
118409
118811
|
const work = import_node_fs158.default.mkdtempSync(import_node_path160.default.join(parent, ".read-"));
|
|
@@ -118500,12 +118902,12 @@ async function compileJavaModuleAbi(input) {
|
|
|
118500
118902
|
);
|
|
118501
118903
|
return library;
|
|
118502
118904
|
}
|
|
118503
|
-
var import_node_child_process74,
|
|
118905
|
+
var import_node_child_process74, import_node_crypto94, import_node_fs158, import_node_path160, import_node_util20, run13, JAVA_BINDINGS_INITIALIZER;
|
|
118504
118906
|
var init_java_module_abi = __esm({
|
|
118505
118907
|
"src/java-module-abi.ts"() {
|
|
118506
118908
|
"use strict";
|
|
118507
118909
|
import_node_child_process74 = require("node:child_process");
|
|
118508
|
-
|
|
118910
|
+
import_node_crypto94 = require("node:crypto");
|
|
118509
118911
|
import_node_fs158 = __toESM(require("node:fs"), 1);
|
|
118510
118912
|
import_node_path160 = __toESM(require("node:path"), 1);
|
|
118511
118913
|
import_node_util20 = require("node:util");
|
|
@@ -118833,7 +119235,7 @@ function zipSources(bytes, where) {
|
|
|
118833
119235
|
return entries2;
|
|
118834
119236
|
}
|
|
118835
119237
|
function extract(bytes, where) {
|
|
118836
|
-
const key2 = (0,
|
|
119238
|
+
const key2 = (0, import_node_crypto95.createHash)("sha256").update(bytes).digest("hex");
|
|
118837
119239
|
const cached4 = pending.get(key2);
|
|
118838
119240
|
if (cached4) return cached4;
|
|
118839
119241
|
const request = (async () => {
|
|
@@ -118882,11 +119284,11 @@ function readSourcesJar(archive, where) {
|
|
|
118882
119284
|
function readMavenSourcesArchive(archive) {
|
|
118883
119285
|
return extract(readSourcesJar(archive, archive), archive);
|
|
118884
119286
|
}
|
|
118885
|
-
var
|
|
119287
|
+
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;
|
|
118886
119288
|
var init_kotlin_maven_sources = __esm({
|
|
118887
119289
|
"src/kotlin-maven-sources.ts"() {
|
|
118888
119290
|
"use strict";
|
|
118889
|
-
|
|
119291
|
+
import_node_crypto95 = require("node:crypto");
|
|
118890
119292
|
import_node_fs160 = __toESM(require("node:fs"), 1);
|
|
118891
119293
|
import_node_os34 = __toESM(require("node:os"), 1);
|
|
118892
119294
|
import_node_path162 = __toESM(require("node:path"), 1);
|
|
@@ -118927,7 +119329,7 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
118927
119329
|
])
|
|
118928
119330
|
];
|
|
118929
119331
|
const name3 = library.coordinate.replace(/[^a-zA-Z0-9._-]/g, "-");
|
|
118930
|
-
const suffix = (0,
|
|
119332
|
+
const suffix = (0, import_node_crypto96.createHash)("sha256").update(library.coordinate).digest("hex").slice(0, 12);
|
|
118931
119333
|
const klib = import_node_path163.default.join(input.output, `${name3}-${suffix}.klib`);
|
|
118932
119334
|
const kotlinJvmAbi = java.length && kotlin.length && library.jars.length === 1 ? library.jars[0] : void 0;
|
|
118933
119335
|
const abiPairs = java.length ? dependencies.flatMap(
|
|
@@ -118969,11 +119371,11 @@ async function compileKotlinGradleLibraries(input) {
|
|
|
118969
119371
|
}
|
|
118970
119372
|
return [...compiled.values()].map(({ klib }) => klib);
|
|
118971
119373
|
}
|
|
118972
|
-
var
|
|
119374
|
+
var import_node_crypto96, import_node_fs161, import_node_path163;
|
|
118973
119375
|
var init_kotlin_gradle_library_plan = __esm({
|
|
118974
119376
|
"src/kotlin-gradle-library-plan.ts"() {
|
|
118975
119377
|
"use strict";
|
|
118976
|
-
|
|
119378
|
+
import_node_crypto96 = require("node:crypto");
|
|
118977
119379
|
import_node_fs161 = __toESM(require("node:fs"), 1);
|
|
118978
119380
|
import_node_path163 = __toESM(require("node:path"), 1);
|
|
118979
119381
|
init_kotlin_library_sources();
|
|
@@ -119209,13 +119611,13 @@ function verifyKotlinSdkDirectory(root, compiler) {
|
|
|
119209
119611
|
if (!stat2.isFile() || stat2.nlink !== 1)
|
|
119210
119612
|
throw new Error(`Kotlin SDK binary is not a regular file: ${name3}`);
|
|
119211
119613
|
const bytes = import_node_fs162.default.readFileSync(target);
|
|
119212
|
-
if (bytes.length !== expected.bytes || (0,
|
|
119614
|
+
if (bytes.length !== expected.bytes || (0, import_node_crypto97.createHash)("sha256").update(bytes).digest("hex") !== expected.sha256)
|
|
119213
119615
|
throw new Error(`Kotlin SDK binary differs from its manifest: ${name3}`);
|
|
119214
119616
|
}
|
|
119215
119617
|
return manifest;
|
|
119216
119618
|
}
|
|
119217
119619
|
async function installKotlinSdkArchive(archive, compiler) {
|
|
119218
|
-
const sha2565 = (0,
|
|
119620
|
+
const sha2565 = (0, import_node_crypto97.createHash)("sha256").update(archive).digest("hex");
|
|
119219
119621
|
const parent = import_node_path164.default.join(kotlinHome(), "sdk");
|
|
119220
119622
|
const root = import_node_path164.default.join(parent, sha2565);
|
|
119221
119623
|
if (import_node_fs162.default.existsSync(root))
|
|
@@ -119244,12 +119646,12 @@ async function installKotlinSdkArchive(archive, compiler) {
|
|
|
119244
119646
|
import_node_fs162.default.rmSync(work, { recursive: true, force: true });
|
|
119245
119647
|
}
|
|
119246
119648
|
}
|
|
119247
|
-
var import_node_child_process76,
|
|
119649
|
+
var import_node_child_process76, import_node_crypto97, import_node_fs162, import_node_path164, import_node_util21, run14;
|
|
119248
119650
|
var init_kotlin_sdk = __esm({
|
|
119249
119651
|
"src/kotlin-sdk.ts"() {
|
|
119250
119652
|
"use strict";
|
|
119251
119653
|
import_node_child_process76 = require("node:child_process");
|
|
119252
|
-
|
|
119654
|
+
import_node_crypto97 = require("node:crypto");
|
|
119253
119655
|
import_node_fs162 = __toESM(require("node:fs"), 1);
|
|
119254
119656
|
import_node_path164 = __toESM(require("node:path"), 1);
|
|
119255
119657
|
import_node_util21 = require("node:util");
|
|
@@ -119385,7 +119787,7 @@ function peachKotlinModuleRoot() {
|
|
|
119385
119787
|
if (!IS_STANDALONE) return import_node_path165.default.join(peachsimPackageRoot(), "kotlin");
|
|
119386
119788
|
if (installedRoot) return installedRoot;
|
|
119387
119789
|
const files2 = JSON.parse(__PEACH_BUNDLED_KOTLIN__);
|
|
119388
|
-
const digest3 = (0,
|
|
119790
|
+
const digest3 = (0, import_node_crypto98.createHash)("sha256").update(__PEACH_BUNDLED_KOTLIN__).digest("hex");
|
|
119389
119791
|
const parent = import_node_path165.default.join(rnxHomeDir(), "kotlin", "modules");
|
|
119390
119792
|
const root = import_node_path165.default.join(parent, digest3);
|
|
119391
119793
|
import_node_fs163.default.mkdirSync(parent, { recursive: true });
|
|
@@ -119414,11 +119816,11 @@ function peachKotlinModuleRoot() {
|
|
|
119414
119816
|
installedRoot = root;
|
|
119415
119817
|
return root;
|
|
119416
119818
|
}
|
|
119417
|
-
var
|
|
119819
|
+
var import_node_crypto98, import_node_fs163, import_node_path165, installedRoot;
|
|
119418
119820
|
var init_kotlin_module = __esm({
|
|
119419
119821
|
"src/kotlin-module.ts"() {
|
|
119420
119822
|
"use strict";
|
|
119421
|
-
|
|
119823
|
+
import_node_crypto98 = require("node:crypto");
|
|
119422
119824
|
import_node_fs163 = __toESM(require("node:fs"), 1);
|
|
119423
119825
|
import_node_path165 = __toESM(require("node:path"), 1);
|
|
119424
119826
|
init_standalone();
|
|
@@ -119452,7 +119854,7 @@ async function resolveAndroidGradleSources(request) {
|
|
|
119452
119854
|
const parent = import_node_path166.default.join(kotlinHome(), "gradle-sources");
|
|
119453
119855
|
import_node_fs164.default.mkdirSync(parent, { recursive: true });
|
|
119454
119856
|
const work = import_node_fs164.default.mkdtempSync(import_node_path166.default.join(parent, ".query-"));
|
|
119455
|
-
const task = `peachAndroidSources${(0,
|
|
119857
|
+
const task = `peachAndroidSources${(0, import_node_crypto99.randomBytes)(8).toString("hex")}`;
|
|
119456
119858
|
const script = import_node_path166.default.join(work, "sources.gradle");
|
|
119457
119859
|
const encoded = Buffer.from(
|
|
119458
119860
|
JSON.stringify({
|
|
@@ -119604,12 +120006,12 @@ function readDependencySources(value) {
|
|
|
119604
120006
|
};
|
|
119605
120007
|
});
|
|
119606
120008
|
}
|
|
119607
|
-
var import_node_child_process77,
|
|
120009
|
+
var import_node_child_process77, import_node_crypto99, import_node_fs164, import_node_path166, import_node_util22, run15, modelQuery;
|
|
119608
120010
|
var init_android_gradle_sources = __esm({
|
|
119609
120011
|
"src/android-gradle-sources.ts"() {
|
|
119610
120012
|
"use strict";
|
|
119611
120013
|
import_node_child_process77 = require("node:child_process");
|
|
119612
|
-
|
|
120014
|
+
import_node_crypto99 = require("node:crypto");
|
|
119613
120015
|
import_node_fs164 = __toESM(require("node:fs"), 1);
|
|
119614
120016
|
import_node_path166 = __toESM(require("node:path"), 1);
|
|
119615
120017
|
import_node_util22 = require("node:util");
|
|
@@ -120024,7 +120426,7 @@ function readExpoTypes(output) {
|
|
|
120024
120426
|
});
|
|
120025
120427
|
}
|
|
120026
120428
|
async function scanSources(tool, parse17, toolchain, moduleRoot, files2) {
|
|
120027
|
-
const digest3 = (0,
|
|
120429
|
+
const digest3 = (0, import_node_crypto100.createHash)("sha256").update(JSON.stringify(toolchain.compiler));
|
|
120028
120430
|
const sdk2 = await loadKotlinSdk(moduleRoot, toolchain);
|
|
120029
120431
|
digest3.update(import_node_fs165.default.readFileSync(import_node_path167.default.join(moduleRoot, "sdk.tar.gz")));
|
|
120030
120432
|
digest3.update(tool);
|
|
@@ -120686,7 +121088,7 @@ async function compileKotlin(input, origin) {
|
|
|
120686
121088
|
bytes: import_node_fs165.default.readFileSync(file)
|
|
120687
121089
|
}));
|
|
120688
121090
|
const { composeArchive, ...compilerInputs } = toolchain;
|
|
120689
|
-
const digest3 = (0,
|
|
121091
|
+
const digest3 = (0, import_node_crypto100.createHash)("sha256");
|
|
120690
121092
|
digest3.update(
|
|
120691
121093
|
JSON.stringify({
|
|
120692
121094
|
format: BUILD_FORMAT,
|
|
@@ -120708,7 +121110,7 @@ async function compileKotlin(input, origin) {
|
|
|
120708
121110
|
...gradleLibraries.libraries.flatMap(({ archive, jars }) => [archive, ...jars])
|
|
120709
121111
|
]);
|
|
120710
121112
|
for (const file of files2) {
|
|
120711
|
-
digest3.update((0,
|
|
121113
|
+
digest3.update((0, import_node_crypto100.createHash)("sha256").update(import_node_fs165.default.readFileSync(file)).digest());
|
|
120712
121114
|
}
|
|
120713
121115
|
}
|
|
120714
121116
|
if (viewModels) digest3.update(viewModels.toolClass);
|
|
@@ -121000,12 +121402,12 @@ async function serveKotlinRequest(pathname, res, app) {
|
|
|
121000
121402
|
}
|
|
121001
121403
|
return true;
|
|
121002
121404
|
}
|
|
121003
|
-
var import_node_child_process78,
|
|
121405
|
+
var import_node_child_process78, import_node_crypto100, import_node_fs165, import_node_module22, import_node_path167, import_node_util23, run16, KOTLIN_ARTIFACT_PREFIX, SKIP_DIRS, configureDeviceSource, BUILD_FORMAT, builds, toolScans, BRIDGE_PARAMETERS, BRIDGE_CASTS, BRIDGE_RETURNS, bridgeType, JAVA_CLASSES, argb, escapes2, literal3, CONTENT_TYPES;
|
|
121004
121406
|
var init_kotlin_host = __esm({
|
|
121005
121407
|
"src/kotlin-host.ts"() {
|
|
121006
121408
|
"use strict";
|
|
121007
121409
|
import_node_child_process78 = require("node:child_process");
|
|
121008
|
-
|
|
121410
|
+
import_node_crypto100 = require("node:crypto");
|
|
121009
121411
|
import_node_fs165 = __toESM(require("node:fs"), 1);
|
|
121010
121412
|
import_node_module22 = require("node:module");
|
|
121011
121413
|
import_node_path167 = __toESM(require("node:path"), 1);
|
|
@@ -121361,7 +121763,7 @@ async function readManagedExpoIdentity(root, platform3, iosTarget, bridgeOrigin)
|
|
|
121361
121763
|
url.searchParams.set("root", root);
|
|
121362
121764
|
const response = await nodeHttpFetch(url.href);
|
|
121363
121765
|
if (response.ok && response.headers.get("content-type") === revisionType) {
|
|
121364
|
-
const environment = (0,
|
|
121766
|
+
const environment = (0, import_node_crypto101.createHash)("sha256").update(JSON.stringify(Object.entries(process.env).sort())).digest("hex");
|
|
121365
121767
|
const inputs2 = Buffer.from(
|
|
121366
121768
|
JSON.stringify([
|
|
121367
121769
|
await response.text(),
|
|
@@ -121417,11 +121819,11 @@ function handleManagedExpoInputs(req, res, url) {
|
|
|
121417
121819
|
res.writeHead(200, { "Content-Type": revisionType });
|
|
121418
121820
|
res.end(revision);
|
|
121419
121821
|
}
|
|
121420
|
-
var
|
|
121822
|
+
var import_node_crypto101, import_node_fs167, import_node_path169, revisionType;
|
|
121421
121823
|
var init_managed_expo_identity = __esm({
|
|
121422
121824
|
"src/managed-expo-identity.ts"() {
|
|
121423
121825
|
"use strict";
|
|
121424
|
-
|
|
121826
|
+
import_node_crypto101 = require("node:crypto");
|
|
121425
121827
|
import_node_fs167 = __toESM(require("node:fs"), 1);
|
|
121426
121828
|
import_node_path169 = __toESM(require("node:path"), 1);
|
|
121427
121829
|
init_backend_origin();
|
|
@@ -121536,7 +121938,7 @@ async function stagePreparedExpoWidgetAssets(preparedApp, origin) {
|
|
|
121536
121938
|
const ext = import_node_path172.default.extname(file);
|
|
121537
121939
|
if (ext.toLowerCase() === ".svg") return stageCatalogSvg(file, scale, origin, bytes);
|
|
121538
121940
|
if (ext.toLowerCase() === ".pdf") {
|
|
121539
|
-
const sha2565 = (0,
|
|
121941
|
+
const sha2565 = (0, import_node_crypto102.createHash)("sha256").update(bytes).digest("hex");
|
|
121540
121942
|
const png = rasterizePdfFiles([{ file: members2.get(file), sha256: sha2565 }]).get(sha2565);
|
|
121541
121943
|
return stageHostBytes(png, origin, ".png");
|
|
121542
121944
|
}
|
|
@@ -121549,11 +121951,11 @@ async function stageExpoWidgetAssets(appRoot, origin) {
|
|
|
121549
121951
|
const prepared = await prepareExpoNativeProject(appRoot);
|
|
121550
121952
|
return stagePreparedExpoWidgetAssets(prepared.app, origin);
|
|
121551
121953
|
}
|
|
121552
|
-
var
|
|
121954
|
+
var import_node_crypto102, import_node_fs169, import_node_path172;
|
|
121553
121955
|
var init_expo_widget_assets = __esm({
|
|
121554
121956
|
"src/expo-widget-assets.ts"() {
|
|
121555
121957
|
"use strict";
|
|
121556
|
-
|
|
121958
|
+
import_node_crypto102 = require("node:crypto");
|
|
121557
121959
|
import_node_fs169 = __toESM(require("node:fs"), 1);
|
|
121558
121960
|
import_node_path172 = __toESM(require("node:path"), 1);
|
|
121559
121961
|
init_app_catalog();
|
|
@@ -121608,11 +122010,11 @@ async function trunkSpecification(lockFile, root, version2, checksum) {
|
|
|
121608
122010
|
"specifications",
|
|
121609
122011
|
`${checksum}.json`
|
|
121610
122012
|
);
|
|
121611
|
-
const sha1 = (value) => (0,
|
|
122013
|
+
const sha1 = (value) => (0, import_node_crypto103.createHash)("sha1").update(value).digest("hex");
|
|
121612
122014
|
let text7;
|
|
121613
122015
|
if (import_node_fs170.default.existsSync(file)) text7 = import_node_fs170.default.readFileSync(file, "utf8");
|
|
121614
122016
|
else {
|
|
121615
|
-
const shard2 = (0,
|
|
122017
|
+
const shard2 = (0, import_node_crypto103.createHash)("md5").update(root).digest("hex").slice(0, 3).split("").join("/");
|
|
121616
122018
|
const specPath = `Specs/${shard2}/${root}/${version2}/${root}.podspec.json`;
|
|
121617
122019
|
const response = await fetch(`https://cdn.cocoapods.org/${specPath}`);
|
|
121618
122020
|
if (!response.ok)
|
|
@@ -121741,7 +122143,7 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
121741
122143
|
"end",
|
|
121742
122144
|
""
|
|
121743
122145
|
].join("\n");
|
|
121744
|
-
const key2 = (0,
|
|
122146
|
+
const key2 = (0, import_node_crypto103.createHash)("sha256").update(project).update(podfile).update(JSON.stringify([...selected].sort(([a], [b]) => a.localeCompare(b)))).update(
|
|
121745
122147
|
JSON.stringify(
|
|
121746
122148
|
Object.entries(specificationChecksums).sort(([a], [b]) => a.localeCompare(b))
|
|
121747
122149
|
)
|
|
@@ -121810,11 +122212,11 @@ async function collectSwiftSourcePods(lockFile, modules, moduleRoot, headerModul
|
|
|
121810
122212
|
);
|
|
121811
122213
|
});
|
|
121812
122214
|
}
|
|
121813
|
-
var
|
|
122215
|
+
var import_node_crypto103, import_node_fs170, import_node_path173, APP, record5, project, podModuleName;
|
|
121814
122216
|
var init_swift_source_pods = __esm({
|
|
121815
122217
|
"src/swift-source-pods.ts"() {
|
|
121816
122218
|
"use strict";
|
|
121817
|
-
|
|
122219
|
+
import_node_crypto103 = require("node:crypto");
|
|
121818
122220
|
import_node_fs170 = __toESM(require("node:fs"), 1);
|
|
121819
122221
|
import_node_path173 = __toESM(require("node:path"), 1);
|
|
121820
122222
|
init_browser();
|
|
@@ -122491,7 +122893,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
122491
122893
|
input.libraries ??= {};
|
|
122492
122894
|
input.libraries[nitroProviderTarget({ name: name3 })] = library;
|
|
122493
122895
|
}
|
|
122494
|
-
const key2 = (0,
|
|
122896
|
+
const key2 = (0, import_node_crypto104.createHash)("sha256").update(
|
|
122495
122897
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
122496
122898
|
).update("\0").update(import_node_fs171.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
122497
122899
|
const packagePath = import_node_path174.default.join(import_node_os35.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
@@ -122548,11 +122950,11 @@ function nitrogenGeneratedSources(podDirectory) {
|
|
|
122548
122950
|
...sources(import_node_path174.default.join(generated, "ios"), /\.(h|hpp|c|cpp|mm|swift)$/)
|
|
122549
122951
|
];
|
|
122550
122952
|
}
|
|
122551
|
-
var
|
|
122953
|
+
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;
|
|
122552
122954
|
var init_nitro_compile = __esm({
|
|
122553
122955
|
"src/nitro-compile.ts"() {
|
|
122554
122956
|
"use strict";
|
|
122555
|
-
|
|
122957
|
+
import_node_crypto104 = require("node:crypto");
|
|
122556
122958
|
import_node_fs171 = __toESM(require("node:fs"), 1);
|
|
122557
122959
|
import_node_os35 = __toESM(require("node:os"), 1);
|
|
122558
122960
|
import_node_path174 = __toESM(require("node:path"), 1);
|
|
@@ -122629,11 +123031,11 @@ var init_nitro_compile = __esm({
|
|
|
122629
123031
|
});
|
|
122630
123032
|
|
|
122631
123033
|
// src/nitro-compiler-digest.ts
|
|
122632
|
-
var
|
|
123034
|
+
var import_node_crypto105, import_node_fs172, import_node_path175;
|
|
122633
123035
|
var init_nitro_compiler_digest = __esm({
|
|
122634
123036
|
"src/nitro-compiler-digest.ts"() {
|
|
122635
123037
|
"use strict";
|
|
122636
|
-
|
|
123038
|
+
import_node_crypto105 = require("node:crypto");
|
|
122637
123039
|
import_node_fs172 = require("node:fs");
|
|
122638
123040
|
import_node_path175 = __toESM(require("node:path"), 1);
|
|
122639
123041
|
init_swift_compiler_digest();
|
|
@@ -122771,7 +123173,7 @@ var init_nitro_superset = __esm({
|
|
|
122771
123173
|
init_nitroContract();
|
|
122772
123174
|
init_swift_standin_digest();
|
|
122773
123175
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
122774
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
123176
|
+
NITRO_COMPILER_DIGEST = true ? "bdc0f5dd61f31a5b6f5bba3db67fc29584077dfb64bd237228a11b91b9ab2730" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
122775
123177
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
122776
123178
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
122777
123179
|
published3 = /* @__PURE__ */ new Map();
|
|
@@ -123300,7 +123702,7 @@ async function compilePreparedOneSDKApp(appRoot, preparedRoot, origin, moduleRoo
|
|
|
123300
123702
|
const packagePath = import_node_path179.default.join(
|
|
123301
123703
|
swiftCacheDir(),
|
|
123302
123704
|
"peach-one-sdk-swift",
|
|
123303
|
-
(0,
|
|
123705
|
+
(0, import_node_crypto106.createHash)("sha256").update(import_node_fs175.default.realpathSync(appRoot)).digest("hex").slice(0, 16),
|
|
123304
123706
|
"sdk"
|
|
123305
123707
|
);
|
|
123306
123708
|
const bindingFlags = optimize ? '["-suppress-warnings"]' : '["-suppress-warnings", "-Onone", "-no-whole-module-optimization"]';
|
|
@@ -123347,11 +123749,11 @@ async function buildOneSDKBundle(appRoot) {
|
|
|
123347
123749
|
assets: await compiledModuleAssets(compiled.artifact)
|
|
123348
123750
|
};
|
|
123349
123751
|
}
|
|
123350
|
-
var
|
|
123752
|
+
var import_node_crypto106, import_node_fs175, import_node_path179, ONE_SDK_ROUTE, ONE_SDK_BINDING_SHARDS, ONE_SDK_BINDING_SHARD_MIN_BYTES, handleOneSDKRequest;
|
|
123351
123753
|
var init_one_sdk_bundle = __esm({
|
|
123352
123754
|
"src/one-sdk-bundle.ts"() {
|
|
123353
123755
|
"use strict";
|
|
123354
|
-
|
|
123756
|
+
import_node_crypto106 = require("node:crypto");
|
|
123355
123757
|
import_node_fs175 = __toESM(require("node:fs"), 1);
|
|
123356
123758
|
import_node_path179 = __toESM(require("node:path"), 1);
|
|
123357
123759
|
init_expo_native_workspace();
|
|
@@ -124014,11 +124416,11 @@ function readSharedDesktopAuthSession() {
|
|
|
124014
124416
|
return null;
|
|
124015
124417
|
}
|
|
124016
124418
|
}
|
|
124017
|
-
var
|
|
124419
|
+
var import_node_crypto107, import_node_fs179, import_node_path184, SESSION_VERSION, SESSION_FILE_ENV, DEFAULT_ORIGIN;
|
|
124018
124420
|
var init_shared_session = __esm({
|
|
124019
124421
|
"src/auth/shared-session.ts"() {
|
|
124020
124422
|
"use strict";
|
|
124021
|
-
|
|
124423
|
+
import_node_crypto107 = require("node:crypto");
|
|
124022
124424
|
import_node_fs179 = require("node:fs");
|
|
124023
124425
|
import_node_path184 = require("node:path");
|
|
124024
124426
|
init_home_paths();
|
|
@@ -124056,7 +124458,7 @@ var init_run_rnx = __esm({
|
|
|
124056
124458
|
// cli/secure-file.ts
|
|
124057
124459
|
function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
124058
124460
|
(0, import_node_fs180.mkdirSync)((0, import_node_path185.dirname)(filepath), { recursive: true });
|
|
124059
|
-
const temporary = `${filepath}.tmp-${process.pid}-${(0,
|
|
124461
|
+
const temporary = `${filepath}.tmp-${process.pid}-${(0, import_node_crypto108.randomUUID)()}`;
|
|
124060
124462
|
let descriptor = null;
|
|
124061
124463
|
try {
|
|
124062
124464
|
descriptor = (0, import_node_fs180.openSync)(temporary, "wx", 384);
|
|
@@ -124073,11 +124475,11 @@ function writeSecureJsonAtomic(filepath, value, { durable = true } = {}) {
|
|
|
124073
124475
|
throw error;
|
|
124074
124476
|
}
|
|
124075
124477
|
}
|
|
124076
|
-
var
|
|
124478
|
+
var import_node_crypto108, import_node_fs180, import_node_path185;
|
|
124077
124479
|
var init_secure_file = __esm({
|
|
124078
124480
|
"cli/secure-file.ts"() {
|
|
124079
124481
|
"use strict";
|
|
124080
|
-
|
|
124482
|
+
import_node_crypto108 = require("node:crypto");
|
|
124081
124483
|
import_node_fs180 = require("node:fs");
|
|
124082
124484
|
import_node_path185 = require("node:path");
|
|
124083
124485
|
}
|
|
@@ -126439,11 +126841,11 @@ function createCloudSession(input) {
|
|
|
126439
126841
|
}
|
|
126440
126842
|
return session;
|
|
126441
126843
|
}
|
|
126442
|
-
var
|
|
126844
|
+
var import_node_crypto109, import_node_fs182, import_node_path187, CLOUD_SESSION_VERSION, MAX_ENCODED_SESSION_BYTES, RNX_SHELL_UPDATE_PREFIX, RNX_SHELL_UPDATE_SET_PREFIX, RNX_SHELL_UPDATE_UNSET;
|
|
126443
126845
|
var init_cloud_session = __esm({
|
|
126444
126846
|
"cli/cloud-session.ts"() {
|
|
126445
126847
|
"use strict";
|
|
126446
|
-
|
|
126848
|
+
import_node_crypto109 = require("node:crypto");
|
|
126447
126849
|
import_node_fs182 = require("node:fs");
|
|
126448
126850
|
import_node_path187 = require("node:path");
|
|
126449
126851
|
init_backend_origin();
|
|
@@ -126705,7 +127107,7 @@ function listMetroAssetDest(assetsPath) {
|
|
|
126705
127107
|
return { directory: directory2, files: files2, truncated };
|
|
126706
127108
|
}
|
|
126707
127109
|
function metroDescriptorHash(scaleBytes) {
|
|
126708
|
-
const hasher = (0,
|
|
127110
|
+
const hasher = (0, import_node_crypto110.createHash)("md5");
|
|
126709
127111
|
for (const bytes of scaleBytes) hasher.update(bytes);
|
|
126710
127112
|
return hasher.digest("hex");
|
|
126711
127113
|
}
|
|
@@ -126734,7 +127136,7 @@ function distinctByContent(directory2, options2) {
|
|
|
126734
127136
|
} catch {
|
|
126735
127137
|
continue;
|
|
126736
127138
|
}
|
|
126737
|
-
const digest3 = (0,
|
|
127139
|
+
const digest3 = (0, import_node_crypto110.createHash)("md5").update(bytes).digest("hex");
|
|
126738
127140
|
if (!byContent.has(digest3)) byContent.set(digest3, relative6);
|
|
126739
127141
|
}
|
|
126740
127142
|
return [...byContent.values()];
|
|
@@ -126782,7 +127184,7 @@ function placeMetroDescriptor(listing, descriptor) {
|
|
|
126782
127184
|
continue;
|
|
126783
127185
|
}
|
|
126784
127186
|
const identical = fileHashes2 ? bytes.every((file, index) => {
|
|
126785
|
-
const digest3 = (0,
|
|
127187
|
+
const digest3 = (0, import_node_crypto110.createHash)("md5").update(file).digest("hex");
|
|
126786
127188
|
return descriptor.scales.some(
|
|
126787
127189
|
(scale, declared) => scale === scales[index] && fileHashes2[declared] === digest3
|
|
126788
127190
|
);
|
|
@@ -126807,7 +127209,7 @@ function unverifiedContentKey(dest, fileDigests2) {
|
|
|
126807
127209
|
const file = (0, import_node_path189.join)(dest.directory, relative6);
|
|
126808
127210
|
let digest3 = fileDigests2.get(file);
|
|
126809
127211
|
if (digest3 === void 0) {
|
|
126810
|
-
digest3 = (0,
|
|
127212
|
+
digest3 = (0, import_node_crypto110.createHash)("sha256").update((0, import_node_fs184.readFileSync)(file)).digest("hex");
|
|
126811
127213
|
fileDigests2.set(file, digest3);
|
|
126812
127214
|
}
|
|
126813
127215
|
return [scale, digest3];
|
|
@@ -127096,7 +127498,7 @@ async function produceArtifact(prepared, maxBytes, command) {
|
|
|
127096
127498
|
}
|
|
127097
127499
|
return {
|
|
127098
127500
|
bytes,
|
|
127099
|
-
sha256: (0,
|
|
127501
|
+
sha256: (0, import_node_crypto110.createHash)("sha256").update(bytes).digest("hex"),
|
|
127100
127502
|
receipt: artifact.receipt,
|
|
127101
127503
|
assetsDirectory: prepared.dest?.directory ?? null,
|
|
127102
127504
|
warnings
|
|
@@ -127201,11 +127603,11 @@ async function createCloudBox(options2) {
|
|
|
127201
127603
|
warnings: artifact.warnings
|
|
127202
127604
|
};
|
|
127203
127605
|
}
|
|
127204
|
-
var
|
|
127606
|
+
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, MAX_ASSET_DEST_FILES, ACCOUNT_CHOICE_REFUSALS, PROJECT_ONLY_DIRECTORIES, MAX_PLACEMENT_COMBINATIONS;
|
|
127205
127607
|
var init_cloud_client = __esm({
|
|
127206
127608
|
"cli/cloud-client.ts"() {
|
|
127207
127609
|
"use strict";
|
|
127208
|
-
|
|
127610
|
+
import_node_crypto110 = require("node:crypto");
|
|
127209
127611
|
import_node_fs184 = require("node:fs");
|
|
127210
127612
|
import_node_path189 = require("node:path");
|
|
127211
127613
|
import_node_vm = require("node:vm");
|
|
@@ -128972,7 +129374,7 @@ function serveAppPackageResource(req, res) {
|
|
|
128972
129374
|
init_fetch_proxy_handler();
|
|
128973
129375
|
|
|
128974
129376
|
// src/host/fetch-proxy-transport.ts
|
|
128975
|
-
var
|
|
129377
|
+
var import_node_crypto89 = require("node:crypto");
|
|
128976
129378
|
var import_node_fs147 = require("node:fs");
|
|
128977
129379
|
var import_node_http23 = require("node:http2");
|
|
128978
129380
|
var import_node_path149 = __toESM(require("node:path"), 1);
|
|
@@ -129005,7 +129407,7 @@ async function createIdentity() {
|
|
|
129005
129407
|
const keys = await crypto.subtle.generateKey(algorithm, true, ["sign", "verify"]);
|
|
129006
129408
|
const certificate = await import_x5092.X509CertificateGenerator.createSelfSigned(
|
|
129007
129409
|
{
|
|
129008
|
-
serialNumber: (0,
|
|
129410
|
+
serialNumber: (0, import_node_crypto89.randomBytes)(16).toString("hex"),
|
|
129009
129411
|
name: "CN=localhost",
|
|
129010
129412
|
notBefore: new Date(Date.now() - 6e4),
|
|
129011
129413
|
notAfter: new Date(Date.now() + 365 * 24 * 60 * 6e4),
|
|
@@ -129024,7 +129426,7 @@ async function createIdentity() {
|
|
|
129024
129426
|
${privateKey.toString("base64").match(/.{1,64}/g)?.join("\n")}
|
|
129025
129427
|
-----END PRIVATE KEY-----
|
|
129026
129428
|
`,
|
|
129027
|
-
spki: (0,
|
|
129429
|
+
spki: (0, import_node_crypto89.createHash)("sha256").update(Buffer.from(await crypto.subtle.exportKey("spki", keys.publicKey))).digest("base64")
|
|
129028
129430
|
};
|
|
129029
129431
|
}
|
|
129030
129432
|
async function startFetchProxyTransport(identityPath, hasLiveSims = () => false) {
|