peachsim 0.1.1640 → 0.1.1644
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/README.md +5 -0
- package/cli/app-bundle-resources.ts +57 -0
- package/cli/app-stubs.ts +38 -13
- package/cli/cloud-session.ts +16 -0
- package/cli/commands/assert.ts +17 -4
- package/cli/commands/box.ts +33 -19
- package/cli/commands/control.ts +12 -0
- package/cli/commands/doctor.ts +24 -15
- package/cli/commands/inspect/actions.ts +3 -2
- package/cli/commands/inspect/core.ts +0 -8
- package/cli/commands/inspect.ts +0 -14
- package/cli/commands/platform.ts +2 -1
- package/cli/commands/record.ts +64 -28
- package/cli/commands/swift.ts +10 -2
- package/cli/commands/three-mode.ts +4 -38
- package/cli/commands/upload.ts +8 -8
- package/cli/drivers/playwright.ts +39 -0
- package/cli/flow-live-status.ts +0 -2
- package/cli/main.ts +1 -1
- package/cli/outbound-endpoints.ts +4 -2
- package/cli/ws-bridge.ts +0 -6
- package/detox/attempt-events.cjs +41 -5
- package/detox/index.ts +155 -109
- package/detox/jest-environment.cjs +5 -1
- package/detox/motion-change.cjs +7 -5
- package/detox/motion-change.d.cts +1 -0
- package/detox/motion-leg-starts.cjs +20 -0
- package/detox/motion-leg-starts.d.cts +8 -0
- 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 +12 -3
- 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 +2671 -1833
- 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 +578 -130
- package/dist-lib/detox/jest-environment.cjs +5 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +2374 -1554
- 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 +2968 -2141
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- 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 +132 -57
- 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 +14 -6
- package/dist-lib/menu.mjs +14 -6
- 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 +120 -53
- package/dist-lib/native-app-identity-project.cjs +96 -44
- package/dist-lib/native-app-identity-project.mjs +95 -44
- 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/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/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +5 -3
- package/dist-lib/sdk.mjs +5 -3
- package/dist-lib/skills.cjs +3932 -2868
- package/dist-lib/swift-compile.cjs +587 -374
- package/dist-lib/swift-compile.mjs +595 -369
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +8 -3
- package/dist-lib/swift-submit.mjs +8 -3
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2263 -1467
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/appBundleResourcesContract.ts +51 -0
- package/src/backend-origin.ts +11 -1
- package/src/host/bridge-host.ts +17 -11
- package/src/host/staged-host-files.ts +28 -4
- package/src/launchMetadataContract.ts +1 -0
- package/src/menu.ts +12 -4
- package/src/native-app-identity-project.ts +47 -38
- package/src/react-native-bridge-modules.ts +89 -76
- package/src/runtime-delivery.ts +6 -7
- package/src/swift-compile.ts +150 -112
- package/src/swift-compiler-digest.ts +5 -3
- package/src/swift-distribution.lock.json +9 -8
- package/src/swift-host.ts +6 -4
- package/src/swift-objc-compile.ts +416 -194
- package/src/swift-objc-metadata.ts +204 -0
- package/src/swift-objc-sdk.ts +195 -2
- package/src/swift-package-manifest.ts +6 -3
- package/src/swift-root-lock.ts +302 -0
- package/src/swift-submit.ts +15 -2
- package/src/swiftContract.ts +12 -0
- package/src/xcode-project.ts +77 -7
package/src/swift-compile.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
spawn,
|
|
3
|
+
execFileSync,
|
|
4
|
+
type ExecFileOptions,
|
|
5
|
+
type SpawnOptions,
|
|
6
|
+
} from 'node:child_process'
|
|
2
7
|
import { createHash } from 'node:crypto'
|
|
3
8
|
import {
|
|
4
9
|
cpSync,
|
|
@@ -33,6 +38,7 @@ import {
|
|
|
33
38
|
swiftTargetModuleName,
|
|
34
39
|
type SwiftPackageTarget,
|
|
35
40
|
} from './swift-package'
|
|
41
|
+
import { withSwiftRootLock, type SwiftRootLease } from './swift-root-lock'
|
|
36
42
|
import { swiftEnvironment, swiftSdkOptions, type SwiftWasmSdk } from './swift-toolchain'
|
|
37
43
|
import { isSwiftResourceBundles } from './swiftContract'
|
|
38
44
|
import type { SwiftImageUpload } from './swift-submit'
|
|
@@ -42,24 +48,29 @@ export { swiftIcuAsset, type SwiftIcuAsset }
|
|
|
42
48
|
|
|
43
49
|
// compiler drivers own descendants such as admission and swiftpm workers.
|
|
44
50
|
// cancellation waits for their pipes to close before releasing the build root.
|
|
51
|
+
// a `lease` records the group under the root's lock, so the root stays held
|
|
52
|
+
// while the compiler lives even if this process does not.
|
|
45
53
|
// `stream` echoes the output as it arrives: all of it, or only matching lines.
|
|
46
54
|
// a successful run then echoes the rest minus lines matching `quiet`, its
|
|
47
55
|
// warnings; a failed run's output goes to the caller's one diagnostic.
|
|
48
56
|
async function runCompiler(
|
|
49
57
|
command: string,
|
|
50
58
|
args: string[],
|
|
51
|
-
options: ExecFileOptions & { signal?: AbortSignal },
|
|
59
|
+
options: ExecFileOptions & { signal?: AbortSignal; lease?: SwiftRootLease },
|
|
52
60
|
stream: boolean | RegExp = false,
|
|
53
61
|
quiet?: RegExp,
|
|
54
62
|
): Promise<void> {
|
|
55
63
|
const { signal } = options
|
|
56
64
|
signal?.throwIfAborted()
|
|
57
|
-
const
|
|
65
|
+
const launch = {
|
|
58
66
|
cwd: options.cwd,
|
|
59
67
|
env: swiftEnvironment(options.env),
|
|
60
68
|
detached: true,
|
|
61
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
62
|
-
}
|
|
69
|
+
stdio: ['ignore', 'pipe', 'pipe'] as ['ignore', 'pipe', 'pipe'],
|
|
70
|
+
} satisfies SpawnOptions
|
|
71
|
+
const child = options.lease
|
|
72
|
+
? options.lease.spawn(command, args, launch)
|
|
73
|
+
: spawn(command, args, launch)
|
|
63
74
|
let stopping: Promise<void> | undefined
|
|
64
75
|
try {
|
|
65
76
|
await new Promise<void>((resolve, reject) => {
|
|
@@ -178,6 +189,8 @@ export interface SwiftCompileOptions {
|
|
|
178
189
|
toolchainBin: string
|
|
179
190
|
timeoutMs?: number
|
|
180
191
|
signal?: AbortSignal
|
|
192
|
+
/** called as the compile reaches each stage, in addition to the stderr line. */
|
|
193
|
+
onStage?: (stage: string) => void
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
export interface SwiftCompileArtifact {
|
|
@@ -948,9 +961,10 @@ export function emitSwiftPackageManifest(args: {
|
|
|
948
961
|
// compiled: whole, and ahead of the sdk libraries, so PeachICU's
|
|
949
962
|
// reservation keeps icu's data member out. merged into one relocatable
|
|
950
963
|
// object (wasm-ld -r) or linked from an archive, a protocol conformance
|
|
951
|
-
// goes unfound at runtime or icu links twice (RAN, the Expo fixture).
|
|
952
|
-
//
|
|
953
|
-
//
|
|
964
|
+
// goes unfound at runtime or icu links twice (RAN, the Expo fixture).
|
|
965
|
+
// clang loads configuration inputs before command-line libraries. forward
|
|
966
|
+
// the file opaquely so swift neither expands it nor scans every framework
|
|
967
|
+
// object for autolinks; distribution.link supplies those libraries.
|
|
954
968
|
const imports = distribution
|
|
955
969
|
? `, "-I", ${JSON.stringify(path.join(moduleRoot, 'modules'))}`
|
|
956
970
|
: ''
|
|
@@ -994,7 +1008,7 @@ export function emitSwiftPackageManifest(args: {
|
|
|
994
1008
|
].join(', ')
|
|
995
1009
|
const library =
|
|
996
1010
|
distribution && distributionLink
|
|
997
|
-
? ['-
|
|
1011
|
+
? ['-Xclang-linker', `--config=${distributionLink.path}`, ...distribution.link]
|
|
998
1012
|
.map((flag) => `, ${JSON.stringify(flag)}`)
|
|
999
1013
|
.join('')
|
|
1000
1014
|
: ''
|
|
@@ -6149,8 +6163,10 @@ export function compileSwiftProjectUnit(
|
|
|
6149
6163
|
}
|
|
6150
6164
|
const hash = swiftArtifactHash(input, options.release, moduleRoot)
|
|
6151
6165
|
const sharedRoot = path.join(rnxHomeDir(), 'cache', 'swift-projects', hash)
|
|
6152
|
-
const report = (message: string) =>
|
|
6166
|
+
const report = (message: string) => {
|
|
6153
6167
|
console.error(`[swift-project ${hash.slice(0, 16)}] ${message}`)
|
|
6168
|
+
options.onStage?.(message)
|
|
6169
|
+
}
|
|
6154
6170
|
report('checking verified artifacts')
|
|
6155
6171
|
return serialize(
|
|
6156
6172
|
root,
|
|
@@ -6232,88 +6248,85 @@ export function compileSwiftProjectUnit(
|
|
|
6232
6248
|
rmSync(requestRoot, { recursive: true, force: true })
|
|
6233
6249
|
}
|
|
6234
6250
|
}
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
throw new Error(
|
|
6239
|
-
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`,
|
|
6240
|
-
)
|
|
6241
|
-
}
|
|
6242
|
-
report('preparing compiler plugins')
|
|
6243
|
-
const macroPlugins = await ensureMacroPlugins(
|
|
6244
|
-
moduleRoot,
|
|
6245
|
-
options.toolchainBin,
|
|
6246
|
-
options.release,
|
|
6247
|
-
options.signal,
|
|
6248
|
-
)
|
|
6249
|
-
// memoized per toolchain, so only a process's first build waits on it,
|
|
6250
|
-
// and that one reads and gzips it while swift builds
|
|
6251
|
-
const sdk = swiftModuleSdk(moduleRoot).wasmSdkId
|
|
6252
|
-
const icu = swiftIcuAsset(options.toolchainBin, sdk)
|
|
6253
|
-
const buildArgs = [
|
|
6254
|
-
'build',
|
|
6255
|
-
...swiftPackageCacheOptions(),
|
|
6256
|
-
'--build-system',
|
|
6257
|
-
'native',
|
|
6258
|
-
'-j',
|
|
6259
|
-
BUILD_JOBS,
|
|
6260
|
-
'--package-path',
|
|
6251
|
+
// the root's sources, manifest and executable are shared by every process
|
|
6252
|
+
// using it, so one process writes, builds and reads them at a time.
|
|
6253
|
+
return withSwiftRootLock(
|
|
6261
6254
|
root,
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6255
|
+
async (lease) => {
|
|
6256
|
+
// a process that held the root while this one waited may have built
|
|
6257
|
+
// this exact address.
|
|
6258
|
+
const built = readCompiledArtifact(path.join(sharedRoot, 'artifact'), hash)
|
|
6259
|
+
if (built) {
|
|
6260
|
+
report('reusing verified disk artifact')
|
|
6261
|
+
return retain(root, built)
|
|
6262
|
+
}
|
|
6263
|
+
writeSwiftProject(layout, input, moduleRoot)
|
|
6264
|
+
const swift = path.join(options.toolchainBin, 'swift')
|
|
6265
|
+
if (!existsSync(swift)) {
|
|
6266
|
+
throw new Error(
|
|
6267
|
+
`swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`,
|
|
6268
|
+
)
|
|
6269
|
+
}
|
|
6270
|
+
report('preparing compiler plugins')
|
|
6271
|
+
const macroPlugins = await ensureMacroPlugins(
|
|
6272
|
+
moduleRoot,
|
|
6273
|
+
options.toolchainBin,
|
|
6274
|
+
options.release,
|
|
6275
|
+
options.signal,
|
|
6276
|
+
)
|
|
6277
|
+
// memoized per toolchain, so only a process's first build waits on it,
|
|
6278
|
+
// and that one reads and gzips it while swift builds
|
|
6279
|
+
const sdk = swiftModuleSdk(moduleRoot).wasmSdkId
|
|
6280
|
+
const icu = swiftIcuAsset(options.toolchainBin, sdk)
|
|
6281
|
+
const buildArgs = [
|
|
6282
|
+
'build',
|
|
6283
|
+
...swiftPackageCacheOptions(),
|
|
6284
|
+
'--build-system',
|
|
6285
|
+
'native',
|
|
6286
|
+
'-j',
|
|
6287
|
+
BUILD_JOBS,
|
|
6288
|
+
'--package-path',
|
|
6289
|
+
root,
|
|
6290
|
+
...swiftSdkOptions(),
|
|
6291
|
+
'--swift-sdk',
|
|
6292
|
+
sdk,
|
|
6293
|
+
'-c',
|
|
6294
|
+
'release',
|
|
6295
|
+
'-Xswiftc',
|
|
6296
|
+
'-Osize',
|
|
6297
|
+
'-Xswiftc',
|
|
6298
|
+
'-num-threads',
|
|
6299
|
+
'-Xswiftc',
|
|
6300
|
+
BUILD_JOBS,
|
|
6301
|
+
...macroPlugins.flatMap((plugin) => [
|
|
6302
|
+
'-Xswiftc',
|
|
6303
|
+
'-load-plugin-library',
|
|
6304
|
+
'-Xswiftc',
|
|
6305
|
+
plugin,
|
|
6306
|
+
]),
|
|
6307
|
+
]
|
|
6308
|
+
const buildOptions = {
|
|
6309
|
+
env: {
|
|
6310
|
+
...process.env,
|
|
6311
|
+
// shipped host plugins resolve against the selected compiler's runtime.
|
|
6312
|
+
...(process.platform === 'linux'
|
|
6313
|
+
? {
|
|
6314
|
+
LD_LIBRARY_PATH: [
|
|
6315
|
+
path.resolve(options.toolchainBin, '../lib/swift/linux'),
|
|
6316
|
+
path.resolve(options.toolchainBin, '../lib/swift/host'),
|
|
6317
|
+
process.env.LD_LIBRARY_PATH,
|
|
6318
|
+
]
|
|
6319
|
+
.filter(Boolean)
|
|
6320
|
+
.join(':'),
|
|
6321
|
+
}
|
|
6322
|
+
: {}),
|
|
6323
|
+
},
|
|
6324
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
6325
|
+
timeout: options.timeoutMs,
|
|
6326
|
+
signal: options.signal,
|
|
6327
|
+
lease,
|
|
6328
|
+
}
|
|
6329
|
+
report('compiling and linking Swift modules')
|
|
6317
6330
|
try {
|
|
6318
6331
|
await runCompiler(
|
|
6319
6332
|
swift,
|
|
@@ -6322,29 +6335,54 @@ export function compileSwiftProjectUnit(
|
|
|
6322
6335
|
SWIFTPM_PROGRESS,
|
|
6323
6336
|
SWIFTPM_NOISE,
|
|
6324
6337
|
)
|
|
6325
|
-
} catch (
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6338
|
+
} catch (error) {
|
|
6339
|
+
const output = outputOf(error)
|
|
6340
|
+
const moduleCache = path.join(
|
|
6341
|
+
root,
|
|
6342
|
+
'.build',
|
|
6343
|
+
WASM_TRIPLE,
|
|
6344
|
+
'release',
|
|
6345
|
+
'ModuleCache',
|
|
6331
6346
|
)
|
|
6347
|
+
if (
|
|
6348
|
+
output.includes('was compiled with module cache path') &&
|
|
6349
|
+
existsSync(moduleCache)
|
|
6350
|
+
) {
|
|
6351
|
+
rmSync(moduleCache, { recursive: true, force: true })
|
|
6352
|
+
try {
|
|
6353
|
+
await runCompiler(
|
|
6354
|
+
swift,
|
|
6355
|
+
buildArgs,
|
|
6356
|
+
buildOptions,
|
|
6357
|
+
SWIFTPM_PROGRESS,
|
|
6358
|
+
SWIFTPM_NOISE,
|
|
6359
|
+
)
|
|
6360
|
+
} catch (retryError) {
|
|
6361
|
+
throw new Error(
|
|
6362
|
+
projectDiagnostic(outputOf(retryError), layout, input.files),
|
|
6363
|
+
{
|
|
6364
|
+
cause: retryError,
|
|
6365
|
+
},
|
|
6366
|
+
)
|
|
6367
|
+
}
|
|
6368
|
+
} else {
|
|
6369
|
+
throw new Error(projectDiagnostic(output, layout, input.files), {
|
|
6370
|
+
cause: error,
|
|
6371
|
+
})
|
|
6372
|
+
}
|
|
6332
6373
|
}
|
|
6333
|
-
|
|
6334
|
-
|
|
6335
|
-
|
|
6336
|
-
|
|
6337
|
-
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
saveCompiledArtifact(sharedRoot, artifact)
|
|
6346
|
-
report('compiled artifact verified')
|
|
6347
|
-
return retain(root, artifact)
|
|
6374
|
+
const artifact = {
|
|
6375
|
+
hash,
|
|
6376
|
+
bytes: readFileSync(builtArtifact(layout)),
|
|
6377
|
+
icu: await icu,
|
|
6378
|
+
}
|
|
6379
|
+
saveCompiledArtifact(root, artifact)
|
|
6380
|
+
saveCompiledArtifact(sharedRoot, artifact)
|
|
6381
|
+
report('compiled artifact verified')
|
|
6382
|
+
return retain(root, artifact)
|
|
6383
|
+
},
|
|
6384
|
+
options.signal,
|
|
6385
|
+
)
|
|
6348
6386
|
},
|
|
6349
6387
|
options.signal,
|
|
6350
6388
|
)
|
|
@@ -3,11 +3,13 @@ import { readFileSync } from 'node:fs'
|
|
|
3
3
|
import path from 'node:path'
|
|
4
4
|
|
|
5
5
|
// the lowering and manifest code in swift-compile.ts and its design-time lowering
|
|
6
|
-
// decide the emitted output,
|
|
7
|
-
//
|
|
6
|
+
// decide the emitted output, and the root lock decides whose sources and
|
|
7
|
+
// executable an address names, so their text addresses every swift artifact.
|
|
8
|
+
// bundled builds cannot read these files at runtime, so build-cli injects this
|
|
9
|
+
// digest.
|
|
8
10
|
export function swiftCompilerSourceDigest(srcDir: string): string {
|
|
9
11
|
const hash = createHash('sha256')
|
|
10
|
-
for (const file of ['swift-compile.ts', 'swift-design-time.ts']) {
|
|
12
|
+
for (const file of ['swift-compile.ts', 'swift-design-time.ts', 'swift-root-lock.ts']) {
|
|
11
13
|
hash.update(readFileSync(path.join(srcDir, file)))
|
|
12
14
|
}
|
|
13
15
|
return hash.digest('hex')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "e8dd3a9ff9c4dc74",
|
|
3
3
|
"release": "swift-6.4.0-RELEASE-custom-0d775d32d7c74eae",
|
|
4
4
|
"wasmSdkId": "swift-6.4.0-RELEASE_wasm-peach-21f60db0",
|
|
5
5
|
"wasmSdkUrl": "https://r2.sootsim.com/swift-wasm-sdk/swift-6.4.0-RELEASE_wasm-peach-21f60db0.artifactbundle.tar.gz",
|
|
6
6
|
"wasmSdkChecksum": "7b7573fd23120549fc928581a42968676f5f00f9ef63e5618032a6928a724e16",
|
|
7
|
-
"source": "
|
|
7
|
+
"source": "693296741f3865605388c21ee7e220cb0b6ccaa3",
|
|
8
8
|
"targets": [
|
|
9
9
|
"ImagePlayground",
|
|
10
10
|
"QuickLookThumbnailing",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"Darwin",
|
|
47
47
|
"MachO",
|
|
48
48
|
"ObjectiveC",
|
|
49
|
+
"PeachObjCRuntime",
|
|
49
50
|
"PeachObjC",
|
|
50
51
|
"UIUtilities",
|
|
51
52
|
"UIKitCore",
|
|
@@ -191,16 +192,16 @@
|
|
|
191
192
|
},
|
|
192
193
|
"hosts": {
|
|
193
194
|
"darwin-arm64": {
|
|
194
|
-
"sha256": "
|
|
195
|
-
"size":
|
|
195
|
+
"sha256": "0e06928cd63077f30226a27b2a3e92e89bdcaaf2fcd57fcac6a38a8465ee6865",
|
|
196
|
+
"size": 71438614
|
|
196
197
|
},
|
|
197
198
|
"linux-x64": {
|
|
198
|
-
"sha256": "
|
|
199
|
-
"size":
|
|
199
|
+
"sha256": "baae9a89308dfde3cc47366ab4163369ac8537274361d10381004f006a965afa",
|
|
200
|
+
"size": 71444190
|
|
200
201
|
},
|
|
201
202
|
"linux-arm64": {
|
|
202
|
-
"sha256": "
|
|
203
|
-
"size":
|
|
203
|
+
"sha256": "422e2fbd6f65a8aebe0456e9becc2a6a28505825457c9758e8275f35e2fe63f1",
|
|
204
|
+
"size": 71442522
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
}
|
package/src/swift-host.ts
CHANGED
|
@@ -1401,10 +1401,11 @@ async function compile(
|
|
|
1401
1401
|
throw new SwiftMissingModulesError(await missingModulesMessage(packagePath, missing))
|
|
1402
1402
|
const artifact = await compileSwiftProjectUnit(input, {
|
|
1403
1403
|
// the compile rewrites Sources/App in its root before swiftpm builds, and
|
|
1404
|
-
//
|
|
1405
|
-
// server and a capture, or two checkouts)
|
|
1406
|
-
// each app and module checkout gets
|
|
1407
|
-
//
|
|
1404
|
+
// a root lock orders every process using it, so two vites on one root
|
|
1405
|
+
// (a lane's dev server and a capture, or two checkouts) queue instead of
|
|
1406
|
+
// building each other's sources. each app and module checkout still gets
|
|
1407
|
+
// its own root, so they do not queue and the same app keeps its
|
|
1408
|
+
// incremental build across restarts.
|
|
1408
1409
|
buildRoot: (() => {
|
|
1409
1410
|
if (process.env.CONTRAST_SWIFT_BUILD_ROOT)
|
|
1410
1411
|
return process.env.CONTRAST_SWIFT_BUILD_ROOT
|
|
@@ -1656,6 +1657,7 @@ async function compileRemote(
|
|
|
1656
1657
|
},
|
|
1657
1658
|
origin,
|
|
1658
1659
|
signal,
|
|
1660
|
+
(stage) => console.error(`Peach: compiling ${path.basename(packagePath)}: ${stage}`),
|
|
1659
1661
|
)
|
|
1660
1662
|
// the app's JS calls with the hash its own `one typegen` wrote; glue the
|
|
1661
1663
|
// service rendered from another One would reject every call as stale.
|