peachsim 0.1.1899 → 0.1.1901
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 +2 -2
- package/cli/account-gate.ts +1 -1
- package/cli/app-stubs.ts +1 -1
- package/cli/commands/box/checkout-plane.ts +1 -1
- package/cli/commands/box/search-command.ts +1 -1
- package/cli/commands/perf-record.ts +1 -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 +73 -56
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +49 -33
- 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 +83 -67
- 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 +31 -30
- 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 +29 -28
- package/dist-lib/native-app-identity-project.cjs +21 -20
- package/dist-lib/native-app-identity-project.mjs +21 -20
- 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 +53 -53
- 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 +118 -101
- package/dist-lib/swift-compile.cjs +25 -9
- package/dist-lib/swift-compile.mjs +25 -9
- 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 +3 -3
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +35 -19
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/kotlin/README.md +4 -4
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/assetCatalogContract.ts +1 -1
- package/src/bundle-channel.mjs +1 -1
- package/src/config.ts +2 -2
- package/src/device-catalog.ts +4 -4
- package/src/expo-native-prebuilt.ts +1 -1
- package/src/nitro-adapter.ts +1 -1
- package/src/nitro-dependencies.ts +1 -1
- package/src/settingsContract.ts +1 -1
- package/src/swift-compile.ts +23 -4
- package/src/swift-darwin-records.ts +1 -1
- package/src/swift-distribution-contract.ts +1 -1
- package/src/swift-distribution.ts +1 -1
- package/src/swift-guest-compile.ts +7 -1
- package/src/swift-guest-link.ts +3 -2
- package/src/swift-toolchain.ts +3 -2
package/src/swift-compile.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
} from 'node:fs'
|
|
26
26
|
import os from 'node:os'
|
|
27
27
|
import path from 'node:path'
|
|
28
|
+
import * as v from 'valibot'
|
|
28
29
|
import { windowAdmission } from './admitted-mac-build'
|
|
29
30
|
import cPredefinesJson from './generated/swift-c-predefines.json' with { type: 'json' }
|
|
30
31
|
import { terminateProcessGroup } from './process-group'
|
|
@@ -133,6 +134,10 @@ import {
|
|
|
133
134
|
type SwiftHeaderAliases,
|
|
134
135
|
type SwiftProjectPreparation,
|
|
135
136
|
} from './swiftContract'
|
|
137
|
+
import {
|
|
138
|
+
SWIFT_FRAMEWORK_PRODUCT_FILE,
|
|
139
|
+
swiftFrameworkProductSchema,
|
|
140
|
+
} from './swiftRuntimeProductContract'
|
|
136
141
|
import { optimizeWasm, WASM_OPTIMIZE_IDENTITY } from './wasm-optimize'
|
|
137
142
|
import { writeBuildFile } from './write-build-file'
|
|
138
143
|
import { writeXcodeHeaderSearch } from './xcode-header-search'
|
|
@@ -362,7 +367,7 @@ export interface SwiftProjectLayout {
|
|
|
362
367
|
* the prebuilt distribution at a module root, or null for a sootsim-swift
|
|
363
368
|
* source checkout. an installed peach links the distribution: compiled
|
|
364
369
|
* modules, one static library and host macro plugins, and no source
|
|
365
|
-
* (docs/swift
|
|
370
|
+
* (docs/peach/swift/distribution.md).
|
|
366
371
|
*/
|
|
367
372
|
export function swiftDistributionAt(root: string): SwiftDistributionManifest | null {
|
|
368
373
|
const file = path.join(root, SWIFT_DISTRIBUTION_MANIFEST)
|
|
@@ -1503,7 +1508,7 @@ const FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
|
1503
1508
|
const ONE_IMPLICIT_FLAGS = ', "-Xfrontend", "-import-module", "-Xfrontend", "One"'
|
|
1504
1509
|
|
|
1505
1510
|
// the executable link lines the template path and every emitted executable
|
|
1506
|
-
// target share (specs/peach
|
|
1511
|
+
// target share (specs/peach/swift/build-plans.md). clang runs `wasm-opt -Os`
|
|
1507
1512
|
// after a wasm link whenever the machine has one on PATH, which makes every
|
|
1508
1513
|
// edit pay for an optimizer pass and the artifact depend on the machine, so
|
|
1509
1514
|
// -O0 on the clang link turns that pass off everywhere. the build root's
|
|
@@ -1523,7 +1528,7 @@ const executableLinkFlags = (root: string) => ` "-Xclang-linker", "-O0"
|
|
|
1523
1528
|
`
|
|
1524
1529
|
// the Darwin module's providers link as an archive does, ahead of the sdk's
|
|
1525
1530
|
// libDarwinRecords.a, which supplies only what remains undefined
|
|
1526
|
-
// (specs/peach
|
|
1531
|
+
// (specs/peach/swift/darwin-libc-providers.md).
|
|
1527
1532
|
const darwinRecordsRegion = (quoted: readonly string[]): string[] =>
|
|
1528
1533
|
quoted.length ? ['-Wl,--start-lib', ...quoted, '-Wl,--end-lib'] : []
|
|
1529
1534
|
const REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n'
|
|
@@ -6956,7 +6961,21 @@ function compileSwiftProjectOnce(
|
|
|
6956
6961
|
report('framework revision changed; rebuilding the app link')
|
|
6957
6962
|
const nativeToolset = needsNativeToolset(input, prebuilt)
|
|
6958
6963
|
const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt)
|
|
6959
|
-
|
|
6964
|
+
// the framework objects link as inputs, so the product name its
|
|
6965
|
+
// modules autolink has no archive to load
|
|
6966
|
+
const productFile = path.join(frameworkRoot, SWIFT_FRAMEWORK_PRODUCT_FILE)
|
|
6967
|
+
writeSwiftAutolinkLinker(
|
|
6968
|
+
root,
|
|
6969
|
+
options.toolchainBin,
|
|
6970
|
+
existsSync(productFile)
|
|
6971
|
+
? [
|
|
6972
|
+
v.parse(
|
|
6973
|
+
swiftFrameworkProductSchema,
|
|
6974
|
+
JSON.parse(readFileSync(productFile, 'utf8')),
|
|
6975
|
+
).product.name,
|
|
6976
|
+
]
|
|
6977
|
+
: [],
|
|
6978
|
+
)
|
|
6960
6979
|
const projectProcess = options.project
|
|
6961
6980
|
? prepareSwiftProjectProcess(root, options.project)
|
|
6962
6981
|
: undefined
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// they compile in its view, with the records' shared sdk tree. the wasm sdk
|
|
4
4
|
// ships them as libDarwinRecords.a for its own clients; a distribution and a
|
|
5
5
|
// source checkout compile them from the same source as their Darwin module and
|
|
6
|
-
// link them ahead of that archive (specs/peach
|
|
6
|
+
// link them ahead of that archive (specs/peach/swift/darwin-libc-providers.md).
|
|
7
7
|
import { execFileSync } from 'node:child_process'
|
|
8
8
|
import { mkdtempSync, readdirSync, rmSync, symlinkSync } from 'node:fs'
|
|
9
9
|
import { tmpdir } from 'node:os'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// the prebuilt Swift distribution's shapes, shared by its builder
|
|
2
2
|
// (packages/sootsim-swift/scripts/build-distribution.ts), its publisher
|
|
3
3
|
// (scripts/ops/swift-distribution-publish.ts) and the CLI that installs it
|
|
4
|
-
// (swift-distribution.ts). docs/swift
|
|
4
|
+
// (swift-distribution.ts). docs/peach/swift/distribution.md owns the design.
|
|
5
5
|
import { isRecord } from './is-record'
|
|
6
6
|
import type { SwiftWasmSdk } from './swift-toolchain'
|
|
7
7
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// distribution from PEACH_SWIFT_ENDPOINT, or the public default when it is
|
|
5
5
|
// unset, verifies it against the lock this build carries, and unpacks it under
|
|
6
6
|
// the peach home
|
|
7
|
-
// (docs/swift
|
|
7
|
+
// (docs/peach/swift/distribution.md). no path here asks Contrast to compile.
|
|
8
8
|
import fs from 'node:fs'
|
|
9
9
|
import os from 'node:os'
|
|
10
10
|
import path from 'node:path'
|
|
@@ -421,9 +421,15 @@ export async function compileGuestLink(options: {
|
|
|
421
421
|
systemProviders,
|
|
422
422
|
hostImports: scope.hostImports,
|
|
423
423
|
})
|
|
424
|
+
// wasm-ld applies a --wrap by name, so the wrapped symbol and its wrapper keep theirs
|
|
425
|
+
const wrapped = new Set(
|
|
426
|
+
prepared.args.flatMap((arg) =>
|
|
427
|
+
arg.startsWith('--wrap=') ? [arg.slice(7), `__wrap_${arg.slice(7)}`] : [],
|
|
428
|
+
),
|
|
429
|
+
)
|
|
424
430
|
return {
|
|
425
431
|
...plan,
|
|
426
|
-
symbols: scope.definitions,
|
|
432
|
+
symbols: scope.definitions.filter((symbol) => !wrapped.has(symbol)),
|
|
427
433
|
directBindings: verified.directBindings,
|
|
428
434
|
}
|
|
429
435
|
},
|
package/src/swift-guest-link.ts
CHANGED
|
@@ -1012,8 +1012,9 @@ export function verifyGuestSymbolScopes(options: {
|
|
|
1012
1012
|
providers: new Map<string, number>(),
|
|
1013
1013
|
physicalModule: false,
|
|
1014
1014
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1015
|
+
// an internal reference is wasm-ld's own, such as the real half of a --wrap, with no object to scope
|
|
1016
|
+
if (object === '<internal>') {
|
|
1017
|
+
if (kind === 'definition of') record.physicalModule = true
|
|
1017
1018
|
} else {
|
|
1018
1019
|
const image = options.owners.get(object!)
|
|
1019
1020
|
if (image === undefined)
|
package/src/swift-toolchain.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// the one place that selects and verifies the toolchain app Swift compiles with.
|
|
2
2
|
// a binary .swiftmodule loads only in the compiler release that wrote it, so
|
|
3
3
|
// every caller names the release from packages/sootsim-swift/toolchain.json
|
|
4
|
-
// or the Swift distribution's lock (docs/swift
|
|
4
|
+
// or the Swift distribution's lock (docs/peach/swift/distribution.md).
|
|
5
5
|
//
|
|
6
6
|
// node builtins only: packages/sootsim-swift/scripts/build.sh imports this
|
|
7
7
|
// file straight from a checkout, with no install.
|
|
@@ -510,6 +510,7 @@ export const SWIFT_AUTOLINK_LINKER = '.peach-wasm-ld'
|
|
|
510
510
|
export function writeSwiftAutolinkLinker(
|
|
511
511
|
directory: string,
|
|
512
512
|
toolchainBin: string,
|
|
513
|
+
omitLibraries: readonly string[] = [],
|
|
513
514
|
): string {
|
|
514
515
|
const linker = path.join(directory, SWIFT_AUTOLINK_LINKER)
|
|
515
516
|
const script = `#!/bin/sh
|
|
@@ -518,7 +519,7 @@ for arg in "$@"; do
|
|
|
518
519
|
case $arg in
|
|
519
520
|
@*)
|
|
520
521
|
rsp=\${arg#@}
|
|
521
|
-
awk 'BEGIN { RS = " "; ORS = " " } /^"-l/ { if (seen[$0]++) next } { print }' "$rsp" > "$rsp.dedup"
|
|
522
|
+
awk 'BEGIN { RS = " "; ORS = " " } /^"-l/ { if (seen[$0]++) next }${omitLibraries.map((name) => ` $0 == "\\"-l${name}\\"" { next }`).join('')} { print }' "$rsp" > "$rsp.dedup"
|
|
522
523
|
mv "$rsp.dedup" "$rsp"
|
|
523
524
|
if [ "\${PEACH_DEFER_WASM_LINK:-}" = "1" ] && grep -q '"--start-lib"' "$rsp"; then
|
|
524
525
|
cp "$rsp" ${JSON.stringify(path.join(directory, '.peach-link.rsp'))}
|