peachsim 0.1.2743 → 0.1.2744
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/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 +23 -24
- 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-4LW63VJO.mjs → acorn-3G2P6SLD.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-EAAYQS4L.mjs → chunk-2XVKKP7C.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2HP5FPCA.mjs → chunk-3N3NWKOV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-6FHNPTCA.mjs → chunk-3R76QB7G.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-BNJ5YG7V.mjs → chunk-4BSH2PJJ.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-VJKLZAU2.mjs → chunk-4J7M5ABU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HOUFNDEV.mjs → chunk-4SL6WT5R.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JHOZWSFF.mjs → chunk-5EMHE44C.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7NBU6OXB.mjs → chunk-6HF6522F.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-V3SRJIBE.mjs → chunk-7PZCYBRZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BJSA6VP6.mjs → chunk-CWTZZ5PW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GIZQHA6L.mjs → chunk-EP64ATYX.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-THJMTM3L.mjs → chunk-ESGH55PU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SG7MN2KW.mjs → chunk-FZCF4XKV.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-BQUYNIMY.mjs → chunk-MHWKZ233.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WKGJ6LAU.mjs → chunk-MK5GDI4J.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-THSR72MV.mjs → chunk-NA3WRJON.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XP5F6PNN.mjs → chunk-OYGAP4IB.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OEQBNK6V.mjs → chunk-Q3AUIPF2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-23OQSLRP.mjs → chunk-QNMAUXAH.mjs} +32 -33
- package/dist-lib/esm-chunks/{chunk-BW3KZJV5.mjs → chunk-SI55AJTD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EES2SLJK.mjs → chunk-U6INDDV4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ZLQX4SVV.mjs → chunk-V6QXWGYS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-B3F4HKM6.mjs → chunk-XRGF7PWG.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-LVCSLWR2.mjs → chunk-YPT6XQJX.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-L57PU3TD.mjs → metro-layout-parser-IISMSHQ6.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-UNXWJN7B.mjs → swift-package-prebuilt-VA4DWCFB.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-DZV3XYCP.mjs → swift-sdk-app-module-3UUKIQI6.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-WRYMP64Z.mjs → swift-sdk-image-XJURAHAQ.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-D6DOCCCR.mjs → swift-sdk-image-producer-HF3NTKWX.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +23 -24
- 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 +46 -48
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
- 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 +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- 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 +85 -85
- package/dist-lib/public-origins-lib.json +64 -64
- 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 +46 -48
- package/dist-lib/swift-compile.cjs +20 -21
- package/dist-lib/swift-compile.mjs +12 -12
- 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/package.json +1 -1
- package/src/one-direct-host-source.ts +23 -24
- package/src/swift-compile.ts +26 -32
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (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
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __commonJS = (cb, mod) => function __require() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (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
|
|
|
4
4
|
// ../../node_modules/valibot/dist/index.cjs
|
package/dist-lib/vendor/ws.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (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 __getOwnPropNames = Object.getOwnPropertyNames;
|
package/dist-lib/vendor/zod.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (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 __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (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,12 +1,12 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2744 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
parse
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-NA3WRJON.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__privateAdd,
|
|
7
7
|
__privateGet,
|
|
8
8
|
__publicField
|
|
9
|
-
} from "./esm-chunks/chunk-
|
|
9
|
+
} from "./esm-chunks/chunk-YPT6XQJX.mjs";
|
|
10
10
|
|
|
11
11
|
// src/worklet-kernel.ts
|
|
12
12
|
var Unsupported = class extends Error {
|
package/package.json
CHANGED
|
@@ -60,19 +60,10 @@ public final class PeachOneDirectStage: NSObject {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
@objc public func attachHostView(_ view: UIView, frame: CGRect) {
|
|
64
|
-
if view.superview !== stageView {
|
|
65
|
-
view.removeFromSuperview()
|
|
66
|
-
stageView.addSubview(view)
|
|
67
|
-
}
|
|
68
|
-
if view.frame != frame {
|
|
69
|
-
view.frame = frame
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
63
|
@objc public func detachHostView(_ view: UIView) {
|
|
64
|
+
let wasDirectHost = view._peachReactContentHost != nil
|
|
74
65
|
view._peachReactContentHost = nil
|
|
75
|
-
if
|
|
66
|
+
if wasDirectHost {
|
|
76
67
|
view.removeFromSuperview()
|
|
77
68
|
}
|
|
78
69
|
}
|
|
@@ -1918,6 +1909,7 @@ struct DirectContainerRecord {
|
|
|
1918
1909
|
BOOL composed = NO;
|
|
1919
1910
|
peach_node hostContentNode = 0;
|
|
1920
1911
|
CGRect frame = CGRectZero;
|
|
1912
|
+
__weak UIView* hostParent = nil;
|
|
1921
1913
|
};
|
|
1922
1914
|
|
|
1923
1915
|
std::unordered_map<peach_node, DirectContainerRecord> gRecords;
|
|
@@ -1925,6 +1917,16 @@ std::unordered_map<peach_node, UIView*> gContentViews;
|
|
|
1925
1917
|
std::unordered_map<peach_node, UIView*> gTriggerViews;
|
|
1926
1918
|
peach_node gInPlaceTriggerNode = 0;
|
|
1927
1919
|
|
|
1920
|
+
UIView* contentViewForNode(peach_node node) {
|
|
1921
|
+
auto& slot = gContentViews[node];
|
|
1922
|
+
if (!slot) {
|
|
1923
|
+
slot = [[UIView alloc] initWithFrame:CGRectZero];
|
|
1924
|
+
slot.backgroundColor = UIColor.clearColor;
|
|
1925
|
+
[PeachOneDirectStage.shared tagContentView:slot node:node];
|
|
1926
|
+
}
|
|
1927
|
+
return slot;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1928
1930
|
NSString* nsStringFromBytes(const char* ptr, uint32_t len) {
|
|
1929
1931
|
if (!ptr || !len) return @"";
|
|
1930
1932
|
return [[NSString alloc] initWithBytes:ptr length:len encoding:NSUTF8StringEncoding] ?: @"";
|
|
@@ -2026,6 +2028,7 @@ id<PeachContainer> makeContainer(NSString* kind, peach_node node, NSDictionary*
|
|
|
2026
2028
|
it->second.hostView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, it->second.frame.size.width, it->second.frame.size.height)];
|
|
2027
2029
|
}
|
|
2028
2030
|
UIView* hostView = it->second.hostView;
|
|
2031
|
+
it->second.hostParent = nil;
|
|
2029
2032
|
[PeachOneDirectStage.shared detachHostView:hostView];
|
|
2030
2033
|
return hostView;
|
|
2031
2034
|
}
|
|
@@ -2039,13 +2042,7 @@ id<PeachContainer> makeContainer(NSString* kind, peach_node node, NSDictionary*
|
|
|
2039
2042
|
}
|
|
2040
2043
|
return trigger;
|
|
2041
2044
|
}
|
|
2042
|
-
|
|
2043
|
-
if (!slot) {
|
|
2044
|
-
slot = [[UIView alloc] initWithFrame:CGRectZero];
|
|
2045
|
-
slot.backgroundColor = UIColor.clearColor;
|
|
2046
|
-
[PeachOneDirectStage.shared tagContentView:slot node:node];
|
|
2047
|
-
}
|
|
2048
|
-
return slot;
|
|
2045
|
+
return contentViewForNode(node);
|
|
2049
2046
|
}
|
|
2050
2047
|
|
|
2051
2048
|
- (CGSize)layoutSizeForNode:(peach_node)node {
|
|
@@ -2222,13 +2219,16 @@ void peach_one_container_mount(uint32_t targetLo, uint32_t targetHi, uint32_t pa
|
|
|
2222
2219
|
record.hostView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, w, h)];
|
|
2223
2220
|
record.hostView.backgroundColor = UIColor.clearColor;
|
|
2224
2221
|
}
|
|
2225
|
-
UIView*
|
|
2226
|
-
if (
|
|
2222
|
+
UIView* currentParent = record.hostView.superview;
|
|
2223
|
+
if (!currentParent || currentParent == record.hostParent) {
|
|
2224
|
+
UIView* parent = hostContentNode ? contentViewForNode(hostContentNode) : PeachOneDirectStage.shared.stageView;
|
|
2225
|
+
record.hostParent = parent;
|
|
2227
2226
|
[PeachOneDirectStage.shared tagHostView:record.hostView
|
|
2228
2227
|
node:node
|
|
2229
2228
|
hostContentNode:hostContentNode];
|
|
2230
|
-
[
|
|
2231
|
-
|
|
2229
|
+
if (currentParent != parent) [parent addSubview:record.hostView];
|
|
2230
|
+
const CGRect next = CGRectMake(0, 0, w, h);
|
|
2231
|
+
if (!CGRectEqualToRect(record.hostView.frame, next)) record.hostView.frame = next;
|
|
2232
2232
|
} else {
|
|
2233
2233
|
CGRect current = record.hostView.frame;
|
|
2234
2234
|
current.size = CGSizeMake(w, h);
|
|
@@ -2262,8 +2262,7 @@ void peach_one_container_mount(uint32_t targetLo, uint32_t targetHi, uint32_t pa
|
|
|
2262
2262
|
|
|
2263
2263
|
// bounds-only update after layout (never re-runs mountIn on PeachSwiftUI)
|
|
2264
2264
|
if (!record.composed && record.hostView) {
|
|
2265
|
-
|
|
2266
|
-
if (record.hostView.superview == stageView) {
|
|
2265
|
+
if (record.hostParent && record.hostView.superview == record.hostParent) {
|
|
2267
2266
|
const CGRect next = CGRectMake(0, 0, w, h);
|
|
2268
2267
|
if (!CGRectEqualToRect(record.hostView.frame, next)) {
|
|
2269
2268
|
record.hostView.frame = next;
|
package/src/swift-compile.ts
CHANGED
|
@@ -6825,6 +6825,7 @@ const SWIFT_FRAMEWORK_UNOPTIMIZED_SLOTS = 4
|
|
|
6825
6825
|
const SWIFT_FRAMEWORK_SLOT_KEY = '.peach-framework-key'
|
|
6826
6826
|
const SWIFT_FRAMEWORK_SLOT_ORIGIN = '.peach-framework-origin'
|
|
6827
6827
|
const SWIFT_FRAMEWORK_SLOT_RELEASE = '.peach-framework-release'
|
|
6828
|
+
const SWIFT_FRAMEWORK_SLOT_HANDOFF = '.peach-framework-handoff'
|
|
6828
6829
|
|
|
6829
6830
|
const SWIFT_BUILD_ROOT_SLOTS = 4
|
|
6830
6831
|
const SWIFT_BUILD_ROOT_SHAPE = '.peach-build-shape'
|
|
@@ -6869,20 +6870,7 @@ function swiftFrameworkSlotRelease(slot: string): string | null {
|
|
|
6869
6870
|
return swiftFrameworkSlotRecord(slot, SWIFT_FRAMEWORK_SLOT_RELEASE)
|
|
6870
6871
|
}
|
|
6871
6872
|
|
|
6872
|
-
|
|
6873
|
-
// producer's caller or iterative guest build to reuse it before restaging.
|
|
6874
|
-
const SWIFT_FRAMEWORK_HOT_RECEIPT_MS = 15 * 60 * 1000
|
|
6875
|
-
|
|
6876
|
-
function swiftFrameworkSlotHasReceipt(slot: string): boolean {
|
|
6877
|
-
try {
|
|
6878
|
-
return readdirSync(path.join(slot, 'products-ready')).some((entry) =>
|
|
6879
|
-
entry.endsWith('.json'),
|
|
6880
|
-
)
|
|
6881
|
-
} catch (error) {
|
|
6882
|
-
if (vanished(error)) return false
|
|
6883
|
-
throw error
|
|
6884
|
-
}
|
|
6885
|
-
}
|
|
6873
|
+
const SWIFT_FRAMEWORK_HANDOFF_MS = 15 * 60 * 1000
|
|
6886
6874
|
|
|
6887
6875
|
async function withSwiftFrameworkSlot<T>(
|
|
6888
6876
|
frameworkKey: string,
|
|
@@ -6894,7 +6882,8 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
6894
6882
|
lease: SwiftRootLease,
|
|
6895
6883
|
allowWrite: boolean,
|
|
6896
6884
|
) => Promise<T | undefined>,
|
|
6897
|
-
unoptimized
|
|
6885
|
+
unoptimized: boolean,
|
|
6886
|
+
linkOnly: boolean,
|
|
6898
6887
|
): Promise<T> {
|
|
6899
6888
|
const slotCount = swiftFrameworkSlotCount(unoptimized)
|
|
6900
6889
|
const slotsDir = swiftFrameworksDir(unoptimized)
|
|
@@ -6913,15 +6902,20 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
6913
6902
|
throw error
|
|
6914
6903
|
}
|
|
6915
6904
|
}
|
|
6916
|
-
const
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6905
|
+
const handoffFile = (slot: string) => path.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF)
|
|
6906
|
+
const hasPendingForeignHandoff = (slot: string, now: number) => {
|
|
6907
|
+
const stamp = statSync(handoffFile(slot), { throwIfNoEntry: false })
|
|
6908
|
+
return (
|
|
6909
|
+
stamp !== undefined &&
|
|
6910
|
+
!own(slot) &&
|
|
6911
|
+
now - stamp.mtimeMs < SWIFT_FRAMEWORK_HANDOFF_MS
|
|
6912
|
+
)
|
|
6913
|
+
}
|
|
6920
6914
|
const trySlot = (
|
|
6921
6915
|
slot: string,
|
|
6922
6916
|
mode: 'reuse' | 'extend' | 'restage',
|
|
6923
6917
|
logSelection?: () => void,
|
|
6924
|
-
|
|
6918
|
+
allowPendingHandoff = true,
|
|
6925
6919
|
) => {
|
|
6926
6920
|
return withSwiftRootLock(
|
|
6927
6921
|
slot,
|
|
@@ -6930,13 +6924,12 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
6930
6924
|
if (mode !== 'restage' && !matches) return
|
|
6931
6925
|
const allowWrite = mode !== 'reuse'
|
|
6932
6926
|
if (allowWrite && (await hasLiveSwiftRootReaders(slot, signal))) return
|
|
6933
|
-
//
|
|
6934
|
-
// a foreign receipt written while waiting when cold/empty slots exist.
|
|
6927
|
+
// an image producer can finish preparing this slot after we ranked it.
|
|
6935
6928
|
if (
|
|
6936
6929
|
mode === 'restage' &&
|
|
6937
6930
|
!matches &&
|
|
6938
|
-
!
|
|
6939
|
-
|
|
6931
|
+
!allowPendingHandoff &&
|
|
6932
|
+
hasPendingForeignHandoff(slot, Date.now())
|
|
6940
6933
|
)
|
|
6941
6934
|
return
|
|
6942
6935
|
if (!matches) logSelection?.()
|
|
@@ -6951,6 +6944,8 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
6951
6944
|
`[swift-framework-cache] ${path.basename(slot)} hit=products release=${release}`,
|
|
6952
6945
|
)
|
|
6953
6946
|
const now = new Date()
|
|
6947
|
+
if (linkOnly) writeFileSync(handoffFile(slot), '')
|
|
6948
|
+
else rmSync(handoffFile(slot), { force: true })
|
|
6954
6949
|
utimesSync(slot, now, now)
|
|
6955
6950
|
return { value }
|
|
6956
6951
|
},
|
|
@@ -7000,10 +6995,10 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
7000
6995
|
}
|
|
7001
6996
|
// swiftc's swift-version hash invalidates every framework target when a slot
|
|
7002
6997
|
// switches compiler release. keep each compiler release in its own slot and
|
|
7003
|
-
//
|
|
7004
|
-
// tier 0:
|
|
6998
|
+
// protect a foreign producer's products until an app has reused them.
|
|
6999
|
+
// tier 0: available same-release slot (nearest source, own first, LRU ties),
|
|
7005
7000
|
// tier 1: empty slot,
|
|
7006
|
-
// tier 2:
|
|
7001
|
+
// tier 2: pending foreign handoff (LRU first),
|
|
7007
7002
|
// tier 3: another release (LRU).
|
|
7008
7003
|
const rankSlots = (now: number) =>
|
|
7009
7004
|
slots
|
|
@@ -7016,11 +7011,8 @@ async function withSwiftFrameworkSlot<T>(
|
|
|
7016
7011
|
return { slot, index, tier: 3, changes: Infinity, own: false, mtimeMs }
|
|
7017
7012
|
const changes = changedInputsFor(slot, slotKey)
|
|
7018
7013
|
const isOwn = own(slot)
|
|
7019
|
-
const
|
|
7020
|
-
|
|
7021
|
-
swiftFrameworkSlotHasReceipt(slot) &&
|
|
7022
|
-
now - mtimeMs < SWIFT_FRAMEWORK_HOT_RECEIPT_MS
|
|
7023
|
-
return { slot, index, tier: hotForeign ? 2 : 0, changes, own: isOwn, mtimeMs }
|
|
7014
|
+
const tier = hasPendingForeignHandoff(slot, now) ? 2 : 0
|
|
7015
|
+
return { slot, index, tier, changes, own: isOwn, mtimeMs }
|
|
7024
7016
|
})
|
|
7025
7017
|
.sort((left, right) => {
|
|
7026
7018
|
if (left.tier !== right.tier) return left.tier - right.tier
|
|
@@ -7195,6 +7187,7 @@ function stageFrameworkSource(
|
|
|
7195
7187
|
// an interrupted restage must not look like a finished one
|
|
7196
7188
|
rmSync(path.join(slot, SWIFT_FRAMEWORK_SLOT_KEY), { force: true })
|
|
7197
7189
|
rmSync(path.join(slot, SWIFT_FRAMEWORK_SLOT_RELEASE), { force: true })
|
|
7190
|
+
rmSync(path.join(slot, SWIFT_FRAMEWORK_SLOT_HANDOFF), { force: true })
|
|
7198
7191
|
rmSync(path.join(slot, 'products-ready'), { recursive: true, force: true })
|
|
7199
7192
|
rmSync(path.join(slot, 'products-lib'), { recursive: true, force: true })
|
|
7200
7193
|
rmSync(path.join(slot, 'lib'), { recursive: true, force: true })
|
|
@@ -7650,6 +7643,7 @@ async function compileSwiftProjectOnce(
|
|
|
7650
7643
|
budget.signal,
|
|
7651
7644
|
prepareFrameworks,
|
|
7652
7645
|
unoptimized,
|
|
7646
|
+
options.linkOnly === true,
|
|
7653
7647
|
)
|
|
7654
7648
|
if (!frameworks)
|
|
7655
7649
|
throw new Error('Swift distribution did not provide its frameworks')
|