peachsim 0.1.1814 → 0.1.1817
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/cli/commands/control.ts +5 -2
- package/cli/commands/inspect.ts +43 -385
- package/cli/commands/package.ts +88 -32
- package/cli/commands/runtime.ts +2 -2
- package/cli/outbound-endpoints.ts +2 -2
- package/cli/packaged-app-launcher.ts +6 -1
- 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 +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +5186 -5881
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +100 -16
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +3949 -4535
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +3724 -4482
- package/dist-lib/host/fetch-proxy-handler.cjs +25 -14
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +26 -36
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +26 -36
- package/dist-lib/native-app-identity-project.cjs +4 -23
- package/dist-lib/native-app-identity-project.mjs +4 -23
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +87 -76
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- 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 +1 -1
- package/dist-lib/skills.cjs +4265 -4982
- package/dist-lib/swift-compile.cjs +218 -243
- package/dist-lib/swift-compile.mjs +218 -243
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +274 -251
- package/dist-lib/vite.cjs +25 -14
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/nativeReplayContract.d.ts +2 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/answeredNativePackages.ts +41 -0
- package/src/cli-runtime.ts +34 -13
- package/src/expo-discovery-cache.ts +2 -0
- package/src/expo-kotlin-host.ts +11 -9
- package/src/expo-swift-host.ts +10 -6
- package/src/expo-swift-ready.ts +16 -2
- package/src/installed-native-libraries.ts +79 -18
- package/src/nitro-adapter.lock.json +240 -240
- package/src/nitro-bundle.ts +8 -6
- package/src/nitro-compile.ts +6 -3
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-dependencies.ts +8 -2
- package/src/nitro-source.ts +34 -3
- package/src/nitro-superset.lock.json +21 -253
- package/src/nitro-superset.ts +59 -63
- package/src/nitroContract.ts +26 -3
- package/src/react-native-bridge-modules.ts +2 -4
- package/src/runtime-delivery.ts +2 -2
- package/src/swift-compile.ts +260 -255
- package/src/swift-distribution.lock.json +9 -8
- package/src/swift-installed-targets.ts +13 -0
- package/src/swift-objc-standin.ts +10 -6
- package/src/swift-standins.ts +44 -14
- package/src/turbo-bundle.ts +20 -1
- package/src/turbo-compile.ts +6 -12
- package/src/turbo-runtime.lock.json +19 -19
- package/src/turbo-source.ts +18 -3
package/src/swift-compile.ts
CHANGED
|
@@ -796,7 +796,8 @@ const OPTIONAL_FRAMEWORK_DEPENDENCIES: Record<string, string[]> = {
|
|
|
796
796
|
TOCropViewController: [],
|
|
797
797
|
RiveRuntime: ['MetalKit'],
|
|
798
798
|
MetalKit: ['ModelIO'],
|
|
799
|
-
|
|
799
|
+
DatadogInternal: [],
|
|
800
|
+
DatadogCore: ['DatadogInternal'],
|
|
800
801
|
DatadogLogs: ['DatadogCore'],
|
|
801
802
|
DatadogRUM: ['DatadogCore'],
|
|
802
803
|
DatadogTrace: ['DatadogCore'],
|
|
@@ -6350,284 +6351,288 @@ export function compileSwiftProjectUnit(
|
|
|
6350
6351
|
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`,
|
|
6351
6352
|
)
|
|
6352
6353
|
}
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6354
|
+
// a distribution is immutable and builds no framework products, so app
|
|
6355
|
+
// roots compiling against it overlap and only its plugin check queues.
|
|
6356
|
+
const frameworkScratch = swiftFrameworkScratch(frameworkKey)
|
|
6357
|
+
const withFrameworkLock = <T>(
|
|
6358
|
+
work: (frameworkLease?: SwiftRootLease) => Promise<T>,
|
|
6359
|
+
) =>
|
|
6360
|
+
distribution
|
|
6361
|
+
? work()
|
|
6362
|
+
: withSwiftRootLock(frameworkScratch, work, options.signal)
|
|
6363
|
+
return withFrameworkLock(async (frameworkLease) => {
|
|
6364
|
+
const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey)
|
|
6365
|
+
report('preparing compiler plugins')
|
|
6366
|
+
const pluginsFor = (pluginLease?: SwiftRootLease) =>
|
|
6367
|
+
ensureMacroPlugins(
|
|
6359
6368
|
frameworkRoot,
|
|
6360
6369
|
options.toolchainBin,
|
|
6361
6370
|
options.release,
|
|
6362
6371
|
options.signal,
|
|
6363
|
-
|
|
6372
|
+
pluginLease,
|
|
6364
6373
|
)
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
|
|
6379
|
-
|
|
6380
|
-
|
|
6381
|
-
|
|
6382
|
-
|
|
6383
|
-
|
|
6384
|
-
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
toolchainBin: options.toolchainBin,
|
|
6402
|
-
plugins: macroPlugins,
|
|
6403
|
-
buildOptions,
|
|
6404
|
-
})
|
|
6405
|
-
await pruneFrameworkScratches(frameworkKey)
|
|
6406
|
-
}
|
|
6407
|
-
if (options.project) removeProjectLinks(root)
|
|
6408
|
-
if (
|
|
6409
|
-
retireStaleSwiftLink(
|
|
6410
|
-
root,
|
|
6411
|
-
swiftLinkStamp({
|
|
6412
|
-
frameworkKey,
|
|
6413
|
-
prebuilt,
|
|
6414
|
-
}),
|
|
6415
|
-
)
|
|
6416
|
-
)
|
|
6417
|
-
report('framework revision changed; rebuilding the app link')
|
|
6418
|
-
const preparation = writeSwiftProject(
|
|
6419
|
-
layout,
|
|
6374
|
+
const macroPlugins = distribution
|
|
6375
|
+
? await withSwiftRootLock(frameworkScratch, pluginsFor, options.signal)
|
|
6376
|
+
: await pluginsFor(frameworkLease)
|
|
6377
|
+
// memoized per toolchain, so only a process's first build waits on it,
|
|
6378
|
+
// and that one reads and gzips it while swift builds
|
|
6379
|
+
const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId
|
|
6380
|
+
const icu = swiftIcuAsset(options.toolchainBin, sdk)
|
|
6381
|
+
const buildOptions = {
|
|
6382
|
+
env: {
|
|
6383
|
+
...(options.project?.env ?? process.env),
|
|
6384
|
+
// shipped host plugins resolve against the selected compiler's runtime.
|
|
6385
|
+
...(process.platform === 'linux'
|
|
6386
|
+
? {
|
|
6387
|
+
LD_LIBRARY_PATH: [
|
|
6388
|
+
path.resolve(options.toolchainBin, '../lib/swift/linux'),
|
|
6389
|
+
path.resolve(options.toolchainBin, '../lib/swift/host'),
|
|
6390
|
+
process.env.LD_LIBRARY_PATH,
|
|
6391
|
+
]
|
|
6392
|
+
.filter(Boolean)
|
|
6393
|
+
.join(':'),
|
|
6394
|
+
}
|
|
6395
|
+
: {}),
|
|
6396
|
+
...(input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: '1' } : {}),
|
|
6397
|
+
},
|
|
6398
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
6399
|
+
timeout: options.timeoutMs,
|
|
6400
|
+
signal: options.signal,
|
|
6401
|
+
lease,
|
|
6402
|
+
frameworkLease,
|
|
6403
|
+
}
|
|
6404
|
+
let prebuilt: SwiftFrameworkProducts | undefined
|
|
6405
|
+
if (!distribution) {
|
|
6406
|
+
report('compiling framework products')
|
|
6407
|
+
prebuilt = await compileFrameworkProducts({
|
|
6408
|
+
moduleRoot: frameworkRoot,
|
|
6409
|
+
frameworkKey,
|
|
6420
6410
|
input,
|
|
6421
|
-
|
|
6422
|
-
|
|
6411
|
+
swift,
|
|
6412
|
+
sdk,
|
|
6413
|
+
toolchainBin: options.toolchainBin,
|
|
6414
|
+
plugins: macroPlugins,
|
|
6415
|
+
buildOptions,
|
|
6416
|
+
})
|
|
6417
|
+
await pruneFrameworkScratches(frameworkKey)
|
|
6418
|
+
}
|
|
6419
|
+
if (options.project) removeProjectLinks(root)
|
|
6420
|
+
if (
|
|
6421
|
+
retireStaleSwiftLink(
|
|
6422
|
+
root,
|
|
6423
|
+
swiftLinkStamp({
|
|
6424
|
+
frameworkKey,
|
|
6425
|
+
prebuilt,
|
|
6426
|
+
}),
|
|
6423
6427
|
)
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6428
|
+
)
|
|
6429
|
+
report('framework revision changed; rebuilding the app link')
|
|
6430
|
+
const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt)
|
|
6431
|
+
writeSwiftAutolinkLinker(root, options.toolchainBin)
|
|
6432
|
+
const projectProcess = options.project
|
|
6433
|
+
? prepareSwiftProjectProcess(root, options.project)
|
|
6434
|
+
: undefined
|
|
6435
|
+
const appOptions = projectProcess
|
|
6436
|
+
? {
|
|
6437
|
+
...buildOptions,
|
|
6438
|
+
uid: projectProcess.uid,
|
|
6439
|
+
gid: projectProcess.gid,
|
|
6440
|
+
confined: projectProcess.env,
|
|
6441
|
+
}
|
|
6442
|
+
: buildOptions
|
|
6443
|
+
const unprepared = preparation.targetFailures.map(
|
|
6444
|
+
(failure) => `error: target ${failure}`,
|
|
6445
|
+
)
|
|
6446
|
+
// a forwarder header (`#include "../../x.hpp"`) reaches its target
|
|
6447
|
+
// through `..`, which clang keeps in __FILE__, while the header
|
|
6448
|
+
// alias overlay names the same file directly. mapping each
|
|
6449
|
+
// forwarder spelling to the directory it reaches makes a debug
|
|
6450
|
+
// assert expand alike in every module that includes the header.
|
|
6451
|
+
const forwarders = new Map<string, string>()
|
|
6452
|
+
for (const [file, text] of Object.entries(input.files)) {
|
|
6453
|
+
const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text)?.[1]
|
|
6454
|
+
if (!parents) continue
|
|
6455
|
+
const directory = path.posix.dirname(file)
|
|
6456
|
+
forwarders.set(
|
|
6457
|
+
`${path.join(root, directory)}/${parents.slice(0, -1)}`,
|
|
6458
|
+
path.posix.join('build', directory, parents).replace(/\/$/, ''),
|
|
6438
6459
|
)
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6460
|
+
}
|
|
6461
|
+
const buildArgs = [
|
|
6462
|
+
'build',
|
|
6463
|
+
...(projectProcess?.cacheOptions ?? swiftPackageCacheOptions()),
|
|
6464
|
+
'--build-system',
|
|
6465
|
+
'native',
|
|
6466
|
+
'-j',
|
|
6467
|
+
BUILD_JOBS,
|
|
6468
|
+
'--package-path',
|
|
6469
|
+
root,
|
|
6470
|
+
...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
|
|
6471
|
+
'--swift-sdk',
|
|
6472
|
+
sdk,
|
|
6473
|
+
...(input.packageFiles || prebuilt
|
|
6474
|
+
? ['--toolset', path.join(root, '.peach-target-toolset.json')]
|
|
6475
|
+
: []),
|
|
6476
|
+
'-c',
|
|
6477
|
+
'release',
|
|
6478
|
+
'-Xswiftc',
|
|
6479
|
+
'-num-threads',
|
|
6480
|
+
'-Xswiftc',
|
|
6481
|
+
BUILD_JOBS,
|
|
6482
|
+
...swiftReproducibleBuildFlags([
|
|
6483
|
+
[path.dirname(options.toolchainBin), 'toolchain'],
|
|
6484
|
+
[frameworkRoot, 'framework'],
|
|
6485
|
+
[root, 'build'],
|
|
6486
|
+
...forwarders,
|
|
6487
|
+
]),
|
|
6488
|
+
...macroPlugins.libraries.flatMap((plugin) => [
|
|
6489
|
+
'-Xswiftc',
|
|
6490
|
+
'-load-plugin-library',
|
|
6491
|
+
'-Xswiftc',
|
|
6492
|
+
plugin,
|
|
6493
|
+
]),
|
|
6494
|
+
...macroPlugins.executables.flatMap((plugin) => [
|
|
6495
|
+
'-Xswiftc',
|
|
6496
|
+
'-load-plugin-executable',
|
|
6497
|
+
'-Xswiftc',
|
|
6498
|
+
`${plugin}#ExpoModulesMacros`,
|
|
6499
|
+
]),
|
|
6500
|
+
]
|
|
6501
|
+
const linked = builtArtifact(layout)
|
|
6502
|
+
if (input.lazyDistribution) {
|
|
6503
|
+
rmSync(path.join(root, '.peach-link.rsp'), { force: true })
|
|
6504
|
+
if (existsSync(linked) && statSync(linked).size <= 8)
|
|
6505
|
+
rmSync(linked, { force: true })
|
|
6506
|
+
}
|
|
6507
|
+
report('compiling and linking Swift modules')
|
|
6508
|
+
try {
|
|
6509
|
+
// clang consumes the real emitted headers after swift finishes.
|
|
6510
|
+
// swiftpm's transitive swift module maps are not C declarations:
|
|
6511
|
+
// importing them would shadow SDK modules such as ObjectiveC.
|
|
6512
|
+
const headerBuilds = preparation.headerProductTarget
|
|
6513
|
+
? [
|
|
6514
|
+
...Object.keys(preparation.nativeHeaderDeclarations),
|
|
6515
|
+
preparation.headerProductTarget,
|
|
6516
|
+
]
|
|
6517
|
+
: preparation.headerProducers
|
|
6518
|
+
for (const build of headerBuilds) {
|
|
6519
|
+
await runCompiler(
|
|
6520
|
+
swift,
|
|
6521
|
+
[...buildArgs, '--target', build],
|
|
6522
|
+
appOptions,
|
|
6523
|
+
SWIFTPM_PROGRESS,
|
|
6524
|
+
SWIFTPM_NOISE,
|
|
6452
6525
|
)
|
|
6526
|
+
for (const producer of build === preparation.headerProductTarget
|
|
6527
|
+
? preparation.headerProducers
|
|
6528
|
+
: [build]) {
|
|
6529
|
+
const emitted = path.join(
|
|
6530
|
+
root,
|
|
6531
|
+
'.build',
|
|
6532
|
+
'peach-cxx-headers',
|
|
6533
|
+
`${producer}-Swift.h`,
|
|
6534
|
+
)
|
|
6535
|
+
const original = preparation.nativeHeaderDeclarations[producer]
|
|
6536
|
+
? emitted.replace(/-Swift\.h$/, '-Swift.original.h')
|
|
6537
|
+
: emitted
|
|
6538
|
+
if (existsSync(original))
|
|
6539
|
+
writeBuildFile(
|
|
6540
|
+
emitted,
|
|
6541
|
+
withoutSwiftDeclarations(
|
|
6542
|
+
clangInterfaceHeader(readFileSync(original, 'utf8')),
|
|
6543
|
+
new Set(preparation.nativeHeaderDeclarations[producer]),
|
|
6544
|
+
`#import <${producer}/${producer}.h>`,
|
|
6545
|
+
),
|
|
6546
|
+
)
|
|
6547
|
+
}
|
|
6453
6548
|
}
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6549
|
+
await runCompiler(
|
|
6550
|
+
swift,
|
|
6551
|
+
buildArgs,
|
|
6552
|
+
appOptions,
|
|
6553
|
+
SWIFTPM_PROGRESS,
|
|
6554
|
+
SWIFTPM_NOISE,
|
|
6555
|
+
)
|
|
6556
|
+
} catch (error) {
|
|
6557
|
+
const output = outputOf(error)
|
|
6558
|
+
const moduleCache = path.join(
|
|
6462
6559
|
root,
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
sdk,
|
|
6466
|
-
...(input.packageFiles || prebuilt
|
|
6467
|
-
? ['--toolset', path.join(root, '.peach-target-toolset.json')]
|
|
6468
|
-
: []),
|
|
6469
|
-
'-c',
|
|
6560
|
+
'.build',
|
|
6561
|
+
WASM_TRIPLE,
|
|
6470
6562
|
'release',
|
|
6471
|
-
'
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
...forwarders,
|
|
6480
|
-
]),
|
|
6481
|
-
...macroPlugins.libraries.flatMap((plugin) => [
|
|
6482
|
-
'-Xswiftc',
|
|
6483
|
-
'-load-plugin-library',
|
|
6484
|
-
'-Xswiftc',
|
|
6485
|
-
plugin,
|
|
6486
|
-
]),
|
|
6487
|
-
...macroPlugins.executables.flatMap((plugin) => [
|
|
6488
|
-
'-Xswiftc',
|
|
6489
|
-
'-load-plugin-executable',
|
|
6490
|
-
'-Xswiftc',
|
|
6491
|
-
`${plugin}#ExpoModulesMacros`,
|
|
6492
|
-
]),
|
|
6493
|
-
]
|
|
6494
|
-
const linked = builtArtifact(layout)
|
|
6495
|
-
if (input.lazyDistribution) {
|
|
6496
|
-
rmSync(path.join(root, '.peach-link.rsp'), { force: true })
|
|
6497
|
-
if (existsSync(linked) && statSync(linked).size <= 8)
|
|
6498
|
-
rmSync(linked, { force: true })
|
|
6499
|
-
}
|
|
6500
|
-
report('compiling and linking Swift modules')
|
|
6501
|
-
try {
|
|
6502
|
-
// clang consumes the real emitted headers after swift finishes.
|
|
6503
|
-
// swiftpm's transitive swift module maps are not C declarations:
|
|
6504
|
-
// importing them would shadow SDK modules such as ObjectiveC.
|
|
6505
|
-
const headerBuilds = preparation.headerProductTarget
|
|
6506
|
-
? [
|
|
6507
|
-
...Object.keys(preparation.nativeHeaderDeclarations),
|
|
6508
|
-
preparation.headerProductTarget,
|
|
6509
|
-
]
|
|
6510
|
-
: preparation.headerProducers
|
|
6511
|
-
for (const build of headerBuilds) {
|
|
6563
|
+
'ModuleCache',
|
|
6564
|
+
)
|
|
6565
|
+
if (
|
|
6566
|
+
output.includes('was compiled with module cache path') &&
|
|
6567
|
+
existsSync(moduleCache)
|
|
6568
|
+
) {
|
|
6569
|
+
rmSync(moduleCache, { recursive: true, force: true })
|
|
6570
|
+
try {
|
|
6512
6571
|
await runCompiler(
|
|
6513
6572
|
swift,
|
|
6514
|
-
|
|
6573
|
+
buildArgs,
|
|
6515
6574
|
appOptions,
|
|
6516
6575
|
SWIFTPM_PROGRESS,
|
|
6517
6576
|
SWIFTPM_NOISE,
|
|
6518
6577
|
)
|
|
6519
|
-
|
|
6520
|
-
? preparation.headerProducers
|
|
6521
|
-
: [build]) {
|
|
6522
|
-
const emitted = path.join(
|
|
6523
|
-
root,
|
|
6524
|
-
'.build',
|
|
6525
|
-
'peach-cxx-headers',
|
|
6526
|
-
`${producer}-Swift.h`,
|
|
6527
|
-
)
|
|
6528
|
-
const original = preparation.nativeHeaderDeclarations[producer]
|
|
6529
|
-
? emitted.replace(/-Swift\.h$/, '-Swift.original.h')
|
|
6530
|
-
: emitted
|
|
6531
|
-
if (existsSync(original))
|
|
6532
|
-
writeBuildFile(
|
|
6533
|
-
emitted,
|
|
6534
|
-
withoutSwiftDeclarations(
|
|
6535
|
-
clangInterfaceHeader(readFileSync(original, 'utf8')),
|
|
6536
|
-
new Set(preparation.nativeHeaderDeclarations[producer]),
|
|
6537
|
-
`#import <${producer}/${producer}.h>`,
|
|
6538
|
-
),
|
|
6539
|
-
)
|
|
6540
|
-
}
|
|
6541
|
-
}
|
|
6542
|
-
await runCompiler(
|
|
6543
|
-
swift,
|
|
6544
|
-
buildArgs,
|
|
6545
|
-
appOptions,
|
|
6546
|
-
SWIFTPM_PROGRESS,
|
|
6547
|
-
SWIFTPM_NOISE,
|
|
6548
|
-
)
|
|
6549
|
-
} catch (error) {
|
|
6550
|
-
const output = outputOf(error)
|
|
6551
|
-
const moduleCache = path.join(
|
|
6552
|
-
root,
|
|
6553
|
-
'.build',
|
|
6554
|
-
WASM_TRIPLE,
|
|
6555
|
-
'release',
|
|
6556
|
-
'ModuleCache',
|
|
6557
|
-
)
|
|
6558
|
-
if (
|
|
6559
|
-
output.includes('was compiled with module cache path') &&
|
|
6560
|
-
existsSync(moduleCache)
|
|
6561
|
-
) {
|
|
6562
|
-
rmSync(moduleCache, { recursive: true, force: true })
|
|
6563
|
-
try {
|
|
6564
|
-
await runCompiler(
|
|
6565
|
-
swift,
|
|
6566
|
-
buildArgs,
|
|
6567
|
-
appOptions,
|
|
6568
|
-
SWIFTPM_PROGRESS,
|
|
6569
|
-
SWIFTPM_NOISE,
|
|
6570
|
-
)
|
|
6571
|
-
} catch (retryError) {
|
|
6572
|
-
throw new Error(
|
|
6573
|
-
[
|
|
6574
|
-
...unprepared,
|
|
6575
|
-
projectDiagnostic(outputOf(retryError), layout, input.files),
|
|
6576
|
-
].join('\n'),
|
|
6577
|
-
{ cause: retryError },
|
|
6578
|
-
)
|
|
6579
|
-
}
|
|
6580
|
-
} else {
|
|
6578
|
+
} catch (retryError) {
|
|
6581
6579
|
throw new Error(
|
|
6582
|
-
[
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6580
|
+
[
|
|
6581
|
+
...unprepared,
|
|
6582
|
+
projectDiagnostic(outputOf(retryError), layout, input.files),
|
|
6583
|
+
].join('\n'),
|
|
6584
|
+
{ cause: retryError },
|
|
6586
6585
|
)
|
|
6587
6586
|
}
|
|
6588
|
-
}
|
|
6589
|
-
// a manifest, macro or build tool can leave processes behind that
|
|
6590
|
-
// outlive the compiler's own group; none runs once the host reads.
|
|
6591
|
-
if (options.project) endSwiftProjectProcesses(options.project)
|
|
6592
|
-
}
|
|
6593
|
-
if (unprepared.length) throw new Error(unprepared.join('\n'))
|
|
6594
|
-
if (!existsSync(linked)) {
|
|
6595
|
-
const binDir = path.dirname(linked)
|
|
6596
|
-
const found = existsSync(binDir)
|
|
6597
|
-
? readdirSync(binDir)
|
|
6598
|
-
.filter((name) => name.endsWith('.wasm'))
|
|
6599
|
-
.sort()
|
|
6600
|
-
: []
|
|
6587
|
+
} else {
|
|
6601
6588
|
throw new Error(
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
const output = options.project
|
|
6607
|
-
? projectOutputFile(root, linked, options.project)
|
|
6608
|
-
: linked
|
|
6609
|
-
const optimized = `${output}.optimized`
|
|
6610
|
-
if (input.lazyDistribution) {
|
|
6611
|
-
pruneSwiftWasmLink(
|
|
6612
|
-
root,
|
|
6613
|
-
options.toolchainBin,
|
|
6614
|
-
frameworkRoot,
|
|
6615
|
-
input.staticClangTargets,
|
|
6589
|
+
[...unprepared, projectDiagnostic(output, layout, input.files)].join(
|
|
6590
|
+
'\n',
|
|
6591
|
+
),
|
|
6592
|
+
{ cause: error },
|
|
6616
6593
|
)
|
|
6617
|
-
await optimizeWasm(output, optimized)
|
|
6618
|
-
}
|
|
6619
|
-
const artifact = {
|
|
6620
|
-
hash,
|
|
6621
|
-
bytes: readFileSync(input.lazyDistribution ? optimized : output),
|
|
6622
|
-
icu: await icu,
|
|
6623
6594
|
}
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
}
|
|
6629
|
-
|
|
6630
|
-
|
|
6595
|
+
} finally {
|
|
6596
|
+
// a manifest, macro or build tool can leave processes behind that
|
|
6597
|
+
// outlive the compiler's own group; none runs once the host reads.
|
|
6598
|
+
if (options.project) endSwiftProjectProcesses(options.project)
|
|
6599
|
+
}
|
|
6600
|
+
if (unprepared.length) throw new Error(unprepared.join('\n'))
|
|
6601
|
+
if (!existsSync(linked)) {
|
|
6602
|
+
const binDir = path.dirname(linked)
|
|
6603
|
+
const found = existsSync(binDir)
|
|
6604
|
+
? readdirSync(binDir)
|
|
6605
|
+
.filter((name) => name.endsWith('.wasm'))
|
|
6606
|
+
.sort()
|
|
6607
|
+
: []
|
|
6608
|
+
throw new Error(
|
|
6609
|
+
`swift-compile: the build produced no ${path.basename(linked)} (found: ${found.join(', ') || 'none'})`,
|
|
6610
|
+
)
|
|
6611
|
+
}
|
|
6612
|
+
if (options.project) removeProjectLinks(root)
|
|
6613
|
+
const output = options.project
|
|
6614
|
+
? projectOutputFile(root, linked, options.project)
|
|
6615
|
+
: linked
|
|
6616
|
+
const optimized = `${output}.optimized`
|
|
6617
|
+
if (input.lazyDistribution) {
|
|
6618
|
+
pruneSwiftWasmLink(
|
|
6619
|
+
root,
|
|
6620
|
+
options.toolchainBin,
|
|
6621
|
+
frameworkRoot,
|
|
6622
|
+
input.staticClangTargets,
|
|
6623
|
+
)
|
|
6624
|
+
await optimizeWasm(output, optimized)
|
|
6625
|
+
}
|
|
6626
|
+
const artifact = {
|
|
6627
|
+
hash,
|
|
6628
|
+
bytes: readFileSync(input.lazyDistribution ? optimized : output),
|
|
6629
|
+
icu: await icu,
|
|
6630
|
+
}
|
|
6631
|
+
if (!options.project) saveCompiledArtifact(root, artifact)
|
|
6632
|
+
saveSharedArtifact(sharedRoot, artifact)
|
|
6633
|
+
report('compiled artifact verified')
|
|
6634
|
+
return retain(root, artifact)
|
|
6635
|
+
})
|
|
6631
6636
|
},
|
|
6632
6637
|
options.signal,
|
|
6633
6638
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "92d08dea86eafc17",
|
|
3
3
|
"release": "swift-6.4.0-RELEASE-custom-a560ff35bf882b5c",
|
|
4
4
|
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-5d385b68",
|
|
5
5
|
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-5d385b68.artifactbundle.tar.gz",
|
|
6
6
|
"wasmSdkChecksum": "d91882af99821a296c3db4459896b46ceaef37e9a30caad14e5f24cf6b964ae9",
|
|
7
|
-
"source": "
|
|
7
|
+
"source": "e5fb86f09228f6a9802a802657fea000ed6a3118",
|
|
8
8
|
"targets": [
|
|
9
9
|
"ImagePlayground",
|
|
10
10
|
"QuickLookThumbnailing",
|
|
@@ -138,6 +138,7 @@
|
|
|
138
138
|
"ModelIOEnums",
|
|
139
139
|
"ModelIO",
|
|
140
140
|
"MetalKit",
|
|
141
|
+
"DatadogInternal",
|
|
141
142
|
"DatadogCore",
|
|
142
143
|
"DatadogLogs",
|
|
143
144
|
"DatadogRUM",
|
|
@@ -230,16 +231,16 @@
|
|
|
230
231
|
},
|
|
231
232
|
"hosts": {
|
|
232
233
|
"darwin-arm64": {
|
|
233
|
-
"sha256": "
|
|
234
|
-
"size":
|
|
234
|
+
"sha256": "b97c1ef24c74d88fe5b03240ac21017959884861a7ab3d298bc4b97e74e1bd02",
|
|
235
|
+
"size": 98848007
|
|
235
236
|
},
|
|
236
237
|
"linux-x64": {
|
|
237
|
-
"sha256": "
|
|
238
|
-
"size":
|
|
238
|
+
"sha256": "2beb12ad379dc2e618029a69c36b92d55c8f1b43b78e9600d97c13f17a1dab8f",
|
|
239
|
+
"size": 101566420
|
|
239
240
|
},
|
|
240
241
|
"linux-arm64": {
|
|
241
|
-
"sha256": "
|
|
242
|
-
"size":
|
|
242
|
+
"sha256": "5ea72a514d3f67aaf477babb848c14177b57b6cbc1671ea075075586a4c38d6a",
|
|
243
|
+
"size": 101056003
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
}
|
|
@@ -137,6 +137,19 @@ export function applyInstalledSwiftTargets(
|
|
|
137
137
|
const module = moduleMapName(snapshot.input.files[file] ?? '')
|
|
138
138
|
return !collection.targets.some((target) => target.name === module)
|
|
139
139
|
})
|
|
140
|
+
// a header the installed search paths already supply, and its module covers,
|
|
141
|
+
// must not also reach the target as a second textual copy
|
|
142
|
+
for (const file of Object.keys(collection.files)) {
|
|
143
|
+
const prefix = `${generated.path}/include/`
|
|
144
|
+
if (!file.startsWith(prefix)) continue
|
|
145
|
+
const include = file.slice(prefix.length)
|
|
146
|
+
if (
|
|
147
|
+
native.headerSearchPaths.some(
|
|
148
|
+
(directory) => snapshot.input.files[`${directory}/${include}`] !== undefined,
|
|
149
|
+
)
|
|
150
|
+
)
|
|
151
|
+
delete collection.files[file]
|
|
152
|
+
}
|
|
140
153
|
const flags = originalModuleFlags(native.flags)
|
|
141
154
|
generated.clangSettings = [
|
|
142
155
|
{ tool: 'c', flags: [...flags, ...ndebug, ...search] },
|
|
@@ -242,16 +242,20 @@ function iosSdkEntries(): (readonly [string, string])[] {
|
|
|
242
242
|
return [...headers, ...overlays].sort(([a], [b]) => (a < b ? -1 : 1))
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
.
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
let sdkId: string | undefined
|
|
246
|
+
/** the sdk's content digest, which keys every stand-in read through it. taken on first
|
|
247
|
+
* use: it reads every header, and the cli's service boot imports this module. */
|
|
248
|
+
export function iosSdkId(): string {
|
|
249
|
+
return (sdkId ??= createHash('sha256')
|
|
250
|
+
.update(JSON.stringify(iosSdkEntries()))
|
|
251
|
+
.digest('hex')
|
|
252
|
+
.slice(0, 16))
|
|
253
|
+
}
|
|
250
254
|
|
|
251
255
|
// the sdk, written once per content under the cache directory so the module
|
|
252
256
|
// cache keyed by its paths stays warm across stand-ins.
|
|
253
257
|
export function materializeObjcSdk(cacheDir: string): string {
|
|
254
|
-
const sdk = path.join(cacheDir, 'ios-sdk',
|
|
258
|
+
const sdk = path.join(cacheDir, 'ios-sdk', iosSdkId())
|
|
255
259
|
if (fs.existsSync(sdk)) return sdk
|
|
256
260
|
fs.mkdirSync(path.dirname(sdk), { recursive: true })
|
|
257
261
|
const staging = fs.mkdtempSync(`${sdk}-`)
|