peachsim 0.1.2792 → 0.1.2794
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 +1162 -997
- 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-WRJUSJKZ.mjs → acorn-A7OMJDVK.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-KM6MA4GX.mjs → chunk-2TCGEMEV.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-LKQFWHTY.mjs → chunk-35HEHEYA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T2AWHCFQ.mjs → chunk-5RQ3U7WK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HLTCPSRU.mjs → chunk-7QNWHCMJ.mjs} +1121 -1060
- package/dist-lib/esm-chunks/{chunk-MPN7ASMV.mjs → chunk-ANIC22U3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2RLCLA6D.mjs → chunk-AW4Z3K2U.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UIMK6KUZ.mjs → chunk-B3E5ZI2D.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GSH5UN7J.mjs → chunk-CIFEHSEA.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-DTUV3X2Q.mjs → chunk-CIR4VZ22.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JGMADAGT.mjs → chunk-DLEQ5NZ5.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-KZF5BL3C.mjs → chunk-E6KA576K.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ETD4V3AD.mjs → chunk-GDITZ3K2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6WTE57J5.mjs → chunk-GHGDWJY3.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-47WU4TMV.mjs → chunk-K7RLWF5X.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6M75JXV2.mjs → chunk-KVFRYFZI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YIQKUSLV.mjs → chunk-NKJ67PFZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OLGTAPUD.mjs → chunk-O6HHWO4Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WDTW47HC.mjs → chunk-OS6YJU3W.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IVMQXMAB.mjs → chunk-PRYC6EMT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T66EPEFI.mjs → chunk-R6ES6QCH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GGEXRAIP.mjs → chunk-TJULYSLY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-U66IKMQZ.mjs → chunk-V6BE34Q3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NHFLYRY6.mjs → chunk-Y6YMRYNX.mjs} +64 -21
- package/dist-lib/esm-chunks/{chunk-AWVOMHWY.mjs → chunk-ZTDPCBGG.mjs} +3 -3
- package/dist-lib/esm-chunks/{metro-layout-parser-DCAE4BLG.mjs → metro-layout-parser-WG2ITRQD.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-PP63JS2U.mjs → swift-package-prebuilt-DN7G5XKR.mjs} +16 -13
- package/dist-lib/esm-chunks/{swift-sdk-app-module-Q5PK6AH4.mjs → swift-sdk-app-module-3DB4F4Y2.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-NTCJSARK.mjs → swift-sdk-image-JTYM3OQY.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-KIVLLITM.mjs → swift-sdk-image-producer-QQUODPXF.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +1104 -939
- 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 +3747 -3456
- package/dist-lib/host/fetch-proxy-handler.cjs +121 -117
- 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 +3 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- 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 +85 -85
- package/dist-lib/public-origins-lib.json +76 -76
- 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 +2032 -1741
- package/dist-lib/swift-compile.cjs +1061 -967
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/engine/image-fetch.d.ts +0 -4
- package/dist-types/packages/peach-engine/src/engine/scene-native-binding.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/native-hot-ops.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/nativeReanimatedCSSContract.d.ts +7 -7
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-css-contract.d.ts +1 -20
- package/dist-types/packages/peach-engine/src/render-worker/scene-packet-feed.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +5 -23
- package/dist-types/packages/peach-engine/src/render-worker/worklet-wire.d.ts +4 -49
- package/package.json +1 -1
- package/src/one-native-controls-package.ts +56 -54
- package/src/swift-compile.ts +1034 -967
- package/src/swift-compiler-digest.ts +79 -4
- package/src/swift-host.ts +246 -91
- package/src/swift-package-prebuilt.ts +6 -3
- package/src/swift-sdk-surface.ts +75 -20
- package/src/swift-startup-split.ts +134 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2794 | (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;
|
|
@@ -19579,16 +19579,16 @@ var init_react_native_core_digest = __esm({
|
|
|
19579
19579
|
|
|
19580
19580
|
// src/swift-compiler-digest.ts
|
|
19581
19581
|
function swiftArchiveCompilerDigestValue() {
|
|
19582
|
-
return true ? "
|
|
19582
|
+
return true ? "9f3ce81119383c0a06504b3325d9b5dcd291f804e34d31b83428ee6fa494df7f" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname, "archive");
|
|
19583
19583
|
}
|
|
19584
|
-
var import_node_crypto16, import_node_fs32, import_node_path31, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
19584
|
+
var import_node_crypto16, import_node_fs32, import_node_os8, import_node_path31, SWIFT_DIGEST_SOURCES, LINKED_IMAGE_SOURCES, SWIFT_ARCHIVE_DIGEST_SOURCES;
|
|
19585
19585
|
var init_swift_compiler_digest = __esm({
|
|
19586
19586
|
"src/swift-compiler-digest.ts"() {
|
|
19587
19587
|
"use strict";
|
|
19588
19588
|
import_node_crypto16 = require("node:crypto");
|
|
19589
19589
|
import_node_fs32 = require("node:fs");
|
|
19590
|
+
import_node_os8 = __toESM(require("node:os"), 1);
|
|
19590
19591
|
import_node_path31 = __toESM(require("node:path"), 1);
|
|
19591
|
-
init_swift_objc_sdk_tree();
|
|
19592
19592
|
SWIFT_DIGEST_SOURCES = [
|
|
19593
19593
|
"swift-compile.ts",
|
|
19594
19594
|
"swift-sdk-surface.ts",
|
|
@@ -19726,13 +19726,13 @@ var init_swift_standin_digest = __esm({
|
|
|
19726
19726
|
];
|
|
19727
19727
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
19728
19728
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
19729
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
19729
|
+
STANDIN_SOURCE_DIGEST = true ? "3f378daefc4c950a9d25cfd3184475a07f63966495c86443c5058ef8f9dd3ac9" : standinSourceDigest();
|
|
19730
19730
|
}
|
|
19731
19731
|
});
|
|
19732
19732
|
|
|
19733
19733
|
// src/expo-native-compiler-digest.ts
|
|
19734
19734
|
function expoNativeCompilerDigestValue() {
|
|
19735
|
-
return true ? "
|
|
19735
|
+
return true ? "b4e25c90e8991056f9eabb85f4bd74963cb974e51d846f32f7c48265169d029c" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
19736
19736
|
}
|
|
19737
19737
|
var import_node_crypto18;
|
|
19738
19738
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -20279,7 +20279,7 @@ var init_oneSdkContract = __esm({
|
|
|
20279
20279
|
|
|
20280
20280
|
// src/one-sdk-preparation.ts
|
|
20281
20281
|
async function generateAppSdkInChild(generatorFile, frameworks, options2) {
|
|
20282
|
-
const directory2 = import_node_fs37.default.mkdtempSync(import_node_path36.default.join(
|
|
20282
|
+
const directory2 = import_node_fs37.default.mkdtempSync(import_node_path36.default.join(import_node_os9.default.tmpdir(), "peach-one-sdk-"));
|
|
20283
20283
|
const resultFile = import_node_path36.default.join(directory2, "result.json");
|
|
20284
20284
|
try {
|
|
20285
20285
|
const child = (0, import_node_child_process18.spawn)(
|
|
@@ -20466,7 +20466,7 @@ async function prepareOneSDKSources(appRoot, output) {
|
|
|
20466
20466
|
if (!import_node_fs37.default.existsSync(localManifestPath)) throw error;
|
|
20467
20467
|
}
|
|
20468
20468
|
}
|
|
20469
|
-
var import_node_child_process18, import_node_crypto20, import_node_fs37, import_node_module7,
|
|
20469
|
+
var import_node_child_process18, import_node_crypto20, import_node_fs37, import_node_module7, import_node_os9, import_node_path36, import_node_url2, import_sucrase2, GENERATE_SCRIPT;
|
|
20470
20470
|
var init_one_sdk_preparation = __esm({
|
|
20471
20471
|
"src/one-sdk-preparation.ts"() {
|
|
20472
20472
|
"use strict";
|
|
@@ -20474,7 +20474,7 @@ var init_one_sdk_preparation = __esm({
|
|
|
20474
20474
|
import_node_crypto20 = require("node:crypto");
|
|
20475
20475
|
import_node_fs37 = __toESM(require("node:fs"), 1);
|
|
20476
20476
|
import_node_module7 = require("node:module");
|
|
20477
|
-
|
|
20477
|
+
import_node_os9 = __toESM(require("node:os"), 1);
|
|
20478
20478
|
import_node_path36 = __toESM(require("node:path"), 1);
|
|
20479
20479
|
import_node_url2 = require("node:url");
|
|
20480
20480
|
import_sucrase2 = require("peachsim/vendor/sucrase");
|
|
@@ -23488,7 +23488,7 @@ var init_swift_shared_sdk = __esm({
|
|
|
23488
23488
|
// src/swift-darwin-records.ts
|
|
23489
23489
|
function compileDarwinRecords(args) {
|
|
23490
23490
|
const records = import_node_path39.default.join(args.packageRoot, "Sources/DarwinRecords");
|
|
23491
|
-
const runtime = (0, import_node_fs41.mkdtempSync)(import_node_path39.default.join((0,
|
|
23491
|
+
const runtime = (0, import_node_fs41.mkdtempSync)(import_node_path39.default.join((0, import_node_os10.tmpdir)(), "peach-objc-runtime-"));
|
|
23492
23492
|
(0, import_node_fs41.symlinkSync)(import_node_path39.default.join(args.darwin, "usr/include/objc"), import_node_path39.default.join(runtime, "objc"));
|
|
23493
23493
|
const objects = (0, import_node_fs41.readdirSync)(records).filter((file) => file.endsWith(".c") || file.endsWith(".m")).sort((a, b) => a < b ? -1 : a > b ? 1 : 0).map((file) => {
|
|
23494
23494
|
const object8 = import_node_path39.default.join(
|
|
@@ -23531,13 +23531,13 @@ function compileDarwinRecords(args) {
|
|
|
23531
23531
|
(0, import_node_fs41.rmSync)(runtime, { recursive: true });
|
|
23532
23532
|
return objects;
|
|
23533
23533
|
}
|
|
23534
|
-
var import_node_child_process20, import_node_fs41,
|
|
23534
|
+
var import_node_child_process20, import_node_fs41, import_node_os10, import_node_path39, DARWIN_RECORDS_PREFIX, darwinRecordsMinimum;
|
|
23535
23535
|
var init_swift_darwin_records = __esm({
|
|
23536
23536
|
"src/swift-darwin-records.ts"() {
|
|
23537
23537
|
"use strict";
|
|
23538
23538
|
import_node_child_process20 = require("node:child_process");
|
|
23539
23539
|
import_node_fs41 = require("node:fs");
|
|
23540
|
-
|
|
23540
|
+
import_node_os10 = require("node:os");
|
|
23541
23541
|
import_node_path39 = __toESM(require("node:path"), 1);
|
|
23542
23542
|
init_swift_objc_platform();
|
|
23543
23543
|
init_swift_objc_runtime();
|
|
@@ -37111,13 +37111,13 @@ var init_swift_source_mask = __esm({
|
|
|
37111
37111
|
// src/swift-sdk-surface.ts
|
|
37112
37112
|
function swiftBuildJobs() {
|
|
37113
37113
|
const admittedCores = windowAdmission()?.cores ?? Number(process.env.TM_EXEC_CPU_CORES);
|
|
37114
|
-
const parallelism = Math.max(1,
|
|
37114
|
+
const parallelism = Math.max(1, import_node_os11.default.availableParallelism());
|
|
37115
37115
|
if (!Number.isInteger(admittedCores) || admittedCores <= 0)
|
|
37116
37116
|
return Math.min(4, Math.max(1, Math.floor(parallelism / 2)));
|
|
37117
37117
|
const cores = Math.min(admittedCores, parallelism);
|
|
37118
37118
|
if (process.platform === "darwin") return cores;
|
|
37119
37119
|
const memory = process.env.TM_EXEC_ADMITTED === "1" && process.env.LINUX_BUILD_SCOPE ? Number(process.env.TM_EXEC_LINUX_MEMORY_MAX) : NaN;
|
|
37120
|
-
const effectiveMemory = Number.isSafeInteger(memory) && memory > 0 ? memory :
|
|
37120
|
+
const effectiveMemory = Number.isSafeInteger(memory) && memory > 0 ? memory : import_node_os11.default.totalmem();
|
|
37121
37121
|
const memoryJobs = Math.max(1, Math.floor(effectiveMemory / (2 * 1024 ** 3)));
|
|
37122
37122
|
return Math.min(cores, memoryJobs);
|
|
37123
37123
|
}
|
|
@@ -37448,6 +37448,16 @@ function swiftMacroPlugins(moduleRoot) {
|
|
|
37448
37448
|
stale: [...libraries, ...executables, stamp].some((file) => !(0, import_node_fs55.existsSync)(file)) || (0, import_node_fs55.readFileSync)(stamp, "utf8").trim() !== release
|
|
37449
37449
|
};
|
|
37450
37450
|
}
|
|
37451
|
+
function withSwiftModuleDigestScope(fn) {
|
|
37452
|
+
if (moduleDigestScopes.getStore()) return fn();
|
|
37453
|
+
return moduleDigestScopes.run(/* @__PURE__ */ new Map(), fn);
|
|
37454
|
+
}
|
|
37455
|
+
function clearSwiftModuleDigestScope(root) {
|
|
37456
|
+
const scope2 = moduleDigestScopes.getStore();
|
|
37457
|
+
if (!scope2) return;
|
|
37458
|
+
if (root === void 0) scope2.clear();
|
|
37459
|
+
else scope2.delete(import_node_path53.default.resolve(root));
|
|
37460
|
+
}
|
|
37451
37461
|
function gitCleanModuleInputsKey(root, files2) {
|
|
37452
37462
|
if (swiftDistributionAt(root)) return null;
|
|
37453
37463
|
const top = (0, import_node_child_process29.spawnSync)("git", ["-C", root, "rev-parse", "--show-toplevel"], {
|
|
@@ -37511,7 +37521,11 @@ function gitCleanModuleInputsKey(root, files2) {
|
|
|
37511
37521
|
for (const file of files2) keyHash.update(file).update("\n");
|
|
37512
37522
|
return keyHash.digest("hex");
|
|
37513
37523
|
}
|
|
37514
|
-
function
|
|
37524
|
+
function swiftModuleEntry(root) {
|
|
37525
|
+
const scope2 = moduleDigestScopes.getStore();
|
|
37526
|
+
const key2 = import_node_path53.default.resolve(root);
|
|
37527
|
+
const scoped = scope2?.get(key2);
|
|
37528
|
+
if (scoped) return scoped;
|
|
37515
37529
|
const files2 = swiftModuleInputFiles(root);
|
|
37516
37530
|
const stampHash = (0, import_node_crypto34.createHash)("sha256");
|
|
37517
37531
|
for (const file of files2) {
|
|
@@ -37524,7 +37538,10 @@ function swiftModuleDigest(root) {
|
|
|
37524
37538
|
}
|
|
37525
37539
|
const stamp = stampHash.digest("hex");
|
|
37526
37540
|
const cached2 = linkedModuleDigests.get(root);
|
|
37527
|
-
if (cached2?.stamp === stamp)
|
|
37541
|
+
if (cached2?.stamp === stamp) {
|
|
37542
|
+
scope2?.set(key2, cached2);
|
|
37543
|
+
return cached2;
|
|
37544
|
+
}
|
|
37528
37545
|
const digestDir = import_node_path53.default.join(swiftCacheDir(), "swift-module-digests");
|
|
37529
37546
|
const record5 = import_node_path53.default.join(
|
|
37530
37547
|
digestDir,
|
|
@@ -37540,8 +37557,10 @@ function swiftModuleDigest(root) {
|
|
|
37540
37557
|
const saved = JSON.parse((0, import_node_fs55.readFileSync)(record5, "utf8"));
|
|
37541
37558
|
if (saved && typeof saved === "object" && Reflect.get(saved, "stamp") === stamp && typeof Reflect.get(saved, "digest") === "string") {
|
|
37542
37559
|
const digest3 = Buffer.from(String(Reflect.get(saved, "digest")), "hex");
|
|
37543
|
-
|
|
37544
|
-
|
|
37560
|
+
const entry2 = { stamp, digest: digest3 };
|
|
37561
|
+
linkedModuleDigests.set(root, entry2);
|
|
37562
|
+
scope2?.set(key2, entry2);
|
|
37563
|
+
return entry2;
|
|
37545
37564
|
}
|
|
37546
37565
|
}
|
|
37547
37566
|
const gitKey = gitCleanModuleInputsKey(root, files2);
|
|
@@ -37551,9 +37570,11 @@ function swiftModuleDigest(root) {
|
|
|
37551
37570
|
if (saved && typeof saved === "object" && typeof Reflect.get(saved, "digest") === "string") {
|
|
37552
37571
|
const hex2 = String(Reflect.get(saved, "digest"));
|
|
37553
37572
|
const digest3 = Buffer.from(hex2, "hex");
|
|
37554
|
-
|
|
37573
|
+
const entry2 = { stamp, digest: digest3 };
|
|
37574
|
+
linkedModuleDigests.set(root, entry2);
|
|
37575
|
+
scope2?.set(key2, entry2);
|
|
37555
37576
|
writeRecord(record5, JSON.stringify({ stamp, digest: hex2 }));
|
|
37556
|
-
return
|
|
37577
|
+
return entry2;
|
|
37557
37578
|
}
|
|
37558
37579
|
}
|
|
37559
37580
|
const hash = (0, import_node_crypto34.createHash)("sha256");
|
|
@@ -37565,10 +37586,18 @@ function swiftModuleDigest(root) {
|
|
|
37565
37586
|
}
|
|
37566
37587
|
const digest2 = hash.digest();
|
|
37567
37588
|
const hex = digest2.toString("hex");
|
|
37568
|
-
|
|
37589
|
+
const entry = { stamp, digest: digest2 };
|
|
37590
|
+
linkedModuleDigests.set(root, entry);
|
|
37591
|
+
scope2?.set(key2, entry);
|
|
37569
37592
|
writeRecord(record5, JSON.stringify({ stamp, digest: hex }));
|
|
37570
37593
|
if (gitRecord) writeRecord(gitRecord, JSON.stringify({ digest: hex }));
|
|
37571
|
-
return
|
|
37594
|
+
return entry;
|
|
37595
|
+
}
|
|
37596
|
+
function swiftModuleDigest(root) {
|
|
37597
|
+
return swiftModuleEntry(root).digest;
|
|
37598
|
+
}
|
|
37599
|
+
function swiftModuleStamp(root) {
|
|
37600
|
+
return swiftModuleEntry(root).stamp;
|
|
37572
37601
|
}
|
|
37573
37602
|
function swiftCompileSurfaceDigest(root) {
|
|
37574
37603
|
const distribution = swiftDistributionAt(root);
|
|
@@ -37659,8 +37688,10 @@ function* swiftConditionalLines(contents2, available2, defines) {
|
|
|
37659
37688
|
}
|
|
37660
37689
|
}
|
|
37661
37690
|
function swiftImportNames(contents2, available2, defines) {
|
|
37662
|
-
if (
|
|
37663
|
-
|
|
37691
|
+
if (!contents2.includes("import")) return [];
|
|
37692
|
+
const definesKey = available2 === void 0 ? defines ? [...defines].sort().join("\0") : "" : void 0;
|
|
37693
|
+
if (definesKey !== void 0) {
|
|
37694
|
+
const cached2 = importNamesCache.get(definesKey)?.get(contents2);
|
|
37664
37695
|
if (cached2 !== void 0) return cached2;
|
|
37665
37696
|
}
|
|
37666
37697
|
const names = [];
|
|
@@ -37669,8 +37700,14 @@ function swiftImportNames(contents2, available2, defines) {
|
|
|
37669
37700
|
const name3 = SWIFT_IMPORT.exec(line)?.[1];
|
|
37670
37701
|
if (name3) names.push(name3);
|
|
37671
37702
|
}
|
|
37672
|
-
if (
|
|
37673
|
-
importNamesCache.
|
|
37703
|
+
if (definesKey !== void 0) {
|
|
37704
|
+
let bucket = importNamesCache.get(definesKey);
|
|
37705
|
+
if (!bucket) {
|
|
37706
|
+
bucket = /* @__PURE__ */ new Map();
|
|
37707
|
+
importNamesCache.set(definesKey, bucket);
|
|
37708
|
+
}
|
|
37709
|
+
bucket.set(contents2, names);
|
|
37710
|
+
}
|
|
37674
37711
|
return names;
|
|
37675
37712
|
}
|
|
37676
37713
|
function swiftPeachModules(moduleRoot) {
|
|
@@ -37960,11 +37997,15 @@ function swiftCTakesReturnAddress(source) {
|
|
|
37960
37997
|
cActiveCode(stripCCode(source), wasmMacroEnvironment)
|
|
37961
37998
|
);
|
|
37962
37999
|
}
|
|
37963
|
-
function
|
|
38000
|
+
function swiftModuleRelease(root) {
|
|
37964
38001
|
const pin2 = swiftDistributionAt(root) ?? JSON.parse((0, import_node_fs55.readFileSync)(import_node_path53.default.join(root, "toolchain.json"), "utf8"));
|
|
38002
|
+
return pin2.release;
|
|
38003
|
+
}
|
|
38004
|
+
function swiftModuleCompiler(root) {
|
|
38005
|
+
const release = swiftModuleRelease(root);
|
|
37965
38006
|
return {
|
|
37966
|
-
release
|
|
37967
|
-
toolchainBin: swiftCompiler(
|
|
38007
|
+
release,
|
|
38008
|
+
toolchainBin: swiftCompiler(release)
|
|
37968
38009
|
};
|
|
37969
38010
|
}
|
|
37970
38011
|
function swiftModuleToolchain(root) {
|
|
@@ -37977,14 +38018,15 @@ function remoteSwiftCheckouts(root) {
|
|
|
37977
38018
|
(0, import_node_fs55.mkdirSync)(cache, { recursive: true });
|
|
37978
38019
|
return import_node_path53.default.join((0, import_node_fs55.realpathSync)(cache), "swift-packages", key2, "checkouts");
|
|
37979
38020
|
}
|
|
37980
|
-
var import_node_child_process29, import_node_crypto34, import_node_fs55,
|
|
38021
|
+
var import_node_async_hooks2, import_node_child_process29, import_node_crypto34, import_node_fs55, import_node_os11, import_node_path53, distributionManifests, distributionCompileViews, REACH_STAGED_FRAMEWORKS, objcEnumerations, clangDeclarationEnumCache, objcEnumForward, sdkDeclarationOwners, swiftInterfaceDeclarations, linkedModuleDigests, moduleDigestScopes, compileSurfaces, SWIFT_IMPORT, kleeneNot, kleeneAnd, kleeneOr, NON_IOS_MODULES, importNamesCache, sdkPaths, FOUNDATION_IMPLICIT_MODULES, FRAMEWORK_COMPANION_IMPORT, codeMasks, codeMaskChars, CODE_MASK_CACHE_CHARS, FOUNDATION_NETWORKING_TYPES, FOUNDATION_OVERLAY_TYPES, FOUNDATION_OVERLAY_GLOBALS, CORE_FOUNDATION_OVERLAY_GLOBALS, emptyMacroEnvironment, wasmMacroEnvironment, swiftBinaryOnDisk;
|
|
37981
38022
|
var init_swift_sdk_surface = __esm({
|
|
37982
38023
|
"src/swift-sdk-surface.ts"() {
|
|
37983
38024
|
"use strict";
|
|
38025
|
+
import_node_async_hooks2 = require("node:async_hooks");
|
|
37984
38026
|
import_node_child_process29 = require("node:child_process");
|
|
37985
38027
|
import_node_crypto34 = require("node:crypto");
|
|
37986
38028
|
import_node_fs55 = require("node:fs");
|
|
37987
|
-
|
|
38029
|
+
import_node_os11 = __toESM(require("node:os"), 1);
|
|
37988
38030
|
import_node_path53 = __toESM(require("node:path"), 1);
|
|
37989
38031
|
init_swift_source_mask();
|
|
37990
38032
|
init_admitted_mac_build();
|
|
@@ -38018,6 +38060,7 @@ var init_swift_sdk_surface = __esm({
|
|
|
38018
38060
|
].map((m) => m[1])
|
|
38019
38061
|
]);
|
|
38020
38062
|
linkedModuleDigests = /* @__PURE__ */ new Map();
|
|
38063
|
+
moduleDigestScopes = new import_node_async_hooks2.AsyncLocalStorage();
|
|
38021
38064
|
compileSurfaces = /* @__PURE__ */ new WeakMap();
|
|
38022
38065
|
SWIFT_IMPORT = /^\s*(?:@\w+(?:\([^)]*\))?\s+|(?:public|package|internal|fileprivate|private)\s+)*import\s+(?:(?:typealias|struct|class|enum|protocol|let|var|func)\s+)?([A-Za-z_][A-Za-z0-9_]*)/;
|
|
38023
38066
|
kleeneNot = (value) => value === void 0 ? void 0 : !value;
|
|
@@ -38457,7 +38500,7 @@ function dumpInputs(dir, xcode) {
|
|
|
38457
38500
|
swiftCodeScan(source).lineStarts,
|
|
38458
38501
|
(line) => line.replace(
|
|
38459
38502
|
MANIFEST_HOST_OS,
|
|
38460
|
-
(match,
|
|
38503
|
+
(match, os26) => (os26 === "macOS" ? "true" : "false").padEnd(match.length)
|
|
38461
38504
|
)
|
|
38462
38505
|
);
|
|
38463
38506
|
if (projected !== source) overlays.push({ name: name3, source: projected });
|
|
@@ -38904,7 +38947,7 @@ let package = Package(
|
|
|
38904
38947
|
]
|
|
38905
38948
|
)
|
|
38906
38949
|
`;
|
|
38907
|
-
const dir = import_node_fs56.default.mkdtempSync(import_node_path54.default.join(
|
|
38950
|
+
const dir = import_node_fs56.default.mkdtempSync(import_node_path54.default.join(import_node_os12.default.tmpdir(), "peach-resolve-"));
|
|
38908
38951
|
import_node_fs56.default.writeFileSync(import_node_path54.default.join(dir, "Package.swift"), manifest);
|
|
38909
38952
|
const args = [
|
|
38910
38953
|
"package",
|
|
@@ -38971,14 +39014,14 @@ function swiftTargetFiles(manifest, target) {
|
|
|
38971
39014
|
}
|
|
38972
39015
|
return [...new Set(files2)].sort();
|
|
38973
39016
|
}
|
|
38974
|
-
var import_node_child_process30, import_node_crypto35, import_node_fs56,
|
|
39017
|
+
var import_node_child_process30, import_node_crypto35, import_node_fs56, import_node_os12, import_node_path54, import_node_util7, TARGET_TYPES, targetRelative, isTargetType, record2, array5, string5, swiftCommand, cacheDir2, evaluated, execFileAsync2, cachedToolchain, SwiftManifestPreparationRequired, MANIFEST_HOST_OS, manifestPreparations, GUEST_PLATFORMS, within, requirementClause;
|
|
38975
39018
|
var init_swift_package_manifest = __esm({
|
|
38976
39019
|
"src/swift-package-manifest.ts"() {
|
|
38977
39020
|
"use strict";
|
|
38978
39021
|
import_node_child_process30 = require("node:child_process");
|
|
38979
39022
|
import_node_crypto35 = require("node:crypto");
|
|
38980
39023
|
import_node_fs56 = __toESM(require("node:fs"), 1);
|
|
38981
|
-
|
|
39024
|
+
import_node_os12 = __toESM(require("node:os"), 1);
|
|
38982
39025
|
import_node_path54 = __toESM(require("node:path"), 1);
|
|
38983
39026
|
import_node_util7 = require("node:util");
|
|
38984
39027
|
init_git_repo_env();
|
|
@@ -39163,7 +39206,7 @@ function swiftHostLibraryView(root, executables) {
|
|
|
39163
39206
|
}
|
|
39164
39207
|
const triple = process.arch === "x64" ? "x86_64-linux-gnu" : "aarch64-linux-gnu";
|
|
39165
39208
|
const libraries = import_node_path55.default.join(root, "usr/lib", triple);
|
|
39166
|
-
const view = import_node_fs57.default.mkdtempSync(import_node_path55.default.join(
|
|
39209
|
+
const view = import_node_fs57.default.mkdtempSync(import_node_path55.default.join(import_node_os13.default.tmpdir(), "peach-swift-libraries-"));
|
|
39167
39210
|
const linked = /* @__PURE__ */ new Set();
|
|
39168
39211
|
try {
|
|
39169
39212
|
while (missing.length) {
|
|
@@ -39186,7 +39229,7 @@ function swiftHostLibraryView(root, executables) {
|
|
|
39186
39229
|
}
|
|
39187
39230
|
async function installSwiftToolchain(release, sdk2, signal, compilerOnly = false) {
|
|
39188
39231
|
const root = import_node_path55.default.resolve(swiftToolchainBin(release), "../..");
|
|
39189
|
-
const owned = process.platform === "darwin" ? import_node_path55.default.join(
|
|
39232
|
+
const owned = process.platform === "darwin" ? import_node_path55.default.join(import_node_os13.default.homedir(), "Library/Developer/Toolchains", `${release}.xctoolchain`) : import_node_path55.default.join(rnxHomeDir(), "swift", "toolchains", release);
|
|
39190
39233
|
const selectedCompiler = process.platform === "darwin" && import_node_fs57.default.existsSync(import_node_path55.default.join(root, "usr/bin/swift"));
|
|
39191
39234
|
const ownsCompiler = release.includes("-custom-") && root === owned && !selectedCompiler;
|
|
39192
39235
|
const executables = ["swift", "swift-package", "swift-frontend", "wasm-ld"].map(
|
|
@@ -39301,13 +39344,13 @@ async function resolveSwiftPackageRequirementsAsync(requirements, destination, s
|
|
|
39301
39344
|
import_node_fs57.default.rmSync(dir, { recursive: true, force: true });
|
|
39302
39345
|
}
|
|
39303
39346
|
}
|
|
39304
|
-
var import_node_child_process31, import_node_fs57,
|
|
39347
|
+
var import_node_child_process31, import_node_fs57, import_node_os13, import_node_path55, import_node_util8, SWIFT_ENDPOINT_ENV, DEFAULT_SWIFT_ENDPOINT, installs, staleWarned, hostLibraryViews;
|
|
39305
39348
|
var init_swift_distribution = __esm({
|
|
39306
39349
|
"src/swift-distribution.ts"() {
|
|
39307
39350
|
"use strict";
|
|
39308
39351
|
import_node_child_process31 = require("node:child_process");
|
|
39309
39352
|
import_node_fs57 = __toESM(require("node:fs"), 1);
|
|
39310
|
-
|
|
39353
|
+
import_node_os13 = __toESM(require("node:os"), 1);
|
|
39311
39354
|
import_node_path55 = __toESM(require("node:path"), 1);
|
|
39312
39355
|
import_node_util8 = require("node:util");
|
|
39313
39356
|
init_src();
|
|
@@ -39437,7 +39480,7 @@ function rootLockKey(root) {
|
|
|
39437
39480
|
return import_node_path56.default.join(backingPath, ...missing);
|
|
39438
39481
|
}
|
|
39439
39482
|
function swiftRootLocksDir() {
|
|
39440
|
-
return import_node_path56.default.join((0,
|
|
39483
|
+
return import_node_path56.default.join((0, import_node_os14.homedir)(), ".peach", "cache", "swift-root-locks");
|
|
39441
39484
|
}
|
|
39442
39485
|
function withSwiftRootReadHolds(work) {
|
|
39443
39486
|
const holds = [];
|
|
@@ -39619,15 +39662,15 @@ async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
|
39619
39662
|
(0, import_node_fs58.writeFileSync)(import_node_path56.default.join(directory2, name2(held, "released")), "");
|
|
39620
39663
|
}
|
|
39621
39664
|
}
|
|
39622
|
-
var
|
|
39665
|
+
var import_node_async_hooks3, import_node_child_process32, import_node_crypto36, import_node_fs58, import_node_os14, import_node_path56, POLL_MS, INSPECT_ATTEMPTS, START_TOLERANCE_MS, name2, swiftRootReadHolds;
|
|
39623
39666
|
var init_swift_root_lock = __esm({
|
|
39624
39667
|
"src/swift-root-lock.ts"() {
|
|
39625
39668
|
"use strict";
|
|
39626
|
-
|
|
39669
|
+
import_node_async_hooks3 = require("node:async_hooks");
|
|
39627
39670
|
import_node_child_process32 = require("node:child_process");
|
|
39628
39671
|
import_node_crypto36 = require("node:crypto");
|
|
39629
39672
|
import_node_fs58 = require("node:fs");
|
|
39630
|
-
|
|
39673
|
+
import_node_os14 = require("node:os");
|
|
39631
39674
|
import_node_path56 = __toESM(require("node:path"), 1);
|
|
39632
39675
|
init_process_group();
|
|
39633
39676
|
init_process_table();
|
|
@@ -39635,7 +39678,7 @@ var init_swift_root_lock = __esm({
|
|
|
39635
39678
|
INSPECT_ATTEMPTS = 5;
|
|
39636
39679
|
START_TOLERANCE_MS = 2e3;
|
|
39637
39680
|
name2 = (number3, suffix) => `${String(number3).padStart(12, "0")}.${suffix}`;
|
|
39638
|
-
swiftRootReadHolds = new
|
|
39681
|
+
swiftRootReadHolds = new import_node_async_hooks3.AsyncLocalStorage();
|
|
39639
39682
|
}
|
|
39640
39683
|
});
|
|
39641
39684
|
|
|
@@ -39780,7 +39823,7 @@ function producerSettled(directory2) {
|
|
|
39780
39823
|
const value = JSON.parse((0, import_node_fs59.readFileSync)(receipt, "utf8"));
|
|
39781
39824
|
return isRecord(value) && value.released === true;
|
|
39782
39825
|
}
|
|
39783
|
-
function swiftSdkProducerCores(admitted, platform = process.platform, hostCpus =
|
|
39826
|
+
function swiftSdkProducerCores(admitted, platform = process.platform, hostCpus = import_node_os15.default.availableParallelism()) {
|
|
39784
39827
|
const floor = platform === "linux" && hostCpus >= 64 ? 24 : 4;
|
|
39785
39828
|
return Number.isSafeInteger(admitted) && admitted > 0 ? Math.max(floor, admitted) : floor;
|
|
39786
39829
|
}
|
|
@@ -39927,14 +39970,14 @@ async function produceSwiftSdkImage(input) {
|
|
|
39927
39970
|
await (0, import_promises6.setTimeout)(2e3, void 0, { signal: input.signal });
|
|
39928
39971
|
}
|
|
39929
39972
|
}
|
|
39930
|
-
var import_node_child_process33, import_node_crypto38, import_node_fs59,
|
|
39973
|
+
var import_node_child_process33, import_node_crypto38, import_node_fs59, import_node_os15, import_node_path57, import_promises6, import_node_util9, run3, environmentNames, launcher;
|
|
39931
39974
|
var init_swift_sdk_image_producer = __esm({
|
|
39932
39975
|
"src/swift-sdk-image-producer.ts"() {
|
|
39933
39976
|
"use strict";
|
|
39934
39977
|
import_node_child_process33 = require("node:child_process");
|
|
39935
39978
|
import_node_crypto38 = require("node:crypto");
|
|
39936
39979
|
import_node_fs59 = require("node:fs");
|
|
39937
|
-
|
|
39980
|
+
import_node_os15 = __toESM(require("node:os"), 1);
|
|
39938
39981
|
import_node_path57 = __toESM(require("node:path"), 1);
|
|
39939
39982
|
import_promises6 = require("node:timers/promises");
|
|
39940
39983
|
import_node_util9 = require("node:util");
|
|
@@ -43794,7 +43837,7 @@ function swiftIcuAddress(icu) {
|
|
|
43794
43837
|
function swiftIcuPacked(icu) {
|
|
43795
43838
|
return memo(packedFiles, icu.sha256, async () => {
|
|
43796
43839
|
const file = import_node_path63.default.join(
|
|
43797
|
-
|
|
43840
|
+
import_node_os16.default.homedir(),
|
|
43798
43841
|
".peach",
|
|
43799
43842
|
"cache",
|
|
43800
43843
|
"swift-brotli",
|
|
@@ -43821,7 +43864,7 @@ async function swiftIcuBundleAsset(icu) {
|
|
|
43821
43864
|
contentType: "application/octet-stream"
|
|
43822
43865
|
};
|
|
43823
43866
|
}
|
|
43824
|
-
var import_node_child_process37, import_node_crypto42, import_node_fs64, import_promises7,
|
|
43867
|
+
var import_node_child_process37, import_node_crypto42, import_node_fs64, import_promises7, import_node_os16, import_node_path63, import_node_util12, import_node_zlib5, run6, deflate, compressBrotli, inflateGzip, ARCHIVE, MEMBER, raw, assets, packedFiles;
|
|
43825
43868
|
var init_swift_icu = __esm({
|
|
43826
43869
|
"src/swift-icu.ts"() {
|
|
43827
43870
|
"use strict";
|
|
@@ -43829,7 +43872,7 @@ var init_swift_icu = __esm({
|
|
|
43829
43872
|
import_node_crypto42 = require("node:crypto");
|
|
43830
43873
|
import_node_fs64 = require("node:fs");
|
|
43831
43874
|
import_promises7 = require("node:fs/promises");
|
|
43832
|
-
|
|
43875
|
+
import_node_os16 = __toESM(require("node:os"), 1);
|
|
43833
43876
|
import_node_path63 = __toESM(require("node:path"), 1);
|
|
43834
43877
|
import_node_util12 = require("node:util");
|
|
43835
43878
|
import_node_zlib5 = require("node:zlib");
|
|
@@ -44118,7 +44161,7 @@ var init_swift_objc_prebuilt = __esm({
|
|
|
44118
44161
|
|
|
44119
44162
|
// src/swift-reproducible.ts
|
|
44120
44163
|
function canonicalHomeDir() {
|
|
44121
|
-
const home =
|
|
44164
|
+
const home = import_node_os17.default.homedir();
|
|
44122
44165
|
const dotPeach = import_node_path66.default.join(home, ".peach");
|
|
44123
44166
|
if ((0, import_node_fs67.existsSync)(dotPeach)) {
|
|
44124
44167
|
const realHome = import_node_path66.default.dirname((0, import_node_fs67.realpathSync)(dotPeach));
|
|
@@ -44140,12 +44183,12 @@ function swiftReproducibleBuildFlags(roots) {
|
|
|
44140
44183
|
`-ffile-prefix-map=${map2}`
|
|
44141
44184
|
]);
|
|
44142
44185
|
}
|
|
44143
|
-
var import_node_fs67,
|
|
44186
|
+
var import_node_fs67, import_node_os17, import_node_path66;
|
|
44144
44187
|
var init_swift_reproducible = __esm({
|
|
44145
44188
|
"src/swift-reproducible.ts"() {
|
|
44146
44189
|
"use strict";
|
|
44147
44190
|
import_node_fs67 = require("node:fs");
|
|
44148
|
-
|
|
44191
|
+
import_node_os17 = __toESM(require("node:os"), 1);
|
|
44149
44192
|
import_node_path66 = __toESM(require("node:path"), 1);
|
|
44150
44193
|
}
|
|
44151
44194
|
});
|
|
@@ -44421,7 +44464,10 @@ function swiftPackagePrebuiltEntries(input, moduleRoot, toolchainBin) {
|
|
|
44421
44464
|
const calls = manifestCalls(manifest, ["target"]);
|
|
44422
44465
|
const platform = /platforms:\s*\[\.iOS\("([\d.]+)"\)\]/.exec(manifest)?.[1];
|
|
44423
44466
|
if (!platform) return [];
|
|
44424
|
-
const sdkModules = swiftAvailableModules(
|
|
44467
|
+
const sdkModules = swiftAvailableModules(
|
|
44468
|
+
moduleRoot,
|
|
44469
|
+
typeof toolchainBin === "function" ? toolchainBin() : toolchainBin
|
|
44470
|
+
);
|
|
44425
44471
|
return selected.flatMap(([name3, modules]) => {
|
|
44426
44472
|
const prefix = `${SWIFT_REMOTE_PACKAGES_DIR}/${name3}/`;
|
|
44427
44473
|
const members2 = targets.filter(
|
|
@@ -44638,7 +44684,7 @@ async function runCompiler(command, args, options2, stream = false, quiet) {
|
|
|
44638
44684
|
}
|
|
44639
44685
|
}
|
|
44640
44686
|
function swiftCompilerJobs() {
|
|
44641
|
-
return Math.min(64, swiftBuildJobs(), Math.max(1, Math.floor(
|
|
44687
|
+
return Math.min(64, swiftBuildJobs(), Math.max(1, Math.floor(import_node_os18.default.totalmem() / 2 ** 31)));
|
|
44642
44688
|
}
|
|
44643
44689
|
function swiftCompilerBaseEnv(toolchainBin, sourceEnv, includePeachHome = false) {
|
|
44644
44690
|
const env = {};
|
|
@@ -45994,6 +46040,8 @@ function swiftSourceClosure(files2, roots) {
|
|
|
45994
46040
|
return collectSwiftSourceClosure(files2, roots, swiftCodeMask);
|
|
45995
46041
|
}
|
|
45996
46042
|
function swiftApplicationEntry(file, source) {
|
|
46043
|
+
if (!source.includes("@main") && !source.includes("@UIApplicationMain") && !(import_node_path70.default.basename(file) === "main.swift" && source.includes("UIApplicationMain")))
|
|
46044
|
+
return false;
|
|
45997
46045
|
const code = [...swiftConditionalLines(swiftCodeMask(source))].map(({ line, active }) => active === false ? " ".repeat(line.length) : line).join("\n");
|
|
45998
46046
|
const { tokens: tokens2 } = swiftCodeScan(code);
|
|
45999
46047
|
let depth = 0;
|
|
@@ -47849,7 +47897,7 @@ ${entry}`);
|
|
|
47849
47897
|
files2.set(
|
|
47850
47898
|
clangWrapper2,
|
|
47851
47899
|
[
|
|
47852
|
-
"#!/bin/
|
|
47900
|
+
"#!/bin/bash",
|
|
47853
47901
|
"name=",
|
|
47854
47902
|
"explicit=",
|
|
47855
47903
|
...prebuiltCompiler.length ? ["module="] : [],
|
|
@@ -47900,19 +47948,20 @@ ${entry}`);
|
|
|
47900
47948
|
// a target that turns modules off keeps them off: the toolset appends its
|
|
47901
47949
|
// module flags after the target settings, which darwin swiftpm puts last.
|
|
47902
47950
|
'if [ -n "$standard$cxxModulesOff$modulesOff" ]; then',
|
|
47951
|
+
" args=()",
|
|
47903
47952
|
' for arg in "$@"; do',
|
|
47904
47953
|
' case "$language:$arg" in',
|
|
47905
47954
|
" *++:-std=*++*) ;;",
|
|
47906
|
-
" *++:-std=*|c:-std=*++*|objective-c:-std=*++*)
|
|
47955
|
+
" *++:-std=*|c:-std=*++*|objective-c:-std=*++*) continue ;;",
|
|
47907
47956
|
" esac",
|
|
47908
|
-
" shift",
|
|
47909
47957
|
' case "$modulesOff:$arg" in 1:-fmodules|1:-fmodules-cache-path=*) continue ;; esac',
|
|
47910
47958
|
' case "$cxxModulesOff:$language:$arg" in',
|
|
47911
47959
|
" 1:*:-fmodules-cache-path=*) ;;",
|
|
47912
47960
|
" 1:c++:-fmodule-map-file=*/.build/*/*.build/module.modulemap) ;;",
|
|
47913
|
-
' *)
|
|
47961
|
+
' *) args+=("$arg") ;;',
|
|
47914
47962
|
" esac",
|
|
47915
47963
|
" done",
|
|
47964
|
+
' set -- "${args[@]}"',
|
|
47916
47965
|
"fi",
|
|
47917
47966
|
'if [ -n "$name" ] && [ -z "$explicit" ]; then set -- "-fmodule-name=$name" "$@"; fi',
|
|
47918
47967
|
...prebuiltCompiler,
|
|
@@ -48753,8 +48802,8 @@ function readFrameworkProductsReceipt(scratch2, receiptKey, planChangedAt = 0n)
|
|
|
48753
48802
|
function resolveBunBinary() {
|
|
48754
48803
|
if (import_node_path70.default.basename(process.execPath).startsWith("bun")) return process.execPath;
|
|
48755
48804
|
for (const candidate of [
|
|
48756
|
-
import_node_path70.default.join(
|
|
48757
|
-
import_node_path70.default.join(
|
|
48805
|
+
import_node_path70.default.join(import_node_os18.default.homedir(), "builders/bun/bin/bun"),
|
|
48806
|
+
import_node_path70.default.join(import_node_os18.default.homedir(), ".bun/bin/bun"),
|
|
48758
48807
|
"/opt/homebrew/bin/bun",
|
|
48759
48808
|
"/usr/local/bin/bun",
|
|
48760
48809
|
"bun"
|
|
@@ -49101,18 +49150,18 @@ ${args.frameworkKey}`,
|
|
|
49101
49150
|
function swiftFrameworkSlotCount(unoptimized) {
|
|
49102
49151
|
const base = unoptimized ? SWIFT_FRAMEWORK_UNOPTIMIZED_SLOTS : SWIFT_FRAMEWORK_SLOTS;
|
|
49103
49152
|
if (process.platform === "darwin") {
|
|
49104
|
-
const gib =
|
|
49153
|
+
const gib = import_node_os18.default.totalmem() / (1024 * 1024 * 1024);
|
|
49105
49154
|
if (gib >= 120) return unoptimized ? 8 : 16;
|
|
49106
49155
|
if (gib >= 56) return unoptimized ? 6 : 12;
|
|
49107
49156
|
return base;
|
|
49108
49157
|
}
|
|
49109
49158
|
if (process.platform !== "linux") return base;
|
|
49110
|
-
const cores =
|
|
49159
|
+
const cores = import_node_os18.default.availableParallelism();
|
|
49111
49160
|
return unoptimized ? Math.min(8, Math.max(base, Math.floor(cores / 16))) : Math.min(16, Math.max(base, Math.floor(cores / 8)));
|
|
49112
49161
|
}
|
|
49113
49162
|
function swiftBuildRootSlotCount() {
|
|
49114
49163
|
if (process.platform !== "linux") return SWIFT_BUILD_ROOT_SLOTS;
|
|
49115
|
-
return
|
|
49164
|
+
return import_node_os18.default.availableParallelism() >= 64 ? 8 : SWIFT_BUILD_ROOT_SLOTS;
|
|
49116
49165
|
}
|
|
49117
49166
|
function swiftFrameworksDir(unoptimized = false) {
|
|
49118
49167
|
return import_node_path70.default.join(
|
|
@@ -49510,818 +49559,865 @@ async function compileSwiftProjectUnit(input, options2) {
|
|
|
49510
49559
|
}
|
|
49511
49560
|
}
|
|
49512
49561
|
async function compileSwiftProjectOnce(sources, options2) {
|
|
49513
|
-
|
|
49514
|
-
|
|
49515
|
-
|
|
49516
|
-
|
|
49517
|
-
|
|
49518
|
-
|
|
49519
|
-
|
|
49520
|
-
|
|
49521
|
-
|
|
49522
|
-
|
|
49523
|
-
|
|
49524
|
-
|
|
49525
|
-
|
|
49526
|
-
|
|
49527
|
-
|
|
49528
|
-
|
|
49529
|
-
|
|
49530
|
-
|
|
49531
|
-
|
|
49532
|
-
|
|
49533
|
-
|
|
49534
|
-
|
|
49535
|
-
|
|
49536
|
-
|
|
49537
|
-
|
|
49538
|
-
|
|
49539
|
-
|
|
49540
|
-
|
|
49541
|
-
|
|
49542
|
-
|
|
49543
|
-
|
|
49544
|
-
|
|
49545
|
-
|
|
49546
|
-
|
|
49547
|
-
|
|
49548
|
-
|
|
49549
|
-
options2.
|
|
49550
|
-
|
|
49551
|
-
|
|
49552
|
-
|
|
49553
|
-
|
|
49554
|
-
|
|
49555
|
-
|
|
49556
|
-
|
|
49557
|
-
|
|
49558
|
-
|
|
49559
|
-
|
|
49560
|
-
|
|
49561
|
-
|
|
49562
|
-
|
|
49563
|
-
|
|
49564
|
-
if (
|
|
49565
|
-
|
|
49566
|
-
|
|
49567
|
-
return retain(root, previous);
|
|
49568
|
-
}
|
|
49569
|
-
}
|
|
49570
|
-
const baseRoot = root;
|
|
49571
|
-
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path70.default.basename(import_node_path70.default.dirname(baseRoot)) === "swift-builds";
|
|
49572
|
-
const compatShapeParts = canPoolBuildRoot ? [
|
|
49573
|
-
distribution ? options2.release : frameworkKey,
|
|
49574
|
-
compileTargets(input).map((target) => target.name).sort(),
|
|
49575
|
-
input.oneModule === true,
|
|
49576
|
-
input.optimize === true,
|
|
49577
|
-
input.unoptimized === true
|
|
49578
|
-
] : null;
|
|
49579
|
-
const compatShape = compatShapeParts ? (0, import_node_crypto45.createHash)("sha256").update(JSON.stringify(compatShapeParts)).digest("hex").slice(0, 16) : "";
|
|
49580
|
-
const exactShape = compatShapeParts ? (0, import_node_crypto45.createHash)("sha256").update(
|
|
49581
|
-
JSON.stringify([...compatShapeParts, Object.keys(input.files).sort()])
|
|
49582
|
-
).digest("hex").slice(0, 16) : "";
|
|
49583
|
-
const buildShape = compatShapeParts ? `${exactShape}
|
|
49584
|
-
${compatShape}` : "";
|
|
49585
|
-
return withSwiftCompileBudget(options2.timeoutMs, options2.signal, async (budget) => {
|
|
49586
|
-
const stage = (message) => {
|
|
49587
|
-
budget.progress();
|
|
49588
|
-
report(message);
|
|
49589
|
-
};
|
|
49590
|
-
const runLocked = (work) => {
|
|
49591
|
-
const runInBuildRoot = () => {
|
|
49592
|
-
if (canPoolBuildRoot)
|
|
49593
|
-
return withSwiftBuildRootSlot(
|
|
49594
|
-
baseRoot,
|
|
49595
|
-
exactShape,
|
|
49596
|
-
compatShape,
|
|
49597
|
-
budget.signal,
|
|
49598
|
-
work
|
|
49599
|
-
);
|
|
49600
|
-
const waitStart = Date.now();
|
|
49601
|
-
return withSwiftRootLock(
|
|
49602
|
-
baseRoot,
|
|
49603
|
-
(lease) => work(baseRoot, lease, Date.now() - waitStart),
|
|
49604
|
-
budget.signal
|
|
49605
|
-
);
|
|
49606
|
-
};
|
|
49607
|
-
if (options2.intermediates || baseRoot === sharedRoot) return runInBuildRoot();
|
|
49608
|
-
return withSwiftRootLock(
|
|
49609
|
-
sharedRoot,
|
|
49610
|
-
async () => {
|
|
49611
|
-
const built2 = readCompiledArtifact(import_node_path70.default.join(sharedRoot, "artifact"), hash);
|
|
49612
|
-
if (built2) {
|
|
49613
|
-
renewSharedArtifact(sharedRoot);
|
|
49614
|
-
stage("reusing verified disk artifact");
|
|
49615
|
-
return retain(baseRoot, built2);
|
|
49616
|
-
}
|
|
49617
|
-
return runInBuildRoot();
|
|
49618
|
-
},
|
|
49619
|
-
budget.signal
|
|
49620
|
-
);
|
|
49621
|
-
};
|
|
49622
|
-
return runLocked(async (slotRoot, lease, waitedMs) => {
|
|
49623
|
-
const root2 = slotRoot;
|
|
49624
|
-
const layout3 = {
|
|
49625
|
-
root: root2,
|
|
49626
|
-
sources: import_node_path70.default.join(root2, "Sources", "App"),
|
|
49627
|
-
multi: compileTargets(input).length > 0
|
|
49628
|
-
};
|
|
49629
|
-
if (!options2.intermediates) {
|
|
49630
|
-
const built2 = readCompiledArtifact(import_node_path70.default.join(sharedRoot, "artifact"), hash);
|
|
49631
|
-
if (built2) {
|
|
49632
|
-
stage("reusing verified disk artifact");
|
|
49633
|
-
return retain(baseRoot, built2);
|
|
49634
|
-
}
|
|
49635
|
-
}
|
|
49636
|
-
if (waitedMs >= 1e3)
|
|
49637
|
-
report(`acquired build root ${import_node_path70.default.basename(root2)} after ${waitedMs}ms`);
|
|
49638
|
-
if (canPoolBuildRoot) {
|
|
49639
|
-
refreshSwiftCacheHold(root2);
|
|
49640
|
-
(0, import_node_fs70.writeFileSync)(import_node_path70.default.join(root2, SWIFT_BUILD_ROOT_SHAPE), buildShape);
|
|
49562
|
+
return withSwiftModuleDigestScope(async () => {
|
|
49563
|
+
options2.signal?.throwIfAborted();
|
|
49564
|
+
(0, import_node_fs70.mkdirSync)(options2.buildRoot, { recursive: true });
|
|
49565
|
+
const root = (0, import_node_fs70.realpathSync)(options2.buildRoot);
|
|
49566
|
+
refreshSwiftCacheHold(root);
|
|
49567
|
+
const moduleRoot = import_node_path70.default.resolve(options2.moduleRoot);
|
|
49568
|
+
const distribution = swiftDistributionAt(moduleRoot);
|
|
49569
|
+
const mirrorDistribution = options2.linkOnly || options2.project ? null : distribution;
|
|
49570
|
+
if (distribution) refreshSwiftCacheHold(moduleRoot);
|
|
49571
|
+
let resolvedToolchainBin = options2.toolchainBin;
|
|
49572
|
+
const resolveToolchainBin = () => {
|
|
49573
|
+
if (resolvedToolchainBin) return resolvedToolchainBin;
|
|
49574
|
+
if (!options2.resolveToolchain)
|
|
49575
|
+
throw new Error("swift-compile: missing toolchainBin");
|
|
49576
|
+
resolvedToolchainBin = options2.resolveToolchain();
|
|
49577
|
+
return resolvedToolchainBin;
|
|
49578
|
+
};
|
|
49579
|
+
const input = distribution && !options2.intermediates ? (await Promise.resolve().then(() => (init_swift_package_prebuilt(), swift_package_prebuilt_exports))).useSwiftPackagePrebuilts(
|
|
49580
|
+
sources,
|
|
49581
|
+
moduleRoot,
|
|
49582
|
+
resolveToolchainBin
|
|
49583
|
+
) : sources;
|
|
49584
|
+
const guestGraph = distribution ? input.sourceLinkGraph : void 0;
|
|
49585
|
+
if (options2.linkOnly && guestGraph)
|
|
49586
|
+
throw new Error("swift-compile: link-only builds do not support guest image graphs");
|
|
49587
|
+
const layout2 = {
|
|
49588
|
+
root,
|
|
49589
|
+
sources: import_node_path70.default.join(root, "Sources", "App"),
|
|
49590
|
+
multi: compileTargets(input).length > 0
|
|
49591
|
+
};
|
|
49592
|
+
const sdkImage = options2.linkOnly ? void 0 : await (await Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))).buildSwiftSdkImage(
|
|
49593
|
+
moduleRoot,
|
|
49594
|
+
!!guestGraph,
|
|
49595
|
+
distribution ? [] : linkedFrameworkTargets(moduleRoot, input).imports,
|
|
49596
|
+
{ signal: options2.signal }
|
|
49597
|
+
);
|
|
49598
|
+
const inputHash = swiftCompileInputHash(input, options2.release);
|
|
49599
|
+
const moduleDigest = swiftModuleDigest(moduleRoot);
|
|
49600
|
+
const sourceHash = inputHash.copy().update(moduleDigest).digest("hex");
|
|
49601
|
+
const hash = sdkImage ? swiftSdkArtifactHash(sourceHash, sdkImage.key) : sourceHash;
|
|
49602
|
+
const sharedRoot = import_node_path70.default.join(swiftCacheDir(), "swift-projects", hash);
|
|
49603
|
+
const report = (message) => {
|
|
49604
|
+
console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`);
|
|
49605
|
+
options2.onStage?.(message);
|
|
49606
|
+
};
|
|
49607
|
+
return serialize(
|
|
49608
|
+
root,
|
|
49609
|
+
async () => {
|
|
49610
|
+
if (!options2.intermediates) {
|
|
49611
|
+
report("checking verified artifacts");
|
|
49612
|
+
const retained = retainedArtifacts.get(root)?.find((old) => old.hash === hash);
|
|
49613
|
+
if (retained) {
|
|
49614
|
+
report("reusing memory artifact");
|
|
49615
|
+
return retain(root, retained);
|
|
49641
49616
|
}
|
|
49642
|
-
const
|
|
49643
|
-
|
|
49644
|
-
|
|
49645
|
-
|
|
49646
|
-
);
|
|
49617
|
+
const cached2 = readCompiledArtifact(import_node_path70.default.join(sharedRoot, "artifact"), hash);
|
|
49618
|
+
const previous = cached2 ?? (options2.project ? null : readCompiledArtifact(import_node_path70.default.join(root, "artifact"), hash));
|
|
49619
|
+
if (previous) {
|
|
49620
|
+
if (cached2) renewSharedArtifact(sharedRoot);
|
|
49621
|
+
else saveSharedArtifact(sharedRoot, previous);
|
|
49622
|
+
report("reusing verified disk artifact");
|
|
49623
|
+
return retain(root, previous);
|
|
49647
49624
|
}
|
|
49648
|
-
|
|
49649
|
-
|
|
49650
|
-
|
|
49651
|
-
|
|
49652
|
-
|
|
49653
|
-
|
|
49654
|
-
|
|
49655
|
-
|
|
49656
|
-
|
|
49657
|
-
|
|
49658
|
-
|
|
49659
|
-
|
|
49660
|
-
|
|
49661
|
-
|
|
49662
|
-
|
|
49663
|
-
|
|
49664
|
-
|
|
49665
|
-
|
|
49666
|
-
|
|
49667
|
-
|
|
49668
|
-
|
|
49669
|
-
|
|
49670
|
-
|
|
49671
|
-
|
|
49672
|
-
|
|
49673
|
-
|
|
49674
|
-
|
|
49675
|
-
|
|
49676
|
-
const sdk2 = swiftModuleSdk(frameworkRoot2).wasmSdkId;
|
|
49677
|
-
const compileSdk2 = mirrorDistribution ? syncSwiftSdkMirror(root2, frameworkRoot2, options2.toolchainBin, sdk2) : {
|
|
49678
|
-
id: sdk2,
|
|
49679
|
-
options: swiftCompileSdkOptions(frameworkRoot2, options2.toolchainBin),
|
|
49680
|
-
toolsetChanged: false
|
|
49625
|
+
}
|
|
49626
|
+
assertSwiftBuildCores();
|
|
49627
|
+
const toolchainBin = resolveToolchainBin();
|
|
49628
|
+
await options2.beforeCompile?.(toolchainBin);
|
|
49629
|
+
clearSwiftModuleDigestScope(moduleRoot);
|
|
49630
|
+
const frameworkKey = swiftProjectBuildKey(moduleRoot, options2.release);
|
|
49631
|
+
const baseRoot = root;
|
|
49632
|
+
const canPoolBuildRoot = !options2.intermediates && !options2.project && !options2.linkOnly && import_node_path70.default.basename(import_node_path70.default.dirname(baseRoot)) === "swift-builds";
|
|
49633
|
+
const compatShapeParts = canPoolBuildRoot ? [
|
|
49634
|
+
distribution ? options2.release : frameworkKey,
|
|
49635
|
+
compileTargets(input).map((target) => target.name).sort(),
|
|
49636
|
+
input.oneModule === true,
|
|
49637
|
+
input.optimize === true,
|
|
49638
|
+
input.unoptimized === true
|
|
49639
|
+
] : null;
|
|
49640
|
+
const compatShape = compatShapeParts ? (0, import_node_crypto45.createHash)("sha256").update(JSON.stringify(compatShapeParts)).digest("hex").slice(0, 16) : "";
|
|
49641
|
+
const exactShape = compatShapeParts ? (0, import_node_crypto45.createHash)("sha256").update(
|
|
49642
|
+
JSON.stringify([...compatShapeParts, Object.keys(input.files).sort()])
|
|
49643
|
+
).digest("hex").slice(0, 16) : "";
|
|
49644
|
+
const buildShape = compatShapeParts ? `${exactShape}
|
|
49645
|
+
${compatShape}` : "";
|
|
49646
|
+
return withSwiftCompileBudget(
|
|
49647
|
+
options2.timeoutMs,
|
|
49648
|
+
options2.signal,
|
|
49649
|
+
async (budget) => {
|
|
49650
|
+
const stage = (message) => {
|
|
49651
|
+
budget.progress();
|
|
49652
|
+
report(message);
|
|
49681
49653
|
};
|
|
49682
|
-
|
|
49683
|
-
|
|
49684
|
-
|
|
49685
|
-
|
|
49686
|
-
|
|
49687
|
-
|
|
49688
|
-
|
|
49689
|
-
|
|
49690
|
-
|
|
49691
|
-
|
|
49692
|
-
|
|
49693
|
-
|
|
49694
|
-
|
|
49695
|
-
|
|
49696
|
-
|
|
49697
|
-
|
|
49698
|
-
|
|
49699
|
-
|
|
49700
|
-
|
|
49701
|
-
|
|
49702
|
-
|
|
49703
|
-
|
|
49704
|
-
|
|
49654
|
+
const runLocked = (work) => {
|
|
49655
|
+
const runInBuildRoot = () => {
|
|
49656
|
+
if (canPoolBuildRoot)
|
|
49657
|
+
return withSwiftBuildRootSlot(
|
|
49658
|
+
baseRoot,
|
|
49659
|
+
exactShape,
|
|
49660
|
+
compatShape,
|
|
49661
|
+
budget.signal,
|
|
49662
|
+
work
|
|
49663
|
+
);
|
|
49664
|
+
const waitStart = Date.now();
|
|
49665
|
+
return withSwiftRootLock(
|
|
49666
|
+
baseRoot,
|
|
49667
|
+
(lease) => work(baseRoot, lease, Date.now() - waitStart),
|
|
49668
|
+
budget.signal
|
|
49669
|
+
);
|
|
49670
|
+
};
|
|
49671
|
+
if (options2.intermediates || baseRoot === sharedRoot)
|
|
49672
|
+
return runInBuildRoot();
|
|
49673
|
+
return withSwiftRootLock(
|
|
49674
|
+
sharedRoot,
|
|
49675
|
+
async () => {
|
|
49676
|
+
const built2 = readCompiledArtifact(
|
|
49677
|
+
import_node_path70.default.join(sharedRoot, "artifact"),
|
|
49678
|
+
hash
|
|
49679
|
+
);
|
|
49680
|
+
if (built2) {
|
|
49681
|
+
renewSharedArtifact(sharedRoot);
|
|
49682
|
+
stage("reusing verified disk artifact");
|
|
49683
|
+
return retain(baseRoot, built2);
|
|
49705
49684
|
}
|
|
49685
|
+
return runInBuildRoot();
|
|
49706
49686
|
},
|
|
49707
|
-
|
|
49687
|
+
budget.signal
|
|
49708
49688
|
);
|
|
49709
|
-
if (!prebuilt2) return;
|
|
49710
|
-
if (!allowWrite) {
|
|
49711
|
-
budget.startCompile();
|
|
49712
|
-
stage("reusing verified framework products");
|
|
49713
|
-
}
|
|
49714
|
-
}
|
|
49715
|
-
const readHold2 = slot ? acquireSwiftRootReadHold(slot) : void 0;
|
|
49716
|
-
return {
|
|
49717
|
-
frameworkRoot: frameworkRoot2,
|
|
49718
|
-
compileFrameworkRoot: compileFrameworkRoot2,
|
|
49719
|
-
macroPlugins: macroPlugins2,
|
|
49720
|
-
sdk: sdk2,
|
|
49721
|
-
compileSdk: compileSdk2,
|
|
49722
|
-
icu: icu2,
|
|
49723
|
-
prebuilt: prebuilt2,
|
|
49724
|
-
readHold: readHold2
|
|
49725
49689
|
};
|
|
49726
|
-
|
|
49727
|
-
|
|
49728
|
-
|
|
49729
|
-
|
|
49730
|
-
|
|
49731
|
-
|
|
49732
|
-
|
|
49733
|
-
|
|
49734
|
-
|
|
49735
|
-
|
|
49736
|
-
|
|
49737
|
-
|
|
49738
|
-
|
|
49739
|
-
|
|
49740
|
-
|
|
49741
|
-
macroPlugins,
|
|
49742
|
-
compileSdk,
|
|
49743
|
-
icu,
|
|
49744
|
-
prebuilt
|
|
49745
|
-
} = frameworks;
|
|
49746
|
-
let readHold = frameworks.readHold;
|
|
49747
|
-
const buildOptions = {
|
|
49748
|
-
env: baseBuildEnv,
|
|
49749
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
49750
|
-
signal: budget.signal,
|
|
49751
|
-
onOutput: budget.progress,
|
|
49752
|
-
lease
|
|
49753
|
-
};
|
|
49754
|
-
try {
|
|
49755
|
-
if (options2.project) removeProjectLinks(root2);
|
|
49756
|
-
const packageHostMacros = process.platform === "linux" ? input.packageHostMacros : void 0;
|
|
49757
|
-
if (retireStaleSwiftLink(
|
|
49758
|
-
root2,
|
|
49759
|
-
swiftLinkStamp({
|
|
49760
|
-
frameworkKey: mirrorDistribution ? `${options2.release}\0mirror` : `${options2.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
|
|
49761
|
-
packageHostMacros
|
|
49762
|
-
}),
|
|
49763
|
-
swiftLinkStamp({
|
|
49764
|
-
// mirrored distributions and their WASI SDK mirror invalidate
|
|
49765
|
-
// dependents per changed file instead of wiping every Clang object.
|
|
49766
|
-
frameworkKey: mirrorDistribution ? `${options2.release}\0mirror` : distribution ? `${options2.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
|
|
49767
|
-
prebuilt,
|
|
49768
|
-
packageHostMacros
|
|
49769
|
-
}),
|
|
49770
|
-
Boolean(options2.linkOnly)
|
|
49771
|
-
))
|
|
49772
|
-
stage("framework revision changed; rebuilding the app link");
|
|
49773
|
-
const nativeToolset = needsNativeToolset(input, prebuilt);
|
|
49774
|
-
const preparation = writeSwiftProject(
|
|
49775
|
-
layout3,
|
|
49776
|
-
input,
|
|
49777
|
-
frameworkRoot,
|
|
49778
|
-
prebuilt,
|
|
49779
|
-
!options2.project,
|
|
49780
|
-
options2.project ? false : options2.objcPrebuiltStage ?? (options2.intermediates ? false : void 0),
|
|
49781
|
-
compileSdk
|
|
49782
|
-
);
|
|
49783
|
-
const productFile = import_node_path70.default.join(frameworkRoot, SWIFT_FRAMEWORK_PRODUCT_FILE);
|
|
49784
|
-
writeSwiftAutolinkLinker(
|
|
49785
|
-
root2,
|
|
49786
|
-
options2.toolchainBin,
|
|
49787
|
-
(0, import_node_fs70.existsSync)(productFile) ? [
|
|
49788
|
-
v6.parse(
|
|
49789
|
-
swiftFrameworkProductSchema,
|
|
49790
|
-
JSON.parse((0, import_node_fs70.readFileSync)(productFile, "utf8"))
|
|
49791
|
-
).product.name
|
|
49792
|
-
] : []
|
|
49793
|
-
);
|
|
49794
|
-
const compiler = preparation.targetToolset ? { CC: import_node_path70.default.join(root2, CLANG_TARGET_MODULE_WRAPPER) } : {};
|
|
49795
|
-
if (packageHostMacros?.length) {
|
|
49796
|
-
const swiftc = import_node_path70.default.join(root2, SWIFT_HOST_COMPILER_WRAPPER);
|
|
49797
|
-
writeBuildFile(
|
|
49798
|
-
swiftc,
|
|
49799
|
-
[
|
|
49800
|
-
"#!/bin/sh",
|
|
49801
|
-
"target=",
|
|
49802
|
-
"module=",
|
|
49803
|
-
"compile=",
|
|
49804
|
-
"previous=",
|
|
49805
|
-
"for argument do",
|
|
49806
|
-
' case "$previous" in -target) target=$argument ;; -module-name) module=$argument ;; esac',
|
|
49807
|
-
' case "$argument" in -c|-emit-module|-scan-dependencies|-typecheck) compile=1 ;; esac',
|
|
49808
|
-
" previous=$argument",
|
|
49809
|
-
"done",
|
|
49810
|
-
'case "$target/$compile" in',
|
|
49811
|
-
" *-*-linux*/1)",
|
|
49812
|
-
' case ",$PEACH_SWIFT_HOST_MACROS," in',
|
|
49813
|
-
' *",$module,"*) set -- "$@" -Xfrontend -import-module -Xfrontend Foundation ;;',
|
|
49814
|
-
" esac ;;",
|
|
49815
|
-
"esac",
|
|
49816
|
-
'exec "$PEACH_SWIFTC" "$@"',
|
|
49817
|
-
""
|
|
49818
|
-
].join("\n")
|
|
49819
|
-
);
|
|
49820
|
-
(0, import_node_fs70.chmodSync)(swiftc, 493);
|
|
49821
|
-
compiler.SWIFT_EXEC = swiftc;
|
|
49822
|
-
compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
|
|
49823
|
-
compiler.PEACH_SWIFTC = import_node_path70.default.join(options2.toolchainBin, "swiftc");
|
|
49824
|
-
}
|
|
49825
|
-
const projectProcess = options2.project ? prepareSwiftProjectProcess(root2, options2.project) : void 0;
|
|
49826
|
-
const temporaryDirectory = projectProcess ? void 0 : import_node_path70.default.join(root2, ".build", "peach-compiler-tmp");
|
|
49827
|
-
const appOptions = projectProcess ? {
|
|
49828
|
-
...buildOptions,
|
|
49829
|
-
uid: projectProcess.uid,
|
|
49830
|
-
gid: projectProcess.gid,
|
|
49831
|
-
confined: { ...projectProcess.env, ...compiler }
|
|
49832
|
-
} : {
|
|
49833
|
-
...buildOptions,
|
|
49834
|
-
temporaryDirectory,
|
|
49835
|
-
env: {
|
|
49836
|
-
...buildOptions.env,
|
|
49837
|
-
...preparation.usesObjcPrebuilt && process.env.PEACH_HOME !== void 0 ? { PEACH_HOME: process.env.PEACH_HOME } : {},
|
|
49838
|
-
...compiler
|
|
49839
|
-
}
|
|
49840
|
-
};
|
|
49841
|
-
const unprepared = preparation.targetFailures.map(
|
|
49842
|
-
(failure2) => `error: target ${failure2}`
|
|
49843
|
-
);
|
|
49844
|
-
const forwarders = /* @__PURE__ */ new Map();
|
|
49845
|
-
for (const [file, text7] of Object.entries(input.files)) {
|
|
49846
|
-
const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text7)?.[1];
|
|
49847
|
-
if (!parents) continue;
|
|
49848
|
-
const directory2 = import_node_path70.default.posix.dirname(file);
|
|
49849
|
-
forwarders.set(
|
|
49850
|
-
`${import_node_path70.default.join(root2, directory2)}/${parents.slice(0, -1)}`,
|
|
49851
|
-
import_node_path70.default.posix.join("build", directory2, parents).replace(/\/$/, "")
|
|
49852
|
-
);
|
|
49853
|
-
}
|
|
49854
|
-
const jobs = swiftCompilerJobs();
|
|
49855
|
-
const incrementalPreview = sdkImage !== void 0 && !guestGraph && !options2.project && !input.optimize && !input.unoptimized;
|
|
49856
|
-
const batchGuest = guestGraph !== void 0 && !options2.project && !input.unoptimized;
|
|
49857
|
-
const guestDriverJobs = Math.min(8, jobs);
|
|
49858
|
-
const singleProducerJobs = Math.min(16, Math.floor(jobs / 2));
|
|
49859
|
-
const batch = incrementalPreview || batchGuest;
|
|
49860
|
-
const perFile = input.unoptimized || batch;
|
|
49861
|
-
const reproducibleFrameworkRoot = mirrorDistribution ? frameworkRoot : compileFrameworkRoot;
|
|
49862
|
-
const buildArgs = [
|
|
49863
|
-
"build",
|
|
49864
|
-
...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
|
|
49865
|
-
"--build-system",
|
|
49866
|
-
"native",
|
|
49867
|
-
"-j",
|
|
49868
|
-
String(jobs),
|
|
49869
|
-
"--package-path",
|
|
49870
|
-
root2,
|
|
49871
|
-
...compileSdk.options,
|
|
49872
|
-
...swiftObjCSelectorOptions(frameworkRoot),
|
|
49873
|
-
"--swift-sdk",
|
|
49874
|
-
compileSdk.id,
|
|
49875
|
-
...preparation.targetToolset ? ["--toolset", import_node_path70.default.join(root2, ".peach-target-toolset.json")] : [],
|
|
49876
|
-
"-c",
|
|
49877
|
-
"release",
|
|
49878
|
-
...input.unoptimized ? ["-Xswiftc", "-Onone"] : [],
|
|
49879
|
-
...perFile ? [
|
|
49880
|
-
"-Xswiftc",
|
|
49881
|
-
"-no-whole-module-optimization",
|
|
49882
|
-
"-Xswiftc",
|
|
49883
|
-
"-j",
|
|
49884
|
-
"-Xswiftc",
|
|
49885
|
-
String(batchGuest ? guestDriverJobs : jobs)
|
|
49886
|
-
] : [],
|
|
49887
|
-
// optimized batches can move specialized definitions between objects.
|
|
49888
|
-
...incrementalPreview ? ["-Xswiftc", "-incremental"] : [],
|
|
49889
|
-
...batch ? ["-Xswiftc", "-enable-batch-mode"] : [],
|
|
49890
|
-
// the mirror finds a changed sdk header's readers in their
|
|
49891
|
-
// dependency files, which omit system headers by default
|
|
49892
|
-
...mirrorDistribution ? ["-Xswiftc", "-track-system-dependencies"] : [],
|
|
49893
|
-
// the link strips debug info, so none is generated (as for the framework).
|
|
49894
|
-
// keep -num-threads fixed across caller core caps so llbuild does not
|
|
49895
|
-
// rebuild every target when callers alternate --cores, and bound backend
|
|
49896
|
-
// fan-out under high -j.
|
|
49897
|
-
"-Xswiftc",
|
|
49898
|
-
"-gnone",
|
|
49899
|
-
"-Xcc",
|
|
49900
|
-
"-g0",
|
|
49901
|
-
"-Xcxx",
|
|
49902
|
-
"-g0",
|
|
49903
|
-
...batch ? [] : [
|
|
49904
|
-
"-Xswiftc",
|
|
49905
|
-
"-num-threads",
|
|
49906
|
-
"-Xswiftc",
|
|
49907
|
-
String(perFile ? 1 : Math.min(8, import_node_os17.default.availableParallelism()))
|
|
49908
|
-
],
|
|
49909
|
-
...swiftReproducibleBuildFlags([
|
|
49910
|
-
[import_node_path70.default.dirname(options2.toolchainBin), "toolchain"],
|
|
49911
|
-
[reproducibleFrameworkRoot, "framework"],
|
|
49912
|
-
[root2, "build"],
|
|
49913
|
-
...forwarders
|
|
49914
|
-
]).flatMap((flag, index, flags) => {
|
|
49915
|
-
if (!nativeToolset || !flag.startsWith("-ffile-prefix-map="))
|
|
49916
|
-
return [flag];
|
|
49917
|
-
const toolchainDir = import_node_path70.default.dirname(options2.toolchainBin);
|
|
49918
|
-
let mapped = flag;
|
|
49919
|
-
for (const [dir, target] of [
|
|
49920
|
-
[root2, "/peach/build"],
|
|
49921
|
-
[reproducibleFrameworkRoot, "/peach/framework"],
|
|
49922
|
-
[(0, import_node_fs70.realpathSync)(reproducibleFrameworkRoot), "/peach/framework"],
|
|
49923
|
-
[toolchainDir, "/peach/toolchain"],
|
|
49924
|
-
[(0, import_node_fs70.realpathSync)(toolchainDir), "/peach/toolchain"]
|
|
49925
|
-
]) {
|
|
49926
|
-
mapped = mapped.replaceAll(dir, target);
|
|
49690
|
+
return runLocked(async (slotRoot, lease, waitedMs) => {
|
|
49691
|
+
const root2 = slotRoot;
|
|
49692
|
+
const layout3 = {
|
|
49693
|
+
root: root2,
|
|
49694
|
+
sources: import_node_path70.default.join(root2, "Sources", "App"),
|
|
49695
|
+
multi: compileTargets(input).length > 0
|
|
49696
|
+
};
|
|
49697
|
+
if (!options2.intermediates) {
|
|
49698
|
+
const built2 = readCompiledArtifact(
|
|
49699
|
+
import_node_path70.default.join(sharedRoot, "artifact"),
|
|
49700
|
+
hash
|
|
49701
|
+
);
|
|
49702
|
+
if (built2) {
|
|
49703
|
+
stage("reusing verified disk artifact");
|
|
49704
|
+
return retain(baseRoot, built2);
|
|
49927
49705
|
}
|
|
49928
|
-
const [, from, to] = /^-ffile-prefix-map=([^=]+)=(.+)$/.exec(mapped) ?? [];
|
|
49929
|
-
const tool = flags[index - 1];
|
|
49930
|
-
return mapped !== flag && from !== to ? [flag, tool, mapped] : [flag];
|
|
49931
|
-
}),
|
|
49932
|
-
...macroPlugins.libraries.flatMap((plugin) => [
|
|
49933
|
-
"-Xswiftc",
|
|
49934
|
-
"-load-plugin-library",
|
|
49935
|
-
"-Xswiftc",
|
|
49936
|
-
plugin
|
|
49937
|
-
]),
|
|
49938
|
-
...macroPlugins.executables.flatMap((plugin) => [
|
|
49939
|
-
"-Xswiftc",
|
|
49940
|
-
"-load-plugin-executable",
|
|
49941
|
-
"-Xswiftc",
|
|
49942
|
-
`${plugin}#ExpoModulesMacros`
|
|
49943
|
-
])
|
|
49944
|
-
];
|
|
49945
|
-
const linked = builtArtifact(layout3);
|
|
49946
|
-
(0, import_node_fs70.rmSync)(import_node_path70.default.join(root2, ".peach-link.rsp"), { force: true });
|
|
49947
|
-
if (options2.linkOnly || (0, import_node_fs70.existsSync)(linked) && (0, import_node_fs70.statSync)(linked).size <= 8)
|
|
49948
|
-
(0, import_node_fs70.rmSync)(linked, { force: true });
|
|
49949
|
-
stage("compiling and linking Swift modules");
|
|
49950
|
-
const frameworkInterfaces = /* @__PURE__ */ new Map();
|
|
49951
|
-
const compileSdkPaths = swiftSdkPaths(
|
|
49952
|
-
frameworkRoot,
|
|
49953
|
-
options2.toolchainBin,
|
|
49954
|
-
compileSdk.options,
|
|
49955
|
-
compileSdk.id
|
|
49956
|
-
);
|
|
49957
|
-
const sdkFrameworks = import_node_path70.default.join(
|
|
49958
|
-
compileSdkPaths.darwin,
|
|
49959
|
-
"System/Library/Frameworks"
|
|
49960
|
-
);
|
|
49961
|
-
const generatedInterface = (source) => withoutImportedSdkEnumForwards(
|
|
49962
|
-
clangInterfaceHeader((0, import_node_fs70.readFileSync)(source, "utf8"), frameworkRoot),
|
|
49963
|
-
sdkObjCDeclarationOwners(sdkFrameworks)
|
|
49964
|
-
);
|
|
49965
|
-
const nativeDeclarations = /* @__PURE__ */ new Map();
|
|
49966
|
-
const nativeHeaders = Object.entries(input.files).filter(([name3]) => name3.endsWith(".h") && !name3.endsWith("-Swift.h")).map(([, source]) => source);
|
|
49967
|
-
for (const [file, contents2] of Object.entries(input.files)) {
|
|
49968
|
-
if (!file.endsWith(".modulemap")) continue;
|
|
49969
|
-
const name3 = moduleMapName(contents2);
|
|
49970
|
-
const umbrella = /\bumbrella\s+header\s+"([^"]+)"/.exec(contents2)?.[1];
|
|
49971
|
-
if (!name3 || !umbrella) continue;
|
|
49972
|
-
const header = input.files[import_node_path70.default.posix.join(import_node_path70.default.posix.dirname(file), umbrella)];
|
|
49973
|
-
if (header === void 0) continue;
|
|
49974
|
-
const included = new Set(
|
|
49975
|
-
[
|
|
49976
|
-
...header.matchAll(/^\s*#\s*(?:import|include)\s*[<"]([^">]+)[">]/gm)
|
|
49977
|
-
].map((match) => import_node_path70.default.posix.basename(match[1]))
|
|
49978
|
-
);
|
|
49979
|
-
const declarations = nativeDeclarations.get(name3) ?? /* @__PURE__ */ new Set();
|
|
49980
|
-
for (const declaration of swiftInterfaceDeclarations(header))
|
|
49981
|
-
declarations.add(declaration);
|
|
49982
|
-
for (const [candidate, source] of Object.entries(input.files))
|
|
49983
|
-
if (included.has(import_node_path70.default.posix.basename(candidate)))
|
|
49984
|
-
for (const declaration of swiftInterfaceDeclarations(source))
|
|
49985
|
-
declarations.add(declaration);
|
|
49986
|
-
nativeDeclarations.set(name3, declarations);
|
|
49987
|
-
}
|
|
49988
|
-
const frameworkInterface = (name3) => {
|
|
49989
|
-
if (frameworkInterfaces.has(name3)) return frameworkInterfaces.get(name3);
|
|
49990
|
-
const source = distribution ? import_node_path70.default.join(frameworkRoot, "modules", `${name3}-Swift.h`) : prebuilt.objcHeaders.get(name3);
|
|
49991
|
-
if (!source || !(0, import_node_fs70.existsSync)(source)) {
|
|
49992
|
-
frameworkInterfaces.set(name3, null);
|
|
49993
|
-
return null;
|
|
49994
49706
|
}
|
|
49995
|
-
|
|
49996
|
-
|
|
49997
|
-
if (
|
|
49998
|
-
|
|
49999
|
-
|
|
50000
|
-
encoding: "utf8"
|
|
50001
|
-
}))
|
|
50002
|
-
if (file.endsWith(".h"))
|
|
50003
|
-
for (const name4 of swiftInterfaceDeclarations(
|
|
50004
|
-
(0, import_node_fs70.readFileSync)(import_node_path70.default.join(headers, file), "utf8")
|
|
50005
|
-
))
|
|
50006
|
-
declared.add(name4);
|
|
49707
|
+
if (waitedMs >= 1e3)
|
|
49708
|
+
report(`acquired build root ${import_node_path70.default.basename(root2)} after ${waitedMs}ms`);
|
|
49709
|
+
if (canPoolBuildRoot) {
|
|
49710
|
+
refreshSwiftCacheHold(root2);
|
|
49711
|
+
(0, import_node_fs70.writeFileSync)(import_node_path70.default.join(root2, SWIFT_BUILD_ROOT_SHAPE), buildShape);
|
|
50007
49712
|
}
|
|
50008
|
-
|
|
50009
|
-
|
|
50010
|
-
|
|
50011
|
-
|
|
50012
|
-
|
|
50013
|
-
nativeDeclarations.has(name3) ? `@import ${name3};` : `#import <${name3}/${name3}.h>`
|
|
50014
|
-
);
|
|
50015
|
-
const owners = sdkObjCDeclarationOwners(sdkFrameworks);
|
|
50016
|
-
const foreign = /* @__PURE__ */ new Map();
|
|
50017
|
-
for (const declaration of [
|
|
50018
|
-
...swiftInterfaceDeclarations(own2),
|
|
50019
|
-
...objcEnumerations(own2),
|
|
50020
|
-
...[...own2.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
|
|
50021
|
-
(match) => match[1]
|
|
50022
|
-
)
|
|
50023
|
-
]) {
|
|
50024
|
-
const owner = owners.get(declaration);
|
|
50025
|
-
if (owner && owner !== name3) foreign.set(declaration, owner);
|
|
49713
|
+
const swift = import_node_path70.default.join(toolchainBin, "swift");
|
|
49714
|
+
if (!(0, import_node_fs70.existsSync)(swift)) {
|
|
49715
|
+
throw new Error(
|
|
49716
|
+
`swift-compile: no swift.org toolchain at ${toolchainBin}; install ${options2.release} and its matching wasm sdk`
|
|
49717
|
+
);
|
|
50026
49718
|
}
|
|
50027
|
-
const
|
|
50028
|
-
|
|
50029
|
-
|
|
50030
|
-
|
|
50031
|
-
|
|
50032
|
-
|
|
50033
|
-
|
|
50034
|
-
|
|
50035
|
-
|
|
49719
|
+
const unoptimized = input.unoptimized === true;
|
|
49720
|
+
const baseBuildEnv = options2.project?.env ? {
|
|
49721
|
+
...options2.project.env,
|
|
49722
|
+
// shipped host plugins resolve against the selected compiler's runtime.
|
|
49723
|
+
...process.platform === "linux" ? {
|
|
49724
|
+
LD_LIBRARY_PATH: [
|
|
49725
|
+
import_node_path70.default.resolve(toolchainBin, "../lib/swift/linux"),
|
|
49726
|
+
import_node_path70.default.resolve(toolchainBin, "../lib/swift/host"),
|
|
49727
|
+
process.env.LD_LIBRARY_PATH
|
|
49728
|
+
].filter(Boolean).join(":")
|
|
49729
|
+
} : {},
|
|
49730
|
+
PEACH_DEFER_WASM_LINK: "1"
|
|
49731
|
+
} : swiftCompilerBaseEnv(toolchainBin, process.env);
|
|
49732
|
+
const prepareFrameworks = async (slot, frameworkLease, allowWrite = true) => {
|
|
49733
|
+
if (allowWrite) budget.startCompile();
|
|
49734
|
+
const frameworkRoot2 = mirrorDistribution ? syncSwiftDistributionMirror(root2, moduleRoot, mirrorDistribution) : distribution ? moduleRoot : stageFrameworkSource(
|
|
49735
|
+
moduleRoot,
|
|
49736
|
+
slot,
|
|
49737
|
+
frameworkKey,
|
|
49738
|
+
options2.release
|
|
49739
|
+
);
|
|
49740
|
+
if (!swiftModuleDigest(frameworkRoot2).equals(moduleDigest))
|
|
49741
|
+
throw new Error("Swift staged project source differs from the caller");
|
|
49742
|
+
if (!allowWrite && swiftMacroPlugins(frameworkRoot2).stale) return;
|
|
49743
|
+
if (allowWrite) stage("preparing compiler plugins");
|
|
49744
|
+
const macroPlugins2 = await ensureMacroPlugins(
|
|
49745
|
+
frameworkRoot2,
|
|
49746
|
+
toolchainBin,
|
|
49747
|
+
options2.release,
|
|
49748
|
+
budget.signal,
|
|
49749
|
+
frameworkLease
|
|
49750
|
+
);
|
|
49751
|
+
const compileFrameworkRoot2 = distribution ? swiftDistributionCompileView(frameworkRoot2, distribution) : frameworkRoot2;
|
|
49752
|
+
const sdk2 = swiftModuleSdk(frameworkRoot2).wasmSdkId;
|
|
49753
|
+
const compileSdk2 = mirrorDistribution ? syncSwiftSdkMirror(root2, frameworkRoot2, toolchainBin, sdk2) : {
|
|
49754
|
+
id: sdk2,
|
|
49755
|
+
options: swiftCompileSdkOptions(frameworkRoot2, toolchainBin),
|
|
49756
|
+
toolsetChanged: false
|
|
49757
|
+
};
|
|
49758
|
+
if (mirrorDistribution && compileSdk2.toolsetChanged)
|
|
49759
|
+
clearSwiftSdkPathsCache(import_node_path70.default.join(root2, SWIFT_SDK_MIRROR));
|
|
49760
|
+
const icu2 = options2.linkOnly ? null : swiftIcuAsset(toolchainBin, sdk2);
|
|
49761
|
+
let prebuilt2;
|
|
49762
|
+
if (!distribution) {
|
|
49763
|
+
if (allowWrite) stage("compiling framework products");
|
|
49764
|
+
prebuilt2 = await buildFrameworkProducts(
|
|
49765
|
+
slot,
|
|
49766
|
+
{
|
|
49767
|
+
moduleRoot: frameworkRoot2,
|
|
49768
|
+
frameworkKey,
|
|
49769
|
+
input,
|
|
49770
|
+
swift,
|
|
49771
|
+
sdk: sdk2,
|
|
49772
|
+
toolchainBin,
|
|
49773
|
+
plugins: macroPlugins2,
|
|
49774
|
+
buildOptions: {
|
|
49775
|
+
env: baseBuildEnv,
|
|
49776
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
49777
|
+
signal: budget.signal,
|
|
49778
|
+
onOutput: budget.progress,
|
|
49779
|
+
lease,
|
|
49780
|
+
frameworkLease
|
|
49781
|
+
}
|
|
49782
|
+
},
|
|
49783
|
+
allowWrite
|
|
49784
|
+
);
|
|
49785
|
+
if (!prebuilt2) return;
|
|
49786
|
+
if (!allowWrite) {
|
|
49787
|
+
budget.startCompile();
|
|
49788
|
+
stage("reusing verified framework products");
|
|
49789
|
+
}
|
|
49790
|
+
}
|
|
49791
|
+
const readHold2 = slot ? acquireSwiftRootReadHold(slot) : void 0;
|
|
49792
|
+
return {
|
|
49793
|
+
frameworkRoot: frameworkRoot2,
|
|
49794
|
+
compileFrameworkRoot: compileFrameworkRoot2,
|
|
49795
|
+
macroPlugins: macroPlugins2,
|
|
49796
|
+
sdk: sdk2,
|
|
49797
|
+
compileSdk: compileSdk2,
|
|
49798
|
+
icu: icu2,
|
|
49799
|
+
prebuilt: prebuilt2,
|
|
49800
|
+
readHold: readHold2
|
|
49801
|
+
};
|
|
50036
49802
|
};
|
|
50037
|
-
|
|
50038
|
-
|
|
50039
|
-
|
|
50040
|
-
|
|
50041
|
-
|
|
50042
|
-
|
|
50043
|
-
|
|
50044
|
-
|
|
50045
|
-
const headerPaths = (producer) => {
|
|
50046
|
-
const stem2 = import_node_path70.default.join(
|
|
50047
|
-
root2,
|
|
50048
|
-
".build",
|
|
50049
|
-
"peach-cxx-headers",
|
|
50050
|
-
`${producer}-Swift`
|
|
50051
|
-
);
|
|
50052
|
-
return { producer, original: `${stem2}.original.h`, emitted: `${stem2}.h` };
|
|
50053
|
-
};
|
|
50054
|
-
const publishHeader = ({
|
|
50055
|
-
producer,
|
|
50056
|
-
original,
|
|
50057
|
-
emitted
|
|
50058
|
-
}) => {
|
|
50059
|
-
const generated = generatedInterface(original);
|
|
50060
|
-
writeBuildFile(
|
|
50061
|
-
emitted,
|
|
50062
|
-
withoutSwiftDeclarations(
|
|
50063
|
-
swiftHeaderWithSuperclassImports(generated, frameworkInterface),
|
|
50064
|
-
/* @__PURE__ */ new Set([
|
|
50065
|
-
...preparation.nativeHeaderDeclarations[producer] ?? [],
|
|
50066
|
-
...nativelyDeclaredFunctions(generated, nativeHeaders)
|
|
50067
|
-
]),
|
|
50068
|
-
`#import <${producer}/${producer}.h>`
|
|
50069
|
-
)
|
|
49803
|
+
const frameworks = distribution ? await prepareFrameworks(null) : await withSwiftFrameworkSlot(
|
|
49804
|
+
frameworkKey,
|
|
49805
|
+
options2.release,
|
|
49806
|
+
moduleRoot,
|
|
49807
|
+
budget.signal,
|
|
49808
|
+
prepareFrameworks,
|
|
49809
|
+
unoptimized,
|
|
49810
|
+
options2.linkOnly === true
|
|
50070
49811
|
);
|
|
50071
|
-
|
|
50072
|
-
|
|
50073
|
-
|
|
50074
|
-
|
|
50075
|
-
|
|
50076
|
-
|
|
50077
|
-
|
|
50078
|
-
|
|
50079
|
-
|
|
50080
|
-
|
|
50081
|
-
|
|
50082
|
-
|
|
50083
|
-
|
|
50084
|
-
|
|
50085
|
-
|
|
50086
|
-
|
|
50087
|
-
|
|
50088
|
-
|
|
50089
|
-
|
|
50090
|
-
|
|
50091
|
-
|
|
50092
|
-
if (
|
|
50093
|
-
|
|
50094
|
-
|
|
50095
|
-
|
|
50096
|
-
|
|
50097
|
-
|
|
50098
|
-
|
|
50099
|
-
|
|
50100
|
-
|
|
50101
|
-
|
|
50102
|
-
|
|
50103
|
-
|
|
49812
|
+
if (!frameworks)
|
|
49813
|
+
throw new Error("Swift distribution did not provide its frameworks");
|
|
49814
|
+
const {
|
|
49815
|
+
frameworkRoot,
|
|
49816
|
+
compileFrameworkRoot,
|
|
49817
|
+
macroPlugins,
|
|
49818
|
+
compileSdk,
|
|
49819
|
+
icu,
|
|
49820
|
+
prebuilt
|
|
49821
|
+
} = frameworks;
|
|
49822
|
+
let readHold = frameworks.readHold;
|
|
49823
|
+
const buildOptions = {
|
|
49824
|
+
env: baseBuildEnv,
|
|
49825
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
49826
|
+
signal: budget.signal,
|
|
49827
|
+
onOutput: budget.progress,
|
|
49828
|
+
lease
|
|
49829
|
+
};
|
|
49830
|
+
try {
|
|
49831
|
+
if (options2.project) removeProjectLinks(root2);
|
|
49832
|
+
const packageHostMacros = process.platform === "linux" ? input.packageHostMacros : void 0;
|
|
49833
|
+
if (retireStaleSwiftLink(
|
|
49834
|
+
root2,
|
|
49835
|
+
swiftLinkStamp({
|
|
49836
|
+
frameworkKey: mirrorDistribution ? `${options2.release}\0mirror` : `${options2.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
|
|
49837
|
+
packageHostMacros
|
|
49838
|
+
}),
|
|
49839
|
+
swiftLinkStamp({
|
|
49840
|
+
// mirrored distributions and their WASI SDK mirror invalidate
|
|
49841
|
+
// dependents per changed file instead of wiping every Clang object.
|
|
49842
|
+
frameworkKey: mirrorDistribution ? `${options2.release}\0mirror` : distribution ? `${options2.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
|
|
49843
|
+
prebuilt,
|
|
49844
|
+
packageHostMacros
|
|
49845
|
+
}),
|
|
49846
|
+
Boolean(options2.linkOnly)
|
|
49847
|
+
))
|
|
49848
|
+
stage("framework revision changed; rebuilding the app link");
|
|
49849
|
+
const nativeToolset = needsNativeToolset(input, prebuilt);
|
|
49850
|
+
const preparation = writeSwiftProject(
|
|
49851
|
+
layout3,
|
|
49852
|
+
input,
|
|
49853
|
+
frameworkRoot,
|
|
49854
|
+
prebuilt,
|
|
49855
|
+
!options2.project,
|
|
49856
|
+
options2.project ? false : options2.objcPrebuiltStage ?? (options2.intermediates ? false : void 0),
|
|
49857
|
+
compileSdk
|
|
50104
49858
|
);
|
|
50105
|
-
const
|
|
50106
|
-
|
|
50107
|
-
|
|
50108
|
-
|
|
50109
|
-
|
|
50110
|
-
|
|
50111
|
-
|
|
50112
|
-
|
|
50113
|
-
|
|
50114
|
-
|
|
49859
|
+
const productFile = import_node_path70.default.join(frameworkRoot, SWIFT_FRAMEWORK_PRODUCT_FILE);
|
|
49860
|
+
writeSwiftAutolinkLinker(
|
|
49861
|
+
root2,
|
|
49862
|
+
toolchainBin,
|
|
49863
|
+
(0, import_node_fs70.existsSync)(productFile) ? [
|
|
49864
|
+
v6.parse(
|
|
49865
|
+
swiftFrameworkProductSchema,
|
|
49866
|
+
JSON.parse((0, import_node_fs70.readFileSync)(productFile, "utf8"))
|
|
49867
|
+
).product.name
|
|
49868
|
+
] : []
|
|
49869
|
+
);
|
|
49870
|
+
const compiler = preparation.targetToolset ? { CC: import_node_path70.default.join(root2, CLANG_TARGET_MODULE_WRAPPER) } : {};
|
|
49871
|
+
if (packageHostMacros?.length) {
|
|
49872
|
+
const swiftc = import_node_path70.default.join(root2, SWIFT_HOST_COMPILER_WRAPPER);
|
|
49873
|
+
writeBuildFile(
|
|
49874
|
+
swiftc,
|
|
49875
|
+
[
|
|
49876
|
+
"#!/bin/sh",
|
|
49877
|
+
"target=",
|
|
49878
|
+
"module=",
|
|
49879
|
+
"compile=",
|
|
49880
|
+
"previous=",
|
|
49881
|
+
"for argument do",
|
|
49882
|
+
' case "$previous" in -target) target=$argument ;; -module-name) module=$argument ;; esac',
|
|
49883
|
+
' case "$argument" in -c|-emit-module|-scan-dependencies|-typecheck) compile=1 ;; esac',
|
|
49884
|
+
" previous=$argument",
|
|
49885
|
+
"done",
|
|
49886
|
+
'case "$target/$compile" in',
|
|
49887
|
+
" *-*-linux*/1)",
|
|
49888
|
+
' case ",$PEACH_SWIFT_HOST_MACROS," in',
|
|
49889
|
+
' *",$module,"*) set -- "$@" -Xfrontend -import-module -Xfrontend Foundation ;;',
|
|
49890
|
+
" esac ;;",
|
|
49891
|
+
"esac",
|
|
49892
|
+
'exec "$PEACH_SWIFTC" "$@"',
|
|
49893
|
+
""
|
|
49894
|
+
].join("\n")
|
|
49895
|
+
);
|
|
49896
|
+
(0, import_node_fs70.chmodSync)(swiftc, 493);
|
|
49897
|
+
compiler.SWIFT_EXEC = swiftc;
|
|
49898
|
+
compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
|
|
49899
|
+
compiler.PEACH_SWIFTC = import_node_path70.default.join(toolchainBin, "swiftc");
|
|
49900
|
+
}
|
|
49901
|
+
const projectProcess = options2.project ? prepareSwiftProjectProcess(root2, options2.project) : void 0;
|
|
49902
|
+
const temporaryDirectory = projectProcess ? void 0 : import_node_path70.default.join(root2, ".build", "peach-compiler-tmp");
|
|
49903
|
+
const appOptions = projectProcess ? {
|
|
49904
|
+
...buildOptions,
|
|
49905
|
+
uid: projectProcess.uid,
|
|
49906
|
+
gid: projectProcess.gid,
|
|
49907
|
+
confined: { ...projectProcess.env, ...compiler }
|
|
49908
|
+
} : {
|
|
49909
|
+
...buildOptions,
|
|
49910
|
+
temporaryDirectory,
|
|
49911
|
+
env: {
|
|
49912
|
+
...buildOptions.env,
|
|
49913
|
+
...preparation.usesObjcPrebuilt && process.env.PEACH_HOME !== void 0 ? { PEACH_HOME: process.env.PEACH_HOME } : {},
|
|
49914
|
+
...compiler
|
|
50115
49915
|
}
|
|
50116
|
-
return digest2.digest("hex");
|
|
50117
49916
|
};
|
|
50118
|
-
|
|
50119
|
-
|
|
50120
|
-
|
|
50121
|
-
|
|
50122
|
-
|
|
50123
|
-
|
|
50124
|
-
|
|
50125
|
-
|
|
50126
|
-
|
|
50127
|
-
|
|
50128
|
-
|
|
50129
|
-
|
|
50130
|
-
);
|
|
49917
|
+
const unprepared = preparation.targetFailures.map(
|
|
49918
|
+
(failure2) => `error: target ${failure2}`
|
|
49919
|
+
);
|
|
49920
|
+
const forwarders = /* @__PURE__ */ new Map();
|
|
49921
|
+
for (const [file, text7] of Object.entries(input.files)) {
|
|
49922
|
+
const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text7)?.[1];
|
|
49923
|
+
if (!parents) continue;
|
|
49924
|
+
const directory2 = import_node_path70.default.posix.dirname(file);
|
|
49925
|
+
forwarders.set(
|
|
49926
|
+
`${import_node_path70.default.join(root2, directory2)}/${parents.slice(0, -1)}`,
|
|
49927
|
+
import_node_path70.default.posix.join("build", directory2, parents).replace(/\/$/, "")
|
|
49928
|
+
);
|
|
50131
49929
|
}
|
|
50132
|
-
|
|
50133
|
-
|
|
50134
|
-
|
|
50135
|
-
|
|
50136
|
-
|
|
50137
|
-
|
|
49930
|
+
const jobs = swiftCompilerJobs();
|
|
49931
|
+
const incrementalPreview = sdkImage !== void 0 && !guestGraph && !options2.project && !input.optimize && !input.unoptimized;
|
|
49932
|
+
const batchGuest = guestGraph !== void 0 && !options2.project && !input.unoptimized;
|
|
49933
|
+
const guestDriverJobs = Math.min(8, jobs);
|
|
49934
|
+
const singleProducerJobs = Math.min(16, Math.floor(jobs / 2));
|
|
49935
|
+
const batch = incrementalPreview || batchGuest;
|
|
49936
|
+
const perFile = input.unoptimized || batch;
|
|
49937
|
+
const reproducibleFrameworkRoot = mirrorDistribution ? frameworkRoot : compileFrameworkRoot;
|
|
49938
|
+
const buildArgs = [
|
|
49939
|
+
"build",
|
|
49940
|
+
...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
|
|
49941
|
+
"--build-system",
|
|
49942
|
+
"native",
|
|
49943
|
+
"-j",
|
|
49944
|
+
String(jobs),
|
|
49945
|
+
"--package-path",
|
|
49946
|
+
root2,
|
|
49947
|
+
...compileSdk.options,
|
|
49948
|
+
...swiftObjCSelectorOptions(frameworkRoot),
|
|
49949
|
+
"--swift-sdk",
|
|
49950
|
+
compileSdk.id,
|
|
49951
|
+
...preparation.targetToolset ? ["--toolset", import_node_path70.default.join(root2, ".peach-target-toolset.json")] : [],
|
|
49952
|
+
"-c",
|
|
49953
|
+
"release",
|
|
49954
|
+
...input.unoptimized ? ["-Xswiftc", "-Onone"] : [],
|
|
49955
|
+
...perFile ? [
|
|
49956
|
+
"-Xswiftc",
|
|
49957
|
+
"-no-whole-module-optimization",
|
|
49958
|
+
"-Xswiftc",
|
|
49959
|
+
"-j",
|
|
49960
|
+
"-Xswiftc",
|
|
49961
|
+
String(batchGuest ? guestDriverJobs : jobs)
|
|
49962
|
+
] : [],
|
|
49963
|
+
// optimized batches can move specialized definitions between objects.
|
|
49964
|
+
...incrementalPreview ? ["-Xswiftc", "-incremental"] : [],
|
|
49965
|
+
...batch ? ["-Xswiftc", "-enable-batch-mode"] : [],
|
|
49966
|
+
// the mirror finds a changed sdk header's readers in their
|
|
49967
|
+
// dependency files, which omit system headers by default
|
|
49968
|
+
...mirrorDistribution ? ["-Xswiftc", "-track-system-dependencies"] : [],
|
|
49969
|
+
// the link strips debug info, so none is generated (as for the framework).
|
|
49970
|
+
// keep -num-threads fixed across caller core caps so llbuild does not
|
|
49971
|
+
// rebuild every target when callers alternate --cores, and bound backend
|
|
49972
|
+
// fan-out under high -j.
|
|
49973
|
+
"-Xswiftc",
|
|
49974
|
+
"-gnone",
|
|
49975
|
+
"-Xcc",
|
|
49976
|
+
"-g0",
|
|
49977
|
+
"-Xcxx",
|
|
49978
|
+
"-g0",
|
|
49979
|
+
...batch ? [] : [
|
|
49980
|
+
"-Xswiftc",
|
|
49981
|
+
"-num-threads",
|
|
49982
|
+
"-Xswiftc",
|
|
49983
|
+
String(perFile ? 1 : Math.min(8, import_node_os18.default.availableParallelism()))
|
|
49984
|
+
],
|
|
49985
|
+
...swiftReproducibleBuildFlags([
|
|
49986
|
+
[import_node_path70.default.dirname(toolchainBin), "toolchain"],
|
|
49987
|
+
[reproducibleFrameworkRoot, "framework"],
|
|
49988
|
+
[root2, "build"],
|
|
49989
|
+
...forwarders
|
|
49990
|
+
]).flatMap((flag, index, flags) => {
|
|
49991
|
+
if (!nativeToolset || !flag.startsWith("-ffile-prefix-map="))
|
|
49992
|
+
return [flag];
|
|
49993
|
+
const toolchainDir = import_node_path70.default.dirname(toolchainBin);
|
|
49994
|
+
let mapped = flag;
|
|
49995
|
+
for (const [dir, target] of [
|
|
49996
|
+
[root2, "/peach/build"],
|
|
49997
|
+
[reproducibleFrameworkRoot, "/peach/framework"],
|
|
49998
|
+
[(0, import_node_fs70.realpathSync)(reproducibleFrameworkRoot), "/peach/framework"],
|
|
49999
|
+
[toolchainDir, "/peach/toolchain"],
|
|
50000
|
+
[(0, import_node_fs70.realpathSync)(toolchainDir), "/peach/toolchain"]
|
|
50001
|
+
]) {
|
|
50002
|
+
mapped = mapped.replaceAll(dir, target);
|
|
50003
|
+
}
|
|
50004
|
+
const [, from, to] = /^-ffile-prefix-map=([^=]+)=(.+)$/.exec(mapped) ?? [];
|
|
50005
|
+
const tool = flags[index - 1];
|
|
50006
|
+
return mapped !== flag && from !== to ? [flag, tool, mapped] : [flag];
|
|
50007
|
+
}),
|
|
50008
|
+
...macroPlugins.libraries.flatMap((plugin) => [
|
|
50009
|
+
"-Xswiftc",
|
|
50010
|
+
"-load-plugin-library",
|
|
50011
|
+
"-Xswiftc",
|
|
50012
|
+
plugin
|
|
50013
|
+
]),
|
|
50014
|
+
...macroPlugins.executables.flatMap((plugin) => [
|
|
50015
|
+
"-Xswiftc",
|
|
50016
|
+
"-load-plugin-executable",
|
|
50017
|
+
"-Xswiftc",
|
|
50018
|
+
`${plugin}#ExpoModulesMacros`
|
|
50019
|
+
])
|
|
50020
|
+
];
|
|
50021
|
+
const linked = builtArtifact(layout3);
|
|
50022
|
+
(0, import_node_fs70.rmSync)(import_node_path70.default.join(root2, ".peach-link.rsp"), { force: true });
|
|
50023
|
+
if (options2.linkOnly || (0, import_node_fs70.existsSync)(linked) && (0, import_node_fs70.statSync)(linked).size <= 8)
|
|
50024
|
+
(0, import_node_fs70.rmSync)(linked, { force: true });
|
|
50025
|
+
stage("compiling and linking Swift modules");
|
|
50026
|
+
const frameworkInterfaces = /* @__PURE__ */ new Map();
|
|
50027
|
+
const compileSdkPaths = swiftSdkPaths(
|
|
50028
|
+
frameworkRoot,
|
|
50029
|
+
toolchainBin,
|
|
50030
|
+
compileSdk.options,
|
|
50031
|
+
compileSdk.id
|
|
50032
|
+
);
|
|
50033
|
+
const sdkFrameworks = import_node_path70.default.join(
|
|
50034
|
+
compileSdkPaths.darwin,
|
|
50035
|
+
"System/Library/Frameworks"
|
|
50138
50036
|
);
|
|
50139
|
-
|
|
50140
|
-
|
|
50141
|
-
|
|
50142
|
-
|
|
50143
|
-
|
|
50144
|
-
|
|
50145
|
-
|
|
50146
|
-
(
|
|
50037
|
+
const generatedInterface = (source) => withoutImportedSdkEnumForwards(
|
|
50038
|
+
clangInterfaceHeader((0, import_node_fs70.readFileSync)(source, "utf8"), frameworkRoot),
|
|
50039
|
+
sdkObjCDeclarationOwners(sdkFrameworks)
|
|
50040
|
+
);
|
|
50041
|
+
const nativeDeclarations = /* @__PURE__ */ new Map();
|
|
50042
|
+
const nativeHeaders = Object.entries(input.files).filter(([name3]) => name3.endsWith(".h") && !name3.endsWith("-Swift.h")).map(([, source]) => source);
|
|
50043
|
+
for (const [file, contents2] of Object.entries(input.files)) {
|
|
50044
|
+
if (!file.endsWith(".modulemap")) continue;
|
|
50045
|
+
const name3 = moduleMapName(contents2);
|
|
50046
|
+
const umbrella = /\bumbrella\s+header\s+"([^"]+)"/.exec(contents2)?.[1];
|
|
50047
|
+
if (!name3 || !umbrella) continue;
|
|
50048
|
+
const header = input.files[import_node_path70.default.posix.join(import_node_path70.default.posix.dirname(file), umbrella)];
|
|
50049
|
+
if (header === void 0) continue;
|
|
50050
|
+
const included = new Set(
|
|
50051
|
+
[
|
|
50052
|
+
...header.matchAll(
|
|
50053
|
+
/^\s*#\s*(?:import|include)\s*[<"]([^">]+)[">]/gm
|
|
50054
|
+
)
|
|
50055
|
+
].map((match) => import_node_path70.default.posix.basename(match[1]))
|
|
50056
|
+
);
|
|
50057
|
+
const declarations = nativeDeclarations.get(name3) ?? /* @__PURE__ */ new Set();
|
|
50058
|
+
for (const declaration of swiftInterfaceDeclarations(header))
|
|
50059
|
+
declarations.add(declaration);
|
|
50060
|
+
for (const [candidate, source] of Object.entries(input.files))
|
|
50061
|
+
if (included.has(import_node_path70.default.posix.basename(candidate)))
|
|
50062
|
+
for (const declaration of swiftInterfaceDeclarations(source))
|
|
50063
|
+
declarations.add(declaration);
|
|
50064
|
+
nativeDeclarations.set(name3, declarations);
|
|
50147
50065
|
}
|
|
50148
|
-
|
|
50149
|
-
|
|
50150
|
-
|
|
50151
|
-
|
|
50152
|
-
|
|
50153
|
-
|
|
50154
|
-
|
|
50155
|
-
|
|
50156
|
-
|
|
50157
|
-
|
|
50158
|
-
|
|
50159
|
-
|
|
50160
|
-
|
|
50161
|
-
|
|
50162
|
-
|
|
50163
|
-
|
|
50164
|
-
|
|
50165
|
-
|
|
50166
|
-
|
|
50167
|
-
|
|
50168
|
-
|
|
50169
|
-
|
|
50170
|
-
|
|
50171
|
-
|
|
50066
|
+
const frameworkInterface = (name3) => {
|
|
50067
|
+
if (frameworkInterfaces.has(name3)) return frameworkInterfaces.get(name3);
|
|
50068
|
+
const source = distribution ? import_node_path70.default.join(frameworkRoot, "modules", `${name3}-Swift.h`) : prebuilt.objcHeaders.get(name3);
|
|
50069
|
+
if (!source || !(0, import_node_fs70.existsSync)(source)) {
|
|
50070
|
+
frameworkInterfaces.set(name3, null);
|
|
50071
|
+
return null;
|
|
50072
|
+
}
|
|
50073
|
+
const headers = import_node_path70.default.join(sdkFrameworks, `${name3}.framework/Headers`);
|
|
50074
|
+
const declared = /* @__PURE__ */ new Set();
|
|
50075
|
+
if ((0, import_node_fs70.existsSync)(headers)) {
|
|
50076
|
+
for (const file of (0, import_node_fs70.readdirSync)(headers, {
|
|
50077
|
+
recursive: true,
|
|
50078
|
+
encoding: "utf8"
|
|
50079
|
+
}))
|
|
50080
|
+
if (file.endsWith(".h"))
|
|
50081
|
+
for (const name4 of swiftInterfaceDeclarations(
|
|
50082
|
+
(0, import_node_fs70.readFileSync)(import_node_path70.default.join(headers, file), "utf8")
|
|
50083
|
+
))
|
|
50084
|
+
declared.add(name4);
|
|
50085
|
+
}
|
|
50086
|
+
for (const declaration of nativeDeclarations.get(name3) ?? [])
|
|
50087
|
+
declared.add(declaration);
|
|
50088
|
+
const own2 = withoutSwiftDeclarations(
|
|
50089
|
+
generatedInterface(source),
|
|
50090
|
+
declared,
|
|
50091
|
+
nativeDeclarations.has(name3) ? `@import ${name3};` : `#import <${name3}/${name3}.h>`
|
|
50092
|
+
);
|
|
50093
|
+
const owners = sdkObjCDeclarationOwners(sdkFrameworks);
|
|
50094
|
+
const foreign = /* @__PURE__ */ new Map();
|
|
50095
|
+
for (const declaration of [
|
|
50096
|
+
...swiftInterfaceDeclarations(own2),
|
|
50097
|
+
...objcEnumerations(own2),
|
|
50098
|
+
...[...own2.matchAll(/^\s*SWIFT_EXTERN\b[^(\n]*?\b(\w+)\s*\(/gm)].map(
|
|
50099
|
+
(match) => match[1]
|
|
50100
|
+
)
|
|
50101
|
+
]) {
|
|
50102
|
+
const owner = owners.get(declaration);
|
|
50103
|
+
if (owner && owner !== name3) foreign.set(declaration, owner);
|
|
50104
|
+
}
|
|
50105
|
+
const header = foreign.size ? withoutSwiftDeclarations(
|
|
50106
|
+
own2,
|
|
50107
|
+
new Set(foreign.keys()),
|
|
50108
|
+
[...new Set(foreign.values())].map((owner) => `#import <${owner}/${owner}.h>`).join("\n")
|
|
50109
|
+
) : own2;
|
|
50110
|
+
const value = {
|
|
50111
|
+
file: import_node_path70.default.join(
|
|
50112
|
+
root2,
|
|
50113
|
+
".build/peach-framework-objc",
|
|
50114
|
+
`${name3}-Swift.h`
|
|
50115
|
+
),
|
|
50116
|
+
header,
|
|
50117
|
+
module: (0, import_node_fs70.existsSync)(headers)
|
|
50118
|
+
};
|
|
50119
|
+
frameworkInterfaces.set(name3, value);
|
|
50120
|
+
writeBuildFile(
|
|
50121
|
+
value.file,
|
|
50122
|
+
((0, import_node_fs70.existsSync)(import_node_path70.default.join(headers, `${name3}.h`)) ? `#import <${name3}/${name3}.h>
|
|
50123
|
+
` : "") + swiftHeaderWithSuperclassImports(header, frameworkInterface)
|
|
50124
|
+
);
|
|
50125
|
+
return value;
|
|
50126
|
+
};
|
|
50127
|
+
const headerPaths = (producer) => {
|
|
50128
|
+
const stem2 = import_node_path70.default.join(
|
|
50129
|
+
root2,
|
|
50130
|
+
".build",
|
|
50131
|
+
"peach-cxx-headers",
|
|
50132
|
+
`${producer}-Swift`
|
|
50133
|
+
);
|
|
50134
|
+
return {
|
|
50135
|
+
producer,
|
|
50136
|
+
original: `${stem2}.original.h`,
|
|
50137
|
+
emitted: `${stem2}.h`
|
|
50138
|
+
};
|
|
50139
|
+
};
|
|
50140
|
+
const publishHeader = ({
|
|
50141
|
+
producer,
|
|
50142
|
+
original,
|
|
50143
|
+
emitted
|
|
50144
|
+
}) => {
|
|
50145
|
+
const generated = generatedInterface(original);
|
|
50146
|
+
writeBuildFile(
|
|
50147
|
+
emitted,
|
|
50148
|
+
withoutSwiftDeclarations(
|
|
50149
|
+
swiftHeaderWithSuperclassImports(generated, frameworkInterface),
|
|
50150
|
+
/* @__PURE__ */ new Set([
|
|
50151
|
+
...preparation.nativeHeaderDeclarations[producer] ?? [],
|
|
50152
|
+
...nativelyDeclaredFunctions(generated, nativeHeaders)
|
|
50153
|
+
]),
|
|
50154
|
+
`#import <${producer}/${producer}.h>`
|
|
50155
|
+
)
|
|
50156
|
+
);
|
|
50157
|
+
};
|
|
50158
|
+
const recipe2 = inputHash.copy().update(
|
|
50159
|
+
distribution ? swiftCompileSurfaceDigest(frameworkRoot) : moduleDigest
|
|
50160
|
+
).update((0, import_node_fs70.readFileSync)(import_node_path70.default.join(root2, "Package.swift"))).update(JSON.stringify(buildArgs)).digest("hex");
|
|
50161
|
+
const runApp = async (compiler2) => {
|
|
50162
|
+
const optionsWithCompiler = compiler2 ? { ...appOptions, env: { ...appOptions.env, ...compiler2 } } : appOptions;
|
|
50163
|
+
const stages = [
|
|
50164
|
+
...(preparation.nativePrerequisiteTargets ?? []).map((target) => ({
|
|
50165
|
+
target,
|
|
50166
|
+
producers: []
|
|
50167
|
+
})),
|
|
50168
|
+
...preparation.headerBuilds,
|
|
50169
|
+
...(preparation.nativeProductTargets ?? []).map((target) => ({
|
|
50170
|
+
target,
|
|
50171
|
+
producers: []
|
|
50172
|
+
}))
|
|
50173
|
+
];
|
|
50174
|
+
const checkpoints = import_node_path70.default.join(
|
|
50175
|
+
root2,
|
|
50176
|
+
".build",
|
|
50177
|
+
"peach-product-checkpoints"
|
|
50178
|
+
);
|
|
50179
|
+
const buildDbExists = (0, import_node_fs70.existsSync)(import_node_path70.default.join(root2, ".build", "build.db"));
|
|
50180
|
+
const releaseDir = import_node_path70.default.dirname(linked);
|
|
50181
|
+
for (const { target, producers } of stages) {
|
|
50182
|
+
if (!options2.project && producers.length === 0 && buildDbExists) {
|
|
50183
|
+
const expectedObjects = preparation.nativeStageObjects.get(target);
|
|
50184
|
+
if (expectedObjects && expectedObjects.length > 0 && expectedObjects.every(
|
|
50185
|
+
(relative3) => (0, import_node_fs70.statSync)(import_node_path70.default.join(releaseDir, relative3), {
|
|
50186
|
+
throwIfNoEntry: false
|
|
50187
|
+
})?.isFile()
|
|
50188
|
+
))
|
|
50189
|
+
continue;
|
|
50190
|
+
}
|
|
50191
|
+
const receipt = import_node_path70.default.join(
|
|
50192
|
+
checkpoints,
|
|
50193
|
+
(0, import_node_crypto45.createHash)("sha256").update(target).digest("hex")
|
|
50194
|
+
);
|
|
50195
|
+
const headers = producers.map(headerPaths);
|
|
50196
|
+
for (const header of headers)
|
|
50197
|
+
if ((0, import_node_fs70.existsSync)(header.original)) publishHeader(header);
|
|
50198
|
+
const fingerprint = () => {
|
|
50199
|
+
const digest2 = (0, import_node_crypto45.createHash)("sha256").update(recipe2);
|
|
50200
|
+
for (const { original, emitted } of headers) {
|
|
50201
|
+
if (!(0, import_node_fs70.existsSync)(original) || !(0, import_node_fs70.existsSync)(emitted)) return;
|
|
50202
|
+
digest2.update(
|
|
50203
|
+
(0, import_node_crypto45.createHash)("sha256").update((0, import_node_fs70.readFileSync)(emitted)).digest()
|
|
50204
|
+
);
|
|
50172
50205
|
}
|
|
50173
|
-
|
|
50174
|
-
|
|
50175
|
-
|
|
50176
|
-
|
|
50177
|
-
|
|
50178
|
-
|
|
50179
|
-
|
|
50180
|
-
|
|
50181
|
-
|
|
50182
|
-
|
|
50183
|
-
|
|
50184
|
-
|
|
50185
|
-
|
|
50186
|
-
|
|
50187
|
-
|
|
50188
|
-
|
|
50189
|
-
|
|
50190
|
-
|
|
50191
|
-
|
|
50192
|
-
|
|
50206
|
+
return digest2.digest("hex");
|
|
50207
|
+
};
|
|
50208
|
+
if (!options2.project && (0, import_node_fs70.existsSync)(receipt) && (0, import_node_fs70.readFileSync)(receipt, "utf8") === fingerprint())
|
|
50209
|
+
continue;
|
|
50210
|
+
if (!options2.project) (0, import_node_fs70.rmSync)(receipt, { force: true });
|
|
50211
|
+
for (const header of headers) {
|
|
50212
|
+
if (!(0, import_node_fs70.existsSync)(header.original))
|
|
50213
|
+
(0, import_node_fs70.rmSync)(
|
|
50214
|
+
import_node_path70.default.join(
|
|
50215
|
+
import_node_path70.default.dirname(linked),
|
|
50216
|
+
"Modules",
|
|
50217
|
+
`${swiftTargetModuleName(header.producer)}.swiftmodule`
|
|
50218
|
+
),
|
|
50219
|
+
{ force: true }
|
|
50220
|
+
);
|
|
50221
|
+
}
|
|
50222
|
+
await runCompiler(
|
|
50223
|
+
swift,
|
|
50224
|
+
[...buildArgs, "--target", target],
|
|
50225
|
+
optionsWithCompiler,
|
|
50226
|
+
/^(?:\[swift-prebuilt\]|\[\d+\/\d+\] )/,
|
|
50227
|
+
SWIFTPM_NOISE
|
|
50228
|
+
);
|
|
50229
|
+
if (!compiler2) for (const header of headers) publishHeader(header);
|
|
50230
|
+
if (!options2.project) {
|
|
50231
|
+
const checkpoint = fingerprint();
|
|
50232
|
+
if (checkpoint === void 0)
|
|
50233
|
+
throw new Error(`missing Swift headers after building ${target}`);
|
|
50234
|
+
(0, import_node_fs70.mkdirSync)(checkpoints, { recursive: true });
|
|
50235
|
+
(0, import_node_fs70.writeFileSync)(`${receipt}.partial`, checkpoint);
|
|
50236
|
+
(0, import_node_fs70.renameSync)(`${receipt}.partial`, receipt);
|
|
50237
|
+
}
|
|
50238
|
+
}
|
|
50239
|
+
await runCompiler(
|
|
50240
|
+
swift,
|
|
50241
|
+
buildArgs,
|
|
50242
|
+
optionsWithCompiler,
|
|
50243
|
+
SWIFTPM_PROGRESS,
|
|
50244
|
+
SWIFTPM_NOISE
|
|
50245
|
+
);
|
|
50246
|
+
};
|
|
50247
|
+
const compileApp = () => preparation.headerCompiler ? withSwiftHeaderCompiler(
|
|
50248
|
+
root2,
|
|
50249
|
+
toolchainBin,
|
|
50250
|
+
recipe2,
|
|
50251
|
+
new Map(
|
|
50252
|
+
preparation.headerBuilds.flatMap(({ producers }) => {
|
|
50253
|
+
const driverJobs = batchGuest && producers.length === 1 && singleProducerJobs > guestDriverJobs ? singleProducerJobs : void 0;
|
|
50254
|
+
return producers.map((producer) => {
|
|
50255
|
+
const paths = headerPaths(producer);
|
|
50256
|
+
return [
|
|
50257
|
+
swiftTargetModuleName(producer),
|
|
50258
|
+
{
|
|
50259
|
+
header: paths.original,
|
|
50260
|
+
publish: () => publishHeader(paths),
|
|
50261
|
+
jobs: driverJobs
|
|
50262
|
+
}
|
|
50263
|
+
];
|
|
50264
|
+
});
|
|
50265
|
+
})
|
|
50266
|
+
),
|
|
50267
|
+
runApp
|
|
50268
|
+
) : runApp();
|
|
50193
50269
|
try {
|
|
50270
|
+
if (temporaryDirectory)
|
|
50271
|
+
(0, import_node_fs70.mkdirSync)(temporaryDirectory, { recursive: true });
|
|
50194
50272
|
await compileApp();
|
|
50195
|
-
} catch (
|
|
50273
|
+
} catch (error) {
|
|
50274
|
+
const output2 = outputOf(error);
|
|
50275
|
+
const moduleCache = import_node_path70.default.join(
|
|
50276
|
+
root2,
|
|
50277
|
+
".build",
|
|
50278
|
+
WASM_TRIPLE,
|
|
50279
|
+
"release",
|
|
50280
|
+
"ModuleCache"
|
|
50281
|
+
);
|
|
50282
|
+
if (output2.includes("was compiled with module cache path") && (0, import_node_fs70.existsSync)(moduleCache)) {
|
|
50283
|
+
(0, import_node_fs70.rmSync)(moduleCache, { recursive: true, force: true });
|
|
50284
|
+
try {
|
|
50285
|
+
await compileApp();
|
|
50286
|
+
} catch (retryError) {
|
|
50287
|
+
throw new Error(
|
|
50288
|
+
[
|
|
50289
|
+
...unprepared,
|
|
50290
|
+
projectDiagnostic(outputOf(retryError), layout3, input.files)
|
|
50291
|
+
].join("\n"),
|
|
50292
|
+
{ cause: retryError }
|
|
50293
|
+
);
|
|
50294
|
+
}
|
|
50295
|
+
} else {
|
|
50296
|
+
throw new Error(
|
|
50297
|
+
[
|
|
50298
|
+
...unprepared,
|
|
50299
|
+
projectDiagnostic(output2, layout3, input.files)
|
|
50300
|
+
].join("\n"),
|
|
50301
|
+
{ cause: error }
|
|
50302
|
+
);
|
|
50303
|
+
}
|
|
50304
|
+
} finally {
|
|
50305
|
+
if (temporaryDirectory)
|
|
50306
|
+
(0, import_node_fs70.rmSync)(temporaryDirectory, { recursive: true, force: true });
|
|
50307
|
+
if (options2.project) endSwiftProjectProcesses(options2.project);
|
|
50308
|
+
}
|
|
50309
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
50310
|
+
if (!(0, import_node_fs70.existsSync)(linked)) {
|
|
50311
|
+
const binDir = import_node_path70.default.dirname(linked);
|
|
50312
|
+
const found = (0, import_node_fs70.existsSync)(binDir) ? (0, import_node_fs70.readdirSync)(binDir).filter((name3) => name3.endsWith(".wasm")).sort() : [];
|
|
50196
50313
|
throw new Error(
|
|
50197
|
-
|
|
50198
|
-
...unprepared,
|
|
50199
|
-
projectDiagnostic(outputOf(retryError), layout3, input.files)
|
|
50200
|
-
].join("\n"),
|
|
50201
|
-
{ cause: retryError }
|
|
50314
|
+
`swift-compile: the build produced no ${import_node_path70.default.basename(linked)} (found: ${found.join(", ") || "none"})`
|
|
50202
50315
|
);
|
|
50203
50316
|
}
|
|
50204
|
-
|
|
50205
|
-
|
|
50206
|
-
|
|
50207
|
-
"\n"
|
|
50208
|
-
),
|
|
50209
|
-
{ cause: error }
|
|
50317
|
+
if (options2.project) removeProjectLinks(root2);
|
|
50318
|
+
const resourceReferences = Object.values(input.resources ?? {}).map(
|
|
50319
|
+
(value) => Buffer.from(value, "base64")
|
|
50210
50320
|
);
|
|
50211
|
-
|
|
50212
|
-
|
|
50213
|
-
|
|
50214
|
-
|
|
50215
|
-
|
|
50216
|
-
|
|
50217
|
-
|
|
50218
|
-
|
|
50219
|
-
|
|
50220
|
-
|
|
50221
|
-
|
|
50222
|
-
|
|
50223
|
-
|
|
50224
|
-
|
|
50225
|
-
|
|
50226
|
-
|
|
50227
|
-
|
|
50228
|
-
|
|
50229
|
-
if (!guestGraph)
|
|
50230
|
-
pruneSwiftWasmLink(
|
|
50231
|
-
root2,
|
|
50232
|
-
options2.toolchainBin,
|
|
50233
|
-
prebuilt?.root ?? frameworkRoot,
|
|
50234
|
-
input.staticClangTargets,
|
|
50235
|
-
options2.project,
|
|
50236
|
-
void 0,
|
|
50237
|
-
resourceReferences
|
|
50238
|
-
);
|
|
50239
|
-
if (options2.linkOnly) {
|
|
50240
|
-
if ((0, import_node_fs70.statSync)(linked).size <= 8)
|
|
50241
|
-
throw new Error("swift-compile: deferred linker produced no executable");
|
|
50242
|
-
stage("project link verified");
|
|
50243
|
-
if (readHold && retainSwiftRootReadHold(readHold)) readHold = void 0;
|
|
50244
|
-
return;
|
|
50245
|
-
}
|
|
50246
|
-
const output = options2.project ? projectOutputFile(root2, linked, options2.project) : linked;
|
|
50247
|
-
const optimized = `${output}.optimized`;
|
|
50248
|
-
if (!sdkImage) throw new Error("swift-compile: missing shared SDK image");
|
|
50249
|
-
if (options2.project) (0, import_node_fs70.rmSync)(optimized, { force: true });
|
|
50250
|
-
let sdkAsset;
|
|
50251
|
-
stage("linking the app image");
|
|
50252
|
-
if (guestGraph) {
|
|
50253
|
-
const binding = await compileGuestLink({
|
|
50254
|
-
graph: guestGraph,
|
|
50255
|
-
buildDirectory: root2,
|
|
50256
|
-
releaseDirectory: import_node_path70.default.dirname(linked),
|
|
50257
|
-
moduleRoot: frameworkRoot,
|
|
50258
|
-
toolchainBin: options2.toolchainBin,
|
|
50259
|
-
swiftCompiler: preparation.headerCompiler ? import_node_path70.default.join(root2, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? import_node_path70.default.join(options2.toolchainBin, "swiftc"),
|
|
50260
|
-
sysroot: compileSdkPaths.sysroot,
|
|
50261
|
-
sdk: swiftModuleSdk(frameworkRoot),
|
|
50262
|
-
sdkImage,
|
|
50263
|
-
compilerDigest: compilerSourceDigest,
|
|
50264
|
-
project: options2.project && {
|
|
50265
|
-
...options2.project,
|
|
50266
|
-
env: { ...options2.project.env, ...projectProcess?.env }
|
|
50267
|
-
},
|
|
50268
|
-
staticClangTargets: input.staticClangTargets ?? [],
|
|
50269
|
-
resourceReferences,
|
|
50270
|
-
resourceBundles: input.resourceBundles ?? [],
|
|
50271
|
-
generatedOwners: preparation.generatedOwners,
|
|
50272
|
-
output,
|
|
50273
|
-
optimized,
|
|
50274
|
-
optimize: input.optimize === true,
|
|
50275
|
-
jobs: swiftBuildJobs(),
|
|
50276
|
-
onStage: stage
|
|
50277
|
-
});
|
|
50278
|
-
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
50279
|
-
} else {
|
|
50280
|
-
const { buildSwiftAppModule: buildSwiftAppModule2 } = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
50281
|
-
const binding = await buildSwiftAppModule2({
|
|
50282
|
-
buildRoot: root2,
|
|
50283
|
-
toolchainBin: options2.toolchainBin,
|
|
50284
|
-
sdk: sdkImage,
|
|
50285
|
-
output: optimized,
|
|
50286
|
-
optimize: input.optimize === true,
|
|
50287
|
-
project: options2.project && {
|
|
50288
|
-
...options2.project,
|
|
50289
|
-
env: { ...options2.project.env, ...projectProcess?.env },
|
|
50290
|
-
sdkRoot: import_node_path70.default.dirname(compileSdkPaths.sysroot),
|
|
50291
|
-
linked: output
|
|
50321
|
+
if (!guestGraph)
|
|
50322
|
+
pruneSwiftWasmLink(
|
|
50323
|
+
root2,
|
|
50324
|
+
toolchainBin,
|
|
50325
|
+
prebuilt?.root ?? frameworkRoot,
|
|
50326
|
+
input.staticClangTargets,
|
|
50327
|
+
options2.project,
|
|
50328
|
+
void 0,
|
|
50329
|
+
resourceReferences
|
|
50330
|
+
);
|
|
50331
|
+
if (options2.linkOnly) {
|
|
50332
|
+
if ((0, import_node_fs70.statSync)(linked).size <= 8)
|
|
50333
|
+
throw new Error(
|
|
50334
|
+
"swift-compile: deferred linker produced no executable"
|
|
50335
|
+
);
|
|
50336
|
+
stage("project link verified");
|
|
50337
|
+
if (readHold && retainSwiftRootReadHold(readHold)) readHold = void 0;
|
|
50338
|
+
return;
|
|
50292
50339
|
}
|
|
50293
|
-
|
|
50294
|
-
|
|
50295
|
-
|
|
50296
|
-
|
|
50297
|
-
|
|
50298
|
-
|
|
50299
|
-
|
|
50300
|
-
|
|
50301
|
-
|
|
50302
|
-
|
|
50303
|
-
|
|
50304
|
-
|
|
50305
|
-
|
|
50306
|
-
|
|
50307
|
-
|
|
50308
|
-
|
|
50309
|
-
|
|
50340
|
+
const output = options2.project ? projectOutputFile(root2, linked, options2.project) : linked;
|
|
50341
|
+
const optimized = `${output}.optimized`;
|
|
50342
|
+
if (!sdkImage) throw new Error("swift-compile: missing shared SDK image");
|
|
50343
|
+
if (options2.project) (0, import_node_fs70.rmSync)(optimized, { force: true });
|
|
50344
|
+
let sdkAsset;
|
|
50345
|
+
stage("linking the app image");
|
|
50346
|
+
if (guestGraph) {
|
|
50347
|
+
const binding = await compileGuestLink({
|
|
50348
|
+
graph: guestGraph,
|
|
50349
|
+
buildDirectory: root2,
|
|
50350
|
+
releaseDirectory: import_node_path70.default.dirname(linked),
|
|
50351
|
+
moduleRoot: frameworkRoot,
|
|
50352
|
+
toolchainBin,
|
|
50353
|
+
swiftCompiler: preparation.headerCompiler ? import_node_path70.default.join(root2, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? import_node_path70.default.join(toolchainBin, "swiftc"),
|
|
50354
|
+
sysroot: compileSdkPaths.sysroot,
|
|
50355
|
+
sdk: swiftModuleSdk(frameworkRoot),
|
|
50356
|
+
sdkImage,
|
|
50357
|
+
compilerDigest: compilerSourceDigest,
|
|
50358
|
+
project: options2.project && {
|
|
50359
|
+
...options2.project,
|
|
50360
|
+
env: { ...options2.project.env, ...projectProcess?.env }
|
|
50361
|
+
},
|
|
50362
|
+
staticClangTargets: input.staticClangTargets ?? [],
|
|
50363
|
+
resourceReferences,
|
|
50364
|
+
resourceBundles: input.resourceBundles ?? [],
|
|
50365
|
+
generatedOwners: preparation.generatedOwners,
|
|
50366
|
+
output,
|
|
50367
|
+
optimized,
|
|
50368
|
+
optimize: input.optimize === true,
|
|
50369
|
+
jobs: swiftBuildJobs(),
|
|
50370
|
+
onStage: stage
|
|
50371
|
+
});
|
|
50372
|
+
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
50373
|
+
} else {
|
|
50374
|
+
const { buildSwiftAppModule: buildSwiftAppModule2 } = await Promise.resolve().then(() => (init_swift_sdk_app_module(), swift_sdk_app_module_exports));
|
|
50375
|
+
const binding = await buildSwiftAppModule2({
|
|
50376
|
+
buildRoot: root2,
|
|
50377
|
+
toolchainBin,
|
|
50378
|
+
sdk: sdkImage,
|
|
50379
|
+
output: optimized,
|
|
50380
|
+
optimize: input.optimize === true,
|
|
50381
|
+
project: options2.project && {
|
|
50382
|
+
...options2.project,
|
|
50383
|
+
env: { ...options2.project.env, ...projectProcess?.env },
|
|
50384
|
+
sdkRoot: import_node_path70.default.dirname(compileSdkPaths.sysroot),
|
|
50385
|
+
linked: output
|
|
50386
|
+
}
|
|
50387
|
+
});
|
|
50388
|
+
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
50389
|
+
}
|
|
50390
|
+
const artifact = {
|
|
50391
|
+
hash,
|
|
50392
|
+
bytes: (0, import_node_fs70.readFileSync)(optimized),
|
|
50393
|
+
icu: await icu,
|
|
50394
|
+
sdk: sdkAsset
|
|
50395
|
+
};
|
|
50396
|
+
if (artifact.bytes.length <= 8)
|
|
50397
|
+
throw new Error("swift-compile: deferred linker produced no executable");
|
|
50398
|
+
if (!options2.project) saveCompiledArtifact(root2, artifact);
|
|
50399
|
+
saveSharedArtifact(sharedRoot, artifact);
|
|
50400
|
+
stage("compiled artifact verified");
|
|
50401
|
+
return retain(baseRoot, artifact);
|
|
50402
|
+
} finally {
|
|
50403
|
+
readHold?.release();
|
|
50404
|
+
}
|
|
50405
|
+
});
|
|
50310
50406
|
}
|
|
50311
|
-
|
|
50312
|
-
}
|
|
50313
|
-
|
|
50314
|
-
|
|
50315
|
-
);
|
|
50407
|
+
);
|
|
50408
|
+
},
|
|
50409
|
+
options2.signal
|
|
50410
|
+
);
|
|
50411
|
+
});
|
|
50316
50412
|
}
|
|
50317
|
-
var import_node_child_process41, import_node_crypto45, import_node_fs70,
|
|
50413
|
+
var import_node_child_process41, import_node_crypto45, import_node_fs70, import_node_os18, import_node_path70, import_promises8, 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_FRAMEWORK_SLOT_HANDOFF, SWIFT_BUILD_ROOT_SLOTS, SWIFT_BUILD_ROOT_SHAPE, SWIFT_FRAMEWORK_HANDOFF_MS;
|
|
50318
50414
|
var init_swift_compile = __esm({
|
|
50319
50415
|
"src/swift-compile.ts"() {
|
|
50320
50416
|
"use strict";
|
|
50321
50417
|
import_node_child_process41 = require("node:child_process");
|
|
50322
50418
|
import_node_crypto45 = require("node:crypto");
|
|
50323
50419
|
import_node_fs70 = require("node:fs");
|
|
50324
|
-
|
|
50420
|
+
import_node_os18 = __toESM(require("node:os"), 1);
|
|
50325
50421
|
import_node_path70 = __toESM(require("node:path"), 1);
|
|
50326
50422
|
import_promises8 = require("node:timers/promises");
|
|
50327
50423
|
v6 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
@@ -50548,7 +50644,7 @@ ${wasmThreadLinkFlags.map((flag) => ` "-Xlinker", ${JSON.stringify(flag
|
|
|
50548
50644
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
50549
50645
|
MULTI_MANIFEST_VERSION = 76;
|
|
50550
50646
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
50551
|
-
compilerSourceDigest = true ? "
|
|
50647
|
+
compilerSourceDigest = true ? "0c6bac10641208c362185255fa7a630f4699656735409862a61a2e125ad2e84b" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
50552
50648
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
50553
50649
|
MODULE_MAP_RESPONSE_FILE_RUN = 16;
|
|
50554
50650
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
@@ -51050,7 +51146,7 @@ async function downloadFile(pod, url, headers, file, algorithm) {
|
|
|
51050
51146
|
return hash ? hash.digest("hex") : null;
|
|
51051
51147
|
}
|
|
51052
51148
|
function netrcCredentials(host2) {
|
|
51053
|
-
const file = import_node_path72.default.join(
|
|
51149
|
+
const file = import_node_path72.default.join(import_node_os19.default.homedir(), ".netrc");
|
|
51054
51150
|
if (!import_node_fs72.default.existsSync(file)) return null;
|
|
51055
51151
|
const tokens2 = import_node_fs72.default.readFileSync(file, "utf8").split(/\s+/).filter(Boolean);
|
|
51056
51152
|
let current2 = null;
|
|
@@ -51293,14 +51389,14 @@ function cleanInstalledPod(spec, root, used) {
|
|
|
51293
51389
|
(node) => used.filter((entry) => entry.specs.includes(node.name)).map((entry) => entry.platform)
|
|
51294
51390
|
);
|
|
51295
51391
|
}
|
|
51296
|
-
var import_node_child_process42, import_node_crypto47, import_node_fs72,
|
|
51392
|
+
var import_node_child_process42, import_node_crypto47, import_node_fs72, import_node_os19, import_node_path72, COCOAPODS_VERSION, USER_AGENT, PLATFORMS, HEADER_EXTENSIONS, SOURCE_EXTENSIONS2, SOURCE_FILES_PATTERN, STRATEGIES, OPTIONS, ARCHIVE_TYPES, object5, RETRY_STATUSES, chomp, stringList, bracketEnd, escapeRegex;
|
|
51297
51393
|
var init_pod_sources = __esm({
|
|
51298
51394
|
"src/pod-sources.ts"() {
|
|
51299
51395
|
"use strict";
|
|
51300
51396
|
import_node_child_process42 = require("node:child_process");
|
|
51301
51397
|
import_node_crypto47 = require("node:crypto");
|
|
51302
51398
|
import_node_fs72 = __toESM(require("node:fs"), 1);
|
|
51303
|
-
|
|
51399
|
+
import_node_os19 = __toESM(require("node:os"), 1);
|
|
51304
51400
|
import_node_path72 = __toESM(require("node:path"), 1);
|
|
51305
51401
|
init_home_paths();
|
|
51306
51402
|
init_pod_prepare_toolchain();
|
|
@@ -68809,10 +68905,10 @@ function bazelBinary(root) {
|
|
|
68809
68905
|
const pinned = import_node_path83.default.join(root, ".bazelversion");
|
|
68810
68906
|
if (!import_node_fs82.default.existsSync(pinned)) return "bazel";
|
|
68811
68907
|
const version2 = import_node_fs82.default.readFileSync(pinned, "utf8").trim();
|
|
68812
|
-
const platform =
|
|
68813
|
-
const arch =
|
|
68908
|
+
const platform = import_node_os20.default.platform() === "darwin" ? "darwin" : "linux";
|
|
68909
|
+
const arch = import_node_os20.default.arch() === "arm64" ? "arm64" : "x86_64";
|
|
68814
68910
|
const name3 = `bazel-${version2}-${platform}-${arch}`;
|
|
68815
|
-
const binary2 = import_node_path83.default.join(
|
|
68911
|
+
const binary2 = import_node_path83.default.join(import_node_os20.default.homedir(), ".peach", "cache", "bazel", name3);
|
|
68816
68912
|
if (import_node_fs82.default.existsSync(binary2)) return binary2;
|
|
68817
68913
|
const url = `https://github.com/bazelbuild/bazel/releases/download/${version2}/${name3}`;
|
|
68818
68914
|
import_node_fs82.default.mkdirSync(import_node_path83.default.dirname(binary2), { recursive: true });
|
|
@@ -69708,14 +69804,14 @@ function shellTokens(options2) {
|
|
|
69708
69804
|
return words2;
|
|
69709
69805
|
});
|
|
69710
69806
|
}
|
|
69711
|
-
var import_node_child_process44, import_node_crypto49, import_node_fs82,
|
|
69807
|
+
var import_node_child_process44, import_node_crypto49, import_node_fs82, import_node_os20, import_node_path83, LIBRARY_RULES, QUERIED_RULES, NATIVE_SOURCE, HEADER4, PRODUCTS, graphs, CLANG_CONFIGURATION_FLAGS, GRAPH_FORMAT, BazelFiles, CXX_STANDARD;
|
|
69712
69808
|
var init_bazel_project = __esm({
|
|
69713
69809
|
"src/bazel-project.ts"() {
|
|
69714
69810
|
"use strict";
|
|
69715
69811
|
import_node_child_process44 = require("node:child_process");
|
|
69716
69812
|
import_node_crypto49 = require("node:crypto");
|
|
69717
69813
|
import_node_fs82 = __toESM(require("node:fs"), 1);
|
|
69718
|
-
|
|
69814
|
+
import_node_os20 = __toESM(require("node:os"), 1);
|
|
69719
69815
|
import_node_path83 = __toESM(require("node:path"), 1);
|
|
69720
69816
|
init_is_record();
|
|
69721
69817
|
init_plist();
|
|
@@ -76954,7 +77050,7 @@ function nativeWorkspacesDir(root) {
|
|
|
76954
77050
|
for (const cache of [
|
|
76955
77051
|
sharedCacheDir(cacheDir()),
|
|
76956
77052
|
cacheDir(),
|
|
76957
|
-
import_node_path92.default.join(
|
|
77053
|
+
import_node_path92.default.join(import_node_os21.default.homedir(), ".peach-cache")
|
|
76958
77054
|
]) {
|
|
76959
77055
|
let existing = cache;
|
|
76960
77056
|
while (!import_node_fs90.default.existsSync(existing)) existing = import_node_path92.default.dirname(existing);
|
|
@@ -76964,7 +77060,7 @@ function nativeWorkspacesDir(root) {
|
|
|
76964
77060
|
let mount = import_node_fs90.default.realpathSync(root);
|
|
76965
77061
|
while (import_node_path92.default.dirname(mount) !== mount && import_node_fs90.default.statSync(import_node_path92.default.dirname(mount)).dev === device)
|
|
76966
77062
|
mount = import_node_path92.default.dirname(mount);
|
|
76967
|
-
const tmpRoots = /* @__PURE__ */ new Set(["/tmp", "/var/tmp", import_node_fs90.default.realpathSync(
|
|
77063
|
+
const tmpRoots = /* @__PURE__ */ new Set(["/tmp", "/var/tmp", import_node_fs90.default.realpathSync(import_node_os21.default.tmpdir())]);
|
|
76968
77064
|
if (tmpRoots.has(mount))
|
|
76969
77065
|
return import_node_path92.default.join(sharedCacheDir(cacheDir()), "expo-native-workspaces");
|
|
76970
77066
|
return import_node_path92.default.join(mount, ".peach-cache", "expo-native-workspaces");
|
|
@@ -77305,7 +77401,7 @@ ${failedOutputLine(command, cwd, bytes)}`
|
|
|
77305
77401
|
});
|
|
77306
77402
|
});
|
|
77307
77403
|
}
|
|
77308
|
-
var import_node_child_process46, import_node_crypto55, import_node_fs90, import_node_module9,
|
|
77404
|
+
var import_node_child_process46, import_node_crypto55, import_node_fs90, import_node_module9, import_node_os21, import_node_path92, import_node_util13, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE2, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
|
|
77309
77405
|
var init_expo_native_workspace = __esm({
|
|
77310
77406
|
"src/expo-native-workspace.ts"() {
|
|
77311
77407
|
"use strict";
|
|
@@ -77313,7 +77409,7 @@ var init_expo_native_workspace = __esm({
|
|
|
77313
77409
|
import_node_crypto55 = require("node:crypto");
|
|
77314
77410
|
import_node_fs90 = __toESM(require("node:fs"), 1);
|
|
77315
77411
|
import_node_module9 = require("node:module");
|
|
77316
|
-
|
|
77412
|
+
import_node_os21 = __toESM(require("node:os"), 1);
|
|
77317
77413
|
import_node_path92 = __toESM(require("node:path"), 1);
|
|
77318
77414
|
import_node_util13 = require("node:util");
|
|
77319
77415
|
init_detect();
|
|
@@ -78140,14 +78236,14 @@ async function readExpoConfigAsync(projectRoot) {
|
|
|
78140
78236
|
import_node_fs93.default.rmSync(directory2, { recursive: true, force: true });
|
|
78141
78237
|
}
|
|
78142
78238
|
}
|
|
78143
|
-
var import_node_child_process47, import_node_fs93, import_node_module11,
|
|
78239
|
+
var import_node_child_process47, import_node_fs93, import_node_module11, import_node_os22, import_node_path95, EXPO_CONFIG_SCRIPT, EXPO_CONFIG_TIMEOUT_MS, resultDirectory;
|
|
78144
78240
|
var init_native_firebase_config = __esm({
|
|
78145
78241
|
"src/native-firebase-config.ts"() {
|
|
78146
78242
|
"use strict";
|
|
78147
78243
|
import_node_child_process47 = require("node:child_process");
|
|
78148
78244
|
import_node_fs93 = __toESM(require("node:fs"), 1);
|
|
78149
78245
|
import_node_module11 = require("node:module");
|
|
78150
|
-
|
|
78246
|
+
import_node_os22 = __toESM(require("node:os"), 1);
|
|
78151
78247
|
import_node_path95 = __toESM(require("node:path"), 1);
|
|
78152
78248
|
init_is_record();
|
|
78153
78249
|
init_plist();
|
|
@@ -78169,7 +78265,7 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
|
|
|
78169
78265
|
if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
|
|
78170
78266
|
writeFileSync(process.argv[2], result, { mode: 0o600 });`;
|
|
78171
78267
|
EXPO_CONFIG_TIMEOUT_MS = 3e4;
|
|
78172
|
-
resultDirectory = () => import_node_fs93.default.mkdtempSync(import_node_path95.default.join(
|
|
78268
|
+
resultDirectory = () => import_node_fs93.default.mkdtempSync(import_node_path95.default.join(import_node_os22.default.tmpdir(), "peach-expo-config-"));
|
|
78173
78269
|
}
|
|
78174
78270
|
});
|
|
78175
78271
|
|
|
@@ -80364,7 +80460,7 @@ function genruleToolchain(moduleRoot) {
|
|
|
80364
80460
|
ranlib: bin("llvm-ranlib"),
|
|
80365
80461
|
jobs: Math.min(
|
|
80366
80462
|
32,
|
|
80367
|
-
Number(process.env.TM_EXEC_CPU_CORES) ||
|
|
80463
|
+
Number(process.env.TM_EXEC_CPU_CORES) || import_node_os23.default.availableParallelism()
|
|
80368
80464
|
),
|
|
80369
80465
|
frameworkIdentity: () => frameworkProbeIdentity(moduleRoot, compiler.toolchainBin),
|
|
80370
80466
|
frameworks: () => frameworks ??= nativeFrameworkCompiler(
|
|
@@ -80520,14 +80616,14 @@ function genruleArchive(declaration, library, moduleRoot) {
|
|
|
80520
80616
|
}
|
|
80521
80617
|
return combined;
|
|
80522
80618
|
}
|
|
80523
|
-
var import_node_child_process51, import_node_crypto64, import_node_fs102,
|
|
80619
|
+
var import_node_child_process51, import_node_crypto64, import_node_fs102, import_node_os23, import_node_path105, v8, BUILDERS, cacheDir4, toolIdentities, sysrootIdentities, GENRULE_RECIPE, GENRULE_BUNDLE;
|
|
80524
80620
|
var init_genrule_archives = __esm({
|
|
80525
80621
|
"src/genrule-archives.ts"() {
|
|
80526
80622
|
"use strict";
|
|
80527
80623
|
import_node_child_process51 = require("node:child_process");
|
|
80528
80624
|
import_node_crypto64 = require("node:crypto");
|
|
80529
80625
|
import_node_fs102 = __toESM(require("node:fs"), 1);
|
|
80530
|
-
|
|
80626
|
+
import_node_os23 = __toESM(require("node:os"), 1);
|
|
80531
80627
|
import_node_path105 = __toESM(require("node:path"), 1);
|
|
80532
80628
|
v8 = __toESM(require("peachsim/vendor/valibot"), 1);
|
|
80533
80629
|
init_ffmpeg_source_build();
|
|
@@ -80613,7 +80709,7 @@ function privateSentrySlice(entry, moduleRoot) {
|
|
|
80613
80709
|
throw new Error(
|
|
80614
80710
|
"the Sentry slice for a private Swift distribution builds from a Contrast source checkout"
|
|
80615
80711
|
);
|
|
80616
|
-
const staging = import_node_fs103.default.mkdtempSync(import_node_path106.default.join(import_node_fs103.default.realpathSync(
|
|
80712
|
+
const staging = import_node_fs103.default.mkdtempSync(import_node_path106.default.join(import_node_fs103.default.realpathSync(import_node_os24.default.tmpdir()), "sentry-slice-"));
|
|
80617
80713
|
try {
|
|
80618
80714
|
process.stderr.write("peach: building the Sentry slice for a private distribution\u2026\n");
|
|
80619
80715
|
(0, import_node_child_process52.execFileSync)("bun", [script, "--output", staging, "--module-root", moduleRoot], {
|
|
@@ -80691,14 +80787,14 @@ function nativeSwiftSlice(standin, moduleRoot, generator, configured, artifact)
|
|
|
80691
80787
|
}
|
|
80692
80788
|
};
|
|
80693
80789
|
}
|
|
80694
|
-
var import_node_child_process52, import_node_crypto65, import_node_fs103,
|
|
80790
|
+
var import_node_child_process52, import_node_crypto65, import_node_fs103, import_node_os24, import_node_path106, SENTRY_SWIFT_SLICE;
|
|
80695
80791
|
var init_native_swift_slices = __esm({
|
|
80696
80792
|
"src/native-swift-slices.ts"() {
|
|
80697
80793
|
"use strict";
|
|
80698
80794
|
import_node_child_process52 = require("node:child_process");
|
|
80699
80795
|
import_node_crypto65 = require("node:crypto");
|
|
80700
80796
|
import_node_fs103 = __toESM(require("node:fs"), 1);
|
|
80701
|
-
|
|
80797
|
+
import_node_os24 = __toESM(require("node:os"), 1);
|
|
80702
80798
|
import_node_path106 = __toESM(require("node:path"), 1);
|
|
80703
80799
|
init_native_prebuilt();
|
|
80704
80800
|
init_swift_sdk_surface();
|
|
@@ -92232,7 +92328,7 @@ function build(checkout, output, toolchainBin, common2, objc) {
|
|
|
92232
92328
|
import_node_fs113.default.cpSync(import_node_path115.default.join(runtime, "include"), import_node_path115.default.join(includes, "rive", "include"), {
|
|
92233
92329
|
recursive: true
|
|
92234
92330
|
});
|
|
92235
|
-
const jobs = String(Number(process.env.TM_EXEC_CPU_CORES) ||
|
|
92331
|
+
const jobs = String(Number(process.env.TM_EXEC_CPU_CORES) || import_node_os25.default.availableParallelism());
|
|
92236
92332
|
const component = (directory2, target, args, headers) => {
|
|
92237
92333
|
const cwd = import_node_path115.default.join(runtime, directory2);
|
|
92238
92334
|
const out = `out/iphonesimulator_${CONFIG}`;
|
|
@@ -92342,14 +92438,14 @@ exec ${quote3(import_node_path115.default.join(toolchainBin, "llvm-ar"))} rcs "$
|
|
|
92342
92438
|
);
|
|
92343
92439
|
return directory2;
|
|
92344
92440
|
}
|
|
92345
|
-
var import_node_child_process57, import_node_crypto69, import_node_fs113,
|
|
92441
|
+
var import_node_child_process57, import_node_crypto69, import_node_fs113, import_node_os25, import_node_path115, import_promises11, RECIPE, CONFIG, RUNTIME_LIBRARIES;
|
|
92346
92442
|
var init_rive_runtime_dependencies = __esm({
|
|
92347
92443
|
"src/rive-runtime-dependencies.ts"() {
|
|
92348
92444
|
"use strict";
|
|
92349
92445
|
import_node_child_process57 = require("node:child_process");
|
|
92350
92446
|
import_node_crypto69 = require("node:crypto");
|
|
92351
92447
|
import_node_fs113 = __toESM(require("node:fs"), 1);
|
|
92352
|
-
|
|
92448
|
+
import_node_os25 = __toESM(require("node:os"), 1);
|
|
92353
92449
|
import_node_path115 = __toESM(require("node:path"), 1);
|
|
92354
92450
|
import_promises11 = require("node:timers/promises");
|
|
92355
92451
|
init_home_paths();
|
|
@@ -93461,7 +93557,7 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
|
|
|
93461
93557
|
record5(input, bytes);
|
|
93462
93558
|
}
|
|
93463
93559
|
if (!pending.size) return rendered;
|
|
93464
|
-
const work = import_node_fs116.default.mkdtempSync(import_node_path118.default.join(
|
|
93560
|
+
const work = import_node_fs116.default.mkdtempSync(import_node_path118.default.join(import_node_os26.default.tmpdir(), "swift-pdf-png-"));
|
|
93465
93561
|
let cacheWork;
|
|
93466
93562
|
let writeCache = true;
|
|
93467
93563
|
try {
|
|
@@ -93514,13 +93610,13 @@ function rasterizePdfFiles(inputs2, { imageBytes, imageTotalBytes } = { imageByt
|
|
|
93514
93610
|
}
|
|
93515
93611
|
return rendered;
|
|
93516
93612
|
}
|
|
93517
|
-
var import_node_child_process60, import_node_fs116,
|
|
93613
|
+
var import_node_child_process60, import_node_fs116, import_node_os26, import_node_path118, RASTER_PDF;
|
|
93518
93614
|
var init_swift_pdf_raster = __esm({
|
|
93519
93615
|
"src/swift-pdf-raster.ts"() {
|
|
93520
93616
|
"use strict";
|
|
93521
93617
|
import_node_child_process60 = require("node:child_process");
|
|
93522
93618
|
import_node_fs116 = __toESM(require("node:fs"), 1);
|
|
93523
|
-
|
|
93619
|
+
import_node_os26 = __toESM(require("node:os"), 1);
|
|
93524
93620
|
import_node_path118 = __toESM(require("node:path"), 1);
|
|
93525
93621
|
init_internal_child_contract();
|
|
93526
93622
|
init_self_invocation();
|
|
@@ -94063,6 +94159,15 @@ var init_swift_sdk_later_data = __esm({
|
|
|
94063
94159
|
});
|
|
94064
94160
|
|
|
94065
94161
|
// src/swift-host.ts
|
|
94162
|
+
function readPackageFileScoped(packagePath, file, maxBytes) {
|
|
94163
|
+
const scope2 = packageReadScopes.getStore();
|
|
94164
|
+
const key2 = `${packagePath}\0${file}`;
|
|
94165
|
+
const cached2 = scope2?.get(key2);
|
|
94166
|
+
if (cached2) return cached2;
|
|
94167
|
+
const bytes = readPackageFile2(packagePath, file, maxBytes);
|
|
94168
|
+
scope2?.set(key2, bytes);
|
|
94169
|
+
return bytes;
|
|
94170
|
+
}
|
|
94066
94171
|
function swiftPackageId(packagePath) {
|
|
94067
94172
|
return import_node_path119.default.basename(packagePath).replace(/[^A-Za-z0-9_]/g, "_").replace(/^(\d)/, "_$1");
|
|
94068
94173
|
}
|
|
@@ -95686,7 +95791,7 @@ function buildSwiftBundleFiles(packagePath, hosted, inputs2, resourceBundles) {
|
|
|
95686
95791
|
}
|
|
95687
95792
|
}
|
|
95688
95793
|
if (xcode?.app.postBundleScripts.length) {
|
|
95689
|
-
const dir = import_node_fs117.default.mkdtempSync(import_node_path119.default.join(
|
|
95794
|
+
const dir = import_node_fs117.default.mkdtempSync(import_node_path119.default.join(import_node_os27.default.tmpdir(), "peach-xcode-bundle-"));
|
|
95690
95795
|
const wrapper = import_node_path119.default.basename(xcode.app.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")) || `${xcode.app.name}.app`;
|
|
95691
95796
|
const bundle = import_node_path119.default.join(dir, wrapper);
|
|
95692
95797
|
try {
|
|
@@ -95864,13 +95969,7 @@ function moduleStamp(packagePath, moduleRootOverride, hosted) {
|
|
|
95864
95969
|
(root) => import_node_fs117.default.existsSync(import_node_path119.default.join(root, "toolchain.json"))
|
|
95865
95970
|
);
|
|
95866
95971
|
if (!moduleRoot) return "";
|
|
95867
|
-
|
|
95868
|
-
hash.update(moduleRoot);
|
|
95869
|
-
for (const relative3 of swiftModuleInputFiles(moduleRoot)) {
|
|
95870
|
-
hash.update(relative3);
|
|
95871
|
-
hash.update(String(import_node_fs117.default.statSync(import_node_path119.default.join(moduleRoot, relative3)).mtimeMs));
|
|
95872
|
-
}
|
|
95873
|
-
return hash.digest("hex");
|
|
95972
|
+
return `${moduleRoot}\0${swiftModuleStamp(moduleRoot)}`;
|
|
95874
95973
|
}
|
|
95875
95974
|
function otherInputs(input) {
|
|
95876
95975
|
const { files: _files, ...rest } = input;
|
|
@@ -95990,7 +96089,7 @@ function packageSources(packagePath, hosted = false, linked = /* @__PURE__ */ ne
|
|
|
95990
96089
|
for (const file of sourceFiles(packagePath)) {
|
|
95991
96090
|
const relative3 = import_node_path119.default.relative(packagePath, file).split(import_node_path119.default.sep).join(import_node_path119.default.posix.sep);
|
|
95992
96091
|
if (manifests.has(file) || xcode?.packageFiles.has(file)) continue;
|
|
95993
|
-
files2[xcode ? xcodeInputKey(xcode, file, relative3) : relative3] = (xcode?.nativeFiles.get(file) ??
|
|
96092
|
+
files2[xcode ? xcodeInputKey(xcode, file, relative3) : relative3] = (xcode?.nativeFiles.get(file) ?? readPackageFileScoped(packagePath, file, limits.sourceBytes)).toString("utf8");
|
|
95994
96093
|
}
|
|
95995
96094
|
if (xcode) {
|
|
95996
96095
|
for (const [file, contents2] of xcode.nativeFiles)
|
|
@@ -96285,48 +96384,52 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
96285
96384
|
const moduleRoot = moduleRootOverride ?? linkedModuleRoots(packagePath).find(
|
|
96286
96385
|
(root) => import_node_fs117.default.existsSync(import_node_path119.default.join(root, "toolchain.json"))
|
|
96287
96386
|
) ?? await swiftDistributionRoot(signal);
|
|
96288
|
-
const
|
|
96387
|
+
const release = swiftModuleRelease(moduleRoot);
|
|
96289
96388
|
const input = snapshotCompileInput(snapshot);
|
|
96290
96389
|
const compiled = {
|
|
96291
96390
|
files: input.files,
|
|
96292
96391
|
inputs: otherInputs(input),
|
|
96293
96392
|
module: moduleStamp(packagePath, moduleRootOverride, false)
|
|
96294
96393
|
};
|
|
96295
|
-
const
|
|
96296
|
-
|
|
96297
|
-
|
|
96298
|
-
|
|
96299
|
-
|
|
96300
|
-
name3,
|
|
96301
|
-
|
|
96302
|
-
|
|
96303
|
-
|
|
96304
|
-
|
|
96305
|
-
|
|
96306
|
-
|
|
96307
|
-
|
|
96308
|
-
const
|
|
96309
|
-
|
|
96394
|
+
const verifyMissingModules = async (toolchainBin) => {
|
|
96395
|
+
const parsed2 = compileTargets(input);
|
|
96396
|
+
const targets = parsed2.map((target) => swiftTargetModuleName(target.name));
|
|
96397
|
+
const byPath = [...parsed2].sort((left, right) => right.path.length - left.path.length);
|
|
96398
|
+
const clangModulesByTarget = new Map(
|
|
96399
|
+
(input.nativeTargets ?? []).map(({ name: name3, headerSearchPaths }) => [
|
|
96400
|
+
name3,
|
|
96401
|
+
headerSearchPaths.flatMap((directory2) => {
|
|
96402
|
+
const map2 = input.files[import_node_path119.default.posix.join(directory2, "module.modulemap")] ?? input.files[import_node_path119.default.posix.join(directory2, "module.map")];
|
|
96403
|
+
return map2 === void 0 ? [] : moduleMapModules(map2).map(({ name: name4 }) => name4);
|
|
96404
|
+
})
|
|
96405
|
+
])
|
|
96406
|
+
);
|
|
96407
|
+
const providedByFile = (file) => {
|
|
96408
|
+
const owner = byPath.find(
|
|
96409
|
+
(target) => target.path === "." ? true : file.startsWith(`${target.path}/`)
|
|
96410
|
+
);
|
|
96411
|
+
if (!owner) return [];
|
|
96412
|
+
const clangModules = clangModulesByTarget.get(owner.name) ?? [];
|
|
96413
|
+
return owner.experimentalFeatures?.includes("BuiltinModule") ? [...clangModules, "Builtin"] : clangModules;
|
|
96414
|
+
};
|
|
96415
|
+
const missing = missingSwiftModules(
|
|
96416
|
+
input.files,
|
|
96417
|
+
/* @__PURE__ */ new Set([
|
|
96418
|
+
...swiftAvailableModules(moduleRoot, toolchainBin),
|
|
96419
|
+
// a project without a manifest compiles as the template's one App target
|
|
96420
|
+
...targets.length > 0 ? targets : ["App"],
|
|
96421
|
+
// a system target's clang module name need not match its target name
|
|
96422
|
+
...swiftSystemLibrarySurface(input.files, parsed2).modules,
|
|
96423
|
+
...Object.keys(input.binaryModules ?? {}),
|
|
96424
|
+
...snapshot.nativeModules
|
|
96425
|
+
]),
|
|
96426
|
+
providedByFile
|
|
96310
96427
|
);
|
|
96311
|
-
if (
|
|
96312
|
-
|
|
96313
|
-
|
|
96428
|
+
if (missing.size > 0)
|
|
96429
|
+
throw new SwiftMissingModulesError(
|
|
96430
|
+
await missingModulesMessage(packagePath, missing)
|
|
96431
|
+
);
|
|
96314
96432
|
};
|
|
96315
|
-
const missing = missingSwiftModules(
|
|
96316
|
-
input.files,
|
|
96317
|
-
/* @__PURE__ */ new Set([
|
|
96318
|
-
...swiftAvailableModules(moduleRoot, toolchain.toolchainBin),
|
|
96319
|
-
// a project without a manifest compiles as the template's one App target
|
|
96320
|
-
...targets.length > 0 ? targets : ["App"],
|
|
96321
|
-
// a system target's clang module name need not match its target name
|
|
96322
|
-
...swiftSystemLibrarySurface(input.files, parsed2).modules,
|
|
96323
|
-
...Object.keys(input.binaryModules ?? {}),
|
|
96324
|
-
...snapshot.nativeModules
|
|
96325
|
-
]),
|
|
96326
|
-
providedByFile
|
|
96327
|
-
);
|
|
96328
|
-
if (missing.size > 0)
|
|
96329
|
-
throw new SwiftMissingModulesError(await missingModulesMessage(packagePath, missing));
|
|
96330
96433
|
const artifact = await compileSwiftProjectUnit(input, {
|
|
96331
96434
|
// the compile rewrites Sources/App in its root before swiftpm builds, and
|
|
96332
96435
|
// a root lock orders every process using it, so two vites on one root
|
|
@@ -96336,7 +96439,9 @@ async function compile(packagePath, stamp, moduleRootOverride, hosted, snapshot,
|
|
|
96336
96439
|
// incremental build across restarts.
|
|
96337
96440
|
buildRoot: swiftBuildRoot(packagePath, moduleRoot),
|
|
96338
96441
|
moduleRoot,
|
|
96339
|
-
|
|
96442
|
+
release,
|
|
96443
|
+
resolveToolchain: () => swiftModuleToolchain(moduleRoot).toolchainBin,
|
|
96444
|
+
beforeCompile: verifyMissingModules,
|
|
96340
96445
|
signal
|
|
96341
96446
|
}).catch((error) => {
|
|
96342
96447
|
const report = error instanceof Error ? swiftApiGapReport(error.message) : null;
|
|
@@ -96547,9 +96652,11 @@ function currentStamp(project2, moduleRoot) {
|
|
|
96547
96652
|
);
|
|
96548
96653
|
}
|
|
96549
96654
|
function artifactFor(project2, entry, moduleRoot, signal = project2.signal) {
|
|
96550
|
-
return
|
|
96551
|
-
|
|
96552
|
-
|
|
96655
|
+
return withSwiftModuleDigestScope(
|
|
96656
|
+
() => withXcodeLayout(
|
|
96657
|
+
project2.packagePath,
|
|
96658
|
+
() => scopedArtifact(project2, entry, moduleRoot, signal)
|
|
96659
|
+
)
|
|
96553
96660
|
);
|
|
96554
96661
|
}
|
|
96555
96662
|
function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
@@ -96610,6 +96717,48 @@ function scopedArtifact(project2, entry, moduleRoot, signal) {
|
|
|
96610
96717
|
project2.building = { stamp, promise: fresh, signal };
|
|
96611
96718
|
return fresh;
|
|
96612
96719
|
}
|
|
96720
|
+
function readCachedSplitBinding(cacheDir6) {
|
|
96721
|
+
const receiptFile2 = import_node_path119.default.join(cacheDir6, "receipt.json");
|
|
96722
|
+
if (!import_node_fs117.default.existsSync(receiptFile2)) return null;
|
|
96723
|
+
try {
|
|
96724
|
+
const receipt = JSON.parse(import_node_fs117.default.readFileSync(receiptFile2, "utf8"));
|
|
96725
|
+
if (!receipt || typeof receipt !== "object" || !("digest" in receipt) || typeof receipt.digest !== "string" || !("later" in receipt) || !Array.isArray(receipt.later) || !receipt.later.every((item) => typeof item === "string"))
|
|
96726
|
+
return null;
|
|
96727
|
+
const binding = import_node_fs117.default.readFileSync(import_node_path119.default.join(cacheDir6, "binding.bin"));
|
|
96728
|
+
if ((0, import_node_crypto72.createHash)("sha256").update(binding).digest("hex") !== receipt.digest) return null;
|
|
96729
|
+
const later = receipt.later.map((sha2564, index) => {
|
|
96730
|
+
const bytes = import_node_fs117.default.readFileSync(import_node_path119.default.join(cacheDir6, `later-${index}.bin`));
|
|
96731
|
+
if ((0, import_node_crypto72.createHash)("sha256").update(bytes).digest("hex") !== sha2564)
|
|
96732
|
+
throw new SyntaxError("digest mismatch");
|
|
96733
|
+
return { sha256: sha2564, bytes };
|
|
96734
|
+
});
|
|
96735
|
+
return { digest: receipt.digest, binding, later };
|
|
96736
|
+
} catch {
|
|
96737
|
+
return null;
|
|
96738
|
+
}
|
|
96739
|
+
}
|
|
96740
|
+
function writeCachedSplitBinding(cacheDir6, digest2, binding, later) {
|
|
96741
|
+
const parent = import_node_path119.default.dirname(cacheDir6);
|
|
96742
|
+
import_node_fs117.default.mkdirSync(parent, { recursive: true });
|
|
96743
|
+
const staging = `${cacheDir6}.${process.pid}.${(0, import_node_crypto72.randomUUID)()}.tmp`;
|
|
96744
|
+
try {
|
|
96745
|
+
import_node_fs117.default.mkdirSync(staging, { recursive: true });
|
|
96746
|
+
import_node_fs117.default.writeFileSync(import_node_path119.default.join(staging, "binding.bin"), binding);
|
|
96747
|
+
for (let index = 0; index < later.length; index++)
|
|
96748
|
+
import_node_fs117.default.writeFileSync(import_node_path119.default.join(staging, `later-${index}.bin`), later[index].bytes);
|
|
96749
|
+
import_node_fs117.default.writeFileSync(
|
|
96750
|
+
import_node_path119.default.join(staging, "receipt.json"),
|
|
96751
|
+
JSON.stringify({ digest: digest2, later: later.map(({ sha256: sha2564 }) => sha2564) })
|
|
96752
|
+
);
|
|
96753
|
+
try {
|
|
96754
|
+
import_node_fs117.default.renameSync(staging, cacheDir6);
|
|
96755
|
+
} catch {
|
|
96756
|
+
if (!import_node_fs117.default.existsSync(cacheDir6)) throw new Error(`failed to store ${cacheDir6}`);
|
|
96757
|
+
}
|
|
96758
|
+
} finally {
|
|
96759
|
+
import_node_fs117.default.rmSync(staging, { recursive: true, force: true });
|
|
96760
|
+
}
|
|
96761
|
+
}
|
|
96613
96762
|
async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
96614
96763
|
const key2 = `${sdk2.binding.sha256}:${splitKey}`;
|
|
96615
96764
|
if (sdkSplitBindings.has(key2)) return;
|
|
@@ -96617,15 +96766,29 @@ async function splitSdkBinding(sdk2, splitKey, plan) {
|
|
|
96617
96766
|
Promise.resolve().then(() => (init_swift_sdk_later_data(), swift_sdk_later_data_exports)),
|
|
96618
96767
|
Promise.resolve().then(() => (init_swift_sdk_image(), swift_sdk_image_exports))
|
|
96619
96768
|
]);
|
|
96620
|
-
const
|
|
96621
|
-
|
|
96622
|
-
|
|
96623
|
-
|
|
96624
|
-
|
|
96769
|
+
const sdkDirectory = import_node_path119.default.dirname(swiftSdkImageFile2(sdk2.key));
|
|
96770
|
+
const planDigest = (0, import_node_crypto72.createHash)("sha256").update(plan).digest("hex");
|
|
96771
|
+
const cacheDir6 = import_node_path119.default.join(
|
|
96772
|
+
sdkDirectory,
|
|
96773
|
+
"split-bindings-v1",
|
|
96774
|
+
(0, import_node_crypto72.createHash)("sha256").update(`${sdk2.binding.sha256}\0${planDigest}`).digest("hex").slice(0, 32)
|
|
96775
|
+
);
|
|
96776
|
+
const cached2 = readCachedSplitBinding(cacheDir6);
|
|
96777
|
+
if (cached2) {
|
|
96778
|
+
sdkBindingFiles.set(cached2.digest, cached2.binding);
|
|
96779
|
+
for (const { sha256: sha2564, bytes } of cached2.later) sdkBindingFiles.set(sha2564, bytes);
|
|
96780
|
+
sdkSplitBindings.set(key2, cached2.digest);
|
|
96781
|
+
return;
|
|
96782
|
+
}
|
|
96783
|
+
const split = splitSwiftSdkLaterData2(sdkDirectory, sdk2.binding.bytes, plan);
|
|
96625
96784
|
const digest2 = (0, import_node_crypto72.createHash)("sha256").update(split.binding).digest("hex");
|
|
96785
|
+
const later = split.later.map((bytes) => ({
|
|
96786
|
+
sha256: (0, import_node_crypto72.createHash)("sha256").update(bytes).digest("hex"),
|
|
96787
|
+
bytes
|
|
96788
|
+
}));
|
|
96789
|
+
writeCachedSplitBinding(cacheDir6, digest2, split.binding, later);
|
|
96626
96790
|
sdkBindingFiles.set(digest2, split.binding);
|
|
96627
|
-
for (const
|
|
96628
|
-
sdkBindingFiles.set((0, import_node_crypto72.createHash)("sha256").update(later).digest("hex"), later);
|
|
96791
|
+
for (const { sha256: sha2564, bytes } of later) sdkBindingFiles.set(sha2564, bytes);
|
|
96629
96792
|
sdkSplitBindings.set(key2, digest2);
|
|
96630
96793
|
}
|
|
96631
96794
|
function swiftSdkEntryAssets(origin, image, sdkDigest = image.sdk?.sha256) {
|
|
@@ -96715,15 +96878,15 @@ async function swiftArtifactAssets(artifact, { sdkUrl, sdkBindingUrl }) {
|
|
|
96715
96878
|
}
|
|
96716
96879
|
return assets2;
|
|
96717
96880
|
}
|
|
96718
|
-
var
|
|
96881
|
+
var import_node_async_hooks4, import_node_child_process61, import_node_crypto72, import_node_fs117, import_node_os27, import_node_path119, ARTIFACT_PATH, RESOURCE_PATH, ICU_PATH, SDK_PATH, SDK_BINDING_PATH, SKIP_ROOT_DIRS, NATIVE_DESCRIPTOR, NATIVE_GLUE, packageReadScopes, SwiftMissingModulesError, 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, sdkStartupParts, sdkPieces2, sdkSplitBindings, sdkBindingFiles, servedSdkBinding;
|
|
96719
96882
|
var init_swift_host = __esm({
|
|
96720
96883
|
"src/swift-host.ts"() {
|
|
96721
96884
|
"use strict";
|
|
96722
|
-
|
|
96885
|
+
import_node_async_hooks4 = require("node:async_hooks");
|
|
96723
96886
|
import_node_child_process61 = require("node:child_process");
|
|
96724
96887
|
import_node_crypto72 = require("node:crypto");
|
|
96725
96888
|
import_node_fs117 = __toESM(require("node:fs"), 1);
|
|
96726
|
-
|
|
96889
|
+
import_node_os27 = __toESM(require("node:os"), 1);
|
|
96727
96890
|
import_node_path119 = __toESM(require("node:path"), 1);
|
|
96728
96891
|
init_pngHeader();
|
|
96729
96892
|
init_nativeSdkBindingContract();
|
|
@@ -96753,6 +96916,7 @@ var init_swift_host = __esm({
|
|
|
96753
96916
|
init_swift_packages();
|
|
96754
96917
|
init_swift_pdf_raster();
|
|
96755
96918
|
init_swift_sdk_image_wasm();
|
|
96919
|
+
init_swift_sdk_surface();
|
|
96756
96920
|
init_swift_shipped_binaries();
|
|
96757
96921
|
init_swift_source_file();
|
|
96758
96922
|
init_swift_standin_config();
|
|
@@ -96773,11 +96937,12 @@ var init_swift_host = __esm({
|
|
|
96773
96937
|
SKIP_ROOT_DIRS = /* @__PURE__ */ new Set(["dist", "types", "build", "ios", "android"]);
|
|
96774
96938
|
NATIVE_DESCRIPTOR = ".one-native-source.json";
|
|
96775
96939
|
NATIVE_GLUE = ".one-native-source.swift.txt";
|
|
96940
|
+
packageReadScopes = new import_node_async_hooks4.AsyncLocalStorage();
|
|
96776
96941
|
SwiftMissingModulesError = class extends Error {
|
|
96777
96942
|
};
|
|
96778
96943
|
swiftArtifactDigests = /* @__PURE__ */ new WeakMap();
|
|
96779
96944
|
sharedProjects = /* @__PURE__ */ new Map();
|
|
96780
|
-
projectScope = new
|
|
96945
|
+
projectScope = new import_node_async_hooks4.AsyncLocalStorage();
|
|
96781
96946
|
projects = () => projectScope.getStore()?.projects ?? sharedProjects;
|
|
96782
96947
|
sharedSourceEntries = /* @__PURE__ */ new Map();
|
|
96783
96948
|
sourceEntries = () => projectScope.getStore()?.sourceEntries ?? sharedSourceEntries;
|
|
@@ -96788,7 +96953,7 @@ var init_swift_host = __esm({
|
|
|
96788
96953
|
XCODE_APP_DIR = "__app__";
|
|
96789
96954
|
XCODE_FRAMEWORKS_DIR = "__frameworks__";
|
|
96790
96955
|
XCODE_PACKAGES_DIR = SWIFT_REMOTE_PACKAGES_DIR;
|
|
96791
|
-
layoutScope = new
|
|
96956
|
+
layoutScope = new import_node_async_hooks4.AsyncLocalStorage();
|
|
96792
96957
|
HOSTED_LIMITS = {
|
|
96793
96958
|
sourceBytes: MAX_SWIFT_COMPILE_SOURCE_BYTES,
|
|
96794
96959
|
resources: MAX_SWIFT_COMPILE_RESOURCES,
|
|
@@ -102821,14 +102986,14 @@ function collectTurboCompileInput(collection, runtime, iosDeploymentTarget, depe
|
|
|
102821
102986
|
resources: { ...dependencies?.resources, ...collection.resources }
|
|
102822
102987
|
};
|
|
102823
102988
|
}
|
|
102824
|
-
var import_node_crypto75, import_node_fs122, import_node_module17,
|
|
102989
|
+
var import_node_crypto75, import_node_fs122, import_node_module17, import_node_os28, import_node_path124;
|
|
102825
102990
|
var init_turbo_compile = __esm({
|
|
102826
102991
|
"src/turbo-compile.ts"() {
|
|
102827
102992
|
"use strict";
|
|
102828
102993
|
import_node_crypto75 = require("node:crypto");
|
|
102829
102994
|
import_node_fs122 = __toESM(require("node:fs"), 1);
|
|
102830
102995
|
import_node_module17 = require("node:module");
|
|
102831
|
-
|
|
102996
|
+
import_node_os28 = __toESM(require("node:os"), 1);
|
|
102832
102997
|
import_node_path124 = __toESM(require("node:path"), 1);
|
|
102833
102998
|
init_native_app_identity_project();
|
|
102834
102999
|
init_nitro_adapter();
|
|
@@ -105017,7 +105182,7 @@ function expoUnitAppPaths(unit2) {
|
|
|
105017
105182
|
});
|
|
105018
105183
|
}
|
|
105019
105184
|
function expoSwiftPackage(appKey, name3) {
|
|
105020
|
-
return import_node_path128.default.join(
|
|
105185
|
+
return import_node_path128.default.join(import_node_os29.default.tmpdir(), "peach-expo-swift", appKey, `p${process.pid}`, name3);
|
|
105021
105186
|
}
|
|
105022
105187
|
function failureRecordPath(packagePath) {
|
|
105023
105188
|
const app = import_node_path128.default.dirname(import_node_path128.default.dirname(packagePath));
|
|
@@ -105721,16 +105886,16 @@ async function compileExpoSwiftModulesTraced(root, base, publishArtifact, option
|
|
|
105721
105886
|
throw failure2;
|
|
105722
105887
|
}
|
|
105723
105888
|
}
|
|
105724
|
-
var
|
|
105889
|
+
var import_node_async_hooks5, import_node_child_process65, import_node_crypto78, import_node_fs126, import_node_module19, import_node_os29, import_node_path128, import_node_url4, import_node_util18, run11, scriptEnv, EXPO_SWIFT_ENTRY, WITNESS_BATCH, traceStore, discoveryCache, preparedCache, savedFs, ignoredRoots, ownTemporaryRoots, EXPO_MODULE_SCAN_TIMEOUT_MS, preparedExpoSwift, openPreparations, ExpoSwiftLinkRefusal;
|
|
105725
105890
|
var init_expo_swift_host = __esm({
|
|
105726
105891
|
"src/expo-swift-host.ts"() {
|
|
105727
105892
|
"use strict";
|
|
105728
|
-
|
|
105893
|
+
import_node_async_hooks5 = require("node:async_hooks");
|
|
105729
105894
|
import_node_child_process65 = require("node:child_process");
|
|
105730
105895
|
import_node_crypto78 = require("node:crypto");
|
|
105731
105896
|
import_node_fs126 = __toESM(require("node:fs"), 1);
|
|
105732
105897
|
import_node_module19 = require("node:module");
|
|
105733
|
-
|
|
105898
|
+
import_node_os29 = __toESM(require("node:os"), 1);
|
|
105734
105899
|
import_node_path128 = __toESM(require("node:path"), 1);
|
|
105735
105900
|
import_node_url4 = require("node:url");
|
|
105736
105901
|
import_node_util18 = require("node:util");
|
|
@@ -105768,7 +105933,7 @@ var init_expo_swift_host = __esm({
|
|
|
105768
105933
|
scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
|
|
105769
105934
|
EXPO_SWIFT_ENTRY = "Sources/PeachExpoApp/PeachExpoEntry.swift";
|
|
105770
105935
|
WITNESS_BATCH = 200;
|
|
105771
|
-
traceStore = new
|
|
105936
|
+
traceStore = new import_node_async_hooks5.AsyncLocalStorage();
|
|
105772
105937
|
discoveryCache = /* @__PURE__ */ new Map();
|
|
105773
105938
|
preparedCache = /* @__PURE__ */ new Map();
|
|
105774
105939
|
savedFs = null;
|
|
@@ -105925,7 +106090,7 @@ var init_nitro_superset = __esm({
|
|
|
105925
106090
|
init_nitroContract();
|
|
105926
106091
|
init_swift_standin_digest();
|
|
105927
106092
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
105928
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
106093
|
+
NITRO_COMPILER_DIGEST = true ? "f6a7a95d8b94acf3b85a06a8646dd3fa62a10b41bd72c1a91c9cfd465a4020e8" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
105929
106094
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
105930
106095
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
105931
106096
|
published2 = /* @__PURE__ */ new Map();
|
|
@@ -105988,7 +106153,7 @@ async function selectCompiledNitroProviders(appRoot, answered = peachAnsweredNat
|
|
|
105988
106153
|
// src/nitro-compile.ts
|
|
105989
106154
|
var import_node_crypto80 = require("node:crypto");
|
|
105990
106155
|
var import_node_fs128 = __toESM(require("node:fs"), 1);
|
|
105991
|
-
var
|
|
106156
|
+
var import_node_os30 = __toESM(require("node:os"), 1);
|
|
105992
106157
|
var import_node_path130 = __toESM(require("node:path"), 1);
|
|
105993
106158
|
init_answeredNativePackages();
|
|
105994
106159
|
init_installed_native_libraries();
|
|
@@ -106862,7 +107027,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
106862
107027
|
);
|
|
106863
107028
|
if (reactProviders.length > 0 || usesReactHeaders) {
|
|
106864
107029
|
const nitroReactCodegenDir = import_node_fs128.default.mkdtempSync(
|
|
106865
|
-
import_node_path130.default.join(
|
|
107030
|
+
import_node_path130.default.join(import_node_os30.default.tmpdir(), "peach-nitro-react-")
|
|
106866
107031
|
);
|
|
106867
107032
|
let support;
|
|
106868
107033
|
try {
|
|
@@ -106953,7 +107118,7 @@ async function prepareNitroCompileInput(options2) {
|
|
|
106953
107118
|
const key2 = (0, import_node_crypto80.createHash)("sha256").update(
|
|
106954
107119
|
collection.providers.map(({ root, hybridObjects }) => `${root}\0${hybridObjects.join(",")}`).join("\0")
|
|
106955
107120
|
).update("\0").update(import_node_fs128.default.realpathSync(options2.moduleRoot)).update("\0").update(options2.configuration).digest("hex");
|
|
106956
|
-
const packagePath = import_node_path130.default.join(
|
|
107121
|
+
const packagePath = import_node_path130.default.join(import_node_os30.default.tmpdir(), "peach-nitro-swift", key2, `p${process.pid}`);
|
|
106957
107122
|
const sharedLibrary = [...nativeLibraries.values()].find(
|
|
106958
107123
|
(pod) => pod.sharedLibrary
|
|
106959
107124
|
)?.sharedLibrary;
|