peachsim 0.1.2767 → 0.1.2769
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 +351 -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-RDD3HI5C.mjs → acorn-GNB3RJH7.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-BY3E6CUM.mjs → chunk-3WG4L5YK.mjs} +372 -106
- package/dist-lib/esm-chunks/{chunk-YX56RZ26.mjs → chunk-3ZKE33FC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-555YCJDH.mjs → chunk-4GHACZYW.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-CBAMX2H3.mjs → chunk-4IJOKKT2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GKHSLOW6.mjs → chunk-53WFZATQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-H4KLP3QO.mjs → chunk-57JPQBQL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PDMYH4NT.mjs → chunk-ALLMPTWQ.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-UGTY5DQQ.mjs → chunk-BFLH7V77.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-LO5KFOI3.mjs → chunk-BP7TLKZD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WJKKLL2J.mjs → chunk-ETXC2XBY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-C6YNOAXM.mjs → chunk-GHJPVQ3A.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-D6JZSVL7.mjs → chunk-L2U2IEHU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7G6WGJWR.mjs → chunk-MBLYJ74N.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-P2KN5U5O.mjs → chunk-MGIODRG3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XPSICY6F.mjs → chunk-OG5C2CN2.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-4W67A7NE.mjs → chunk-OPIPPBGX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DFK4ZVNM.mjs → chunk-TI42U3CD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-H5C5TZNB.mjs → chunk-TJNFADI5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OYMWLKPN.mjs → chunk-TTVQWJGW.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-7VSU2AV7.mjs → chunk-VF3CWZTM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AC2RBU5N.mjs → chunk-WWANYYJG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EJWUFWN3.mjs → chunk-XX7VUACB.mjs} +26 -13
- package/dist-lib/esm-chunks/{chunk-BSN5R62H.mjs → chunk-ZGNNVEWM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3WJRW63F.mjs → chunk-ZLYAJ4CU.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-7POGDD5P.mjs → metro-layout-parser-LT2DPN6F.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-ULD72CI5.mjs → swift-package-prebuilt-ZFFWBI33.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-VXSTLD57.mjs → swift-sdk-app-module-UZ6BZSES.mjs} +22 -17
- package/dist-lib/esm-chunks/{swift-sdk-image-KDJATRA6.mjs → swift-sdk-image-J2DE3SBW.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-KNBUALWN.mjs → swift-sdk-image-producer-C4U4EQRW.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +351 -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 +351 -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 +351 -77
- package/dist-lib/swift-compile.cjs +331 -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 +273 -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
package/src/swift-compile.ts
CHANGED
|
@@ -50,7 +50,11 @@ import {
|
|
|
50
50
|
} from './swift-distribution-contract'
|
|
51
51
|
import {
|
|
52
52
|
SWIFT_DISTRIBUTION_MIRROR,
|
|
53
|
+
SWIFT_SDK_MIRROR,
|
|
54
|
+
SWIFT_SDK_MIRROR_ID,
|
|
53
55
|
syncSwiftDistributionMirror,
|
|
56
|
+
syncSwiftSdkMirror,
|
|
57
|
+
type SwiftMirrorSdk,
|
|
54
58
|
} from './swift-distribution-mirror'
|
|
55
59
|
import { foundationCategoryObjects } from './swift-foundation'
|
|
56
60
|
import { compileGuestLink } from './swift-guest-compile'
|
|
@@ -136,6 +140,7 @@ import {
|
|
|
136
140
|
cActiveCode,
|
|
137
141
|
clangInterfaceHeader,
|
|
138
142
|
clearLinkedModuleDigests,
|
|
143
|
+
clearSwiftSdkPathsCache,
|
|
139
144
|
CORE_FOUNDATION_OVERLAY_GLOBALS,
|
|
140
145
|
emptyMacroEnvironment,
|
|
141
146
|
FOUNDATION_IMPLICIT_MODULES,
|
|
@@ -2280,6 +2285,7 @@ export function syncSwiftTree(
|
|
|
2280
2285
|
// must not remove them.
|
|
2281
2286
|
entry.name === CLANG_DISTRIBUTION_MODULES ||
|
|
2282
2287
|
entry.name === SWIFT_DISTRIBUTION_MIRROR ||
|
|
2288
|
+
entry.name === SWIFT_SDK_MIRROR ||
|
|
2283
2289
|
entry.name === SWIFT_LINK_STAMP ||
|
|
2284
2290
|
entry.name === SWIFT_BUILD_ROOT_SHAPE)
|
|
2285
2291
|
)
|
|
@@ -3369,6 +3375,7 @@ export function writeSwiftProject(
|
|
|
3369
3375
|
prebuilt?: SwiftFrameworkProducts,
|
|
3370
3376
|
allowHeaderCompiler = false,
|
|
3371
3377
|
objcPrebuiltStage?: SwiftObjCPrebuiltStage | false,
|
|
3378
|
+
compileSdk?: Pick<SwiftMirrorSdk, 'id' | 'options'>,
|
|
3372
3379
|
): SwiftProjectPreparation & {
|
|
3373
3380
|
generatedOwners: Map<string, string>
|
|
3374
3381
|
targetToolset: boolean
|
|
@@ -3540,6 +3547,8 @@ export function writeSwiftProject(
|
|
|
3540
3547
|
checkedToolchain = swiftToolchain(pin.release, swiftModuleSdk(moduleRoot))
|
|
3541
3548
|
return checkedToolchain
|
|
3542
3549
|
}
|
|
3550
|
+
const resolvedSdkPaths = (toolchainBin: string) =>
|
|
3551
|
+
swiftSdkPaths(moduleRoot, toolchainBin, compileSdk?.options, compileSdk?.id)
|
|
3543
3552
|
const targetStagedFiles = new Map<string, Map<string, string | Buffer | undefined>>()
|
|
3544
3553
|
const stageTargetFile = (
|
|
3545
3554
|
target: string,
|
|
@@ -3713,16 +3722,35 @@ export function writeSwiftProject(
|
|
|
3713
3722
|
files.set(destination, contents)
|
|
3714
3723
|
}
|
|
3715
3724
|
}
|
|
3725
|
+
// ensure active staged binary-tree headers in this input exist on disk before
|
|
3726
|
+
// building the case-insensitive overlay, so stale trees from prior runs are excluded.
|
|
3727
|
+
const binaryTreePrefix = `${SWIFT_BINARY_TREES_DIR}/`
|
|
3728
|
+
const binaryTreeSegment = `/${SWIFT_BINARY_TREES_DIR}/`
|
|
3729
|
+
const isBinaryTreeFile = (file: string) =>
|
|
3730
|
+
file.startsWith(binaryTreePrefix) || file.includes(binaryTreeSegment)
|
|
3731
|
+
const stageBinaryTreeFile = (file: string, contents: string | Buffer) => {
|
|
3732
|
+
const destination = path.join(layout.root, file)
|
|
3733
|
+
if (files.has(destination)) return
|
|
3734
|
+
writeBuildFile(destination, contents)
|
|
3735
|
+
alreadySynced.set(destination, contents)
|
|
3736
|
+
files.set(destination, contents)
|
|
3737
|
+
}
|
|
3738
|
+
for (const [file, contents] of Object.entries(input.files))
|
|
3739
|
+
if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, contents)
|
|
3740
|
+
for (const [file, bytes] of Object.entries(input.packageFiles ?? {}))
|
|
3741
|
+
if (isBinaryTreeFile(file) && !file.endsWith('.swift'))
|
|
3742
|
+
stageBinaryTreeFile(file, Buffer.from(bytes, 'base64'))
|
|
3743
|
+
for (const [file, bytes] of Object.entries(input.projectFiles ?? {}))
|
|
3744
|
+
if (isBinaryTreeFile(file)) stageBinaryTreeFile(file, Buffer.from(bytes, 'base64'))
|
|
3716
3745
|
// xcode's header maps and product header overlay, naming the headers
|
|
3717
3746
|
// written above, bound into every clang command of their target.
|
|
3718
3747
|
const fromInputRoot = (file: string) =>
|
|
3719
3748
|
file.startsWith(`${SWIFT_NATIVE_INPUT_ROOT}/`)
|
|
3720
3749
|
? path.join(layout.root, file.slice(SWIFT_NATIVE_INPUT_ROOT.length + 1))
|
|
3721
3750
|
: file
|
|
3722
|
-
// a warm root also holds what earlier builds emitted into it; this
|
|
3723
|
-
//
|
|
3751
|
+
// a warm root also holds what earlier builds emitted into it; admit only this
|
|
3752
|
+
// input's files under the root so stale binary trees never churn the overlay.
|
|
3724
3753
|
const inRoot = `${layout.root}${path.sep}`
|
|
3725
|
-
const binaryTree = `${path.sep}${SWIFT_BINARY_TREES_DIR}${path.sep}`
|
|
3726
3754
|
const headerSearch = writeXcodeHeaderSearch(
|
|
3727
3755
|
path.join(layout.root, '.build', 'peach-xcode-headers'),
|
|
3728
3756
|
nativeTargets.map((settings) => {
|
|
@@ -3784,7 +3812,7 @@ export function writeSwiftProject(
|
|
|
3784
3812
|
path.join(layout.root, file),
|
|
3785
3813
|
]),
|
|
3786
3814
|
),
|
|
3787
|
-
(file) => !file.startsWith(inRoot) || files.has(file)
|
|
3815
|
+
(file) => !file.startsWith(inRoot) || files.has(file),
|
|
3788
3816
|
)
|
|
3789
3817
|
// declarations are imported before swift can emit the header that native
|
|
3790
3818
|
// implementations consume. give those implementations a downstream target.
|
|
@@ -3973,7 +4001,7 @@ export function writeSwiftProject(
|
|
|
3973
4001
|
]
|
|
3974
4002
|
})()
|
|
3975
4003
|
const sdkInclude = path.join(
|
|
3976
|
-
|
|
4004
|
+
resolvedSdkPaths(toolchainBin).sysroot,
|
|
3977
4005
|
'darwin/usr/include',
|
|
3978
4006
|
)
|
|
3979
4007
|
const dependencyModuleMaps = clangImportModuleMapFlags(
|
|
@@ -4914,7 +4942,11 @@ export function writeSwiftProject(
|
|
|
4914
4942
|
)
|
|
4915
4943
|
if (nativeFlags) {
|
|
4916
4944
|
const toolchainBin = nativeToolchain()
|
|
4917
|
-
const headers = path.join(
|
|
4945
|
+
const headers = path.join(resolvedSdkPaths(toolchainBin).sysroot, 'darwin')
|
|
4946
|
+
const sdkOverlayDirectory =
|
|
4947
|
+
compileSdk?.id === SWIFT_SDK_MIRROR_ID
|
|
4948
|
+
? path.join(layout.root, SWIFT_SDK_MIRROR)
|
|
4949
|
+
: undefined
|
|
4918
4950
|
const dependencies = swiftTargetDependencies(input.files, targets)
|
|
4919
4951
|
const reachesNative = (name: string, seen = new Set<string>()): boolean => {
|
|
4920
4952
|
if (native.has(name)) return true
|
|
@@ -4937,7 +4969,12 @@ export function writeSwiftProject(
|
|
|
4937
4969
|
': missing or unsupported declared iOS deployment target ' +
|
|
4938
4970
|
JSON.stringify(version),
|
|
4939
4971
|
)
|
|
4940
|
-
const sdkIntake = objcSdkIntakeFlags(
|
|
4972
|
+
const sdkIntake = objcSdkIntakeFlags(
|
|
4973
|
+
headers,
|
|
4974
|
+
toolchainBin,
|
|
4975
|
+
minimum,
|
|
4976
|
+
sdkOverlayDirectory,
|
|
4977
|
+
)
|
|
4941
4978
|
const sdkOverlay = sdkIntake.indexOf('-ivfsoverlay')
|
|
4942
4979
|
if (sdkOverlay >= 0) generatedOverlays.add(sdkIntake[sdkOverlay + 1]!)
|
|
4943
4980
|
const intake = [
|
|
@@ -5225,7 +5262,7 @@ export function writeSwiftProject(
|
|
|
5225
5262
|
deferDarwinOverlay:
|
|
5226
5263
|
native.size > 0 &&
|
|
5227
5264
|
toolsetOrdersLibcxxBeforeDarwinOverlay(
|
|
5228
|
-
|
|
5265
|
+
resolvedSdkPaths(nativeToolchain()).cFlags,
|
|
5229
5266
|
),
|
|
5230
5267
|
...(reachesFrameworks
|
|
5231
5268
|
? {
|
|
@@ -5278,7 +5315,7 @@ export function writeSwiftProject(
|
|
|
5278
5315
|
? [
|
|
5279
5316
|
'-fmodule-map-file=' +
|
|
5280
5317
|
path.join(
|
|
5281
|
-
|
|
5318
|
+
resolvedSdkPaths(nativeToolchain()).sysroot,
|
|
5282
5319
|
'darwin/wasm/include/module.modulemap',
|
|
5283
5320
|
),
|
|
5284
5321
|
]
|
|
@@ -5297,7 +5334,7 @@ export function writeSwiftProject(
|
|
|
5297
5334
|
? swiftObjCPrebuiltCompiler(
|
|
5298
5335
|
clang,
|
|
5299
5336
|
layout.root,
|
|
5300
|
-
|
|
5337
|
+
resolvedSdkPaths(nativeToolchain()).sysroot,
|
|
5301
5338
|
distribution.id,
|
|
5302
5339
|
[...native.keys()],
|
|
5303
5340
|
objcPrebuiltStage,
|
|
@@ -5572,14 +5609,69 @@ export function writeSwiftProject(
|
|
|
5572
5609
|
return name
|
|
5573
5610
|
}
|
|
5574
5611
|
// normalize a dependency header before its consumers, while swiftpm schedules
|
|
5575
|
-
// independent producers together within the admitted job budget.
|
|
5576
|
-
|
|
5577
|
-
|
|
5612
|
+
// independent producers together within the admitted job budget. chunk large
|
|
5613
|
+
// producer graphs in topological level order so llbuild commits build.db and
|
|
5614
|
+
// product checkpoints every few minutes instead of rolling back on timeout.
|
|
5615
|
+
const producerUnitCount = new Map<string, number>()
|
|
5616
|
+
for (const target of targets) {
|
|
5617
|
+
if (!producerSet.has(target.name)) continue
|
|
5618
|
+
producerUnitCount.set(
|
|
5619
|
+
target.name,
|
|
5620
|
+
Math.max(
|
|
5621
|
+
1,
|
|
5622
|
+
targetEntries(target).filter(([file]) => file.endsWith('.swift')).length,
|
|
5623
|
+
),
|
|
5624
|
+
)
|
|
5625
|
+
}
|
|
5626
|
+
const MAX_HEADER_STAGE_TARGETS = 100
|
|
5627
|
+
const MAX_HEADER_STAGE_UNITS = 400
|
|
5628
|
+
const chunkHeaderProducers = (
|
|
5629
|
+
producers: readonly string[],
|
|
5630
|
+
): { target: string; producers: string[] }[] => {
|
|
5631
|
+
const levelOrdered = [...producers].sort(
|
|
5632
|
+
(left, right) => depths.get(left)! - depths.get(right)!,
|
|
5633
|
+
)
|
|
5634
|
+
const totalUnits = levelOrdered.reduce(
|
|
5635
|
+
(sum, name) => sum + (producerUnitCount.get(name) ?? 1),
|
|
5636
|
+
0,
|
|
5637
|
+
)
|
|
5638
|
+
if (
|
|
5639
|
+
levelOrdered.length <= 1 ||
|
|
5640
|
+
(levelOrdered.length <= MAX_HEADER_STAGE_TARGETS &&
|
|
5641
|
+
totalUnits <= MAX_HEADER_STAGE_UNITS)
|
|
5642
|
+
) {
|
|
5643
|
+
return [
|
|
5578
5644
|
{
|
|
5579
|
-
target: buildProduct(SWIFT_HEADER_PRODUCTS_TARGET,
|
|
5580
|
-
producers:
|
|
5645
|
+
target: buildProduct(SWIFT_HEADER_PRODUCTS_TARGET, levelOrdered),
|
|
5646
|
+
producers: levelOrdered,
|
|
5581
5647
|
},
|
|
5582
5648
|
]
|
|
5649
|
+
}
|
|
5650
|
+
const chunks: string[][] = []
|
|
5651
|
+
let current: string[] = []
|
|
5652
|
+
let units = 0
|
|
5653
|
+
for (const name of levelOrdered) {
|
|
5654
|
+
const size = producerUnitCount.get(name) ?? 1
|
|
5655
|
+
if (
|
|
5656
|
+
current.length > 0 &&
|
|
5657
|
+
(current.length >= MAX_HEADER_STAGE_TARGETS ||
|
|
5658
|
+
units + size > MAX_HEADER_STAGE_UNITS)
|
|
5659
|
+
) {
|
|
5660
|
+
chunks.push(current)
|
|
5661
|
+
current = []
|
|
5662
|
+
units = 0
|
|
5663
|
+
}
|
|
5664
|
+
current.push(name)
|
|
5665
|
+
units += size
|
|
5666
|
+
}
|
|
5667
|
+
if (current.length > 0) chunks.push(current)
|
|
5668
|
+
return chunks.map((members, index) => ({
|
|
5669
|
+
target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${index + 1}`, members),
|
|
5670
|
+
producers: members,
|
|
5671
|
+
}))
|
|
5672
|
+
}
|
|
5673
|
+
const headerBuilds = headerCompiler
|
|
5674
|
+
? chunkHeaderProducers(orderedProducers)
|
|
5583
5675
|
: [...stages]
|
|
5584
5676
|
.sort(([left], [right]) => left - right)
|
|
5585
5677
|
.map(([level, producers]) => ({
|
|
@@ -7616,6 +7708,15 @@ async function compileSwiftProjectOnce(
|
|
|
7616
7708
|
// memoized per toolchain, so only a process's first build waits on it,
|
|
7617
7709
|
// and that one reads and gzips it while swift builds
|
|
7618
7710
|
const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId
|
|
7711
|
+
const compileSdk: SwiftMirrorSdk = mirrorDistribution
|
|
7712
|
+
? syncSwiftSdkMirror(root, frameworkRoot, options.toolchainBin, sdk)
|
|
7713
|
+
: {
|
|
7714
|
+
id: sdk,
|
|
7715
|
+
options: swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
7716
|
+
toolsetChanged: false,
|
|
7717
|
+
}
|
|
7718
|
+
if (mirrorDistribution && compileSdk.toolsetChanged)
|
|
7719
|
+
clearSwiftSdkPathsCache(path.join(root, SWIFT_SDK_MIRROR))
|
|
7619
7720
|
const icu = options.linkOnly ? null : swiftIcuAsset(options.toolchainBin, sdk)
|
|
7620
7721
|
let prebuilt: SwiftFrameworkProducts | undefined
|
|
7621
7722
|
if (!distribution) {
|
|
@@ -7655,6 +7756,7 @@ async function compileSwiftProjectOnce(
|
|
|
7655
7756
|
compileFrameworkRoot,
|
|
7656
7757
|
macroPlugins,
|
|
7657
7758
|
sdk,
|
|
7759
|
+
compileSdk,
|
|
7658
7760
|
icu,
|
|
7659
7761
|
prebuilt,
|
|
7660
7762
|
readHold,
|
|
@@ -7677,7 +7779,7 @@ async function compileSwiftProjectOnce(
|
|
|
7677
7779
|
frameworkRoot,
|
|
7678
7780
|
compileFrameworkRoot,
|
|
7679
7781
|
macroPlugins,
|
|
7680
|
-
|
|
7782
|
+
compileSdk,
|
|
7681
7783
|
icu,
|
|
7682
7784
|
prebuilt,
|
|
7683
7785
|
} = frameworks
|
|
@@ -7697,15 +7799,19 @@ async function compileSwiftProjectOnce(
|
|
|
7697
7799
|
retireStaleSwiftLink(
|
|
7698
7800
|
root,
|
|
7699
7801
|
swiftLinkStamp({
|
|
7700
|
-
frameworkKey:
|
|
7802
|
+
frameworkKey: mirrorDistribution
|
|
7803
|
+
? `${options.release}\0mirror`
|
|
7804
|
+
: `${options.release}\0${Boolean(distribution)}\0${swiftModuleSdk(frameworkRoot).wasmSdkId}`,
|
|
7701
7805
|
packageHostMacros,
|
|
7702
7806
|
}),
|
|
7703
7807
|
swiftLinkStamp({
|
|
7704
|
-
//
|
|
7705
|
-
//
|
|
7706
|
-
frameworkKey:
|
|
7707
|
-
? `${options.release}\
|
|
7708
|
-
:
|
|
7808
|
+
// mirrored distributions and their WASI SDK mirror invalidate
|
|
7809
|
+
// dependents per changed file instead of wiping every Clang object.
|
|
7810
|
+
frameworkKey: mirrorDistribution
|
|
7811
|
+
? `${options.release}\0mirror`
|
|
7812
|
+
: distribution
|
|
7813
|
+
? `${options.release}\0${distribution.wasmSdkChecksum}`
|
|
7814
|
+
: frameworkKey,
|
|
7709
7815
|
prebuilt,
|
|
7710
7816
|
packageHostMacros,
|
|
7711
7817
|
}),
|
|
@@ -7724,6 +7830,7 @@ async function compileSwiftProjectOnce(
|
|
|
7724
7830
|
? false
|
|
7725
7831
|
: (options.objcPrebuiltStage ??
|
|
7726
7832
|
(options.intermediates ? false : undefined)),
|
|
7833
|
+
compileSdk,
|
|
7727
7834
|
)
|
|
7728
7835
|
// the framework objects link as inputs, so the product name its
|
|
7729
7836
|
// modules autolink has no archive to load
|
|
@@ -7828,6 +7935,9 @@ async function compileSwiftProjectOnce(
|
|
|
7828
7935
|
!input.optimize &&
|
|
7829
7936
|
!input.unoptimized
|
|
7830
7937
|
const perFile = input.unoptimized || incrementalPreview
|
|
7938
|
+
const reproducibleFrameworkRoot = mirrorDistribution
|
|
7939
|
+
? frameworkRoot
|
|
7940
|
+
: compileFrameworkRoot
|
|
7831
7941
|
const buildArgs = [
|
|
7832
7942
|
'build',
|
|
7833
7943
|
...(projectProcess?.cacheOptions ?? swiftPackageCacheOptions()),
|
|
@@ -7837,10 +7947,10 @@ async function compileSwiftProjectOnce(
|
|
|
7837
7947
|
String(jobs),
|
|
7838
7948
|
'--package-path',
|
|
7839
7949
|
root,
|
|
7840
|
-
...
|
|
7950
|
+
...compileSdk.options,
|
|
7841
7951
|
...swiftObjCSelectorOptions(frameworkRoot),
|
|
7842
7952
|
'--swift-sdk',
|
|
7843
|
-
|
|
7953
|
+
compileSdk.id,
|
|
7844
7954
|
...(preparation.targetToolset
|
|
7845
7955
|
? ['--toolset', path.join(root, '.peach-target-toolset.json')]
|
|
7846
7956
|
: []),
|
|
@@ -7883,7 +7993,7 @@ async function compileSwiftProjectOnce(
|
|
|
7883
7993
|
]),
|
|
7884
7994
|
...swiftReproducibleBuildFlags([
|
|
7885
7995
|
[path.dirname(options.toolchainBin), 'toolchain'],
|
|
7886
|
-
[
|
|
7996
|
+
[reproducibleFrameworkRoot, 'framework'],
|
|
7887
7997
|
[root, 'build'],
|
|
7888
7998
|
...forwarders,
|
|
7889
7999
|
]).flatMap((flag, index, flags) => {
|
|
@@ -7893,8 +8003,8 @@ async function compileSwiftProjectOnce(
|
|
|
7893
8003
|
let mapped = flag
|
|
7894
8004
|
for (const [dir, target] of [
|
|
7895
8005
|
[root, '/peach/build'],
|
|
7896
|
-
[
|
|
7897
|
-
[realpathSync(
|
|
8006
|
+
[reproducibleFrameworkRoot, '/peach/framework'],
|
|
8007
|
+
[realpathSync(reproducibleFrameworkRoot), '/peach/framework'],
|
|
7898
8008
|
[toolchainDir, '/peach/toolchain'],
|
|
7899
8009
|
[realpathSync(toolchainDir), '/peach/toolchain'],
|
|
7900
8010
|
] as const) {
|
|
@@ -7934,8 +8044,14 @@ async function compileSwiftProjectOnce(
|
|
|
7934
8044
|
string,
|
|
7935
8045
|
{ file: string; header: string; module: boolean } | null
|
|
7936
8046
|
>()
|
|
8047
|
+
const compileSdkPaths = swiftSdkPaths(
|
|
8048
|
+
frameworkRoot,
|
|
8049
|
+
options.toolchainBin,
|
|
8050
|
+
compileSdk.options,
|
|
8051
|
+
compileSdk.id,
|
|
8052
|
+
)
|
|
7937
8053
|
const sdkFrameworks = path.join(
|
|
7938
|
-
|
|
8054
|
+
compileSdkPaths.darwin,
|
|
7939
8055
|
'System/Library/Frameworks',
|
|
7940
8056
|
)
|
|
7941
8057
|
const generatedInterface = (source: string) =>
|
|
@@ -8180,16 +8296,18 @@ async function compileSwiftProjectOnce(
|
|
|
8180
8296
|
options.toolchainBin,
|
|
8181
8297
|
recipe,
|
|
8182
8298
|
new Map(
|
|
8183
|
-
preparation.headerBuilds
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8299
|
+
preparation.headerBuilds
|
|
8300
|
+
.flatMap((stage) => stage.producers)
|
|
8301
|
+
.map((producer) => {
|
|
8302
|
+
const paths = headerPaths(producer)
|
|
8303
|
+
return [
|
|
8304
|
+
swiftTargetModuleName(producer),
|
|
8305
|
+
{
|
|
8306
|
+
header: paths.original,
|
|
8307
|
+
publish: () => publishHeader(paths),
|
|
8308
|
+
},
|
|
8309
|
+
]
|
|
8310
|
+
}),
|
|
8193
8311
|
),
|
|
8194
8312
|
runApp,
|
|
8195
8313
|
)
|
|
@@ -8290,7 +8408,7 @@ async function compileSwiftProjectOnce(
|
|
|
8290
8408
|
swiftCompiler: preparation.headerCompiler
|
|
8291
8409
|
? path.join(root, SWIFT_HEADER_COMPILER_WRAPPER)
|
|
8292
8410
|
: (compiler.SWIFT_EXEC ?? path.join(options.toolchainBin, 'swiftc')),
|
|
8293
|
-
sysroot:
|
|
8411
|
+
sysroot: compileSdkPaths.sysroot,
|
|
8294
8412
|
sdk: swiftModuleSdk(frameworkRoot),
|
|
8295
8413
|
sdkImage,
|
|
8296
8414
|
compilerDigest: compilerSourceDigest,
|
|
@@ -8320,9 +8438,7 @@ async function compileSwiftProjectOnce(
|
|
|
8320
8438
|
project: options.project && {
|
|
8321
8439
|
...options.project,
|
|
8322
8440
|
env: { ...options.project.env, ...projectProcess?.env },
|
|
8323
|
-
sdkRoot: path.dirname(
|
|
8324
|
-
swiftSdkPaths(frameworkRoot, options.toolchainBin).sysroot,
|
|
8325
|
-
),
|
|
8441
|
+
sdkRoot: path.dirname(compileSdkPaths.sysroot),
|
|
8326
8442
|
linked: output,
|
|
8327
8443
|
},
|
|
8328
8444
|
})
|