peachsim 0.1.2608 → 0.1.2610
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/perf-native.ts +120 -6
- package/cli/drivers/playwright-provisioning.ts +4 -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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +60485 -60177
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-4QDEL7IO.mjs → acorn-L2SFCOHG.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-4C57RZXG.mjs → chunk-2LJTZ2KG.mjs} +17 -328
- package/dist-lib/esm-chunks/{chunk-X6CONUT6.mjs → chunk-42NDD4R7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F724FZHJ.mjs → chunk-73NIGS7D.mjs} +1490 -3950
- package/dist-lib/esm-chunks/{chunk-KNCWQQZG.mjs → chunk-CUBTZPSZ.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-EU5WMP5O.mjs +322 -0
- package/dist-lib/esm-chunks/{chunk-NXG27NGU.mjs → chunk-EYSNLE5V.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-IKFFQXJN.mjs → chunk-FP447MCW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JIW4PICV.mjs → chunk-HMTSU22Q.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7KU5ROOE.mjs → chunk-KTAGV5U6.mjs} +14 -12
- package/dist-lib/esm-chunks/{chunk-3DUFAH5J.mjs → chunk-MJP4WOSX.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-H3QASOKR.mjs → chunk-MK4DOEDN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZFI5OF6U.mjs → chunk-N3M5KT33.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-F2FHFORX.mjs → chunk-N7XU2WWO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UHYHEJ3N.mjs → chunk-RN73P2DY.mjs} +34 -28
- package/dist-lib/esm-chunks/{chunk-VICI67J5.mjs → chunk-VDLPNJ6P.mjs} +1 -1
- package/dist-lib/esm-chunks/chunk-W3LNUIUA.mjs +2655 -0
- package/dist-lib/esm-chunks/{chunk-R25MOOFS.mjs → chunk-WBQFHIGS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YBMBAXAZ.mjs → chunk-WZHEW7Z7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RTXAZMTP.mjs → chunk-X74N3K5N.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-IJX7PBNG.mjs → chunk-XN74REO2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RZLGVWHK.mjs → chunk-YLUD2UET.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BEWJL2LY.mjs → chunk-YVLXYLNV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W5EHCHDD.mjs → chunk-YYGSN3BN.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-GPPOU5DO.mjs → chunk-ZZB2LFYV.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-YWPJI3L6.mjs → metro-layout-parser-VDPXJ7LW.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-MWTLCMQD.mjs → swift-package-prebuilt-HRPDLN2P.mjs} +14 -11
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PF5QMK5X.mjs → swift-sdk-app-module-5DOGMU3M.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-5IMAACRF.mjs → swift-sdk-image-W3UU4H4L.mjs} +16 -14
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-JPIJI25U.mjs → swift-sdk-image-producer-OJWD6ZOH.mjs} +8 -6
- package/dist-lib/expo-swift-bundle.cjs +42524 -42216
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +43716 -43244
- package/dist-lib/host/fetch-proxy-handler.cjs +670 -645
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1499 -2889
- package/dist-lib/native-app-identity-project.mjs +317 -339
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +166 -154
- package/dist-lib/public-origins-lib.json +141 -198
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +38979 -38507
- package/dist-lib/swift-compile.cjs +12239 -12121
- package/dist-lib/swift-compile.mjs +36 -33
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +13 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +3 -0
- package/package.json +1 -1
- package/src/agent-prompt.ts +15 -2
- package/src/binaryen.lock.json +3 -3
- package/src/genrule-archives.ts +5 -2
- package/src/native-framework-compiler.ts +1 -1
- package/src/native-static-libraries.ts +2 -3
- package/src/native-swift-slices.ts +1 -1
- package/src/nitro-dependencies.ts +3 -7
- package/src/one-native-controls-package.ts +165 -11
- package/src/oneNativeControlsContract.ts +1 -0
- package/src/rive-runtime-dependencies.ts +1 -2
- package/src/swift-compile.ts +165 -1796
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-distribution.ts +39 -15
- package/src/swift-objc-compile.ts +194 -32
- package/src/swift-package-manifest.ts +6 -29
- package/src/swift-packages.ts +6 -14
- package/src/swift-sdk-surface.ts +1811 -0
- package/src/swift-standin-digest.ts +28 -5
- package/src/swift-standins.ts +16 -19
- package/src/swift-wasm-archive.ts +200 -0
- package/src/swift-wasm-prune.ts +3 -93
- package/src/swift-wasm64-native-source.ts +4 -2
- package/src/swiftWasm64ConfigContract.ts +10 -0
- package/src/wasm-optimize.ts +18 -14
- package/src/xcode-project.ts +2 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
RNX_SCREEN_CAPTURE_VERSION,
|
|
4
4
|
describeInvalidScreenCapture,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
rnxRasterFrames,
|
|
11
11
|
rnxRasterRegionRequests,
|
|
12
12
|
selectRnxRasterNodeIds
|
|
13
|
-
} from "./esm-chunks/chunk-
|
|
14
|
-
import "./esm-chunks/chunk-
|
|
13
|
+
} from "./esm-chunks/chunk-WBQFHIGS.mjs";
|
|
14
|
+
import "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
15
15
|
export {
|
|
16
16
|
RNX_SCREEN_CAPTURE_VERSION,
|
|
17
17
|
describeInvalidScreenCapture,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
AGENT_IDENTITY_MAX_CHARS,
|
|
4
4
|
RNX_CLOUD_ALL_COMMAND_SCOPES,
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
readRnxLaunchUrl,
|
|
32
32
|
rnxCloudCommandScope,
|
|
33
33
|
rnxCloudScopesAllowCommand
|
|
34
|
-
} from "./esm-chunks/chunk-
|
|
35
|
-
import "./esm-chunks/chunk-
|
|
34
|
+
} from "./esm-chunks/chunk-MJP4WOSX.mjs";
|
|
35
|
+
import "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
36
36
|
export {
|
|
37
37
|
AGENT_IDENTITY_MAX_CHARS,
|
|
38
38
|
RNX_CLOUD_ALL_COMMAND_SCOPES,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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,5 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
import "./esm-chunks/chunk-
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
3
3
|
|
|
4
4
|
// src/cloud-test-args.ts
|
|
5
5
|
var CLOUD_TEST_ARGS_MAX_COUNT = 32;
|
package/dist-lib/cloud.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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;
|
package/dist-lib/cloud.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
sleep
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-N7XU2WWO.mjs";
|
|
5
5
|
import {
|
|
6
6
|
isRnxScreenCapture
|
|
7
|
-
} from "./esm-chunks/chunk-
|
|
7
|
+
} from "./esm-chunks/chunk-WBQFHIGS.mjs";
|
|
8
8
|
import {
|
|
9
9
|
RNX_CLOUD_COMMAND_TYPES,
|
|
10
10
|
RNX_CLOUD_MAX_ARTIFACT_BYTES,
|
|
@@ -14,16 +14,16 @@ import {
|
|
|
14
14
|
isRnxCloudCommandType,
|
|
15
15
|
rnxCloudCommandScope,
|
|
16
16
|
rnxCloudScopesAllowCommand
|
|
17
|
-
} from "./esm-chunks/chunk-
|
|
17
|
+
} from "./esm-chunks/chunk-MJP4WOSX.mjs";
|
|
18
18
|
import {
|
|
19
19
|
rnxPublicBrand
|
|
20
|
-
} from "./esm-chunks/chunk-
|
|
20
|
+
} from "./esm-chunks/chunk-HMTSU22Q.mjs";
|
|
21
21
|
import {
|
|
22
22
|
isRecord
|
|
23
|
-
} from "./esm-chunks/chunk-
|
|
23
|
+
} from "./esm-chunks/chunk-XN74REO2.mjs";
|
|
24
24
|
import {
|
|
25
25
|
__publicField
|
|
26
|
-
} from "./esm-chunks/chunk-
|
|
26
|
+
} from "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
27
27
|
|
|
28
28
|
// src/backend-origin.ts
|
|
29
29
|
var NativeURL = globalThis.URL;
|
package/dist-lib/config.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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;
|
package/dist-lib/config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
isValidRuntimeVersion
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-WZHEW7Z7.mjs";
|
|
5
5
|
import {
|
|
6
6
|
findBundleFooter
|
|
7
|
-
} from "./esm-chunks/chunk-
|
|
7
|
+
} from "./esm-chunks/chunk-YLUD2UET.mjs";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
|
-
} from "./esm-chunks/chunk-
|
|
11
|
-
import "./esm-chunks/chunk-
|
|
10
|
+
} from "./esm-chunks/chunk-XN74REO2.mjs";
|
|
11
|
+
import "./esm-chunks/chunk-N3M5KT33.mjs";
|
|
12
12
|
|
|
13
13
|
// src/nativeViewSourceContract.ts
|
|
14
14
|
function isNativeViewSource(value) {
|
package/dist-lib/detox/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
Node,
|
|
4
4
|
Parser,
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
types,
|
|
23
23
|
types$1,
|
|
24
24
|
version
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-ZZB2LFYV.mjs";
|
|
26
|
+
import "./chunk-N3M5KT33.mjs";
|
|
27
27
|
export {
|
|
28
28
|
Node,
|
|
29
29
|
Parser,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2610 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
|
|
3
3
|
// src/swiftTargetContract.ts
|
|
4
4
|
var SWIFT_WASM_TRIPLE = "wasm64-unknown-wasip1-threads";
|
|
@@ -344,7 +344,7 @@ for arg in "$@"; do
|
|
|
344
344
|
case $arg in
|
|
345
345
|
@*)
|
|
346
346
|
rsp=\${arg#@}
|
|
347
|
-
awk 'BEGIN { RS = " "; ORS = " " } /^"-l/ { if (seen[$0]++) next }${omitLibraries.map((
|
|
347
|
+
awk 'BEGIN { RS = " "; ORS = " " } /^"-l/ { if (seen[$0]++) next }${omitLibraries.map((name) => ` $0 == "\\"-l${name}\\"" { next }`).join("")} $0 == "\\"-ObjC\\"" { next } { print }' "$rsp" > "$rsp.dedup"
|
|
348
348
|
mv "$rsp.dedup" "$rsp"
|
|
349
349
|
if [ "\${PEACH_DEFER_WASM_LINK:-}" = "1" ] && grep -q '"--start-lib"' "$rsp"; then
|
|
350
350
|
cp "$rsp" ${JSON.stringify(path.join(directory, ".peach-link.rsp"))}
|
|
@@ -452,9 +452,9 @@ function refreshSwiftCacheHold(directory) {
|
|
|
452
452
|
function swiftPackageCacheOptions() {
|
|
453
453
|
const root = path.join(swiftCacheDir(), "swiftpm");
|
|
454
454
|
return [
|
|
455
|
-
...["cache", "config", "security"].flatMap((
|
|
456
|
-
`--${
|
|
457
|
-
path.join(root,
|
|
455
|
+
...["cache", "config", "security"].flatMap((name) => [
|
|
456
|
+
`--${name}-path`,
|
|
457
|
+
path.join(root, name)
|
|
458
458
|
]),
|
|
459
459
|
"--disable-keychain"
|
|
460
460
|
];
|
|
@@ -571,7 +571,7 @@ function swiftSdkPayloadChecksum(bundle) {
|
|
|
571
571
|
hash.update(JSON.stringify([relative, "link", fs.readlinkSync(file)]) + "\n");
|
|
572
572
|
} else if (stat.isDirectory()) {
|
|
573
573
|
hash.update(JSON.stringify([relative, "directory"]) + "\n");
|
|
574
|
-
for (const
|
|
574
|
+
for (const name of fs.readdirSync(file).sort()) visit(path.join(relative, name));
|
|
575
575
|
} else if (stat.isFile()) {
|
|
576
576
|
const stamp = [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
577
577
|
let cached = sdkFileHashes.get(file);
|
|
@@ -770,12 +770,12 @@ function swiftCompilerInstall(release) {
|
|
|
770
770
|
};
|
|
771
771
|
}
|
|
772
772
|
const platform = `debian12${process.arch === "arm64" ? "-aarch64" : ""}`;
|
|
773
|
-
const
|
|
773
|
+
const name = `${release}-${platform}`;
|
|
774
774
|
return {
|
|
775
775
|
note: " (Debian 12 shown; other distributions: https://www.swift.org/install/linux/)",
|
|
776
776
|
commands: [
|
|
777
|
-
`curl -fsSL ${downloads}/${platform}/${release}/${
|
|
778
|
-
`export PATH=/opt/${
|
|
777
|
+
`curl -fsSL ${downloads}/${platform}/${release}/${name}.tar.gz | tar -xz -C /opt`,
|
|
778
|
+
`export PATH=/opt/${name}/usr/bin:$PATH`
|
|
779
779
|
]
|
|
780
780
|
};
|
|
781
781
|
}
|
|
@@ -821,13 +821,13 @@ function readProcessTable(timeoutMs = 1e4, pid) {
|
|
|
821
821
|
const deadline = Date.now() + timeoutMs;
|
|
822
822
|
const rows2 = [];
|
|
823
823
|
const names = pid === void 0 ? readdirSync("/proc") : [String(pid)];
|
|
824
|
-
for (const
|
|
825
|
-
if (!/^\d+$/.test(
|
|
824
|
+
for (const name of names) {
|
|
825
|
+
if (!/^\d+$/.test(name)) continue;
|
|
826
826
|
if (Date.now() >= deadline)
|
|
827
827
|
throw new Error("process inspection exceeded its deadline");
|
|
828
828
|
let stat;
|
|
829
829
|
try {
|
|
830
|
-
stat = readFileSync(`/proc/${
|
|
830
|
+
stat = readFileSync(`/proc/${name}/stat`, "utf8");
|
|
831
831
|
} catch (error) {
|
|
832
832
|
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ESRCH"))
|
|
833
833
|
continue;
|
|
@@ -837,9 +837,9 @@ function readProcessTable(timeoutMs = 1e4, pid) {
|
|
|
837
837
|
const pgid = Number(fields[2]);
|
|
838
838
|
const ticks = Number(fields[19]);
|
|
839
839
|
if (!fields[0] || !Number.isSafeInteger(pgid) || !Number.isSafeInteger(ticks))
|
|
840
|
-
throw new Error(`unreadable process table row for ${
|
|
840
|
+
throw new Error(`unreadable process table row for ${name}`);
|
|
841
841
|
rows2.push({
|
|
842
|
-
pid: Number(
|
|
842
|
+
pid: Number(name),
|
|
843
843
|
pgid,
|
|
844
844
|
zombie: fields[0] === "Z" || fields[0] === "X",
|
|
845
845
|
start: bootMs + ticks * 1e3 / clockTicks
|
|
@@ -1239,315 +1239,6 @@ function windowAdmission() {
|
|
|
1239
1239
|
};
|
|
1240
1240
|
}
|
|
1241
1241
|
|
|
1242
|
-
// src/swift-root-lock.ts
|
|
1243
|
-
import {
|
|
1244
|
-
spawn as spawn3
|
|
1245
|
-
} from "node:child_process";
|
|
1246
|
-
import { createHash as createHash2, randomUUID } from "node:crypto";
|
|
1247
|
-
import {
|
|
1248
|
-
closeSync,
|
|
1249
|
-
existsSync,
|
|
1250
|
-
linkSync,
|
|
1251
|
-
mkdirSync,
|
|
1252
|
-
openSync,
|
|
1253
|
-
readdirSync as readdirSync3,
|
|
1254
|
-
readFileSync as readFileSync3,
|
|
1255
|
-
realpathSync,
|
|
1256
|
-
rmSync as rmSync2,
|
|
1257
|
-
writeFileSync as writeFileSync2
|
|
1258
|
-
} from "node:fs";
|
|
1259
|
-
import { homedir } from "node:os";
|
|
1260
|
-
import path2 from "node:path";
|
|
1261
|
-
var POLL_MS = 250;
|
|
1262
|
-
var INSPECT_ATTEMPTS = 5;
|
|
1263
|
-
var START_TOLERANCE_MS = 2e3;
|
|
1264
|
-
function errorCode(error) {
|
|
1265
|
-
return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
|
|
1266
|
-
}
|
|
1267
|
-
function processTable(pid) {
|
|
1268
|
-
try {
|
|
1269
|
-
return readProcessTable(void 0, pid);
|
|
1270
|
-
} catch (error) {
|
|
1271
|
-
throw new Error(
|
|
1272
|
-
`swift root lock cannot read the process table: ${error instanceof Error ? error.message : String(error)}`
|
|
1273
|
-
);
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
async function processTableWithRetry(pid, signal) {
|
|
1277
|
-
for (let attempt = 1; ; attempt++) {
|
|
1278
|
-
try {
|
|
1279
|
-
return processTable(pid);
|
|
1280
|
-
} catch (error) {
|
|
1281
|
-
if (attempt >= INSPECT_ATTEMPTS) throw error;
|
|
1282
|
-
await pause(POLL_MS * attempt, signal);
|
|
1283
|
-
signal?.throwIfAborted();
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
function sameProcess(row, identity) {
|
|
1288
|
-
return row.pid === identity.pid && Math.abs(row.start - identity.start) <= START_TOLERANCE_MS;
|
|
1289
|
-
}
|
|
1290
|
-
function ownIdentity(pid) {
|
|
1291
|
-
const row = processTable(pid).find(
|
|
1292
|
-
(candidate) => candidate.pid === pid && !candidate.zombie
|
|
1293
|
-
);
|
|
1294
|
-
if (!row) throw new Error(`swift root lock cannot find process ${pid}`);
|
|
1295
|
-
return { pid, start: row.start };
|
|
1296
|
-
}
|
|
1297
|
-
function parseIdentity(text) {
|
|
1298
|
-
const value = JSON.parse(text);
|
|
1299
|
-
if (value && typeof value === "object" && "pid" in value && typeof value.pid === "number" && Number.isInteger(value.pid) && value.pid > 1 && "start" in value && typeof value.start === "number")
|
|
1300
|
-
return { pid: value.pid, start: value.start };
|
|
1301
|
-
throw new Error(`swift root lock record is not a process identity: ${text}`);
|
|
1302
|
-
}
|
|
1303
|
-
function pause(ms, signal) {
|
|
1304
|
-
return new Promise((resolve) => {
|
|
1305
|
-
const done = () => {
|
|
1306
|
-
clearTimeout(timer);
|
|
1307
|
-
signal?.removeEventListener("abort", done);
|
|
1308
|
-
resolve();
|
|
1309
|
-
};
|
|
1310
|
-
const timer = setTimeout(done, ms);
|
|
1311
|
-
signal?.addEventListener("abort", done, { once: true });
|
|
1312
|
-
});
|
|
1313
|
-
}
|
|
1314
|
-
var name = (number, suffix) => `${String(number).padStart(12, "0")}.${suffix}`;
|
|
1315
|
-
function generationNumbers(directory) {
|
|
1316
|
-
const numbers = /* @__PURE__ */ new Set();
|
|
1317
|
-
for (const entry of readdirSync3(directory)) {
|
|
1318
|
-
const match = /^(\d{12})\./.exec(entry);
|
|
1319
|
-
if (match) numbers.add(Number(match[1]));
|
|
1320
|
-
}
|
|
1321
|
-
return [...numbers].sort((a, b) => a - b);
|
|
1322
|
-
}
|
|
1323
|
-
function readGeneration(directory, number) {
|
|
1324
|
-
let owner;
|
|
1325
|
-
try {
|
|
1326
|
-
owner = readFileSync3(path2.join(directory, name(number, "owner")), "utf8");
|
|
1327
|
-
} catch (error) {
|
|
1328
|
-
if (errorCode(error) === "ENOENT") return null;
|
|
1329
|
-
throw error;
|
|
1330
|
-
}
|
|
1331
|
-
return {
|
|
1332
|
-
number,
|
|
1333
|
-
holder: parseIdentity(owner),
|
|
1334
|
-
released: readdirSync3(directory).includes(name(number, "released"))
|
|
1335
|
-
};
|
|
1336
|
-
}
|
|
1337
|
-
function readChildren(directory, number) {
|
|
1338
|
-
const prefix = name(number, "child.");
|
|
1339
|
-
return readdirSync3(directory).filter((entry) => entry.startsWith(prefix)).map((entry) => parseIdentity(readFileSync3(path2.join(directory, entry), "utf8")));
|
|
1340
|
-
}
|
|
1341
|
-
function groupAlive(table, leader) {
|
|
1342
|
-
const row = table.find((candidate) => candidate.pid === leader.pid);
|
|
1343
|
-
if (row && !sameProcess(row, leader)) return false;
|
|
1344
|
-
return table.some((candidate) => candidate.pgid === leader.pid && !candidate.zombie);
|
|
1345
|
-
}
|
|
1346
|
-
function linuxMountPath(existing) {
|
|
1347
|
-
const fd = openSync(existing, "r");
|
|
1348
|
-
try {
|
|
1349
|
-
const mountId = /^mnt_id:\s+(\d+)$/m.exec(
|
|
1350
|
-
readFileSync3("/proc/self/fdinfo/" + fd, "utf8")
|
|
1351
|
-
)?.[1];
|
|
1352
|
-
const mount = readFileSync3("/proc/self/mountinfo", "utf8").split("\n").find((line) => line.startsWith(mountId + " "))?.split(" ");
|
|
1353
|
-
if (!mount?.[4]) throw new Error("cannot identify Swift build mount for " + existing);
|
|
1354
|
-
const decode = (value) => value.replace(
|
|
1355
|
-
/\\([0-7]{3})/g,
|
|
1356
|
-
(_, octal) => String.fromCharCode(parseInt(octal, 8))
|
|
1357
|
-
);
|
|
1358
|
-
return mount[2] + ":" + path2.join(decode(mount[3]), path2.relative(decode(mount[4]), existing));
|
|
1359
|
-
} finally {
|
|
1360
|
-
closeSync(fd);
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
function rootLockKey(root) {
|
|
1364
|
-
let existing = path2.resolve(root);
|
|
1365
|
-
const missing = [];
|
|
1366
|
-
while (!existsSync(existing) && path2.dirname(existing) !== existing) {
|
|
1367
|
-
missing.unshift(path2.basename(existing));
|
|
1368
|
-
existing = path2.dirname(existing);
|
|
1369
|
-
}
|
|
1370
|
-
existing = realpathSync(existing);
|
|
1371
|
-
const backingPath = process.platform === "linux" ? linuxMountPath(existing) : existing;
|
|
1372
|
-
return path2.join(backingPath, ...missing);
|
|
1373
|
-
}
|
|
1374
|
-
function swiftRootLocksDir() {
|
|
1375
|
-
return path2.join(homedir(), ".peach", "cache", "swift-root-locks");
|
|
1376
|
-
}
|
|
1377
|
-
function lockDirectoryFor(root) {
|
|
1378
|
-
const directory = path2.join(
|
|
1379
|
-
swiftRootLocksDir(),
|
|
1380
|
-
createHash2("sha256").update(rootLockKey(root)).digest("hex").slice(0, 32)
|
|
1381
|
-
);
|
|
1382
|
-
mkdirSync(directory, { recursive: true });
|
|
1383
|
-
return directory;
|
|
1384
|
-
}
|
|
1385
|
-
function acquireSwiftRootReadHold(root) {
|
|
1386
|
-
const directory = lockDirectoryFor(root);
|
|
1387
|
-
const token = randomUUID();
|
|
1388
|
-
const pending = path2.join(directory, `pending.reader.${token}`);
|
|
1389
|
-
const reader = path2.join(directory, `reader.${token}`);
|
|
1390
|
-
writeFileSync2(pending, JSON.stringify(ownIdentity(process.pid)));
|
|
1391
|
-
try {
|
|
1392
|
-
linkSync(pending, reader);
|
|
1393
|
-
} finally {
|
|
1394
|
-
rmSync2(pending, { force: true });
|
|
1395
|
-
}
|
|
1396
|
-
let released = false;
|
|
1397
|
-
return {
|
|
1398
|
-
release() {
|
|
1399
|
-
if (released) return;
|
|
1400
|
-
released = true;
|
|
1401
|
-
rmSync2(reader, { force: true });
|
|
1402
|
-
}
|
|
1403
|
-
};
|
|
1404
|
-
}
|
|
1405
|
-
async function hasLiveSwiftRootReaders(root, signal) {
|
|
1406
|
-
const directory = lockDirectoryFor(root);
|
|
1407
|
-
const entries = readdirSync3(directory).filter((entry) => entry.startsWith("reader."));
|
|
1408
|
-
if (entries.length === 0) return false;
|
|
1409
|
-
for (const entry of entries) {
|
|
1410
|
-
const file = path2.join(directory, entry);
|
|
1411
|
-
let text;
|
|
1412
|
-
try {
|
|
1413
|
-
text = readFileSync3(file, "utf8");
|
|
1414
|
-
} catch (error) {
|
|
1415
|
-
if (errorCode(error) === "ENOENT") continue;
|
|
1416
|
-
throw error;
|
|
1417
|
-
}
|
|
1418
|
-
const identity = parseIdentity(text);
|
|
1419
|
-
const rows = await processTableWithRetry(identity.pid, signal);
|
|
1420
|
-
if (rows.some((row) => !row.zombie && sameProcess(row, identity))) return true;
|
|
1421
|
-
rmSync2(file, { force: true });
|
|
1422
|
-
}
|
|
1423
|
-
return false;
|
|
1424
|
-
}
|
|
1425
|
-
async function waitForNoSwiftRootReaders(root, signal) {
|
|
1426
|
-
let announced = false;
|
|
1427
|
-
while (await hasLiveSwiftRootReaders(root, signal)) {
|
|
1428
|
-
signal?.throwIfAborted();
|
|
1429
|
-
if (!announced) {
|
|
1430
|
-
announced = true;
|
|
1431
|
-
process.stderr.write(`[swift-root-lock] waiting for readers of ${root}
|
|
1432
|
-
`);
|
|
1433
|
-
}
|
|
1434
|
-
await pause(POLL_MS, signal);
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
async function withSwiftRootLock(root, work, signal, wait = true) {
|
|
1438
|
-
const directory = lockDirectoryFor(root);
|
|
1439
|
-
const token = randomUUID();
|
|
1440
|
-
const ownRow = (await processTableWithRetry(process.pid, signal)).find(
|
|
1441
|
-
(candidate) => candidate.pid === process.pid && !candidate.zombie
|
|
1442
|
-
);
|
|
1443
|
-
if (!ownRow) throw new Error(`swift root lock cannot find process ${process.pid}`);
|
|
1444
|
-
const owner = JSON.stringify({ pid: process.pid, start: ownRow.start });
|
|
1445
|
-
const pending = path2.join(directory, `pending.${token}`);
|
|
1446
|
-
let held = 0;
|
|
1447
|
-
let announced = 0;
|
|
1448
|
-
let current = null;
|
|
1449
|
-
const waiting = async (reason) => {
|
|
1450
|
-
if (announced !== current?.number) {
|
|
1451
|
-
announced = current?.number ?? 0;
|
|
1452
|
-
process.stderr.write(`[swift-root-lock] waiting for ${root}: ${reason}
|
|
1453
|
-
`);
|
|
1454
|
-
}
|
|
1455
|
-
await pause(POLL_MS, signal);
|
|
1456
|
-
};
|
|
1457
|
-
for (; ; ) {
|
|
1458
|
-
signal?.throwIfAborted();
|
|
1459
|
-
const newest = generationNumbers(directory).at(-1) ?? 0;
|
|
1460
|
-
current = newest > 0 ? readGeneration(directory, newest) : null;
|
|
1461
|
-
if (newest > 0 && !current) continue;
|
|
1462
|
-
if (current && !current.released) {
|
|
1463
|
-
const { holder: identity } = current;
|
|
1464
|
-
const holder = await processTableWithRetry(identity.pid, signal);
|
|
1465
|
-
if (holder.some((row) => !row.zombie && sameProcess(row, identity))) {
|
|
1466
|
-
if (!wait) return void 0;
|
|
1467
|
-
await waiting(`held by pid ${identity.pid}`);
|
|
1468
|
-
continue;
|
|
1469
|
-
}
|
|
1470
|
-
const children2 = readChildren(directory, newest);
|
|
1471
|
-
if (children2.length) {
|
|
1472
|
-
const table = await processTableWithRetry(void 0, signal);
|
|
1473
|
-
const orphaned = children2.filter((child) => groupAlive(table, child));
|
|
1474
|
-
if (orphaned.length) {
|
|
1475
|
-
if (!wait) return void 0;
|
|
1476
|
-
for (const child of orphaned) killOrphanedProcessGroup(child.pid);
|
|
1477
|
-
await waiting(
|
|
1478
|
-
`stopping compiler groups ${orphaned.map((child) => child.pid).join(", ")} left by dead pid ${identity.pid}`
|
|
1479
|
-
);
|
|
1480
|
-
continue;
|
|
1481
|
-
}
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
writeFileSync2(pending, owner);
|
|
1485
|
-
try {
|
|
1486
|
-
linkSync(pending, path2.join(directory, name(newest + 1, "owner")));
|
|
1487
|
-
} catch (error) {
|
|
1488
|
-
if (errorCode(error) === "EEXIST") continue;
|
|
1489
|
-
throw error;
|
|
1490
|
-
} finally {
|
|
1491
|
-
rmSync2(pending, { force: true });
|
|
1492
|
-
}
|
|
1493
|
-
const numbers = generationNumbers(directory);
|
|
1494
|
-
if (numbers.at(-1) !== newest + 1) {
|
|
1495
|
-
rmSync2(path2.join(directory, name(newest + 1, "owner")), { force: true });
|
|
1496
|
-
continue;
|
|
1497
|
-
}
|
|
1498
|
-
held = newest + 1;
|
|
1499
|
-
for (const number of numbers)
|
|
1500
|
-
if (number < held) {
|
|
1501
|
-
for (const entry of readdirSync3(directory))
|
|
1502
|
-
if (entry.startsWith(name(number, "")))
|
|
1503
|
-
rmSync2(path2.join(directory, entry), { force: true });
|
|
1504
|
-
}
|
|
1505
|
-
break;
|
|
1506
|
-
}
|
|
1507
|
-
const children = [];
|
|
1508
|
-
const lease = {
|
|
1509
|
-
register(child) {
|
|
1510
|
-
const index = children.push(child);
|
|
1511
|
-
if (child.pid === void 0) throw new Error("could not register compiler process");
|
|
1512
|
-
const childPending = `${pending}.child.${index}`;
|
|
1513
|
-
try {
|
|
1514
|
-
writeFileSync2(childPending, JSON.stringify(ownIdentity(child.pid)));
|
|
1515
|
-
linkSync(childPending, path2.join(directory, name(held, `child.${index}`)));
|
|
1516
|
-
} finally {
|
|
1517
|
-
rmSync2(childPending, { force: true });
|
|
1518
|
-
}
|
|
1519
|
-
},
|
|
1520
|
-
spawn(command, args, options, companion) {
|
|
1521
|
-
const child = spawn3(
|
|
1522
|
-
"/bin/sh",
|
|
1523
|
-
["-c", 'IFS= read -r go || exit 1; exec "$@" </dev/null', "sh", command, ...args],
|
|
1524
|
-
{ ...options, detached: true, stdio: ["pipe", "pipe", "pipe"] }
|
|
1525
|
-
);
|
|
1526
|
-
child.stdin.on("error", () => {
|
|
1527
|
-
});
|
|
1528
|
-
if (child.pid === void 0) {
|
|
1529
|
-
child.stdin.destroy();
|
|
1530
|
-
return child;
|
|
1531
|
-
}
|
|
1532
|
-
try {
|
|
1533
|
-
lease.register(child);
|
|
1534
|
-
companion?.register(child);
|
|
1535
|
-
} catch (error) {
|
|
1536
|
-
child.stdin.destroy();
|
|
1537
|
-
throw error;
|
|
1538
|
-
}
|
|
1539
|
-
child.stdin.end("go\n");
|
|
1540
|
-
return child;
|
|
1541
|
-
}
|
|
1542
|
-
};
|
|
1543
|
-
try {
|
|
1544
|
-
return await work(lease);
|
|
1545
|
-
} finally {
|
|
1546
|
-
await Promise.all(children.map((child) => terminateProcessGroup(child, "SIGKILL", 0)));
|
|
1547
|
-
writeFileSync2(path2.join(directory, name(held, "released")), "");
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
1242
|
export {
|
|
1552
1243
|
SWIFT_WASM_TRIPLE,
|
|
1553
1244
|
wasmThreadFlags,
|
|
@@ -1568,10 +1259,8 @@ export {
|
|
|
1568
1259
|
swiftToolchain,
|
|
1569
1260
|
swiftFileChecksum,
|
|
1570
1261
|
swiftCompiler,
|
|
1262
|
+
readProcessTable,
|
|
1263
|
+
killOrphanedProcessGroup,
|
|
1571
1264
|
terminateProcessGroup,
|
|
1572
|
-
windowAdmission
|
|
1573
|
-
acquireSwiftRootReadHold,
|
|
1574
|
-
hasLiveSwiftRootReaders,
|
|
1575
|
-
waitForNoSwiftRootReaders,
|
|
1576
|
-
withSwiftRootLock
|
|
1265
|
+
windowAdmission
|
|
1577
1266
|
};
|