peachsim 0.1.2768 → 0.1.2770
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 +356 -77
- 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-4DR5UGFN.mjs → acorn-A3J4BCR3.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-P4QFEMNW.mjs → chunk-25CEOCB7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TNCPRFBQ.mjs → chunk-4IOWCCHS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LMELFNFT.mjs → chunk-4LHY3IKU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-76RJVPS6.mjs → chunk-5YKVWHMS.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-SBIBHVCU.mjs → chunk-CFWWQTJ5.mjs} +26 -13
- package/dist-lib/esm-chunks/{chunk-OASENKSR.mjs → chunk-CQBPQSRE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LDBKSWMK.mjs → chunk-F3FQZ6SE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NRFW2S2E.mjs → chunk-FBVGSJJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UP76RU63.mjs → chunk-FJZINSC2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LW6EFCKB.mjs → chunk-JGCIXB77.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FM4IQKZR.mjs → chunk-JN4WVMT4.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-IA466TSB.mjs → chunk-KSVTJ3JI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IXCYOMAY.mjs → chunk-NJNU5MPO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QS3CSXQR.mjs → chunk-PT3YJZI2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-K6H2SOFN.mjs → chunk-Q4BHHFX7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FY6GYFKM.mjs → chunk-RBNIOLS5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SZC5VUTW.mjs → chunk-RG5UROLK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FSZC4K7L.mjs → chunk-RSRSOEDS.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-CWLOVTXX.mjs → chunk-TTOBAW65.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-PYVRYHRN.mjs → chunk-TXTIDFLT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NNHQMYXA.mjs → chunk-USSIX7QH.mjs} +377 -106
- package/dist-lib/esm-chunks/{chunk-EP3OX3CJ.mjs → chunk-W4ZOHLQE.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-MC3T7WXI.mjs → chunk-Y4DWEUO2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6FVNWSDJ.mjs → chunk-YGXQSWWR.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-4TX56S4G.mjs → metro-layout-parser-QXJ7SU7Z.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-7PIYWUST.mjs → swift-package-prebuilt-3YL3XSX3.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-7NOBYKIE.mjs → swift-sdk-app-module-QSLP6GQS.mjs} +22 -17
- package/dist-lib/esm-chunks/{swift-sdk-image-FTSV6Y6Y.mjs → swift-sdk-image-XJV6ZFNG.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-TDBFULDN.mjs → swift-sdk-image-producer-NFE2G4PN.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +356 -77
- 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 +356 -77
- package/dist-lib/host/fetch-proxy-handler.cjs +24 -20
- 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 +1 -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 +64 -64
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +356 -77
- package/dist-lib/swift-compile.cjs +336 -57
- 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/render-worker/aux-pointer-native.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/auxPointerContract.d.ts +4 -0
- package/package.json +1 -1
- package/src/case-insensitive-header-overlay.ts +9 -1
- package/src/native-static-libraries.ts +16 -16
- package/src/swift-compile.ts +158 -42
- package/src/swift-distribution-mirror.ts +280 -10
- package/src/swift-objc-prebuilt.ts +10 -1
- package/src/swift-objc-standin.ts +6 -1
- package/src/swift-sdk-app-module.ts +10 -3
- package/src/swift-sdk-surface.ts +5 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2770 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
acquireSwiftRootReadHold,
|
|
4
4
|
hasLiveSwiftRootReaders,
|
|
5
5
|
retainSwiftRootReadHold,
|
|
6
6
|
withSwiftRootLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JN4WVMT4.mjs";
|
|
8
8
|
import {
|
|
9
9
|
CORE_FOUNDATION_OVERLAY_GLOBALS,
|
|
10
10
|
NATIVE_GRAPH_SDK_VERSION,
|
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
cacheDir,
|
|
18
18
|
caseInsensitiveHeaderOverlay,
|
|
19
19
|
clangInterfaceHeader,
|
|
20
|
+
clearCaseInsensitiveHeaderOverlayCache,
|
|
21
|
+
clearSwiftSdkPathsCache,
|
|
20
22
|
emptyMacroEnvironment,
|
|
21
23
|
foundationOwnerOf,
|
|
22
24
|
installVerifiedTarball,
|
|
@@ -49,13 +51,14 @@ import {
|
|
|
49
51
|
swiftSdkPaths,
|
|
50
52
|
swiftSharedSdkFlags,
|
|
51
53
|
swiftSharedSdkRoot,
|
|
54
|
+
swiftSharedSdkViewOptions,
|
|
52
55
|
wasmMacroEnvironment,
|
|
53
56
|
weakenFoundationOverridesInArchive,
|
|
54
57
|
withFrameworkCompanionImports,
|
|
55
58
|
withoutImportedSdkEnumForwards,
|
|
56
59
|
withoutSwiftDeclarations,
|
|
57
60
|
writeBuildFile
|
|
58
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-CFWWQTJ5.mjs";
|
|
59
62
|
import {
|
|
60
63
|
SWIFT_AUTOLINK_LINKER,
|
|
61
64
|
SWIFT_CACHE_HOLD_MARKER,
|
|
@@ -72,7 +75,7 @@ import {
|
|
|
72
75
|
wasmThreadLinkFlags,
|
|
73
76
|
windowAdmission,
|
|
74
77
|
writeSwiftAutolinkLinker
|
|
75
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-4IOWCCHS.mjs";
|
|
76
79
|
import {
|
|
77
80
|
SWIFT_BINARY_TREES_DIR,
|
|
78
81
|
SWIFT_NATIVE_INPUT_ROOT,
|
|
@@ -87,7 +90,7 @@ import {
|
|
|
87
90
|
isSwiftResourcePath,
|
|
88
91
|
isSwiftSourceLinkGraph,
|
|
89
92
|
swiftProjectFilesProblems
|
|
90
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-FJZINSC2.mjs";
|
|
91
94
|
import {
|
|
92
95
|
OBJC_RESOURCE_ACCESSOR_BODY,
|
|
93
96
|
OBJC_RESOURCE_ACCESSOR_HEADER,
|
|
@@ -110,16 +113,16 @@ import {
|
|
|
110
113
|
swiftPackagePartition,
|
|
111
114
|
swiftTargetModuleName,
|
|
112
115
|
withoutGlogModuleMap
|
|
113
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-CQBPQSRE.mjs";
|
|
114
117
|
import {
|
|
115
118
|
rnxPublicBrand
|
|
116
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-F3FQZ6SE.mjs";
|
|
117
120
|
import {
|
|
118
121
|
isRecord
|
|
119
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-4LHY3IKU.mjs";
|
|
120
123
|
import {
|
|
121
124
|
__publicField
|
|
122
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-RBNIOLS5.mjs";
|
|
123
126
|
|
|
124
127
|
// src/swift-compile.ts
|
|
125
128
|
import {
|
|
@@ -128,21 +131,21 @@ import {
|
|
|
128
131
|
} from "node:child_process";
|
|
129
132
|
import { createHash as createHash16, randomUUID as randomUUID4 } from "node:crypto";
|
|
130
133
|
import {
|
|
131
|
-
chmodSync as
|
|
134
|
+
chmodSync as chmodSync4,
|
|
132
135
|
copyFileSync as copyFileSync2,
|
|
133
136
|
cpSync,
|
|
134
137
|
existsSync as existsSync9,
|
|
135
|
-
lstatSync,
|
|
138
|
+
lstatSync as lstatSync2,
|
|
136
139
|
mkdirSync as mkdirSync7,
|
|
137
140
|
mkdtempSync as mkdtempSync4,
|
|
138
141
|
readFileSync as readFileSync13,
|
|
139
142
|
readdirSync as readdirSync4,
|
|
140
|
-
readlinkSync,
|
|
143
|
+
readlinkSync as readlinkSync2,
|
|
141
144
|
realpathSync as realpathSync6,
|
|
142
145
|
renameSync as renameSync5,
|
|
143
146
|
rmSync as rmSync7,
|
|
144
|
-
statSync as
|
|
145
|
-
symlinkSync as
|
|
147
|
+
statSync as statSync5,
|
|
148
|
+
symlinkSync as symlinkSync3,
|
|
146
149
|
utimesSync,
|
|
147
150
|
writeFileSync as writeFileSync7
|
|
148
151
|
} from "node:fs";
|
|
@@ -3402,18 +3405,28 @@ function designTimeDiagnostic(output, files) {
|
|
|
3402
3405
|
// src/swift-distribution-mirror.ts
|
|
3403
3406
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
3404
3407
|
import {
|
|
3408
|
+
chmodSync,
|
|
3405
3409
|
constants,
|
|
3406
3410
|
copyFileSync,
|
|
3407
3411
|
existsSync,
|
|
3412
|
+
lstatSync,
|
|
3408
3413
|
mkdirSync,
|
|
3409
3414
|
readdirSync as readdirSync2,
|
|
3410
3415
|
readFileSync as readFileSync3,
|
|
3416
|
+
readlinkSync,
|
|
3411
3417
|
renameSync as renameSync2,
|
|
3412
3418
|
rmSync as rmSync2,
|
|
3419
|
+
statSync,
|
|
3420
|
+
symlinkSync as symlinkSync2,
|
|
3413
3421
|
writeFileSync
|
|
3414
3422
|
} from "node:fs";
|
|
3415
3423
|
import path4 from "node:path";
|
|
3416
3424
|
var SWIFT_DISTRIBUTION_MIRROR = ".peach-distribution";
|
|
3425
|
+
var SWIFT_SDK_MIRROR = ".peach-sdk";
|
|
3426
|
+
var SWIFT_SDK_MIRROR_ID = "peach-wasm-sdk";
|
|
3427
|
+
var SWIFT_SDK_MIRROR_RECORD = ".peach-sdk-mirror.json";
|
|
3428
|
+
var SWIFT_SDK_MIRROR_SYNCING = ".peach-sdk-syncing";
|
|
3429
|
+
var SWIFT_SDK_MIRROR_BUNDLE = "peach-wasm.artifactbundle";
|
|
3417
3430
|
function syncSwiftDistributionMirror(root, source, manifest) {
|
|
3418
3431
|
const mirror = path4.join(root, SWIFT_DISTRIBUTION_MIRROR);
|
|
3419
3432
|
const record = path4.join(mirror, SWIFT_DISTRIBUTION_MIRROR_RECORD);
|
|
@@ -3440,9 +3453,179 @@ function syncSwiftDistributionMirror(root, source, manifest) {
|
|
|
3440
3453
|
const partial = `${record}.${randomUUID2()}`;
|
|
3441
3454
|
writeFileSync(partial, JSON.stringify(manifest.files));
|
|
3442
3455
|
renameSync2(partial, record);
|
|
3456
|
+
if ([...changed, ...removed].some(
|
|
3457
|
+
(file) => !file.startsWith("lib/") && !file.startsWith("modules/")
|
|
3458
|
+
)) {
|
|
3459
|
+
clearCaseInsensitiveHeaderOverlayCache(mirror);
|
|
3460
|
+
clearCaseInsensitiveHeaderOverlayCache(path4.join(root, SWIFT_SDK_MIRROR));
|
|
3461
|
+
}
|
|
3443
3462
|
}
|
|
3444
3463
|
return mirror;
|
|
3445
3464
|
}
|
|
3465
|
+
function syncSwiftSdkMirror(root, frameworkRoot, toolchainBin, sourceSdkId) {
|
|
3466
|
+
const viewOptions = swiftSharedSdkViewOptions(
|
|
3467
|
+
frameworkRoot,
|
|
3468
|
+
true,
|
|
3469
|
+
toolchainBin,
|
|
3470
|
+
sourceSdkId
|
|
3471
|
+
);
|
|
3472
|
+
const sourceView = viewOptions[1];
|
|
3473
|
+
return syncSwiftSdkMirrorFromView(root, frameworkRoot, sourceView, sourceSdkId);
|
|
3474
|
+
}
|
|
3475
|
+
function syncSwiftSdkMirrorFromView(root, frameworkRoot, sourceView, sourceSdkId) {
|
|
3476
|
+
const mirror = path4.join(root, SWIFT_SDK_MIRROR);
|
|
3477
|
+
const bundle = path4.join(mirror, SWIFT_SDK_MIRROR_BUNDLE);
|
|
3478
|
+
const destTriple = path4.join(bundle, "sdk", SWIFT_WASM_TRIPLE);
|
|
3479
|
+
const bundleInfo = path4.join(bundle, "info.json");
|
|
3480
|
+
const recordFile = path4.join(mirror, SWIFT_SDK_MIRROR_RECORD);
|
|
3481
|
+
const syncingMarker = path4.join(mirror, SWIFT_SDK_MIRROR_SYNCING);
|
|
3482
|
+
const options = ["--swift-sdks-path", mirror];
|
|
3483
|
+
const interrupted = existsSync(syncingMarker);
|
|
3484
|
+
const previous = interrupted ? null : readSdkRecord(recordFile);
|
|
3485
|
+
if (previous && previous.sourceView === sourceView && previous.sourceSdkId === sourceSdkId && existsSync(bundleInfo) && existsSync(path4.join(destTriple, "swift-sdk.json"))) {
|
|
3486
|
+
return { id: SWIFT_SDK_MIRROR_ID, options, toolsetChanged: false };
|
|
3487
|
+
}
|
|
3488
|
+
const sourceTriple = resolveSdkViewTripleDir(sourceView, sourceSdkId);
|
|
3489
|
+
if (!previous) {
|
|
3490
|
+
if (!interrupted) rmSync2(mirror, { recursive: true, force: true });
|
|
3491
|
+
rmSync2(path4.join(root, ".build"), { recursive: true, force: true });
|
|
3492
|
+
}
|
|
3493
|
+
mkdirSync(mirror, { recursive: true });
|
|
3494
|
+
writeFileSync(syncingMarker, "1\n");
|
|
3495
|
+
const changed = [];
|
|
3496
|
+
const removed = [];
|
|
3497
|
+
const distributionPrefix = `${frameworkRoot}${path4.sep}`;
|
|
3498
|
+
syncSdkTree(sourceTriple, destTriple, "", distributionPrefix, changed, removed);
|
|
3499
|
+
const infoText = JSON.stringify(
|
|
3500
|
+
{
|
|
3501
|
+
artifacts: {
|
|
3502
|
+
[SWIFT_SDK_MIRROR_ID]: {
|
|
3503
|
+
type: "swiftSDK",
|
|
3504
|
+
variants: [{ path: `sdk/${SWIFT_WASM_TRIPLE}/swift-sdk.json` }],
|
|
3505
|
+
version: "0.0.1"
|
|
3506
|
+
}
|
|
3507
|
+
},
|
|
3508
|
+
schemaVersion: "1.0"
|
|
3509
|
+
},
|
|
3510
|
+
null,
|
|
3511
|
+
2
|
|
3512
|
+
) + "\n";
|
|
3513
|
+
if (!existsSync(bundleInfo) || readFileSync3(bundleInfo, "utf8") !== infoText) {
|
|
3514
|
+
mkdirSync(bundle, { recursive: true });
|
|
3515
|
+
const partial = `${bundleInfo}.${randomUUID2()}`;
|
|
3516
|
+
writeFileSync(partial, infoText);
|
|
3517
|
+
renameSync2(partial, bundleInfo);
|
|
3518
|
+
}
|
|
3519
|
+
const touched = [...changed, ...removed];
|
|
3520
|
+
const toolsetChanged = !previous || touched.some(
|
|
3521
|
+
(file) => file === "toolset.json" || file === "swift-sdk.json" || file.startsWith("swift.xctoolchain/usr/bin/")
|
|
3522
|
+
);
|
|
3523
|
+
if (previous) {
|
|
3524
|
+
if (toolsetChanged) {
|
|
3525
|
+
rmSync2(path4.join(root, ".build"), { recursive: true, force: true });
|
|
3526
|
+
} else {
|
|
3527
|
+
const compileTouched = touched.filter(
|
|
3528
|
+
(file) => !file.endsWith(".a") && !file.endsWith(".o") && !file.startsWith("rust/") && file !== "runtime-products.json"
|
|
3529
|
+
);
|
|
3530
|
+
const headersChanged = compileTouched.some(
|
|
3531
|
+
(file) => !file.endsWith(".swiftmodule") && !file.endsWith(".swiftdoc") && !file.endsWith(".swiftsourceinfo") && !file.endsWith(".abi.json")
|
|
3532
|
+
);
|
|
3533
|
+
if (compileTouched.length > 0) {
|
|
3534
|
+
invalidateBuildDependents(
|
|
3535
|
+
root,
|
|
3536
|
+
[[Buffer.from(`${escapeDepPath(destTriple)}/`), ""]],
|
|
3537
|
+
new Set(compileTouched),
|
|
3538
|
+
headersChanged
|
|
3539
|
+
);
|
|
3540
|
+
}
|
|
3541
|
+
if (headersChanged) clearCaseInsensitiveHeaderOverlayCache(mirror);
|
|
3542
|
+
}
|
|
3543
|
+
} else {
|
|
3544
|
+
clearCaseInsensitiveHeaderOverlayCache(mirror);
|
|
3545
|
+
}
|
|
3546
|
+
const partialRecord = `${recordFile}.${randomUUID2()}`;
|
|
3547
|
+
writeFileSync(partialRecord, JSON.stringify({ version: 1, sourceView, sourceSdkId }));
|
|
3548
|
+
renameSync2(partialRecord, recordFile);
|
|
3549
|
+
rmSync2(syncingMarker, { force: true });
|
|
3550
|
+
return { id: SWIFT_SDK_MIRROR_ID, options, toolsetChanged };
|
|
3551
|
+
}
|
|
3552
|
+
function readSdkRecord(file) {
|
|
3553
|
+
if (!existsSync(file)) return null;
|
|
3554
|
+
const value = JSON.parse(readFileSync3(file, "utf8"));
|
|
3555
|
+
if (!isRecord(value) || value.version !== 1 || typeof value.sourceView !== "string" || typeof value.sourceSdkId !== "string")
|
|
3556
|
+
return null;
|
|
3557
|
+
return {
|
|
3558
|
+
version: value.version,
|
|
3559
|
+
sourceView: value.sourceView,
|
|
3560
|
+
sourceSdkId: value.sourceSdkId
|
|
3561
|
+
};
|
|
3562
|
+
}
|
|
3563
|
+
function resolveSdkViewTripleDir(sourceView, sourceSdkId) {
|
|
3564
|
+
for (const entry of readdirSync2(sourceView, { withFileTypes: true })) {
|
|
3565
|
+
if (!entry.name.endsWith(".artifactbundle")) continue;
|
|
3566
|
+
const bundleDir = path4.join(sourceView, entry.name);
|
|
3567
|
+
const infoPath = path4.join(bundleDir, "info.json");
|
|
3568
|
+
if (!existsSync(infoPath)) continue;
|
|
3569
|
+
const info = JSON.parse(readFileSync3(infoPath, "utf8"));
|
|
3570
|
+
if (!isRecord(info) || !isRecord(info.artifacts)) continue;
|
|
3571
|
+
const artifact = info.artifacts[sourceSdkId];
|
|
3572
|
+
if (!isRecord(artifact) || !Array.isArray(artifact.variants)) continue;
|
|
3573
|
+
const first = artifact.variants[0];
|
|
3574
|
+
if (!isRecord(first) || typeof first.path !== "string") continue;
|
|
3575
|
+
return path4.dirname(path4.join(bundleDir, first.path));
|
|
3576
|
+
}
|
|
3577
|
+
throw new Error(`Swift SDK ${sourceSdkId} not found in view ${sourceView}`);
|
|
3578
|
+
}
|
|
3579
|
+
function collectRemovedFiles(dir, prefix, out) {
|
|
3580
|
+
for (const entry of readdirSync2(dir, { withFileTypes: true })) {
|
|
3581
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
3582
|
+
const full = path4.join(dir, entry.name);
|
|
3583
|
+
if (entry.isDirectory()) collectRemovedFiles(full, rel, out);
|
|
3584
|
+
else out.push(rel);
|
|
3585
|
+
}
|
|
3586
|
+
}
|
|
3587
|
+
function syncSdkTree(sourceDir, destDir, prefix, distributionPrefix, changed, removed) {
|
|
3588
|
+
mkdirSync(destDir, { recursive: true });
|
|
3589
|
+
const wanted = /* @__PURE__ */ new Set();
|
|
3590
|
+
for (const entry of readdirSync2(sourceDir, { withFileTypes: true })) {
|
|
3591
|
+
wanted.add(entry.name);
|
|
3592
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
3593
|
+
const src = path4.join(sourceDir, entry.name);
|
|
3594
|
+
const dest = path4.join(destDir, entry.name);
|
|
3595
|
+
const destLstat = lstatSync(dest, { throwIfNoEntry: false });
|
|
3596
|
+
if (entry.isSymbolicLink()) {
|
|
3597
|
+
const target = readlinkSync(src);
|
|
3598
|
+
if (target.startsWith(distributionPrefix)) {
|
|
3599
|
+
if (destLstat?.isSymbolicLink() && readlinkSync(dest) === target) continue;
|
|
3600
|
+
if (destLstat) rmSync2(dest, { recursive: true, force: true });
|
|
3601
|
+
symlinkSync2(target, dest);
|
|
3602
|
+
changed.push(rel);
|
|
3603
|
+
continue;
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
const srcStat = statSync(src, { throwIfNoEntry: false });
|
|
3607
|
+
if (!srcStat) continue;
|
|
3608
|
+
if (srcStat.isDirectory()) {
|
|
3609
|
+
if (destLstat && (!destLstat.isDirectory() || destLstat.isSymbolicLink()))
|
|
3610
|
+
rmSync2(dest, { recursive: true, force: true });
|
|
3611
|
+
syncSdkTree(src, dest, rel, distributionPrefix, changed, removed);
|
|
3612
|
+
continue;
|
|
3613
|
+
}
|
|
3614
|
+
if (destLstat?.isFile() && !destLstat.isSymbolicLink() && destLstat.size === srcStat.size && readFileSync3(src).equals(readFileSync3(dest)))
|
|
3615
|
+
continue;
|
|
3616
|
+
if (destLstat?.isDirectory()) rmSync2(dest, { recursive: true, force: true });
|
|
3617
|
+
place(src, dest, (srcStat.mode & 73) !== 0 ? srcStat.mode & 511 : void 0);
|
|
3618
|
+
changed.push(rel);
|
|
3619
|
+
}
|
|
3620
|
+
for (const entry of readdirSync2(destDir, { withFileTypes: true })) {
|
|
3621
|
+
if (wanted.has(entry.name)) continue;
|
|
3622
|
+
const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
|
|
3623
|
+
const dest = path4.join(destDir, entry.name);
|
|
3624
|
+
if (entry.isDirectory()) collectRemovedFiles(dest, rel, removed);
|
|
3625
|
+
else removed.push(rel);
|
|
3626
|
+
rmSync2(dest, { recursive: true, force: true });
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3446
3629
|
function readRecord(file) {
|
|
3447
3630
|
if (!existsSync(file)) return null;
|
|
3448
3631
|
const value = JSON.parse(readFileSync3(file, "utf8"));
|
|
@@ -3454,24 +3637,33 @@ function readRecord(file) {
|
|
|
3454
3637
|
}
|
|
3455
3638
|
return files;
|
|
3456
3639
|
}
|
|
3457
|
-
function place(from, to) {
|
|
3640
|
+
function place(from, to, mode) {
|
|
3458
3641
|
mkdirSync(path4.dirname(to), { recursive: true });
|
|
3459
3642
|
const partial = `${to}.${randomUUID2()}`;
|
|
3460
3643
|
copyFileSync(from, partial, constants.COPYFILE_FICLONE);
|
|
3644
|
+
if (mode !== void 0) chmodSync(partial, mode);
|
|
3461
3645
|
renameSync2(partial, to);
|
|
3462
3646
|
}
|
|
3463
|
-
function
|
|
3464
|
-
|
|
3465
|
-
if (read.size === 0) return;
|
|
3466
|
-
const escapedMirror = mirror.replace(
|
|
3647
|
+
function escapeDepPath(directory) {
|
|
3648
|
+
return directory.replace(
|
|
3467
3649
|
/[\\ #$]/g,
|
|
3468
3650
|
(character) => character === "$" ? "$$" : `\\${character}`
|
|
3469
3651
|
);
|
|
3652
|
+
}
|
|
3653
|
+
function invalidateDependents(root, mirror, files) {
|
|
3654
|
+
const read = new Set(files.filter((file) => !file.startsWith("lib/")));
|
|
3655
|
+
if (read.size === 0) return;
|
|
3470
3656
|
const spellings = [
|
|
3471
|
-
[Buffer.from(`${
|
|
3657
|
+
[Buffer.from(`${escapeDepPath(mirror)}/`), ""]
|
|
3472
3658
|
];
|
|
3473
3659
|
if (files.some((file) => file.startsWith("sdk/ios/")))
|
|
3474
3660
|
spellings.push([Buffer.from("/darwin/"), "sdk/ios/"]);
|
|
3661
|
+
const headersChanged = files.some(
|
|
3662
|
+
(file) => !file.startsWith("lib/") && !file.startsWith("modules/")
|
|
3663
|
+
);
|
|
3664
|
+
invalidateBuildDependents(root, spellings, read, headersChanged);
|
|
3665
|
+
}
|
|
3666
|
+
function invalidateBuildDependents(root, spellings, read, headersChanged) {
|
|
3475
3667
|
const names = (text2) => spellings.some(([prefix, base]) => {
|
|
3476
3668
|
let end = 0;
|
|
3477
3669
|
for (let at = text2.indexOf(prefix); at !== -1; at = text2.indexOf(prefix, end)) {
|
|
@@ -3486,9 +3678,6 @@ function invalidateDependents(root, mirror, files) {
|
|
|
3486
3678
|
});
|
|
3487
3679
|
const scratch = path4.join(root, ".build");
|
|
3488
3680
|
if (!existsSync(scratch)) return;
|
|
3489
|
-
const headersChanged = files.some(
|
|
3490
|
-
(file) => !file.startsWith("lib/") && !file.startsWith("modules/")
|
|
3491
|
-
);
|
|
3492
3681
|
for (const triple of readdirSync2(scratch, { withFileTypes: true })) {
|
|
3493
3682
|
const products = path4.join(scratch, triple.name, "release");
|
|
3494
3683
|
if (!triple.isDirectory() || !existsSync(products)) continue;
|
|
@@ -13478,7 +13667,7 @@ import {
|
|
|
13478
13667
|
readFileSync as readFileSync8,
|
|
13479
13668
|
realpathSync as realpathSync2,
|
|
13480
13669
|
renameSync as renameSync3,
|
|
13481
|
-
statSync,
|
|
13670
|
+
statSync as statSync2,
|
|
13482
13671
|
writeFileSync as writeFileSync4
|
|
13483
13672
|
} from "node:fs";
|
|
13484
13673
|
import path11 from "node:path";
|
|
@@ -13562,11 +13751,11 @@ Promise.all(Array.from({ length: jobs }, run))
|
|
|
13562
13751
|
})
|
|
13563
13752
|
`;
|
|
13564
13753
|
function clangProducerStamp(file) {
|
|
13565
|
-
const stat =
|
|
13754
|
+
const stat = statSync2(file, { bigint: true });
|
|
13566
13755
|
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
13567
13756
|
}
|
|
13568
13757
|
function clangBinaryStamp(file) {
|
|
13569
|
-
const stat =
|
|
13758
|
+
const stat = statSync2(file, { bigint: true });
|
|
13570
13759
|
return [file, stat.size, stat.mtimeNs].join(":");
|
|
13571
13760
|
}
|
|
13572
13761
|
function sha256Hex2(bytes) {
|
|
@@ -14138,14 +14327,14 @@ function logicalGuestLinkOptions(args, identities, roots) {
|
|
|
14138
14327
|
// src/swift-project-user.ts
|
|
14139
14328
|
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
14140
14329
|
import {
|
|
14141
|
-
chmodSync,
|
|
14330
|
+
chmodSync as chmodSync2,
|
|
14142
14331
|
existsSync as existsSync4,
|
|
14143
14332
|
mkdirSync as mkdirSync4,
|
|
14144
14333
|
readdirSync as readdirSync3,
|
|
14145
14334
|
readFileSync as readFileSync9,
|
|
14146
14335
|
realpathSync as realpathSync3,
|
|
14147
14336
|
rmSync as rmSync5,
|
|
14148
|
-
statSync as
|
|
14337
|
+
statSync as statSync3
|
|
14149
14338
|
} from "node:fs";
|
|
14150
14339
|
import path12 from "node:path";
|
|
14151
14340
|
function prepareSwiftProjectProcess(root, user) {
|
|
@@ -14157,8 +14346,8 @@ function prepareSwiftProjectProcess(root, user) {
|
|
|
14157
14346
|
const caches = ["cache", "config", "security"].map((name) => path12.join(swiftpm, name));
|
|
14158
14347
|
for (const directory of caches) mkdirSync4(directory, { recursive: true });
|
|
14159
14348
|
execFileSync7("chown", ["-R", "-P", `${user.uid}:${user.gid}`, root, home]);
|
|
14160
|
-
|
|
14161
|
-
|
|
14349
|
+
chmodSync2(root, 448);
|
|
14350
|
+
chmodSync2(home, 448);
|
|
14162
14351
|
return {
|
|
14163
14352
|
uid: user.uid,
|
|
14164
14353
|
gid: user.gid,
|
|
@@ -14187,7 +14376,7 @@ function endSwiftProjectProcesses(user) {
|
|
|
14187
14376
|
function projectOutputFile(root, file, user) {
|
|
14188
14377
|
const real = realpathSync3(file);
|
|
14189
14378
|
const base = realpathSync3(root);
|
|
14190
|
-
const stat =
|
|
14379
|
+
const stat = statSync3(real);
|
|
14191
14380
|
if (!real.startsWith(base + path12.sep) || !stat.isFile() || stat.uid !== user.uid) {
|
|
14192
14381
|
throw new Error(`swift-compile: project output ${file} is not a file of its build`);
|
|
14193
14382
|
}
|
|
@@ -14470,7 +14659,7 @@ async function compileGuestLink(options) {
|
|
|
14470
14659
|
};
|
|
14471
14660
|
const sdk = options.sdkImage;
|
|
14472
14661
|
const sdkCallers = sdk.sdkInterface.guestCallers;
|
|
14473
|
-
const sdkObjects = (await import("./swift-sdk-image-
|
|
14662
|
+
const sdkObjects = (await import("./swift-sdk-image-XJV6ZFNG.mjs")).readSwiftSdkManifestIndex(
|
|
14474
14663
|
sdk
|
|
14475
14664
|
).guestObjects;
|
|
14476
14665
|
if (!sdkCallers || !sdkObjects)
|
|
@@ -14771,7 +14960,7 @@ async function compileGuestLink(options) {
|
|
|
14771
14960
|
swiftSdkProjectionDigest,
|
|
14772
14961
|
swiftSdkProjectionSpans,
|
|
14773
14962
|
writeSwiftSdkAppLink
|
|
14774
|
-
} = await import("./swift-sdk-app-module-
|
|
14963
|
+
} = await import("./swift-sdk-app-module-QSLP6GQS.mjs");
|
|
14775
14964
|
const project = options.project;
|
|
14776
14965
|
const work = project ? mkdtempSync2(path14.join(directory, "app-module-")) : path14.join(directory, "app-module");
|
|
14777
14966
|
if (project) chownSync(work, project.uid, project.gid);
|
|
@@ -14945,14 +15134,14 @@ async function compileGuestLink(options) {
|
|
|
14945
15134
|
// src/swift-header-compiler.ts
|
|
14946
15135
|
import { createHash as createHash11 } from "node:crypto";
|
|
14947
15136
|
import {
|
|
14948
|
-
chmodSync as
|
|
15137
|
+
chmodSync as chmodSync3,
|
|
14949
15138
|
existsSync as existsSync5,
|
|
14950
15139
|
mkdirSync as mkdirSync6,
|
|
14951
15140
|
mkdtempSync as mkdtempSync3,
|
|
14952
15141
|
readFileSync as readFileSync11,
|
|
14953
15142
|
renameSync as renameSync4,
|
|
14954
15143
|
rmSync as rmSync6,
|
|
14955
|
-
statSync as
|
|
15144
|
+
statSync as statSync4,
|
|
14956
15145
|
writeFileSync as writeFileSync6
|
|
14957
15146
|
} from "node:fs";
|
|
14958
15147
|
import { createServer } from "node:http";
|
|
@@ -15019,7 +15208,7 @@ function compilerCheckpoint(root, recipe, args, header) {
|
|
|
15019
15208
|
}
|
|
15020
15209
|
for (const file of outputs) {
|
|
15021
15210
|
if (!file.startsWith(path15.join(root, ".build") + path15.sep)) return;
|
|
15022
|
-
const stat =
|
|
15211
|
+
const stat = statSync4(file, { bigint: true, throwIfNoEntry: false });
|
|
15023
15212
|
if (!stat?.isFile() || stat.size === 0n) return;
|
|
15024
15213
|
digest.update(JSON.stringify([file, String(stat.size), String(stat.mtimeNs)]));
|
|
15025
15214
|
}
|
|
@@ -15051,7 +15240,7 @@ async function withSwiftHeaderCompiler(root, toolchainBin, recipe, producers, bu
|
|
|
15051
15240
|
""
|
|
15052
15241
|
].join("\n")
|
|
15053
15242
|
);
|
|
15054
|
-
|
|
15243
|
+
chmodSync3(wrapper, 493);
|
|
15055
15244
|
const directory = mkdtempSync3("/tmp/peach-headers-");
|
|
15056
15245
|
const socket = path15.join(directory, "compile");
|
|
15057
15246
|
const server = createServer(async (request, response) => {
|
|
@@ -16643,7 +16832,7 @@ function providedModulesPath(root, modules, excluded) {
|
|
|
16643
16832
|
for (const entry of readdirSync4(directory))
|
|
16644
16833
|
rmSync7(path23.join(directory, entry), { recursive: true, force: true });
|
|
16645
16834
|
for (const entry of entries2) {
|
|
16646
|
-
|
|
16835
|
+
symlinkSync3(path23.join(modules, entry), path23.join(directory, entry));
|
|
16647
16836
|
}
|
|
16648
16837
|
writeFileSync7(complete, "");
|
|
16649
16838
|
}
|
|
@@ -16751,7 +16940,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
16751
16940
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
16752
16941
|
var MULTI_MANIFEST_VERSION = 76;
|
|
16753
16942
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
16754
|
-
var compilerSourceDigest = true ? "
|
|
16943
|
+
var compilerSourceDigest = true ? "a0b547d433e1045fc952acc099a7aa9b05cde3376f8d2dd002afbf6d4593e5ba" : swiftCompilerSourceDigest(import.meta.dirname);
|
|
16755
16944
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
16756
16945
|
return swiftCompileInputHash(input, release).update(swiftModuleDigest(moduleRoot)).digest("hex");
|
|
16757
16946
|
}
|
|
@@ -17375,7 +17564,7 @@ function syncSwiftTree(base, files, alreadySynced) {
|
|
|
17375
17564
|
if (process.platform !== "linux") {
|
|
17376
17565
|
kept = /* @__PURE__ */ new Set();
|
|
17377
17566
|
for (const file of files.keys()) {
|
|
17378
|
-
const stat =
|
|
17567
|
+
const stat = statSync5(file, { throwIfNoEntry: false });
|
|
17379
17568
|
if (stat) kept.add(stat.ino);
|
|
17380
17569
|
}
|
|
17381
17570
|
}
|
|
@@ -17384,10 +17573,10 @@ function syncSwiftTree(base, files, alreadySynced) {
|
|
|
17384
17573
|
const full = path23.join(dir, entry.name);
|
|
17385
17574
|
if (dir === base && (entry.name === ".build" || entry.name === SWIFT_CACHE_HOLD_MARKER || entry.name.startsWith(".peach-modules-") || // distribution clang maps are written beside the project, so a sync
|
|
17386
17575
|
// must not remove them.
|
|
17387
|
-
entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_BUILD_ROOT_SHAPE))
|
|
17576
|
+
entry.name === CLANG_DISTRIBUTION_MODULES || entry.name === SWIFT_DISTRIBUTION_MIRROR || entry.name === SWIFT_SDK_MIRROR || entry.name === SWIFT_LINK_STAMP || entry.name === SWIFT_BUILD_ROOT_SHAPE))
|
|
17388
17577
|
continue;
|
|
17389
17578
|
if (entry.isDirectory()) walk(full);
|
|
17390
|
-
else if (!files.has(full) && (!kept || !kept.has(
|
|
17579
|
+
else if (!files.has(full) && (!kept || !kept.has(lstatSync2(full).ino)))
|
|
17391
17580
|
rmSync7(full, { force: true });
|
|
17392
17581
|
}
|
|
17393
17582
|
};
|
|
@@ -18151,7 +18340,7 @@ function needsNativeToolset(input, prebuilt) {
|
|
|
18151
18340
|
input.packageFiles || prebuilt || Object.keys(input.files).some(isSwiftNativeTranslationUnit)
|
|
18152
18341
|
);
|
|
18153
18342
|
}
|
|
18154
|
-
function writeSwiftProject(layout2, input, moduleRoot, prebuilt, allowHeaderCompiler = false, objcPrebuiltStage) {
|
|
18343
|
+
function writeSwiftProject(layout2, input, moduleRoot, prebuilt, allowHeaderCompiler = false, objcPrebuiltStage, compileSdk) {
|
|
18155
18344
|
const nativeToolset = needsNativeToolset(input, prebuilt);
|
|
18156
18345
|
if (input.headerAliases !== void 0 && !isSwiftHeaderAliases(input.headerAliases))
|
|
18157
18346
|
throw new Error("swift compile input has invalid original header aliases");
|
|
@@ -18280,6 +18469,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
18280
18469
|
checkedToolchain = swiftToolchain(pin.release, swiftModuleSdk(moduleRoot));
|
|
18281
18470
|
return checkedToolchain;
|
|
18282
18471
|
};
|
|
18472
|
+
const resolvedSdkPaths = (toolchainBin) => swiftSdkPaths(moduleRoot, toolchainBin, compileSdk?.options, compileSdk?.id);
|
|
18283
18473
|
const targetStagedFiles = /* @__PURE__ */ new Map();
|
|
18284
18474
|
const stageTargetFile = (target, file, contents, options) => {
|
|
18285
18475
|
const relative = path23.relative(layout2.root, file).split(path23.sep).join(path23.posix.sep);
|
|
@@ -18406,9 +18596,25 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
18406
18596
|
files.set(destination, contents);
|
|
18407
18597
|
}
|
|
18408
18598
|
}
|
|
18599
|
+
const binaryTreePrefix = `${SWIFT_BINARY_TREES_DIR}/`;
|
|
18600
|
+
const binaryTreeSegment = `/${SWIFT_BINARY_TREES_DIR}/`;
|
|
18601
|
+
const isBinaryTreeFile = (file) => file.startsWith(binaryTreePrefix) || file.includes(binaryTreeSegment);
|
|
18602
|
+
const stageBinaryTreeFile = (file, contents) => {
|
|
18603
|
+
const destination = path23.join(layout2.root, file);
|
|
18604
|
+
if (files.has(destination)) return;
|
|
18605
|
+
writeBuildFile(destination, contents);
|
|
18606
|
+
alreadySynced.set(destination, contents);
|
|
18607
|
+
files.set(destination, contents);
|
|
18608
|
+
};
|
|
18609
|
+
for (const [file, contents] of Object.entries(input.files))
|
|
18610
|
+
if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, contents);
|
|
18611
|
+
for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
|
|
18612
|
+
if (isBinaryTreeFile(file) && !file.endsWith(".swift"))
|
|
18613
|
+
stageBinaryTreeFile(file, Buffer.from(bytes, "base64"));
|
|
18614
|
+
for (const [file, bytes] of Object.entries(input.projectFiles ?? {}))
|
|
18615
|
+
if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, Buffer.from(bytes, "base64"));
|
|
18409
18616
|
const fromInputRoot = (file) => file.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`) ? path23.join(layout2.root, file.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1)) : file;
|
|
18410
18617
|
const inRoot = `${layout2.root}${path23.sep}`;
|
|
18411
|
-
const binaryTree = `${path23.sep}${SWIFT_BINARY_TREES_DIR}${path23.sep}`;
|
|
18412
18618
|
const headerSearch = writeXcodeHeaderSearch(
|
|
18413
18619
|
path23.join(layout2.root, ".build", "peach-xcode-headers"),
|
|
18414
18620
|
nativeTargets.map((settings) => {
|
|
@@ -18460,7 +18666,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
18460
18666
|
path23.join(layout2.root, file)
|
|
18461
18667
|
])
|
|
18462
18668
|
),
|
|
18463
|
-
(file) => !file.startsWith(inRoot) || files.has(file)
|
|
18669
|
+
(file) => !file.startsWith(inRoot) || files.has(file)
|
|
18464
18670
|
);
|
|
18465
18671
|
const importModuleMaps = /* @__PURE__ */ new Map();
|
|
18466
18672
|
const sourceModuleMaps = /* @__PURE__ */ new Map();
|
|
@@ -18603,7 +18809,7 @@ ${swiftProjectFilesProblems(input.projectFiles).join("\n")}`
|
|
|
18603
18809
|
];
|
|
18604
18810
|
})();
|
|
18605
18811
|
const sdkInclude = path23.join(
|
|
18606
|
-
|
|
18812
|
+
resolvedSdkPaths(toolchainBin).sysroot,
|
|
18607
18813
|
"darwin/usr/include"
|
|
18608
18814
|
);
|
|
18609
18815
|
const dependencyModuleMaps = clangImportModuleMapFlags(
|
|
@@ -19350,7 +19556,8 @@ ${entry}`);
|
|
|
19350
19556
|
);
|
|
19351
19557
|
if (nativeFlags) {
|
|
19352
19558
|
const toolchainBin = nativeToolchain();
|
|
19353
|
-
const headers = path23.join(
|
|
19559
|
+
const headers = path23.join(resolvedSdkPaths(toolchainBin).sysroot, "darwin");
|
|
19560
|
+
const sdkOverlayDirectory = compileSdk?.id === SWIFT_SDK_MIRROR_ID ? path23.join(layout2.root, SWIFT_SDK_MIRROR) : void 0;
|
|
19354
19561
|
const dependencies2 = swiftTargetDependencies(input.files, targets);
|
|
19355
19562
|
const reachesNative = (name, seen = /* @__PURE__ */ new Set()) => {
|
|
19356
19563
|
if (native.has(name)) return true;
|
|
@@ -19368,7 +19575,12 @@ ${entry}`);
|
|
|
19368
19575
|
throw new Error(
|
|
19369
19576
|
target.name + ": missing or unsupported declared iOS deployment target " + JSON.stringify(version2)
|
|
19370
19577
|
);
|
|
19371
|
-
const sdkIntake = objcSdkIntakeFlags(
|
|
19578
|
+
const sdkIntake = objcSdkIntakeFlags(
|
|
19579
|
+
headers,
|
|
19580
|
+
toolchainBin,
|
|
19581
|
+
minimum,
|
|
19582
|
+
sdkOverlayDirectory
|
|
19583
|
+
);
|
|
19372
19584
|
const sdkOverlay = sdkIntake.indexOf("-ivfsoverlay");
|
|
19373
19585
|
if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]);
|
|
19374
19586
|
const intake = [
|
|
@@ -19590,7 +19802,7 @@ ${entry}`);
|
|
|
19590
19802
|
distribution: distribution ?? void 0,
|
|
19591
19803
|
moduleExcludes,
|
|
19592
19804
|
deferDarwinOverlay: native.size > 0 && toolsetOrdersLibcxxBeforeDarwinOverlay(
|
|
19593
|
-
|
|
19805
|
+
resolvedSdkPaths(nativeToolchain()).cFlags
|
|
19594
19806
|
),
|
|
19595
19807
|
...reachesFrameworks ? {
|
|
19596
19808
|
distributionLink: {
|
|
@@ -19633,7 +19845,7 @@ ${entry}`);
|
|
|
19633
19845
|
...headerAliasFlags,
|
|
19634
19846
|
...native.size > 0 ? [
|
|
19635
19847
|
"-fmodule-map-file=" + path23.join(
|
|
19636
|
-
|
|
19848
|
+
resolvedSdkPaths(nativeToolchain()).sysroot,
|
|
19637
19849
|
"darwin/wasm/include/module.modulemap"
|
|
19638
19850
|
)
|
|
19639
19851
|
] : []
|
|
@@ -19643,7 +19855,7 @@ ${entry}`);
|
|
|
19643
19855
|
const prebuiltCompiler = distribution && objcPrebuiltStage !== false ? swiftObjCPrebuiltCompiler(
|
|
19644
19856
|
clang,
|
|
19645
19857
|
layout2.root,
|
|
19646
|
-
|
|
19858
|
+
resolvedSdkPaths(nativeToolchain()).sysroot,
|
|
19647
19859
|
distribution.id,
|
|
19648
19860
|
[...native.keys()],
|
|
19649
19861
|
objcPrebuiltStage
|
|
@@ -19901,12 +20113,55 @@ package.targets += [.target(name: ${JSON.stringify(name)}, dependencies: ${JSON.
|
|
|
19901
20113
|
`;
|
|
19902
20114
|
return name;
|
|
19903
20115
|
};
|
|
19904
|
-
const
|
|
19905
|
-
|
|
19906
|
-
|
|
19907
|
-
|
|
20116
|
+
const producerUnitCount = /* @__PURE__ */ new Map();
|
|
20117
|
+
for (const target of targets) {
|
|
20118
|
+
if (!producerSet.has(target.name)) continue;
|
|
20119
|
+
producerUnitCount.set(
|
|
20120
|
+
target.name,
|
|
20121
|
+
Math.max(
|
|
20122
|
+
1,
|
|
20123
|
+
targetEntries(target).filter(([file]) => file.endsWith(".swift")).length
|
|
20124
|
+
)
|
|
20125
|
+
);
|
|
20126
|
+
}
|
|
20127
|
+
const MAX_HEADER_STAGE_TARGETS = 100;
|
|
20128
|
+
const MAX_HEADER_STAGE_UNITS = 400;
|
|
20129
|
+
const chunkHeaderProducers = (producers2) => {
|
|
20130
|
+
const levelOrdered = [...producers2].sort(
|
|
20131
|
+
(left, right) => depths.get(left) - depths.get(right)
|
|
20132
|
+
);
|
|
20133
|
+
const totalUnits = levelOrdered.reduce(
|
|
20134
|
+
(sum, name) => sum + (producerUnitCount.get(name) ?? 1),
|
|
20135
|
+
0
|
|
20136
|
+
);
|
|
20137
|
+
if (levelOrdered.length <= 1 || levelOrdered.length <= MAX_HEADER_STAGE_TARGETS && totalUnits <= MAX_HEADER_STAGE_UNITS) {
|
|
20138
|
+
return [
|
|
20139
|
+
{
|
|
20140
|
+
target: buildProduct(SWIFT_HEADER_PRODUCTS_TARGET, levelOrdered),
|
|
20141
|
+
producers: levelOrdered
|
|
20142
|
+
}
|
|
20143
|
+
];
|
|
19908
20144
|
}
|
|
19909
|
-
|
|
20145
|
+
const chunks = [];
|
|
20146
|
+
let current = [];
|
|
20147
|
+
let units = 0;
|
|
20148
|
+
for (const name of levelOrdered) {
|
|
20149
|
+
const size = producerUnitCount.get(name) ?? 1;
|
|
20150
|
+
if (current.length > 0 && (current.length >= MAX_HEADER_STAGE_TARGETS || units + size > MAX_HEADER_STAGE_UNITS)) {
|
|
20151
|
+
chunks.push(current);
|
|
20152
|
+
current = [];
|
|
20153
|
+
units = 0;
|
|
20154
|
+
}
|
|
20155
|
+
current.push(name);
|
|
20156
|
+
units += size;
|
|
20157
|
+
}
|
|
20158
|
+
if (current.length > 0) chunks.push(current);
|
|
20159
|
+
return chunks.map((members, index) => ({
|
|
20160
|
+
target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${index + 1}`, members),
|
|
20161
|
+
producers: members
|
|
20162
|
+
}));
|
|
20163
|
+
};
|
|
20164
|
+
const headerBuilds = headerCompiler ? chunkHeaderProducers(orderedProducers) : [...stages].sort(([left], [right]) => left - right).map(([level, producers2]) => ({
|
|
19910
20165
|
target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${level}`, producers2),
|
|
19911
20166
|
producers: producers2
|
|
19912
20167
|
}));
|
|
@@ -20031,8 +20286,8 @@ package.targets += [.target(name: ${JSON.stringify(name)}, dependencies: ${JSON.
|
|
|
20031
20286
|
for (const target of targets)
|
|
20032
20287
|
mkdirSync7(path23.join(layout2.root, target.path), { recursive: true });
|
|
20033
20288
|
const clangWrapper = path23.join(layout2.root, CLANG_TARGET_MODULE_WRAPPER);
|
|
20034
|
-
if (files.has(clangWrapper) && (
|
|
20035
|
-
|
|
20289
|
+
if (files.has(clangWrapper) && (statSync5(clangWrapper).mode & 4095) !== 493)
|
|
20290
|
+
chmodSync4(clangWrapper, 493);
|
|
20036
20291
|
return {
|
|
20037
20292
|
...nativePrerequisiteStageTargets.length ? { nativePrerequisiteTargets: nativePrerequisiteStageTargets } : {},
|
|
20038
20293
|
headerBuilds,
|
|
@@ -20214,12 +20469,12 @@ function pruneSharedArtifacts(parent, keep) {
|
|
|
20214
20469
|
encoding: "utf8"
|
|
20215
20470
|
})) {
|
|
20216
20471
|
try {
|
|
20217
|
-
bytes +=
|
|
20472
|
+
bytes += statSync5(path23.join(directory, "artifact", file)).size;
|
|
20218
20473
|
} catch (error) {
|
|
20219
20474
|
if (!vanished(error)) throw error;
|
|
20220
20475
|
}
|
|
20221
20476
|
}
|
|
20222
|
-
entries2.push({ directory, used:
|
|
20477
|
+
entries2.push({ directory, used: statSync5(directory).mtimeMs, bytes });
|
|
20223
20478
|
} catch (error) {
|
|
20224
20479
|
if (!vanished(error)) throw error;
|
|
20225
20480
|
}
|
|
@@ -20234,7 +20489,7 @@ function pruneSharedArtifacts(parent, keep) {
|
|
|
20234
20489
|
`${RETIRED_PREFIX}${process.pid}-${path23.basename(entry.directory)}`
|
|
20235
20490
|
);
|
|
20236
20491
|
try {
|
|
20237
|
-
if (
|
|
20492
|
+
if (statSync5(entry.directory).mtimeMs !== entry.used) continue;
|
|
20238
20493
|
renameSync5(entry.directory, retired);
|
|
20239
20494
|
} catch (error) {
|
|
20240
20495
|
if (vanished(error)) continue;
|
|
@@ -20497,7 +20752,7 @@ var frameworkProductsReceiptSchema = object({
|
|
|
20497
20752
|
});
|
|
20498
20753
|
function readFrameworkProductsReceipt(scratch, receiptKey, planChangedAt = 0n) {
|
|
20499
20754
|
const receiptFile = path23.join(scratch, "products-ready", `${receiptKey}.json`);
|
|
20500
|
-
const receiptStat =
|
|
20755
|
+
const receiptStat = statSync5(receiptFile, { bigint: true, throwIfNoEntry: false });
|
|
20501
20756
|
if (!receiptStat || receiptStat.mtimeNs < planChangedAt) return null;
|
|
20502
20757
|
let parsed;
|
|
20503
20758
|
try {
|
|
@@ -20589,7 +20844,7 @@ function prepareFrameworkCompileCache(scratch, moduleRoot, toolchainBin, sdkOpti
|
|
|
20589
20844
|
].join("\n");
|
|
20590
20845
|
const partial = `${wrapper}.${process.pid}.${randomUUID4()}.partial`;
|
|
20591
20846
|
writeFileSync7(partial, script, { mode: 493 });
|
|
20592
|
-
|
|
20847
|
+
chmodSync4(partial, 493);
|
|
20593
20848
|
renameSync5(partial, wrapper);
|
|
20594
20849
|
return { wrapper, statsFile };
|
|
20595
20850
|
}
|
|
@@ -20642,8 +20897,8 @@ async function buildFrameworkProducts(scratch, args, allowWrite) {
|
|
|
20642
20897
|
if (!allowWrite) return;
|
|
20643
20898
|
const linkRoot = path23.join(scratch, "link");
|
|
20644
20899
|
const manifest = path23.join(linkRoot, "Package.swift");
|
|
20645
|
-
const manifestStat =
|
|
20646
|
-
const planStat =
|
|
20900
|
+
const manifestStat = statSync5(manifest, { bigint: true, throwIfNoEntry: false });
|
|
20901
|
+
const planStat = statSync5(path23.join(scratch, "release.yaml"), {
|
|
20647
20902
|
bigint: true,
|
|
20648
20903
|
throwIfNoEntry: false
|
|
20649
20904
|
});
|
|
@@ -20826,7 +21081,7 @@ async function buildFrameworkProducts(scratch, args, allowWrite) {
|
|
|
20826
21081
|
const dir = path23.join(release, `${target}.build`);
|
|
20827
21082
|
if (!target || target === "Darwin" || !object2.startsWith(dir + path23.sep)) continue;
|
|
20828
21083
|
const name = `${target}-${path23.relative(dir, object2).replaceAll(path23.sep, "-").replace(/\.swift\.o$/, ".o")}`;
|
|
20829
|
-
|
|
21084
|
+
symlinkSync3(object2, path23.join(stagedArchive, name));
|
|
20830
21085
|
archived.set(object2, `lib/${name}`);
|
|
20831
21086
|
}
|
|
20832
21087
|
rmSync7(archiveRoot, { recursive: true, force: true });
|
|
@@ -20936,7 +21191,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
|
|
|
20936
21191
|
const own = (slot) => swiftFrameworkSlotRecord(slot, SWIFT_FRAMEWORK_SLOT_ORIGIN) === moduleRoot;
|
|
20937
21192
|
const slotMtimeMs = (slot) => {
|
|
20938
21193
|
try {
|
|
20939
|
-
return
|
|
21194
|
+
return statSync5(slot).mtimeMs;
|
|
20940
21195
|
} catch (error) {
|
|
20941
21196
|
if (vanished(error)) return 0;
|
|
20942
21197
|
throw error;
|
|
@@ -20944,7 +21199,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
|
|
|
20944
21199
|
};
|
|
20945
21200
|
const handoffFile = (slot) => path23.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF);
|
|
20946
21201
|
const hasPendingForeignHandoff = (slot, now) => {
|
|
20947
|
-
const stamp =
|
|
21202
|
+
const stamp = statSync5(handoffFile(slot), { throwIfNoEntry: false });
|
|
20948
21203
|
return stamp !== void 0 && !own(slot) && now - stamp.mtimeMs < SWIFT_FRAMEWORK_HANDOFF_MS;
|
|
20949
21204
|
};
|
|
20950
21205
|
const trySlot = (slot, mode, logSelection, allowPendingHandoff = true) => {
|
|
@@ -21005,7 +21260,7 @@ async function withSwiftFrameworkSlot(frameworkKey, release, moduleRoot, signal,
|
|
|
21005
21260
|
for (const [file, contents] of inputs) {
|
|
21006
21261
|
try {
|
|
21007
21262
|
const candidate = path23.join(source, file);
|
|
21008
|
-
if (
|
|
21263
|
+
if (statSync5(candidate).size !== contents.length || !readFileSync13(candidate).equals(contents))
|
|
21009
21264
|
changes++;
|
|
21010
21265
|
} catch (error) {
|
|
21011
21266
|
if (!vanished(error)) throw error;
|
|
@@ -21081,7 +21336,7 @@ async function withSwiftBuildRootSlot(baseRoot, exactShape, compatShape, signal,
|
|
|
21081
21336
|
utimesSync(slot, now, now);
|
|
21082
21337
|
return work(slot, lease, waitedMs);
|
|
21083
21338
|
};
|
|
21084
|
-
const built = new Map(slots.map((slot) => [slot,
|
|
21339
|
+
const built = new Map(slots.map((slot) => [slot, statSync5(slot).mtimeMs]));
|
|
21085
21340
|
const ranked = slots.map((slot, index) => {
|
|
21086
21341
|
const record = swiftFrameworkSlotRecord(slot, SWIFT_BUILD_ROOT_SHAPE);
|
|
21087
21342
|
const [slotExact, slotCompat] = record ? record.split("\n") : [null, null];
|
|
@@ -21118,7 +21373,7 @@ function mirrorTree(source, target, skip) {
|
|
|
21118
21373
|
const to = path23.join(target, entry.name);
|
|
21119
21374
|
let existing = null;
|
|
21120
21375
|
try {
|
|
21121
|
-
existing =
|
|
21376
|
+
existing = lstatSync2(to);
|
|
21122
21377
|
} catch (error) {
|
|
21123
21378
|
if (!vanished(error)) throw error;
|
|
21124
21379
|
}
|
|
@@ -21127,12 +21382,12 @@ function mirrorTree(source, target, skip) {
|
|
|
21127
21382
|
if (existing && !existing.isDirectory()) rmSync7(to, { force: true });
|
|
21128
21383
|
if (mirrorTree(from, to)) restructured = true;
|
|
21129
21384
|
} else if (entry.isSymbolicLink()) {
|
|
21130
|
-
const link =
|
|
21131
|
-
if (existing?.isSymbolicLink() &&
|
|
21385
|
+
const link = readlinkSync2(from);
|
|
21386
|
+
if (existing?.isSymbolicLink() && readlinkSync2(to) === link) continue;
|
|
21132
21387
|
if (existing) rmSync7(to, { recursive: true, force: true });
|
|
21133
|
-
|
|
21388
|
+
symlinkSync3(link, to);
|
|
21134
21389
|
} else {
|
|
21135
|
-
const stat =
|
|
21390
|
+
const stat = statSync5(from);
|
|
21136
21391
|
if (existing?.isFile() && existing.size === stat.size && (existing.mtimeMs === stat.mtimeMs || readFileSync13(from).equals(readFileSync13(to))))
|
|
21137
21392
|
continue;
|
|
21138
21393
|
if (existing) rmSync7(to, { recursive: true, force: true });
|
|
@@ -21186,9 +21441,9 @@ function stageFrameworkSource(moduleRoot, slot, frameworkKey, release) {
|
|
|
21186
21441
|
throw new Error("Swift staged framework source differs from the caller");
|
|
21187
21442
|
const modules = path23.join(staged, "node_modules");
|
|
21188
21443
|
const target = realpathSync6(path23.join(moduleRoot, "../../node_modules"));
|
|
21189
|
-
if (!existsSync9(modules) ||
|
|
21444
|
+
if (!existsSync9(modules) || readlinkSync2(modules) !== target) {
|
|
21190
21445
|
rmSync7(modules, { recursive: true, force: true });
|
|
21191
|
-
|
|
21446
|
+
symlinkSync3(target, modules);
|
|
21192
21447
|
}
|
|
21193
21448
|
writeFileSync7(path23.join(slot, SWIFT_FRAMEWORK_SLOT_RELEASE), release);
|
|
21194
21449
|
writeFileSync7(path23.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), frameworkKey);
|
|
@@ -21207,7 +21462,7 @@ ${args.frameworkKey}
|
|
|
21207
21462
|
hash.update("package-host-macros\n" + JSON.stringify(args.packageHostMacros));
|
|
21208
21463
|
if (!args.prebuilt) return hash.digest("hex");
|
|
21209
21464
|
const statOf = (file) => {
|
|
21210
|
-
const stat =
|
|
21465
|
+
const stat = statSync5(file, { bigint: true });
|
|
21211
21466
|
return `${stat.size}:${stat.mtimeNs}`;
|
|
21212
21467
|
};
|
|
21213
21468
|
for (const object2 of args.prebuilt.objects)
|
|
@@ -21310,7 +21565,7 @@ async function compileSwiftProjectOnce(sources, options) {
|
|
|
21310
21565
|
const distribution = swiftDistributionAt(moduleRoot);
|
|
21311
21566
|
const mirrorDistribution = options.linkOnly || options.project ? null : distribution;
|
|
21312
21567
|
if (distribution) refreshSwiftCacheHold(moduleRoot);
|
|
21313
|
-
const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-
|
|
21568
|
+
const input = distribution && !options.intermediates ? (await import("./swift-package-prebuilt-3YL3XSX3.mjs")).useSwiftPackagePrebuilts(
|
|
21314
21569
|
sources,
|
|
21315
21570
|
moduleRoot,
|
|
21316
21571
|
options.toolchainBin
|
|
@@ -21323,7 +21578,7 @@ async function compileSwiftProjectOnce(sources, options) {
|
|
|
21323
21578
|
sources: path23.join(root, "Sources", "App"),
|
|
21324
21579
|
multi: compileTargets(input).length > 0
|
|
21325
21580
|
};
|
|
21326
|
-
const sdkImage = options.linkOnly ? void 0 : await (await import("./swift-sdk-image-
|
|
21581
|
+
const sdkImage = options.linkOnly ? void 0 : await (await import("./swift-sdk-image-XJV6ZFNG.mjs")).buildSwiftSdkImage(
|
|
21327
21582
|
moduleRoot,
|
|
21328
21583
|
!!guestGraph,
|
|
21329
21584
|
distribution ? [] : linkedFrameworkTargets(moduleRoot, input).imports,
|
|
@@ -21464,8 +21719,15 @@ ${compatShape}` : "";
|
|
|
21464
21719
|
frameworkLease
|
|
21465
21720
|
);
|
|
21466
21721
|
const compileFrameworkRoot2 = distribution ? swiftDistributionCompileView(frameworkRoot2, distribution) : frameworkRoot2;
|
|
21467
|
-
const
|
|
21468
|
-
const
|
|
21722
|
+
const sdk = swiftModuleSdk(frameworkRoot2).wasmSdkId;
|
|
21723
|
+
const compileSdk2 = mirrorDistribution ? syncSwiftSdkMirror(root2, frameworkRoot2, options.toolchainBin, sdk) : {
|
|
21724
|
+
id: sdk,
|
|
21725
|
+
options: swiftCompileSdkOptions(frameworkRoot2, options.toolchainBin),
|
|
21726
|
+
toolsetChanged: false
|
|
21727
|
+
};
|
|
21728
|
+
if (mirrorDistribution && compileSdk2.toolsetChanged)
|
|
21729
|
+
clearSwiftSdkPathsCache(path23.join(root2, SWIFT_SDK_MIRROR));
|
|
21730
|
+
const icu2 = options.linkOnly ? null : swiftIcuAsset(options.toolchainBin, sdk);
|
|
21469
21731
|
let prebuilt2;
|
|
21470
21732
|
if (!distribution) {
|
|
21471
21733
|
if (allowWrite) stage("compiling framework products");
|
|
@@ -21476,7 +21738,7 @@ ${compatShape}` : "";
|
|
|
21476
21738
|
frameworkKey,
|
|
21477
21739
|
input,
|
|
21478
21740
|
swift,
|
|
21479
|
-
sdk
|
|
21741
|
+
sdk,
|
|
21480
21742
|
toolchainBin: options.toolchainBin,
|
|
21481
21743
|
plugins: macroPlugins2,
|
|
21482
21744
|
buildOptions: {
|
|
@@ -21501,7 +21763,8 @@ ${compatShape}` : "";
|
|
|
21501
21763
|
frameworkRoot: frameworkRoot2,
|
|
21502
21764
|
compileFrameworkRoot: compileFrameworkRoot2,
|
|
21503
21765
|
macroPlugins: macroPlugins2,
|
|
21504
|
-
sdk
|
|
21766
|
+
sdk,
|
|
21767
|
+
compileSdk: compileSdk2,
|
|
21505
21768
|
icu: icu2,
|
|
21506
21769
|
prebuilt: prebuilt2,
|
|
21507
21770
|
readHold: readHold2
|
|
@@ -21522,7 +21785,7 @@ ${compatShape}` : "";
|
|
|
21522
21785
|
frameworkRoot,
|
|
21523
21786
|
compileFrameworkRoot,
|
|
21524
21787
|
macroPlugins,
|
|
21525
|
-
|
|
21788
|
+
compileSdk,
|
|
21526
21789
|
icu,
|
|
21527
21790
|
prebuilt
|
|
21528
21791
|
} = frameworks;
|
|
@@ -21540,13 +21803,13 @@ ${compatShape}` : "";
|
|
|
21540
21803
|
if (retireStaleSwiftLink(
|
|
21541
21804
|
root2,
|
|
21542
21805
|
swiftLinkStamp({
|
|
21543
|
-
frameworkKey: `${options.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
|
|
21806
|
+
frameworkKey: mirrorDistribution ? `${options.release}\0mirror` : `${options.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
|
|
21544
21807
|
packageHostMacros
|
|
21545
21808
|
}),
|
|
21546
21809
|
swiftLinkStamp({
|
|
21547
|
-
//
|
|
21548
|
-
//
|
|
21549
|
-
frameworkKey: distribution ? `${options.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
|
|
21810
|
+
// mirrored distributions and their WASI SDK mirror invalidate
|
|
21811
|
+
// dependents per changed file instead of wiping every Clang object.
|
|
21812
|
+
frameworkKey: mirrorDistribution ? `${options.release}\0mirror` : distribution ? `${options.release}\0${distribution.wasmSdkChecksum}` : frameworkKey,
|
|
21550
21813
|
prebuilt,
|
|
21551
21814
|
packageHostMacros
|
|
21552
21815
|
}),
|
|
@@ -21560,7 +21823,8 @@ ${compatShape}` : "";
|
|
|
21560
21823
|
frameworkRoot,
|
|
21561
21824
|
prebuilt,
|
|
21562
21825
|
!options.project,
|
|
21563
|
-
options.project ? false : options.objcPrebuiltStage ?? (options.intermediates ? false : void 0)
|
|
21826
|
+
options.project ? false : options.objcPrebuiltStage ?? (options.intermediates ? false : void 0),
|
|
21827
|
+
compileSdk
|
|
21564
21828
|
);
|
|
21565
21829
|
const productFile = path23.join(frameworkRoot, SWIFT_FRAMEWORK_PRODUCT_FILE);
|
|
21566
21830
|
writeSwiftAutolinkLinker(
|
|
@@ -21599,7 +21863,7 @@ ${compatShape}` : "";
|
|
|
21599
21863
|
""
|
|
21600
21864
|
].join("\n")
|
|
21601
21865
|
);
|
|
21602
|
-
|
|
21866
|
+
chmodSync4(swiftc, 493);
|
|
21603
21867
|
compiler.SWIFT_EXEC = swiftc;
|
|
21604
21868
|
compiler.PEACH_SWIFT_HOST_MACROS = packageHostMacros.join(",");
|
|
21605
21869
|
compiler.PEACH_SWIFTC = path23.join(options.toolchainBin, "swiftc");
|
|
@@ -21636,6 +21900,7 @@ ${compatShape}` : "";
|
|
|
21636
21900
|
const jobs = swiftCompilerJobs();
|
|
21637
21901
|
const incrementalPreview = sdkImage !== void 0 && !guestGraph && !options.project && !input.optimize && !input.unoptimized;
|
|
21638
21902
|
const perFile = input.unoptimized || incrementalPreview;
|
|
21903
|
+
const reproducibleFrameworkRoot = mirrorDistribution ? frameworkRoot : compileFrameworkRoot;
|
|
21639
21904
|
const buildArgs = [
|
|
21640
21905
|
"build",
|
|
21641
21906
|
...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
|
|
@@ -21645,10 +21910,10 @@ ${compatShape}` : "";
|
|
|
21645
21910
|
String(jobs),
|
|
21646
21911
|
"--package-path",
|
|
21647
21912
|
root2,
|
|
21648
|
-
...
|
|
21913
|
+
...compileSdk.options,
|
|
21649
21914
|
...swiftObjCSelectorOptions(frameworkRoot),
|
|
21650
21915
|
"--swift-sdk",
|
|
21651
|
-
|
|
21916
|
+
compileSdk.id,
|
|
21652
21917
|
...preparation.targetToolset ? ["--toolset", path23.join(root2, ".peach-target-toolset.json")] : [],
|
|
21653
21918
|
"-c",
|
|
21654
21919
|
"release",
|
|
@@ -21683,7 +21948,7 @@ ${compatShape}` : "";
|
|
|
21683
21948
|
],
|
|
21684
21949
|
...swiftReproducibleBuildFlags([
|
|
21685
21950
|
[path23.dirname(options.toolchainBin), "toolchain"],
|
|
21686
|
-
[
|
|
21951
|
+
[reproducibleFrameworkRoot, "framework"],
|
|
21687
21952
|
[root2, "build"],
|
|
21688
21953
|
...forwarders
|
|
21689
21954
|
]).flatMap((flag, index, flags) => {
|
|
@@ -21693,8 +21958,8 @@ ${compatShape}` : "";
|
|
|
21693
21958
|
let mapped = flag;
|
|
21694
21959
|
for (const [dir, target] of [
|
|
21695
21960
|
[root2, "/peach/build"],
|
|
21696
|
-
[
|
|
21697
|
-
[realpathSync6(
|
|
21961
|
+
[reproducibleFrameworkRoot, "/peach/framework"],
|
|
21962
|
+
[realpathSync6(reproducibleFrameworkRoot), "/peach/framework"],
|
|
21698
21963
|
[toolchainDir, "/peach/toolchain"],
|
|
21699
21964
|
[realpathSync6(toolchainDir), "/peach/toolchain"]
|
|
21700
21965
|
]) {
|
|
@@ -21719,12 +21984,18 @@ ${compatShape}` : "";
|
|
|
21719
21984
|
];
|
|
21720
21985
|
const linked = builtArtifact(layout3);
|
|
21721
21986
|
rmSync7(path23.join(root2, ".peach-link.rsp"), { force: true });
|
|
21722
|
-
if (options.linkOnly || existsSync9(linked) &&
|
|
21987
|
+
if (options.linkOnly || existsSync9(linked) && statSync5(linked).size <= 8)
|
|
21723
21988
|
rmSync7(linked, { force: true });
|
|
21724
21989
|
stage("compiling and linking Swift modules");
|
|
21725
21990
|
const frameworkInterfaces = /* @__PURE__ */ new Map();
|
|
21991
|
+
const compileSdkPaths = swiftSdkPaths(
|
|
21992
|
+
frameworkRoot,
|
|
21993
|
+
options.toolchainBin,
|
|
21994
|
+
compileSdk.options,
|
|
21995
|
+
compileSdk.id
|
|
21996
|
+
);
|
|
21726
21997
|
const sdkFrameworks = path23.join(
|
|
21727
|
-
|
|
21998
|
+
compileSdkPaths.darwin,
|
|
21728
21999
|
"System/Library/Frameworks"
|
|
21729
22000
|
);
|
|
21730
22001
|
const generatedInterface = (source) => withoutImportedSdkEnumForwards(
|
|
@@ -21861,7 +22132,7 @@ ${compatShape}` : "";
|
|
|
21861
22132
|
if (!options.project && producers.length === 0 && buildDbExists) {
|
|
21862
22133
|
const expectedObjects = preparation.nativeStageObjects.get(target);
|
|
21863
22134
|
if (expectedObjects && expectedObjects.length > 0 && expectedObjects.every(
|
|
21864
|
-
(relative) =>
|
|
22135
|
+
(relative) => statSync5(path23.join(releaseDir, relative), {
|
|
21865
22136
|
throwIfNoEntry: false
|
|
21866
22137
|
})?.isFile()
|
|
21867
22138
|
))
|
|
@@ -21928,7 +22199,7 @@ ${compatShape}` : "";
|
|
|
21928
22199
|
options.toolchainBin,
|
|
21929
22200
|
recipe,
|
|
21930
22201
|
new Map(
|
|
21931
|
-
preparation.headerBuilds
|
|
22202
|
+
preparation.headerBuilds.flatMap((stage2) => stage2.producers).map((producer) => {
|
|
21932
22203
|
const paths = headerPaths(producer);
|
|
21933
22204
|
return [
|
|
21934
22205
|
swiftTargetModuleName(producer),
|
|
@@ -22002,7 +22273,7 @@ ${compatShape}` : "";
|
|
|
22002
22273
|
resourceReferences
|
|
22003
22274
|
);
|
|
22004
22275
|
if (options.linkOnly) {
|
|
22005
|
-
if (
|
|
22276
|
+
if (statSync5(linked).size <= 8)
|
|
22006
22277
|
throw new Error("swift-compile: deferred linker produced no executable");
|
|
22007
22278
|
stage("project link verified");
|
|
22008
22279
|
if (readHold && retainSwiftRootReadHold(readHold)) readHold = void 0;
|
|
@@ -22022,7 +22293,7 @@ ${compatShape}` : "";
|
|
|
22022
22293
|
moduleRoot: frameworkRoot,
|
|
22023
22294
|
toolchainBin: options.toolchainBin,
|
|
22024
22295
|
swiftCompiler: preparation.headerCompiler ? path23.join(root2, SWIFT_HEADER_COMPILER_WRAPPER) : compiler.SWIFT_EXEC ?? path23.join(options.toolchainBin, "swiftc"),
|
|
22025
|
-
sysroot:
|
|
22296
|
+
sysroot: compileSdkPaths.sysroot,
|
|
22026
22297
|
sdk: swiftModuleSdk(frameworkRoot),
|
|
22027
22298
|
sdkImage,
|
|
22028
22299
|
compilerDigest: compilerSourceDigest,
|
|
@@ -22042,7 +22313,7 @@ ${compatShape}` : "";
|
|
|
22042
22313
|
});
|
|
22043
22314
|
sdkAsset = { key: sdkImage.key, sha256: sdkImage.sha256, binding };
|
|
22044
22315
|
} else {
|
|
22045
|
-
const { buildSwiftAppModule } = await import("./swift-sdk-app-module-
|
|
22316
|
+
const { buildSwiftAppModule } = await import("./swift-sdk-app-module-QSLP6GQS.mjs");
|
|
22046
22317
|
const binding = await buildSwiftAppModule({
|
|
22047
22318
|
buildRoot: root2,
|
|
22048
22319
|
toolchainBin: options.toolchainBin,
|
|
@@ -22052,9 +22323,7 @@ ${compatShape}` : "";
|
|
|
22052
22323
|
project: options.project && {
|
|
22053
22324
|
...options.project,
|
|
22054
22325
|
env: { ...options.project.env, ...projectProcess?.env },
|
|
22055
|
-
sdkRoot: path23.dirname(
|
|
22056
|
-
swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot
|
|
22057
|
-
),
|
|
22326
|
+
sdkRoot: path23.dirname(compileSdkPaths.sysroot),
|
|
22058
22327
|
linked: output
|
|
22059
22328
|
}
|
|
22060
22329
|
});
|
|
@@ -22084,6 +22353,8 @@ ${compatShape}` : "";
|
|
|
22084
22353
|
|
|
22085
22354
|
export {
|
|
22086
22355
|
DARWIN_RECORDS_PREFIX,
|
|
22356
|
+
SWIFT_DISTRIBUTION_MIRROR,
|
|
22357
|
+
SWIFT_SDK_MIRROR,
|
|
22087
22358
|
peachGuestServiceAllowlist,
|
|
22088
22359
|
guestWasmDataSegments,
|
|
22089
22360
|
assertPeachGuestEngineLink,
|