peachsim 0.1.2432 → 0.1.2434
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/app-project.ts +5 -0
- package/cli/commands/box.ts +3 -0
- package/cli/commands/control.ts +14 -6
- package/cli/commands/platform.ts +3 -3
- package/cli/commands/stream.ts +8 -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 +105 -85
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +59 -18
- 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 +96 -76
- package/dist-lib/host/fetch-proxy-handler.cjs +6 -4
- 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 +6 -4
- 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 +36 -57
- 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 +6 -4
- package/dist-lib/native-app-identity-project.cjs +2 -2
- package/dist-lib/native-app-identity-project.mjs +2 -2
- 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 +25 -25
- package/dist-lib/public-origins-lib.json +56 -56
- 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 +112 -79
- package/dist-lib/swift-compile.cjs +25 -16
- package/dist-lib/swift-compile.mjs +25 -16
- 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 +61 -22
- package/dist-lib/vite.cjs +6 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/image-loader-canvaskit.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +3 -2
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -1
- package/dist-types/packages/peach-globals/src/cameraInputBridgeContract.d.ts +26 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +2 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -0
- package/kotlin/README.md +3 -1
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/java-module-abi.ts +11 -28
- package/src/kotlin-host.ts +13 -32
- package/src/kotlin-toolchain.ts +25 -0
- package/src/react-native-coverage/native-typescript-parser.ts +29 -1
- package/src/swift-guest-source-inputs.ts +5 -1
- package/src/swift-guest-source-plan.ts +25 -9
- package/src/swift-host.ts +28 -5
- package/src/swift-xcframework.ts +24 -0
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2434 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -13558,6 +13558,17 @@ function swiftPackageLinkage(target) {
|
|
|
13558
13558
|
throw new Error(`conflicting SwiftPM library linkage for ${target.id}`);
|
|
13559
13559
|
return linkage;
|
|
13560
13560
|
}
|
|
13561
|
+
function linkEdges(targets, id) {
|
|
13562
|
+
const target = targets.get(id);
|
|
13563
|
+
if (!target) throw new Error(`unknown source target ${id}`);
|
|
13564
|
+
return target.dependencies.flatMap((edge) => {
|
|
13565
|
+
if (edge.attributes.length)
|
|
13566
|
+
throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
|
|
13567
|
+
const dependency = targets.get(edge.target);
|
|
13568
|
+
if (!dependency) throw new Error(`unknown source target ${edge.target}`);
|
|
13569
|
+
return dependency.productType.startsWith("swiftpm.library.") && swiftPackageLinkage(dependency) === "static" ? linkEdges(targets, edge.target) : [edge];
|
|
13570
|
+
});
|
|
13571
|
+
}
|
|
13561
13572
|
function guestSourceImages(graph) {
|
|
13562
13573
|
const targets = new Map(graph.targets.map((target) => [target.id, target]));
|
|
13563
13574
|
const entry = targets.get(graph.entry);
|
|
@@ -13581,17 +13592,14 @@ function guestSourceImages(graph) {
|
|
|
13581
13592
|
ownership.set(id, image.id);
|
|
13582
13593
|
image.members.push(id);
|
|
13583
13594
|
active.add(id);
|
|
13584
|
-
for (const edge of
|
|
13585
|
-
if (edge.attributes.length)
|
|
13586
|
-
throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
|
|
13595
|
+
for (const edge of linkEdges(targets, id)) {
|
|
13587
13596
|
const dependency = targets.get(edge.target);
|
|
13588
|
-
if (!dependency) throw new Error(`unknown source target ${edge.target}`);
|
|
13589
13597
|
const type = dependency.productType;
|
|
13590
13598
|
let dynamic;
|
|
13591
13599
|
if (type.startsWith("swiftpm.target.")) {
|
|
13592
13600
|
if (type !== "swiftpm.target.regular" && type !== "swiftpm.target.binary" && type !== "swiftpm.target.system")
|
|
13593
13601
|
throw new Error(`unsupported SwiftPM target ${edge.target}`);
|
|
13594
|
-
dynamic =
|
|
13602
|
+
dynamic = type === "swiftpm.target.binary" && dependency.machOType === "mh_dylib";
|
|
13595
13603
|
} else if (type.startsWith("swiftpm.library.")) {
|
|
13596
13604
|
dynamic = swiftPackageLinkage(dependency) === "dynamic";
|
|
13597
13605
|
} else if (type === "com.apple.product-type.library.static") {
|
|
@@ -13726,9 +13734,7 @@ function planGuestSourceLink(graph, images, callers, artifacts, symbols) {
|
|
|
13726
13734
|
(flag) => /(?:^|,)-(?:weak|reexport|upward|lazy)(?:[_-]|$)/.test(flag)
|
|
13727
13735
|
))
|
|
13728
13736
|
throw new Error(`unsupported special link flag for ${id}`);
|
|
13729
|
-
for (const edge of
|
|
13730
|
-
if (edge.attributes.length)
|
|
13731
|
-
throw new Error(`unsupported link attributes for ${id} -> ${edge.target}`);
|
|
13737
|
+
for (const edge of linkEdges(targets, id)) {
|
|
13732
13738
|
const dependencyImage = ownerByTarget.get(edge.target);
|
|
13733
13739
|
if (dependencyImage === void 0)
|
|
13734
13740
|
throw new Error(`linked target ${edge.target} has no guest image`);
|
|
@@ -15302,6 +15308,11 @@ var import_node_child_process12 = require("node:child_process");
|
|
|
15302
15308
|
var import_node_crypto10 = require("node:crypto");
|
|
15303
15309
|
var import_node_fs17 = require("node:fs");
|
|
15304
15310
|
var import_node_path17 = __toESM(require("node:path"), 1);
|
|
15311
|
+
|
|
15312
|
+
// src/forked-script-contract.ts
|
|
15313
|
+
var PEACH_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
|
|
15314
|
+
|
|
15315
|
+
// src/swift-guest-source-inputs.ts
|
|
15305
15316
|
function clangIrLinkOptions(ir) {
|
|
15306
15317
|
const list2 = /^!llvm\.linker\.options = !\{([^\n]*)\}$/m.exec(ir);
|
|
15307
15318
|
if (!list2) {
|
|
@@ -15422,10 +15433,13 @@ function sourceGuestClangLinkOptions(options) {
|
|
|
15422
15433
|
plan,
|
|
15423
15434
|
JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args]))
|
|
15424
15435
|
);
|
|
15425
|
-
|
|
15436
|
+
const script = import_node_path17.default.join(options.directory, "clang-link-replay.cjs");
|
|
15437
|
+
(0, import_node_fs17.writeFileSync)(script, PARALLEL_REPLAY);
|
|
15438
|
+
(0, import_node_child_process12.execFileSync)(process.execPath, [script], {
|
|
15426
15439
|
stdio: "inherit",
|
|
15427
15440
|
env: {
|
|
15428
15441
|
...process.env,
|
|
15442
|
+
[PEACH_FORKED_SCRIPT_ENV]: "1",
|
|
15429
15443
|
PEACH_CLANG_REPLAYS: plan,
|
|
15430
15444
|
PEACH_CLANG_JOBS: String(options.jobs)
|
|
15431
15445
|
}
|
|
@@ -16721,11 +16735,6 @@ var import_node_crypto12 = require("node:crypto");
|
|
|
16721
16735
|
var import_node_fs22 = require("node:fs");
|
|
16722
16736
|
var import_node_http = require("node:http");
|
|
16723
16737
|
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
16724
|
-
|
|
16725
|
-
// src/forked-script-contract.ts
|
|
16726
|
-
var PEACH_FORKED_SCRIPT_ENV = "PEACH_RUNS_FORKED_SCRIPTS";
|
|
16727
|
-
|
|
16728
|
-
// src/swift-header-compiler.ts
|
|
16729
16738
|
var SWIFT_HEADER_COMPILER_WRAPPER = ".build/peach-swiftc";
|
|
16730
16739
|
var argument = (value) => `'${value.replaceAll("'", `'"'"'`)}'`;
|
|
16731
16740
|
var client = `const { request } = require('node:http')
|
|
@@ -18996,7 +19005,7 @@ var darwinRecordsRegion = (quoted2) => quoted2.length ? ["-Wl,--start-lib", ...q
|
|
|
18996
19005
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
18997
19006
|
var MULTI_MANIFEST_VERSION = 72;
|
|
18998
19007
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
18999
|
-
var compilerSourceDigest = true ? "
|
|
19008
|
+
var compilerSourceDigest = true ? "2ff4da3ff6b56e29c8968a39135d8974f54c927608bde4993a6a2476beb749e6" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
19000
19009
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
19001
19010
|
const hash = (0, import_node_crypto15.createHash)("sha256");
|
|
19002
19011
|
hash.update(`swift-compile
|
|
@@ -34874,7 +34883,7 @@ function sourceClosureDigest(srcDir, entrypoints, excludedFiles) {
|
|
|
34874
34883
|
return hash.digest("hex");
|
|
34875
34884
|
}
|
|
34876
34885
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
34877
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
34886
|
+
var STANDIN_SOURCE_DIGEST = true ? "1f6eece6339ce20859e9666fa0ad8e9076485c71ec1cd098fe6a45fd6e28a28f" : standinSourceDigest();
|
|
34878
34887
|
|
|
34879
34888
|
// src/swift-standins.ts
|
|
34880
34889
|
var import_node_child_process32 = require("node:child_process");
|
|
@@ -35049,6 +35058,28 @@ function simulatorNativeLibrary(dir) {
|
|
|
35049
35058
|
if (matches.length !== 1) throw new Error(`${dir}: ambiguous simulator library`);
|
|
35050
35059
|
return matches[0];
|
|
35051
35060
|
}
|
|
35061
|
+
function isDynamicLibrary(file) {
|
|
35062
|
+
const fd = import_node_fs47.default.openSync(file, "r");
|
|
35063
|
+
try {
|
|
35064
|
+
const read = (offset) => {
|
|
35065
|
+
const bytes = Buffer.alloc(16);
|
|
35066
|
+
import_node_fs47.default.readSync(fd, bytes, 0, 16, offset);
|
|
35067
|
+
return bytes;
|
|
35068
|
+
};
|
|
35069
|
+
let header = read(0);
|
|
35070
|
+
const universal = header.readUInt32BE(0);
|
|
35071
|
+
if (universal === 3405691582 || universal === 3405691583) {
|
|
35072
|
+
const arch = read(8);
|
|
35073
|
+
header = read(
|
|
35074
|
+
universal === 3405691582 ? arch.readUInt32BE(8) : Number(arch.readBigUInt64BE(8))
|
|
35075
|
+
);
|
|
35076
|
+
}
|
|
35077
|
+
const magic = header.readUInt32LE(0);
|
|
35078
|
+
return (magic === 4277009103 || magic === 4277009102) && header.readUInt32LE(12) === 6;
|
|
35079
|
+
} finally {
|
|
35080
|
+
import_node_fs47.default.closeSync(fd);
|
|
35081
|
+
}
|
|
35082
|
+
}
|
|
35052
35083
|
|
|
35053
35084
|
// src/native-static-libraries.ts
|
|
35054
35085
|
var NATIVE_STATIC_LIBRARY_RECIPES = [
|
|
@@ -40658,6 +40689,7 @@ async function swiftPackages(entry, app) {
|
|
|
40658
40689
|
packages,
|
|
40659
40690
|
binaries: packages.binaries,
|
|
40660
40691
|
standins: [],
|
|
40692
|
+
dynamicFrameworks: /* @__PURE__ */ new Map(),
|
|
40661
40693
|
projectGaps: /* @__PURE__ */ new Map()
|
|
40662
40694
|
};
|
|
40663
40695
|
entry.packages = cached;
|
|
@@ -40737,6 +40769,14 @@ async function swiftPackages(entry, app) {
|
|
|
40737
40769
|
for (const target of new Set(built2.standins.map((standin) => standin.target)))
|
|
40738
40770
|
console.error(`Peach: target ${target} was replaced with a stand-in`);
|
|
40739
40771
|
cached.standins = built2.standins;
|
|
40772
|
+
const stoodIn = new Set(built2.standins.map((standin) => standin.target));
|
|
40773
|
+
cached.dynamicFrameworks = new Map(
|
|
40774
|
+
cxxArtifacts.flatMap((binary) => {
|
|
40775
|
+
if (!stoodIn.has(binary.target)) return [];
|
|
40776
|
+
const native = simulatorNativeLibrary(swiftBinaryFramework(binary).dir);
|
|
40777
|
+
return native?.kind === "framework" && isDynamicLibrary(native.file) ? [[binary.target, native.name]] : [];
|
|
40778
|
+
})
|
|
40779
|
+
);
|
|
40740
40780
|
cached.projectGaps = new Map(
|
|
40741
40781
|
vendored.flatMap(({ target }) => {
|
|
40742
40782
|
const gap = built2.gaps.get(target);
|
|
@@ -40800,10 +40840,7 @@ async function buildXcodeLayout(root) {
|
|
|
40800
40840
|
nativeModules: registered.nativeModules
|
|
40801
40841
|
}
|
|
40802
40842
|
);
|
|
40803
|
-
const { packages, standins, projectGaps, binaries } = await swiftPackages(
|
|
40804
|
-
registered,
|
|
40805
|
-
appTarget
|
|
40806
|
-
);
|
|
40843
|
+
const { packages, standins, dynamicFrameworks, projectGaps, binaries } = await swiftPackages(registered, appTarget);
|
|
40807
40844
|
const sourceFrameworks = new Map(
|
|
40808
40845
|
packages.sourceFrameworks.map(
|
|
40809
40846
|
({
|
|
@@ -41407,7 +41444,8 @@ async function buildXcodeLayout(root) {
|
|
|
41407
41444
|
(owner) => owner.module === original.moduleName
|
|
41408
41445
|
)?.products ?? [] : [];
|
|
41409
41446
|
const packageTarget = target.productType.startsWith("swiftpm.");
|
|
41410
|
-
const
|
|
41447
|
+
const binaryFramework = target.productType === "swiftpm.target.binary" ? dynamicFrameworks.get(target.productName) ?? null : null;
|
|
41448
|
+
const packageFramework = target.productType === "swiftpm.library.dynamic" ? target.productName : binaryFramework;
|
|
41411
41449
|
const buildVersion = {
|
|
41412
41450
|
platform: packageTarget ? applicationBuildVersion.platform : target.buildVersion.platform,
|
|
41413
41451
|
minimumOS: target.buildVersion.minimumOS ?? (packageTarget ? applicationBuildVersion.minimumOS : null),
|
|
@@ -41422,6 +41460,7 @@ async function buildXcodeLayout(root) {
|
|
|
41422
41460
|
id: relative2(target.id),
|
|
41423
41461
|
productName: packageFramework === null ? target.productName : `${packageFramework}.framework`,
|
|
41424
41462
|
installName: packageFramework === null ? target.installName : `@rpath/${packageFramework}.framework/${packageFramework}`,
|
|
41463
|
+
machOType: binaryFramework === null ? target.machOType : "mh_dylib",
|
|
41425
41464
|
sourceTarget: target.sourceTarget === null ? first ?? null : original ? frameworkNames.get(original) ?? original.moduleName : target.sourceTarget,
|
|
41426
41465
|
buildVersion,
|
|
41427
41466
|
dependencies: [
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2434 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -4005,7 +4005,7 @@ var require_lib = __commonJS({
|
|
|
4005
4005
|
var runtime_companion_default;
|
|
4006
4006
|
var init_runtime_companion = __esm({
|
|
4007
4007
|
"runtime-companion.json"() {
|
|
4008
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
4008
|
+
runtime_companion_default = { abi: 1, sha256: "2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367", file: "node/cli-2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367.cjs" };
|
|
4009
4009
|
}
|
|
4010
4010
|
});
|
|
4011
4011
|
|
|
@@ -4392,7 +4392,7 @@ var STANDIN_SOURCE_DIGEST;
|
|
|
4392
4392
|
var init_swift_standin_digest = __esm({
|
|
4393
4393
|
"src/swift-standin-digest.ts"() {
|
|
4394
4394
|
"use strict";
|
|
4395
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
4395
|
+
STANDIN_SOURCE_DIGEST = true ? "1f6eece6339ce20859e9666fa0ad8e9076485c71ec1cd098fe6a45fd6e28a28f" : standinSourceDigest();
|
|
4396
4396
|
}
|
|
4397
4397
|
});
|
|
4398
4398
|
|
|
@@ -5511,6 +5511,7 @@ var init_swift_guest_link = __esm({
|
|
|
5511
5511
|
var init_swift_guest_source_inputs = __esm({
|
|
5512
5512
|
"src/swift-guest-source-inputs.ts"() {
|
|
5513
5513
|
"use strict";
|
|
5514
|
+
init_forked_script_contract();
|
|
5514
5515
|
init_swift_guest_source_plan();
|
|
5515
5516
|
init_swift_runtime_products();
|
|
5516
5517
|
}
|
|
@@ -5822,7 +5823,7 @@ var init_swift_compile = __esm({
|
|
|
5822
5823
|
FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
5823
5824
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
5824
5825
|
).join("");
|
|
5825
|
-
compilerSourceDigest = true ? "
|
|
5826
|
+
compilerSourceDigest = true ? "2ff4da3ff6b56e29c8968a39135d8974f54c927608bde4993a6a2476beb749e6" : swiftCompilerSourceDigest2(__sootsim_import_meta_dirname);
|
|
5826
5827
|
C_WORDS = new Set(
|
|
5827
5828
|
"auto bool break case char const continue default do double else enum extern false float for goto if inline int long register restrict return short signed sizeof static struct switch true typedef union unsigned void volatile while YES NO NULL nil Nil id self super instancetype".split(
|
|
5828
5829
|
" "
|
|
@@ -6504,6 +6505,7 @@ var init_swift_host = __esm({
|
|
|
6504
6505
|
init_swift_standins();
|
|
6505
6506
|
init_swift_submit();
|
|
6506
6507
|
init_swift_toolchain();
|
|
6508
|
+
init_swift_xcframework();
|
|
6507
6509
|
init_swiftContract();
|
|
6508
6510
|
init_swiftContract();
|
|
6509
6511
|
init_xcode_project();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2434 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type MetroAssetPathRecord } from '../metro-asset-path.d.ts';
|
|
2
2
|
import { type ImageFrameSource } from '../render-worker/image-pixel-contract.d.ts';
|
|
3
|
+
import { getImageLoaderCanvasKit } from './image-loader-canvaskit.d.ts';
|
|
3
4
|
import type { ImageLifecycleEvent } from '../render-worker/image-lifecycle-event.d.ts';
|
|
4
5
|
import type { DecodedImagePixels, ImagePixelDecodeSize } from '../render-worker/image-pixel-contract.d.ts';
|
|
5
6
|
import type { CanvasKitRenderingApi as CanvasKit } from './canvaskit-api.d.ts';
|
|
@@ -363,3 +364,4 @@ export declare function readImagePrefetchRequest(uri: string, exactCacheKey: str
|
|
|
363
364
|
export declare function prefetchImage(uri: string, requestId?: number, exactCacheKey?: string, headers?: Record<string, string>, paintNode?: SootSimNode, nativeUserAgent?: string | null): Promise<boolean>;
|
|
364
365
|
export declare function clearImageCache(uri: string): void;
|
|
365
366
|
export declare function touchPaintedImages(native: SceneNativeBinding, ctx: RenderContext, base?: number): void;
|
|
367
|
+
export { getImageLoaderCanvasKit };
|
|
@@ -135,7 +135,7 @@ export type CanvasMapSection = {
|
|
|
135
135
|
screenIds: string[];
|
|
136
136
|
sectionIds: string[];
|
|
137
137
|
};
|
|
138
|
-
outline?: 'bounds';
|
|
138
|
+
outline?: 'bounds' | 'none';
|
|
139
139
|
dragFromBody?: boolean;
|
|
140
140
|
fitInsets?: {
|
|
141
141
|
horizontal: number;
|
|
@@ -238,7 +238,7 @@ export type CanvasMapTap = {
|
|
|
238
238
|
y: number;
|
|
239
239
|
};
|
|
240
240
|
export type CanvasMapKey = 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'ArrowDown' | 'Enter' | 'Home';
|
|
241
|
-
export type CanvasMapCommand = 'fit' | 'actual-size' | {
|
|
241
|
+
export type CanvasMapCommand = 'fit' | 'actual-size' | 'clear-selection' | {
|
|
242
242
|
kind: 'agent';
|
|
243
243
|
agent: CanvasMapAgent;
|
|
244
244
|
} | {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const DISPLAY_SERVER_VERSION = 26;
|
|
2
2
|
export declare const DISPLAY_SERVER_MAJOR = 2;
|
|
3
|
-
export declare const DISPLAY_SERVER_MINOR =
|
|
4
|
-
export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.
|
|
3
|
+
export declare const DISPLAY_SERVER_MINOR = 37;
|
|
4
|
+
export declare const DISPLAY_SERVER_SUBPROTOCOL = "rnx.display-server.v2.wire26.minor37";
|
|
5
5
|
export declare const DISPLAY_SERVER_TOKEN_SUBPROTOCOL_PREFIX = "rnx.sim-token.";
|
|
6
6
|
export declare const RNX_CLOUD_DISPLAY_GRANT_TTL_MS: number;
|
|
7
7
|
export declare const RNX_CLOUD_DISPLAY_CLOSE: {
|
|
@@ -37,6 +37,7 @@ export declare const DISPLAY_SERVER_LIMITS: {
|
|
|
37
37
|
readonly maxNativeAnimMirrorBytes: 262144;
|
|
38
38
|
readonly maxNativeAnimMirrorDepth: 64;
|
|
39
39
|
readonly maxDiagnosticsBytes: 1048576;
|
|
40
|
+
readonly maxCameraInputBytes: 1048576;
|
|
40
41
|
};
|
|
41
42
|
export type DisplayServerAppearance = 'light' | 'dark';
|
|
42
43
|
export interface RemotePeerIdentity {
|
|
@@ -32,7 +32,7 @@ import type { WorkerStorageSyncMessage } from './worker-storage.d.ts';
|
|
|
32
32
|
import type { WorkletPeerEpoch } from './worklet-runtime.d.ts';
|
|
33
33
|
import type { UiRpcMailboxes } from './worklet-sab.d.ts';
|
|
34
34
|
import type { WorkletMessage } from './worklet-wire.d.ts';
|
|
35
|
-
import type { SootSimLocationFix } from '../../../peach-globals/src/index.d.ts';
|
|
35
|
+
import type { SootSimCameraInputPayload, SootSimCameraInputState, SootSimLocationFix } from '../../../peach-globals/src/index.d.ts';
|
|
36
36
|
import type { SootsimBootMark } from '../../../peach-globals/src/index.d.ts';
|
|
37
37
|
import type { PeachPageServingAuthority, SootSimAccessibilityInput } from '../../../peach-globals/src/index.d.ts';
|
|
38
38
|
import type { SootSimAgentActionDetail, SootSimLaunchArguments } from '../../../peach-globals/src/index.d.ts';
|
|
@@ -199,6 +199,9 @@ export type HostToWorker = {
|
|
|
199
199
|
} | {
|
|
200
200
|
type: 'setSimulatedLocation';
|
|
201
201
|
location: SootSimLocationFix | null;
|
|
202
|
+
} | {
|
|
203
|
+
type: 'setCameraInput';
|
|
204
|
+
input: SootSimCameraInputPayload;
|
|
202
205
|
} | {
|
|
203
206
|
type: 'dispatchWindowEvent';
|
|
204
207
|
eventType: ForwardedWindowEventType;
|
|
@@ -744,6 +747,9 @@ export type WorkerToHost = {
|
|
|
744
747
|
} | {
|
|
745
748
|
type: 'remoteDeviceLocation';
|
|
746
749
|
location: SootSimLocationFix | null;
|
|
750
|
+
} | {
|
|
751
|
+
type: 'remoteDeviceCamera';
|
|
752
|
+
state: SootSimCameraInputState;
|
|
747
753
|
} | {
|
|
748
754
|
type: 'replayDevice';
|
|
749
755
|
posture: DevicePosture | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type SootSimCameraInputMode = 'off' | 'test-pattern' | 'photo' | 'video' | 'webcam';
|
|
2
|
+
export type SootSimCameraInputMimeType = 'image/jpeg' | 'image/png' | 'image/webp';
|
|
3
|
+
export interface SootSimCameraInputState {
|
|
4
|
+
mode: SootSimCameraInputMode;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SootSimCameraInputFrame {
|
|
8
|
+
mode: 'photo' | 'video' | 'webcam';
|
|
9
|
+
label?: string;
|
|
10
|
+
mimeType: SootSimCameraInputMimeType;
|
|
11
|
+
bytes: Uint8Array;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}
|
|
15
|
+
export type SootSimCameraInputPayload = {
|
|
16
|
+
mode: 'off';
|
|
17
|
+
} | {
|
|
18
|
+
mode: 'test-pattern';
|
|
19
|
+
} | SootSimCameraInputFrame;
|
|
20
|
+
export interface SootSimCameraInputBridge {
|
|
21
|
+
get(): SootSimCameraInputState;
|
|
22
|
+
setTestPattern(): SootSimCameraInputState;
|
|
23
|
+
setFrame(frame: SootSimCameraInputFrame): SootSimCameraInputState;
|
|
24
|
+
clear(): SootSimCameraInputState;
|
|
25
|
+
subscribe(listener: (state: SootSimCameraInputState) => void): () => void;
|
|
26
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { SootSimAndroidDateTimePickerBridge } from './androidDateTimePicker
|
|
|
3
3
|
import type { SootSimHotRemountBridge } from './appLifecycleBridgeContract.d.ts';
|
|
4
4
|
import type { SootSimAudioRecorderBridge, SootSimMediaSessionBridge } from './audioBridgeContract.d.ts';
|
|
5
5
|
import type { SootSimCameraBridge } from './cameraBridgeContract.d.ts';
|
|
6
|
+
import type { SootSimCameraInputBridge } from './cameraInputBridgeContract.d.ts';
|
|
6
7
|
import type { SootSimCaptureOptions } from './captureBridgeContract.d.ts';
|
|
7
8
|
import type { SootSimClipboardBridge } from './clipboardBridgeContract.d.ts';
|
|
8
9
|
import type { SootSimLiveCompositeBridge, SootSimVideoStreamBridge, SootSimAuxCompositorStats } from './compositorBridgeContract.d.ts';
|
|
@@ -118,6 +119,7 @@ export interface SootSimBridges {
|
|
|
118
119
|
portalManager: SootSimPortalManager | null;
|
|
119
120
|
settings: SootSimSettingsBridge | null;
|
|
120
121
|
location: SootSimLocationBridge | null;
|
|
122
|
+
cameraInput: SootSimCameraInputBridge | null;
|
|
121
123
|
windowScale: SootSimWindowScaleBridge | null;
|
|
122
124
|
electron: SootSimElectronBridge | null;
|
|
123
125
|
shellHost: SootSimShellHostBridge | null;
|
|
@@ -40,6 +40,7 @@ export type { LockstepFramePosition, PointerDeliveryTarget, PointerDeliveryPendi
|
|
|
40
40
|
export type { SootSimLaunchArguments, SootSimExternalAppLifecycleOptions, SootSimStorageResetStrategy, SootSimExternalAppResetOptions, SootSimExternalAppResetResult, SootSimExternalAppStorageClearOptions, SootSimWebStorageName, SootSimHotRemountBridge, } from './appLifecycleBridgeContract.d.ts';
|
|
41
41
|
export { PEACH_FINAL_LAUNCH_GLOBAL } from './appLifecycleBridgeContract.d.ts';
|
|
42
42
|
export type { SootSimSettingsBridge } from './settingsBridgeContract.d.ts';
|
|
43
|
+
export type { SootSimCameraInputMode, SootSimCameraInputMimeType, SootSimCameraInputState, SootSimCameraInputFrame, SootSimCameraInputPayload, SootSimCameraInputBridge, } from './cameraInputBridgeContract.d.ts';
|
|
43
44
|
export type { SootSimLocationFix, SootSimLocationResult, SootSimLocationBridge, } from './locationBridgeContract.d.ts';
|
|
44
45
|
export { SOOTSIM_CAPTURE_IMAGE_QUALITY, sootsimCaptureIsFlat, } from './captureBridgeContract.d.ts';
|
|
45
46
|
export type { SootSimCaptureFilter, SootSimCaptureOptions } from './captureBridgeContract.d.ts';
|
package/kotlin/README.md
CHANGED
|
@@ -42,7 +42,9 @@ traffic in `scripts/debug/peach-swift-lazy-network.sh`.
|
|
|
42
42
|
- `CompilerSources/`: the native member compiler plugin and JVM service
|
|
43
43
|
registration. Release producers compile it to `plugin.jar`; clients load that
|
|
44
44
|
jar without compiling or receiving plugin source. `ToolSources/` builds
|
|
45
|
-
`tools.jar` for the
|
|
45
|
+
`tools.jar` for the Expo type scan, ViewModel ABI scan, and Java bindings.
|
|
46
|
+
The host runs those tools directly on the configured JVM with the compiler
|
|
47
|
+
and standard library jars from the pinned archive.
|
|
46
48
|
`JniPlatformSources/` and `JniSources/` supply platform declarations and the
|
|
47
49
|
native invocation runtime. Incoming JNI lookup retains stable IDs, private
|
|
48
50
|
and virtual calls, constructors and backing fields. Native static companion
|
package/kotlin/sdk.tar.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/runtime-companion.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"abi":1,"sha256":"
|
|
1
|
+
{"abi":1,"sha256":"2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367","file":"node/cli-2d42441f509451bf1c660a06ac087056d0cc7d96ca43aead02f6fd91f5e4e367.cjs"}
|
package/src/java-module-abi.ts
CHANGED
|
@@ -5,7 +5,7 @@ import path from 'node:path'
|
|
|
5
5
|
import { promisify } from 'node:util'
|
|
6
6
|
import { readBridgeMethod } from './android-bridge-packages'
|
|
7
7
|
import { isRecord } from './is-record'
|
|
8
|
-
import { kotlinHome } from './kotlin-toolchain'
|
|
8
|
+
import { kotlinHome, runKotlinTool } from './kotlin-toolchain'
|
|
9
9
|
import type { JavaModuleSpec, JavaModuleSpecs } from './javaAbiContract'
|
|
10
10
|
import type { KotlinToolchainInstallation } from './kotlinSdkContract'
|
|
11
11
|
|
|
@@ -31,19 +31,11 @@ export async function readJavaModuleSpecs(
|
|
|
31
31
|
fs.writeFileSync(target, bytes)
|
|
32
32
|
origins.set(target, file)
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
path.join(sdkRoot, 'tools.jar'),
|
|
40
|
-
path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-compiler.jar'),
|
|
41
|
-
path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-stdlib.jar'),
|
|
42
|
-
].join(path.delimiter),
|
|
43
|
-
'dev.peach.tools.javaabi.JavaModuleSpecsKt',
|
|
44
|
-
...origins.keys(),
|
|
45
|
-
],
|
|
46
|
-
{ maxBuffer: 16 * 1024 * 1024 },
|
|
34
|
+
const stdout = await runKotlinTool(
|
|
35
|
+
toolchain,
|
|
36
|
+
sdkRoot,
|
|
37
|
+
'dev.peach.tools.javaabi.JavaModuleSpecsKt',
|
|
38
|
+
[...origins.keys()],
|
|
47
39
|
).catch((cause: unknown) => {
|
|
48
40
|
if (!isRecord(cause) || typeof cause.stderr !== 'string') throw cause
|
|
49
41
|
let diagnostic = cause.stderr
|
|
@@ -134,20 +126,11 @@ export async function compileJavaModuleAbi(input: {
|
|
|
134
126
|
{ maxBuffer: 16 * 1024 * 1024 },
|
|
135
127
|
)
|
|
136
128
|
const library = path.join(directory, 'java-abi.klib')
|
|
137
|
-
await
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
path.join(sdkRoot, 'tools.jar'),
|
|
143
|
-
path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-compiler.jar'),
|
|
144
|
-
path.resolve(path.dirname(toolchain.kotlinc), '../lib/kotlin-stdlib.jar'),
|
|
145
|
-
].join(path.delimiter),
|
|
146
|
-
'dev.peach.tools.platform.JavaPlatformTypesKt',
|
|
147
|
-
path.join(directory, `${name}.klib`),
|
|
148
|
-
library,
|
|
149
|
-
],
|
|
150
|
-
{ maxBuffer: 16 * 1024 * 1024 },
|
|
129
|
+
await runKotlinTool(
|
|
130
|
+
toolchain,
|
|
131
|
+
sdkRoot,
|
|
132
|
+
'dev.peach.tools.platform.JavaPlatformTypesKt',
|
|
133
|
+
[path.join(directory, `${name}.klib`), library],
|
|
151
134
|
)
|
|
152
135
|
return library
|
|
153
136
|
}
|
package/src/kotlin-host.ts
CHANGED
|
@@ -30,6 +30,7 @@ import { kotlinInstanceSource } from './kotlin-instance-source'
|
|
|
30
30
|
import { installKotlinSdkArchive } from './kotlin-sdk'
|
|
31
31
|
import {
|
|
32
32
|
ensureToolchain,
|
|
33
|
+
runKotlinTool,
|
|
33
34
|
fetchVerified,
|
|
34
35
|
kotlinHome,
|
|
35
36
|
readToolchain,
|
|
@@ -404,26 +405,12 @@ async function scanSources<T>(
|
|
|
404
405
|
const key = digest.digest('hex')
|
|
405
406
|
let scan = toolScans.get(key)
|
|
406
407
|
if (!scan) {
|
|
407
|
-
scan = (
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
[
|
|
414
|
-
path.resolve(path.dirname(kotlinc), '../lib/kotlin-compiler.jar'),
|
|
415
|
-
path.join(sdk.root, 'tools.jar'),
|
|
416
|
-
].join(path.delimiter),
|
|
417
|
-
tool,
|
|
418
|
-
...files,
|
|
419
|
-
],
|
|
420
|
-
{ maxBuffer: 16 * 1024 * 1024 },
|
|
421
|
-
)
|
|
422
|
-
return stdout
|
|
423
|
-
})().catch((error: unknown) => {
|
|
424
|
-
toolScans.delete(key)
|
|
425
|
-
throw error
|
|
426
|
-
})
|
|
408
|
+
scan = ensureToolchain(toolchain)
|
|
409
|
+
.then((ready) => runKotlinTool(ready, sdk.root, tool, files))
|
|
410
|
+
.catch((error: unknown) => {
|
|
411
|
+
toolScans.delete(key)
|
|
412
|
+
throw error
|
|
413
|
+
})
|
|
427
414
|
toolScans.set(key, scan)
|
|
428
415
|
}
|
|
429
416
|
return parse(await scan)
|
|
@@ -1415,18 +1402,12 @@ async function compileKotlin(
|
|
|
1415
1402
|
)
|
|
1416
1403
|
) {
|
|
1417
1404
|
await compileKlib(path.join(work, 'abi'))
|
|
1418
|
-
const
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
path.join(sdk.root, 'tools.jar'),
|
|
1425
|
-
].join(path.delimiter),
|
|
1426
|
-
viewModels.toolClass,
|
|
1427
|
-
path.join(work, 'abi'),
|
|
1428
|
-
],
|
|
1429
|
-
{ maxBuffer: 64 * 1024 * 1024 },
|
|
1405
|
+
const stdout = await runKotlinTool(
|
|
1406
|
+
ready,
|
|
1407
|
+
sdk.root,
|
|
1408
|
+
viewModels.toolClass,
|
|
1409
|
+
[path.join(work, 'abi')],
|
|
1410
|
+
64 * 1024 * 1024,
|
|
1430
1411
|
)
|
|
1431
1412
|
fs.writeFileSync(
|
|
1432
1413
|
path.join(generatedDir, viewModels.file),
|
package/src/kotlin-toolchain.ts
CHANGED
|
@@ -14,6 +14,31 @@ import type {
|
|
|
14
14
|
|
|
15
15
|
const run = promisify(execFile)
|
|
16
16
|
|
|
17
|
+
export async function runKotlinTool(
|
|
18
|
+
toolchain: KotlinToolchainInstallation,
|
|
19
|
+
sdkRoot: string,
|
|
20
|
+
tool: string,
|
|
21
|
+
args: string[],
|
|
22
|
+
maxBuffer = 16 * 1024 * 1024,
|
|
23
|
+
): Promise<string> {
|
|
24
|
+
const lib = path.resolve(path.dirname(toolchain.kotlinc), '../lib')
|
|
25
|
+
const { stdout } = await run(
|
|
26
|
+
path.join(toolchain.javaHome, 'bin', 'java'),
|
|
27
|
+
[
|
|
28
|
+
'-cp',
|
|
29
|
+
[
|
|
30
|
+
path.join(sdkRoot, 'tools.jar'),
|
|
31
|
+
path.join(lib, 'kotlin-compiler.jar'),
|
|
32
|
+
path.join(lib, 'kotlin-stdlib.jar'),
|
|
33
|
+
].join(path.delimiter),
|
|
34
|
+
tool,
|
|
35
|
+
...args,
|
|
36
|
+
],
|
|
37
|
+
{ maxBuffer },
|
|
38
|
+
)
|
|
39
|
+
return stdout
|
|
40
|
+
}
|
|
41
|
+
|
|
17
42
|
export function readToolchain(moduleRoot: string): KotlinToolchain {
|
|
18
43
|
const parsed: unknown = JSON.parse(
|
|
19
44
|
fs.readFileSync(path.join(moduleRoot, 'toolchain.json'), 'utf8'),
|
|
@@ -18,10 +18,38 @@ export type TypeScriptSourceParser = <T>(
|
|
|
18
18
|
requestedSources?: Iterable<string>,
|
|
19
19
|
) => Promise<T>
|
|
20
20
|
|
|
21
|
+
const SOURCE_FILE_MEMO = new Map<string, { source: string; ast: SourceFile }>()
|
|
22
|
+
const MAX_SOURCE_FILE_MEMO = 8192
|
|
23
|
+
|
|
21
24
|
export async function parseTypeScriptSources(
|
|
22
25
|
files: ReadonlyMap<string, string>,
|
|
23
26
|
): Promise<Map<string, SourceFile>> {
|
|
24
|
-
|
|
27
|
+
const hits = new Map<string, SourceFile>()
|
|
28
|
+
const pending = new Map<string, string>()
|
|
29
|
+
for (const [path, source] of files) {
|
|
30
|
+
const cached = SOURCE_FILE_MEMO.get(path)
|
|
31
|
+
if (cached && cached.source === source) hits.set(path, cached.ast)
|
|
32
|
+
else pending.set(path, source)
|
|
33
|
+
}
|
|
34
|
+
if (pending.size === 0) return hits
|
|
35
|
+
const freshlyParsed = await withTypeScriptSourceParser((parse) =>
|
|
36
|
+
parse(pending, async (sources) => sources),
|
|
37
|
+
)
|
|
38
|
+
for (const [path, ast] of freshlyParsed) {
|
|
39
|
+
const source = pending.get(path)
|
|
40
|
+
if (source === undefined) continue
|
|
41
|
+
if (SOURCE_FILE_MEMO.size >= MAX_SOURCE_FILE_MEMO && !SOURCE_FILE_MEMO.has(path)) {
|
|
42
|
+
const oldest = SOURCE_FILE_MEMO.keys().next().value
|
|
43
|
+
if (oldest !== undefined) SOURCE_FILE_MEMO.delete(oldest)
|
|
44
|
+
}
|
|
45
|
+
SOURCE_FILE_MEMO.set(path, { source, ast })
|
|
46
|
+
}
|
|
47
|
+
const ordered = new Map<string, SourceFile>()
|
|
48
|
+
for (const path of files.keys()) {
|
|
49
|
+
const ast = hits.get(path) ?? freshlyParsed.get(path)
|
|
50
|
+
if (ast) ordered.set(path, ast)
|
|
51
|
+
}
|
|
52
|
+
return ordered
|
|
25
53
|
}
|
|
26
54
|
|
|
27
55
|
export async function withTypeScriptSourceParser<T>(
|
|
@@ -2,6 +2,7 @@ import { execFileSync } from 'node:child_process'
|
|
|
2
2
|
import { createHash } from 'node:crypto'
|
|
3
3
|
import { mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs'
|
|
4
4
|
import path from 'node:path'
|
|
5
|
+
import { PEACH_FORKED_SCRIPT_ENV } from './forked-script-contract'
|
|
5
6
|
import { libraryArchiveTarget, type GuestSourceArtifact } from './swift-guest-source-plan'
|
|
6
7
|
import { frameworkRuntimeProductId } from './swift-runtime-products'
|
|
7
8
|
import type { SwiftSourceLinkGraph } from './swiftContract'
|
|
@@ -161,10 +162,13 @@ export function sourceGuestClangLinkOptions(options: {
|
|
|
161
162
|
plan,
|
|
162
163
|
JSON.stringify(replays.map(({ compiler, args }) => [compiler, ...args])),
|
|
163
164
|
)
|
|
164
|
-
|
|
165
|
+
const script = path.join(options.directory, 'clang-link-replay.cjs')
|
|
166
|
+
writeFileSync(script, PARALLEL_REPLAY)
|
|
167
|
+
execFileSync(process.execPath, [script], {
|
|
165
168
|
stdio: 'inherit',
|
|
166
169
|
env: {
|
|
167
170
|
...process.env,
|
|
171
|
+
[PEACH_FORKED_SCRIPT_ENV]: '1',
|
|
168
172
|
PEACH_CLANG_REPLAYS: plan,
|
|
169
173
|
PEACH_CLANG_JOBS: String(options.jobs),
|
|
170
174
|
},
|