stim 1.26.0 → 1.28.0
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/{acquire-artifact-DVsvSwf7.mjs → acquire-artifact-CKByBnTD.mjs} +2 -2
- package/dist/{act-C-BqJEpu.mjs → act-8iswyfRa.mjs} +319 -126
- package/dist/{activity-Lnb_EoRY.mjs → activity-DRMg4_mD.mjs} +6 -6
- package/dist/{agent-device-usage-output-DbXy5tg8.mjs → agent-device-usage-output-tE90fDdo.mjs} +5 -5
- package/dist/{android-CiNQw3kq.mjs → android-CHmSU4B4.mjs} +101 -45
- package/dist/{android-DTAcRwBC.mjs → android-CsPs-7Mg.mjs} +23 -18
- package/dist/{android-B5P81yI-.mjs → android-D577ApKG.mjs} +37 -15
- package/dist/{android-CSbLRD53.mjs → android-YWCbmkVK.mjs} +5 -5
- package/dist/{android-cas-BTVhZ0Qs.mjs → android-cas-_aDifWW0.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/api.d.mts +14 -4
- package/dist/api.mjs +39 -29
- package/dist/{apk-signed-tail-B46U9hXc.mjs → apk-signed-tail-CQbwM0qO.mjs} +2 -2
- package/dist/{artifact-CsAP6AGK.mjs → artifact-DYtHjxsn.mjs} +19 -24
- package/dist/{artifact-BxREhAaV.mjs → artifact-bFkfD3vf.mjs} +18 -23
- package/dist/{artifact-platform-CMRc0M_r.mjs → artifact-platform-BO2Uvk_A.mjs} +1 -1
- package/dist/auto-placement-BVqs8AJi.mjs +350 -0
- package/dist/{browser-web-rYPyqhTf.mjs → browser-web-BUaLcafY.mjs} +16 -16
- package/dist/{build-DPhApsjV.mjs → build-cQURy_KW.mjs} +35 -31
- package/dist/{build-cache-DrXNCy3T.mjs → build-cache-CZULpXVl.mjs} +43 -21
- package/dist/{build-plan-DrMMdayj.mjs → build-plan-CxoYfxsc.mjs} +7 -6
- package/dist/{cache-manifest-BEZ9Bpl1.mjs → cache-manifest-DEjqGGat.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{budget-k2mZGvvk.mjs → ccache-Bm_A1xX9.mjs} +562 -1604
- package/dist/{cdp-BG3FJCCx.mjs → cdp-C3svvXiE.mjs} +1 -1
- package/dist/{chrome-BvV8ssI3.mjs → chrome-DyDWurWG.mjs} +1 -1
- package/dist/{cli-BBKFGOFl.mjs → cli-CpbaLDa7.mjs} +24 -23
- package/dist/cli.mjs +1 -1
- package/dist/{client-D9CaRks-.mjs → client-YxCer6ab.mjs} +84 -65
- package/dist/collector-run.d.mts +10 -9
- package/dist/collector-run.mjs +42 -27
- package/dist/{command-output-BF5AR2dL.mjs → command-output-C8R1KIvi.mjs} +1 -1
- package/dist/{config-BktkY_zC.mjs → config-Cn94Jc0g.mjs} +23 -4
- package/dist/{dependencies-Dw6wfQdv.mjs → dependencies-DKeMzwXY.mjs} +108 -60
- package/dist/{dependency-state-DFB41vfr.mjs → dependency-state-CojA2o0t.mjs} +14 -7
- package/dist/{detached-entry-KmieOKgN.mjs → detached-entry-BPlSaCwC.mjs} +1 -1
- package/dist/{dev-client-DXR_tPVY.mjs → dev-client-D-BW5uiq.mjs} +2 -2
- package/dist/{device-BK-zwyd_.mjs → device-CgXfbcz5.mjs} +25 -24
- package/dist/{device-capacity-DCSvUF0l.mjs → device-capacity-Cd8lMSn3.mjs} +175 -22
- package/dist/{device-BcYeHSFu.mjs → device-eeK95Lir.mjs} +16 -16
- package/dist/device-host-worker.mjs +22 -20
- package/dist/{device-ios-BLGfXQeK.mjs → device-ios-Cc9ulihb.mjs} +251 -23
- package/dist/{device-lease-run-BmvIl7bI.mjs → device-lease-run-Mtzp4THX.mjs} +5 -5
- package/dist/{device-pool-Dluix4H3.mjs → device-pool-eRz6DtCg.mjs} +3 -3
- package/dist/{doctor-Bhg1ii70.mjs → doctor-Bz_ouYAW.mjs} +28 -16
- package/dist/{doctor-Cp-BhzTS.mjs → doctor-C2QyhejJ.mjs} +1 -1
- package/dist/{doctor-fingerprint-D3a04Mhu.mjs → doctor-fingerprint-o7ZI9YLn.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-BStK05nt.mjs → doctor-watchman-BTW82PDC.mjs} +5 -5
- package/dist/{doctor-OnwP94ne.mjs → doctor-xf7ht-5n.mjs} +76 -32
- package/dist/{eas-build-Dsj93iM9.mjs → eas-build-Dm6q68QY.mjs} +4 -4
- package/dist/eas-fallback-DajNpxf-.mjs +87 -0
- package/dist/{eas-session-ledger-B5vygTiD.mjs → eas-session-ledger-CBFo_Uo1.mjs} +37 -8
- package/dist/{error-diagnostics-BOOm9Db7.mjs → error-diagnostics-D1QfyJzQ.mjs} +51 -25
- package/dist/{exec-VFRpu1iA.mjs → exec-aULwtNly.mjs} +57 -6
- package/dist/{gc-ldgr-hXU.mjs → gc-DM5oMm-J.mjs} +161 -45
- package/dist/{gc-C_79zvz4.mjs → gc-PLFwb0k4.mjs} +2 -2
- package/dist/{guide-D7K0X6KG.mjs → guide-C4I46XAk.mjs} +674 -213
- package/dist/{hosted-android-Bk54ej6n.mjs → hosted-android-DlaKLbW0.mjs} +6 -7
- package/dist/{hosted-client-fHO8yqzc.mjs → hosted-client-DDRm9hPJ.mjs} +51 -20
- package/dist/{hosted-logs-BfbmDM4M.mjs → hosted-logs-bSebOKbz.mjs} +8 -8
- package/dist/{hosted-logs-sync-B0pvmOk-.mjs → hosted-logs-sync-B0c53W_c.mjs} +5 -5
- package/dist/{hosted-macos-CPl0OZ9h.mjs → hosted-macos-B7-8Pv4H.mjs} +6 -6
- package/dist/{hosted-native-CpDB3-PO.mjs → hosted-native-CDe33CSr.mjs} +22 -18
- package/dist/{idle-shutdown-FfxL1KdG.mjs → idle-shutdown-CQ0QwU9J.mjs} +7 -8
- package/dist/{ios-WxpDJ5T1.mjs → ios-B1DYuOjh.mjs} +27 -11
- package/dist/{ios-B7-lToDu.mjs → ios-B1HvafEG.mjs} +8 -8
- package/dist/{ios-ENC4sRPA.mjs → ios-CsRVik64.mjs} +7 -1
- package/dist/{ios-device-CsyryvpT.mjs → ios-device-B4elVFKi.mjs} +3 -3
- package/dist/{ios-device-B6HK951C.mjs → ios-device-CiBA-er9.mjs} +1 -1
- package/dist/{ios-project-Ty5pHl9O.mjs → ios-project-CR4mZ7CH.mjs} +22 -9
- package/dist/{ios-signing-4c_qXvQm.mjs → ios-signing-BJzvDPfU.mjs} +2 -2
- package/dist/{ios-state-Cw7-WQf2.mjs → ios-state-BPHqMDdZ.mjs} +1 -1
- package/dist/{ios-ftxdQbJS.mjs → ios-tg4tp3q1.mjs} +94 -37
- package/dist/{js-swap-BMhXYVDS.mjs → js-swap-CVpSW1fn.mjs} +8 -7
- package/dist/{launch-DOp8RjDz.mjs → launch-DoySmhjz.mjs} +42 -38
- package/dist/lightened-DFAJgfIk.mjs +171 -0
- package/dist/{logs-s1dRIG1E.mjs → logs-BGsW7iPe.mjs} +46 -21
- package/dist/{logs-dQDki6Tt.mjs → logs-DI5ILkYB.mjs} +7 -7
- package/dist/{macos-DBBPNnIA.mjs → macos-Bo9st9Di.mjs} +73 -38
- package/dist/{macos-B0VEV3Gf.mjs → macos-C12RMJQF.mjs} +1 -1
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +7 -7
- package/dist/{metro-CjC10t6E.mjs → metro-BnhXV2Mj.mjs} +4 -4
- package/dist/{metro-gateway-B6_PgD0L.mjs → metro-request-DXyKjVDF.mjs} +26 -47
- package/dist/{named-ports-BG0j1X4g.mjs → named-ports-Phoi2POD.mjs} +3 -3
- package/dist/{native-android-CL2NGiik.mjs → native-android-vxgtLD7w.mjs} +17 -18
- package/dist/{native-gradle-artifact-inputs-btSUulme.mjs → native-gradle-artifact-inputs-BN96IVw8.mjs} +5 -5
- package/dist/{native-runtime-Dq3RBcON.mjs → native-runtime-DG4Rodzj.mjs} +9 -8
- package/dist/{native-source-D-4Dh4JU.mjs → native-source-D1AzWiuP.mjs} +1 -1
- package/dist/{native-xcode-inputs-BW7H8JGu.mjs → native-xcode-inputs-BKarCoKg.mjs} +3 -3
- package/dist/{native-xcode-ios-CBXJAxfC.mjs → native-xcode-ios-8A-efGa5.mjs} +17 -17
- package/dist/{ndjson-CgE_o3Dl.mjs → ndjson-Dy2W4vRa.mjs} +2 -2
- package/dist/offload-worker.mjs +23 -24
- package/dist/{operation-exec-CUZifp6Z.mjs → operation-exec-Dp4FuIGR.mjs} +1 -1
- package/dist/{ownership-BjYvMNX_.mjs → ownership-DJCq48IJ.mjs} +3 -3
- package/dist/{page-CzEA_-5_.mjs → page-CQJlcj3x.mjs} +2 -2
- package/dist/{phone-reverses-lmj6kcPm.mjs → phone-reverses-BzTa8g1F.mjs} +18 -4
- package/dist/{placement-log-DIFPQAXp.mjs → placement-log-Cvhta5ib.mjs} +3 -3
- package/dist/{plan-placement-IiiSQhtz.mjs → plan-placement-WkZdccuN.mjs} +36 -10
- package/dist/{ports-C2_w1Z0Z.mjs → ports-UV4mJgyC.mjs} +3 -3
- package/dist/{prebuild-gmouvmJZ.mjs → prebuild-k8d_tqOq.mjs} +16 -17
- package/dist/{project-BUu6Is4k.mjs → project-Sui52ywT.mjs} +17 -17
- package/dist/{pull-request-CbNlkFok.mjs → pull-request-BzLmzAIQ.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-Cgg99REN.mjs → react-native-android-DANlGGQf.mjs} +32 -26
- package/dist/{react-native-build-oNwqF5Wb.mjs → react-native-build-jUHnIfZ9.mjs} +9 -9
- package/dist/{react-native-doctor-BhA3KUte.mjs → react-native-doctor-DCWRjS7K.mjs} +6 -6
- package/dist/{react-native-ios-B-nf4rjN.mjs → react-native-ios-BwMsFMXi.mjs} +23 -17
- package/dist/{recordings-BldzVKq0.mjs → recordings-iy0mkm7b.mjs} +1 -1
- package/dist/{registration-CN6nlhcD.mjs → registration-BwCe64PH.mjs} +1 -1
- package/dist/{reload-C9OduiNc.mjs → reload-Bj7QyuDy.mjs} +1 -1
- package/dist/{reload-CCR7KC_l.mjs → reload-c_uEyc_X.mjs} +16 -16
- package/dist/{remote-C8S7FlPF.mjs → remote-DFlpAqdV.mjs} +23 -10
- package/dist/{result-7F5hEwQJ.mjs → result-BIcXREyC.mjs} +32 -21
- package/dist/{run-BqB0v3pt.mjs → run-y2HwyNvg.mjs} +3 -3
- package/dist/{selection-BNPBZ6T5.mjs → selection-CXgM_VK_.mjs} +37 -29
- package/dist/{server-bare-A75rDIdD.mjs → server-bare-2N4vSRZG.mjs} +2 -2
- package/dist/{server-command-CssKFOD7.mjs → server-command-qneHPcRI.mjs} +6 -6
- package/dist/{server-expo-eQfOdydb.mjs → server-expo-Ccm9zB0o.mjs} +4 -4
- package/dist/server-expo-WulkyAwT.mjs +2 -0
- package/dist/{settings-CosW5X-S.mjs → settings-CY5JZlNN.mjs} +375 -62
- package/dist/{settings-OaGQF-ri.mjs → settings-Cfd_Q6ys.mjs} +24 -3
- package/dist/settings-payload-DwQiEMCn.mjs +257 -0
- package/dist/settings-write-CJpjkeAd.mjs +185 -0
- package/dist/settings.schema.json +51 -33
- package/dist/{simslim-Bax1qcxu.mjs → simslim-DCQwzoPy.mjs} +2 -2
- package/dist/{slot-launch-CYCEhfBY.mjs → slot-launch-BpmanOnk.mjs} +6 -6
- package/dist/{stage-jKQ7CP_B.mjs → stage-CmugrSG5.mjs} +2 -2
- package/dist/{start-C_wefNKB.mjs → start-CHH3zgIU.mjs} +1 -1
- package/dist/{start-_BdJ32cZ.mjs → start-DYLk6GXn.mjs} +27 -22
- package/dist/{state-C1i2nMOP.mjs → state-B2QJbDwz.mjs} +4 -4
- package/dist/{state-C4OdpOTF.mjs → state-BXC1Lfxw.mjs} +2 -2
- package/dist/{stats-tEpEEH-u.mjs → stats-DxKqhcGp.mjs} +5 -5
- package/dist/{stats-report-n2U5plhk.mjs → stats-report-B86Cv7Uc.mjs} +1 -1
- package/dist/{status-CRXz-Gtj.mjs → status-7ULDEJ1e.mjs} +1 -1
- package/dist/{status-DQrqodLj.mjs → status-BHCkOZga.mjs} +51 -28
- package/dist/{status-B9M7x4CZ.mjs → status-D_Ljc89p.mjs} +1 -1
- package/dist/{status-watch-B5wDIH_o.mjs → status-watch-BmsPqYSU.mjs} +18 -7
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-6Dqp-gjX.mjs → stim-desktop-CbWo21kb.mjs} +2 -2
- package/dist/{stop-DRqQVqDJ.mjs → stop-D-dGE9gh.mjs} +21 -20
- package/dist/{stop-ySNQHXMG.mjs → stop-DQvE-P76.mjs} +10 -6
- package/dist/{stop-CmdNhGlC.mjs → stop-b2pouxAO.mjs} +2 -2
- package/dist/supervisor-run.mjs +237 -63
- package/dist/{support-BGSCBoib.mjs → support-04IhBUTT.mjs} +6 -6
- package/dist/{support-CVOCp0Ft.mjs → support-BtlJKjyQ.mjs} +12 -11
- package/dist/{swiftpm-artifact-inputs-CfUzt_0Z.mjs → swiftpm-artifact-inputs-Cj2UpmPN.mjs} +4 -4
- package/dist/{swiftpm-macos-x6HPpl_2.mjs → swiftpm-macos-BhF2stxY.mjs} +11 -12
- package/dist/{toolchain-J4J8MrAr.mjs → toolchain-mLA_km-b.mjs} +321 -15
- package/dist/{toolchain-DoavrvIA.mjs → toolchain-qktiV8xc.mjs} +1 -1
- package/dist/{trigger-KVaWWNyn.mjs → trigger-DMou-X7j.mjs} +2 -2
- package/dist/trigger-qp2ji5wE.mjs +2 -0
- package/dist/{warm-progress-DvhTX_eu.mjs → warm-progress-B0Vpuvpl.mjs} +731 -727
- package/dist/{web-Bihbf7-u.mjs → web-BYmK0TjL.mjs} +9 -9
- package/dist/web-CrVLVQZY.mjs +2 -0
- package/dist/web-run.mjs +9 -9
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-pUg3_RRA.mjs → workspace-state-kIZrdlSg.mjs} +3 -3
- package/dist/{workspaces-g2lhdBXF.mjs → workspaces-CmOcceDN.mjs} +1879 -74
- package/dist/{worktree-BKuklFh_.mjs → worktree-2dk5edza.mjs} +933 -534
- package/dist/worktree-nliAoHxB.mjs +2 -0
- package/package.json +7 -7
- package/dist/ccache-Bx5TbxwG.mjs +0 -143
- package/dist/eas-fallback-FwkeqqGi.mjs +0 -381
- package/dist/hosted-ios-D55QhYaD.mjs +0 -15
- package/dist/native-run-BfIDFKLH.mjs +0 -275
- package/dist/server-expo-wvcj5tiZ.mjs +0 -2
- package/dist/settings-write-QjYfSrjF.mjs +0 -360
- package/dist/trigger-DzJu208Q.mjs +0 -2
- package/dist/web-BFLueSh-.mjs +0 -2
- package/dist/worktree-Bm4cb-nU.mjs +0 -2
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { _ as loadConfig$1, p as getProject } from "./config-Cn94Jc0g.mjs";
|
|
2
|
+
import { m as peekBudget } from "./ccache-Bm_A1xX9.mjs";
|
|
3
|
+
import { z as readHostMemoryPressureAsync } from "./ios-B1DYuOjh.mjs";
|
|
4
|
+
import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-CXgM_VK_.mjs";
|
|
5
|
+
import { c as call, l as connectHost, m as requireHostedAppMode } from "./hosted-client-DDRm9hPJ.mjs";
|
|
6
|
+
import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-BPHqMDdZ.mjs";
|
|
7
|
+
import { i as prepareHostedNative } from "./hosted-native-CDe33CSr.mjs";
|
|
8
|
+
import { t as DEFAULT_DEVICE_SLOT_WAIT_MS, u as peekDeviceSlots } from "./device-capacity-Cd8lMSn3.mjs";
|
|
9
|
+
import { ambientEnv } from "@stim-cli/core";
|
|
10
|
+
import { automaticMachineEnabled, isJsonObject, machineCapacity, mayRunHere, parseHostedChoice, parseHostedNativeOffer, prefersRemote } from "@stim-cli/core/state";
|
|
11
|
+
import { setTimeout } from "node:timers/promises";
|
|
12
|
+
//#region src/device-host/placement.ts
|
|
13
|
+
function local$1(code, reason, skipped = [], atCapacity = false) {
|
|
14
|
+
return {
|
|
15
|
+
kind: "local",
|
|
16
|
+
code,
|
|
17
|
+
reason,
|
|
18
|
+
skipped,
|
|
19
|
+
...atCapacity ? { atCapacity: true } : {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function decideDevicePlacement(inputs) {
|
|
23
|
+
if ("sticky" in inputs) {
|
|
24
|
+
if ("machine" in inputs.sticky) {
|
|
25
|
+
const reason = `recorded session on ${inputs.sticky.machine}`;
|
|
26
|
+
return {
|
|
27
|
+
kind: "host",
|
|
28
|
+
code: "sticky",
|
|
29
|
+
reason,
|
|
30
|
+
machines: [{
|
|
31
|
+
machine: inputs.sticky.machine,
|
|
32
|
+
reason
|
|
33
|
+
}],
|
|
34
|
+
skipped: []
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
kind: "local",
|
|
39
|
+
code: "sticky",
|
|
40
|
+
reason: "this workspace's device runs here",
|
|
41
|
+
skipped: []
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const { platform, placement = "auto", here, offers, buildMachine, noWait, eas } = inputs;
|
|
45
|
+
const remoteFirst = prefersRemote(placement);
|
|
46
|
+
const { count, max, queued } = here.devices;
|
|
47
|
+
const room = max === 0 || count !== null && count < max;
|
|
48
|
+
const localEnabled = here.localEnabled !== false && mayRunHere(placement);
|
|
49
|
+
const cannotTake = !localEnabled || !room || queued > 0;
|
|
50
|
+
const atCapacity = count !== null && (!room || queued > 0);
|
|
51
|
+
const usage = max > 0 ? `${count} of ${max} devices in use` : `${count} devices in use, no device cap`;
|
|
52
|
+
const localReason = !mayRunHere(placement) ? "remote-only never runs here" : !localEnabled ? "local is disabled in remote.devicePoolDisabled" : count === null ? "cannot tell how many devices run here; local boot admission decides" : cannotTake ? `${usage}${queued ? `, ${queued} runs queued ahead` : ""}` : here.budgetRefusal ?? (here.memoryPressure !== "normal" ? `host memory pressure ${here.memoryPressure ?? "unknown"} here` : `load ${here.loadPerCore.toFixed(1)}/core here, ${usage}`);
|
|
53
|
+
let hostsFull = false;
|
|
54
|
+
const nowhere = (code, reason, skipped = [], waiting = "") => {
|
|
55
|
+
if (!mayRunHere(placement)) return {
|
|
56
|
+
kind: "refused",
|
|
57
|
+
code: "pool-unavailable",
|
|
58
|
+
reason,
|
|
59
|
+
skipped,
|
|
60
|
+
...hostsFull ? { hostsFull: true } : {}
|
|
61
|
+
};
|
|
62
|
+
if (!localEnabled && !atCapacity) return {
|
|
63
|
+
kind: "refused",
|
|
64
|
+
code: "pool-unavailable",
|
|
65
|
+
reason,
|
|
66
|
+
skipped
|
|
67
|
+
};
|
|
68
|
+
if (!cannotTake || count === null) return local$1(code, reason + waiting, skipped);
|
|
69
|
+
if (eas?.usable) return {
|
|
70
|
+
kind: "eas",
|
|
71
|
+
code: "eas-fallback",
|
|
72
|
+
reason: `${reason}; EAS Simulator (remote.easFallback)`,
|
|
73
|
+
skipped
|
|
74
|
+
};
|
|
75
|
+
const why = eas ? [...skipped, {
|
|
76
|
+
machine: "eas",
|
|
77
|
+
code: eas.code,
|
|
78
|
+
reason: eas.reason
|
|
79
|
+
}] : skipped;
|
|
80
|
+
return localEnabled ? local$1(code, reason + waiting, why, true) : {
|
|
81
|
+
kind: "refused",
|
|
82
|
+
code: "pool-unavailable",
|
|
83
|
+
reason,
|
|
84
|
+
skipped: why,
|
|
85
|
+
atCapacity: true
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
if (!offers.length) return nowhere("no-remote-mac", "no remote machines configured; " + localReason);
|
|
89
|
+
if (localEnabled && count === null && !remoteFirst) return local$1("device-count-unknown", localReason);
|
|
90
|
+
if (!remoteFirst && !cannotTake && here.memoryPressure === "normal" && !here.budgetRefusal && here.loadPerCore < here.maxLoadPerCore) return local$1("this-mac-free", localReason);
|
|
91
|
+
const ceiling = (offer) => offer.resources.maxLoadPerCore ?? here.maxLoadPerCore;
|
|
92
|
+
const skipped = [];
|
|
93
|
+
const admitted = [];
|
|
94
|
+
offers.forEach((probe, index) => {
|
|
95
|
+
let reason = null;
|
|
96
|
+
let code = "unreachable";
|
|
97
|
+
if ("failure" in probe) reason = probe.failure;
|
|
98
|
+
else {
|
|
99
|
+
const { offer } = probe;
|
|
100
|
+
if (offer.declined !== null) [code, reason] = ["declined", `declined: ${offer.declined}`];
|
|
101
|
+
else if (offer.platform !== platform || !offer.choice) [code, reason] = ["no-matching-device", `no matching ${platform} device choice`];
|
|
102
|
+
else if (offer.resources.memoryPressure !== "normal") [code, reason] = ["memory", "host memory pressure unknown or elevated"];
|
|
103
|
+
else if (offer.capacity.available === 0) [code, reason] = ["no-capacity", "no hosted device capacity available"];
|
|
104
|
+
else if (offer.resources.loadPerCore !== null && offer.resources.loadPerCore >= ceiling(offer)) [code, reason] = ["load", `saturated: load ${offer.resources.loadPerCore.toFixed(1)}/core there, at or above ${ceiling(offer)}/core`];
|
|
105
|
+
else if (placement === "auto" && !cannotTake && offer.resources.loadPerCore === null) [code, reason] = ["load", "host load unknown while this machine has room"];
|
|
106
|
+
else admitted.push({
|
|
107
|
+
machine: probe.machine,
|
|
108
|
+
offer,
|
|
109
|
+
index
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (reason) skipped.push({
|
|
113
|
+
machine: probe.machine,
|
|
114
|
+
code,
|
|
115
|
+
reason
|
|
116
|
+
});
|
|
117
|
+
if (reason && ("offer" in probe ? [
|
|
118
|
+
"no-capacity",
|
|
119
|
+
"load",
|
|
120
|
+
"memory"
|
|
121
|
+
].includes(code) || code === "declined" && (probe.offer.capacity.available === 0 || probe.offer.resources.memoryPressure !== "normal") : false)) hostsFull = true;
|
|
122
|
+
});
|
|
123
|
+
admitted.sort((a, b) => Number(b.machine === buildMachine) - Number(a.machine === buildMachine) || a.index - b.index);
|
|
124
|
+
if (!admitted.length) return nowhere("no-host-admits", `${localReason}; no host admits`, skipped, localEnabled && cannotTake && !noWait ? "; waiting locally if needed" : "");
|
|
125
|
+
const machines = admitted.map(({ machine, offer }) => ({
|
|
126
|
+
machine,
|
|
127
|
+
reason: `${remoteFirst && !cannotTake ? `${placement} tries remote machines first` : localReason}; ${machine}${machine === buildMachine ? " is the explicit remote machine," : ""} load ${offer.resources.loadPerCore === null ? "unknown" : offer.resources.loadPerCore.toFixed(1) + "/core"}`
|
|
128
|
+
}));
|
|
129
|
+
return {
|
|
130
|
+
kind: "host",
|
|
131
|
+
code: "placed",
|
|
132
|
+
machines,
|
|
133
|
+
reason: machines[0].reason,
|
|
134
|
+
skipped
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/device-host/auto-placement.ts
|
|
139
|
+
const HOST_WAIT_POLL_MS = 5e3;
|
|
140
|
+
function refusalText(decision, waitedMs) {
|
|
141
|
+
return [
|
|
142
|
+
decision.reason,
|
|
143
|
+
...decision.skipped.map((each) => `${each.machine}: ${each.reason}`),
|
|
144
|
+
...waitedMs === null ? [] : [`waited ${Math.round(waitedMs / 1e3)}s for a remote machine with room`]
|
|
145
|
+
].join("; ");
|
|
146
|
+
}
|
|
147
|
+
async function probeHost(machine, platform, selectors, appMode, signal) {
|
|
148
|
+
let host;
|
|
149
|
+
const deadline = Date.now() + 3e3;
|
|
150
|
+
const cancel = () => host?.connection.close();
|
|
151
|
+
try {
|
|
152
|
+
host = await connectHost(machine, 3e3, true, signal);
|
|
153
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
154
|
+
signal?.throwIfAborted();
|
|
155
|
+
if (platform !== "macos") requireHostedAppMode(host, platform, appMode);
|
|
156
|
+
const offer = await call(host, "device-host.offer", {
|
|
157
|
+
platform,
|
|
158
|
+
...selectors
|
|
159
|
+
}, Math.max(1, deadline - Date.now()));
|
|
160
|
+
signal?.throwIfAborted();
|
|
161
|
+
const resources = isJsonObject(offer.resources) ? offer.resources : {};
|
|
162
|
+
const parsed = parseHostedNativeOffer({
|
|
163
|
+
...offer,
|
|
164
|
+
resources: {
|
|
165
|
+
...resources,
|
|
166
|
+
loadPerCore: resources.loadPerCore ?? 0
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
let choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsed?.platform === platform ? parsed.choice : null;
|
|
170
|
+
if (choice && platform !== "macos" && ("runtime" in choice ? selectors.deviceType && selectors.deviceType !== choice.deviceType || selectors.runtime && selectors.runtime.replace(/^iOS /, "") !== choice.runtime.replace(/^iOS /, "") : "systemImage" in choice && (selectors.systemImage && selectors.systemImage !== choice.systemImage || selectors.deviceProfile && selectors.deviceProfile !== choice.deviceProfile))) choice = null;
|
|
171
|
+
if (!isJsonObject(offer.capacity) || offer.declined !== null && typeof offer.declined !== "string") throw new Error("unreadable device offer");
|
|
172
|
+
return {
|
|
173
|
+
probe: {
|
|
174
|
+
machine,
|
|
175
|
+
offer: {
|
|
176
|
+
platform,
|
|
177
|
+
choice,
|
|
178
|
+
declined: offer.declined,
|
|
179
|
+
capacity: { available: typeof offer.capacity.available === "number" ? offer.capacity.available : null },
|
|
180
|
+
resources: {
|
|
181
|
+
...typeof resources.maxLoadPerCore === "number" && Number.isFinite(resources.maxLoadPerCore) && resources.maxLoadPerCore > 0 ? { maxLoadPerCore: resources.maxLoadPerCore } : {},
|
|
182
|
+
loadPerCore: typeof resources.loadPerCore === "number" && Number.isFinite(resources.loadPerCore) && resources.loadPerCore >= 0 ? resources.loadPerCore : null,
|
|
183
|
+
memoryFreeBytes: typeof resources.memoryFreeBytes === "number" ? resources.memoryFreeBytes : 0,
|
|
184
|
+
memoryPressure: typeof resources.memoryPressure === "string" ? resources.memoryPressure : null
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
...choice && ("runtime" in choice || "systemImage" in choice) ? { target: {
|
|
189
|
+
host,
|
|
190
|
+
choice,
|
|
191
|
+
session: null
|
|
192
|
+
} } : {}
|
|
193
|
+
};
|
|
194
|
+
} catch (error) {
|
|
195
|
+
signal?.throwIfAborted();
|
|
196
|
+
return { probe: {
|
|
197
|
+
machine,
|
|
198
|
+
failure: error instanceof Error ? error.message : String(error)
|
|
199
|
+
} };
|
|
200
|
+
} finally {
|
|
201
|
+
signal?.removeEventListener("abort", cancel);
|
|
202
|
+
host?.connection.close();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function hosted(target, machine, code, reason, skipped = []) {
|
|
206
|
+
if (target) target.selection = {
|
|
207
|
+
selected: "auto",
|
|
208
|
+
reason
|
|
209
|
+
};
|
|
210
|
+
return {
|
|
211
|
+
target,
|
|
212
|
+
placement: {
|
|
213
|
+
decision: "hosted",
|
|
214
|
+
machine,
|
|
215
|
+
reason
|
|
216
|
+
},
|
|
217
|
+
code,
|
|
218
|
+
skipped
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function local(code, reason, skipped = []) {
|
|
222
|
+
return {
|
|
223
|
+
target: null,
|
|
224
|
+
placement: {
|
|
225
|
+
decision: "local",
|
|
226
|
+
reason
|
|
227
|
+
},
|
|
228
|
+
code,
|
|
229
|
+
skipped
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function viaEas(code, reason, skipped) {
|
|
233
|
+
return {
|
|
234
|
+
target: null,
|
|
235
|
+
placement: {
|
|
236
|
+
decision: "eas",
|
|
237
|
+
machine: "eas",
|
|
238
|
+
reason
|
|
239
|
+
},
|
|
240
|
+
code,
|
|
241
|
+
skipped
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
async function automaticDevicePlacement({ root, slot, platform, placement = "auto", selectors, appMode, buildMachine, noWait, waitMs = DEFAULT_DEVICE_SLOT_WAIT_MS, onWait = () => {}, eas, signal, localSims }, { machines = () => hostingMachines(void 0, signal), read = readHostedNative, write = writeHostedNativeAsync, resume = prepareHostedNative, peek = () => peekDeviceSlots({
|
|
245
|
+
platform: platform === "macos" ? "ios" : platform,
|
|
246
|
+
project: getProject(root),
|
|
247
|
+
slot,
|
|
248
|
+
...localSims ? { sources: { sims: localSims } } : {}
|
|
249
|
+
}), capacity = machineCapacity, memory = () => readHostMemoryPressureAsync(void 0, void 0, signal), probe = probeHost, budget = (projectRoot) => peekBudget(projectRoot, {}, ambientEnv(), signal), now = Date.now, sleep = (ms) => setTimeout(ms, void 0, { signal }) } = {}) {
|
|
250
|
+
const recorded = platform === "macos" ? void 0 : read(root, platform, slot)[slot];
|
|
251
|
+
if (recorded && platform !== "macos") {
|
|
252
|
+
const target = await resume(recorded.machine, selectors, recorded, platform, true, appMode);
|
|
253
|
+
if (target) return {
|
|
254
|
+
target,
|
|
255
|
+
placement: {
|
|
256
|
+
decision: "hosted",
|
|
257
|
+
machine: recorded.machine,
|
|
258
|
+
reason: recorded.reason ?? decideDevicePlacement({ sticky: { machine: recorded.machine } }).reason
|
|
259
|
+
},
|
|
260
|
+
code: "sticky",
|
|
261
|
+
skipped: [],
|
|
262
|
+
sticky: true
|
|
263
|
+
};
|
|
264
|
+
await write(root, slot, null, platform);
|
|
265
|
+
}
|
|
266
|
+
const devices = platform === "macos" ? {
|
|
267
|
+
count: 0,
|
|
268
|
+
max: 0,
|
|
269
|
+
queued: 0,
|
|
270
|
+
localLive: false
|
|
271
|
+
} : peek();
|
|
272
|
+
if (devices.localLive && placement === "remote-only") throw Object.assign(/* @__PURE__ */ new Error(`This workspace's ${platform} device for slot ${slot} runs on this machine, and remote-only never runs here.`), {
|
|
273
|
+
code: "STIM_HOSTING_REFUSED",
|
|
274
|
+
remedy: "Run stim stop, then retry."
|
|
275
|
+
});
|
|
276
|
+
if (devices.localLive) return {
|
|
277
|
+
...local("sticky", decideDevicePlacement({ sticky: { local: true } }).reason),
|
|
278
|
+
sticky: true
|
|
279
|
+
};
|
|
280
|
+
const configured = await machines();
|
|
281
|
+
signal?.throwIfAborted();
|
|
282
|
+
if (configured === null) throw Object.assign(/* @__PURE__ */ new Error("remote.machines is invalid. Run stim guide settings and correct it."), { code: "STIM_HOSTING_REFUSED" });
|
|
283
|
+
const config = loadConfig$1();
|
|
284
|
+
const entries = configured.filter((machine) => automaticMachineEnabled("device", machine, config));
|
|
285
|
+
const preference = resolveBuildMachine(buildMachine, ambientEnv().STIM_REMOTE_BUILD, config?.remote?.build);
|
|
286
|
+
buildMachine = namedBuildMachine(preference) ? preference : void 0;
|
|
287
|
+
const load = capacity();
|
|
288
|
+
const here = {
|
|
289
|
+
localEnabled: automaticMachineEnabled("device", "local", config),
|
|
290
|
+
loadPerCore: load.loadPerCore,
|
|
291
|
+
maxLoadPerCore: load.maxLoadPerCore,
|
|
292
|
+
memoryPressure: await memory(),
|
|
293
|
+
devices,
|
|
294
|
+
budgetRefusal: await budget(root)
|
|
295
|
+
};
|
|
296
|
+
signal?.throwIfAborted();
|
|
297
|
+
const inputs = (offers) => ({
|
|
298
|
+
platform,
|
|
299
|
+
placement,
|
|
300
|
+
here,
|
|
301
|
+
offers,
|
|
302
|
+
buildMachine,
|
|
303
|
+
noWait
|
|
304
|
+
});
|
|
305
|
+
const notProbed = entries.map((machine) => ({
|
|
306
|
+
machine,
|
|
307
|
+
failure: "not probed"
|
|
308
|
+
}));
|
|
309
|
+
const waitStarted = now();
|
|
310
|
+
let announced = false;
|
|
311
|
+
let probes = [];
|
|
312
|
+
let offers = notProbed;
|
|
313
|
+
let decision;
|
|
314
|
+
for (;;) {
|
|
315
|
+
const early = decideDevicePlacement(inputs(notProbed));
|
|
316
|
+
probes = early.kind === "local" && early.skipped.length === 0 ? [] : await Promise.all(entries.map((machine) => probe(machine, platform, selectors, appMode, signal)));
|
|
317
|
+
offers = probes.length ? probes.map((each) => each.probe) : notProbed;
|
|
318
|
+
decision = decideDevicePlacement(inputs(offers));
|
|
319
|
+
if (decision.kind !== "refused" || !decision.hostsFull) break;
|
|
320
|
+
const waited = now() - waitStarted;
|
|
321
|
+
const immediate = noWait || waitMs <= 0;
|
|
322
|
+
if (immediate || waited >= waitMs) throw Object.assign(new Error(refusalText(decision, immediate ? null : waited)), {
|
|
323
|
+
code: "STIM_AT_CAPACITY",
|
|
324
|
+
remedy: `Wait for a remote machine in remote.machines to have room, ${platform === "macos" ? "retry later" : "retry with a longer --wait <seconds>"}, or select a placement that may run here.`
|
|
325
|
+
});
|
|
326
|
+
if (!announced) {
|
|
327
|
+
announced = true;
|
|
328
|
+
onWait(`remote-only waits up to ${Math.round(waitMs / 1e3)}s for a remote machine with room (${decision.skipped.map((each) => `${each.machine}: ${each.reason}`).join("; ")})`);
|
|
329
|
+
}
|
|
330
|
+
await sleep(Math.min(HOST_WAIT_POLL_MS, waitMs - waited));
|
|
331
|
+
signal?.throwIfAborted();
|
|
332
|
+
}
|
|
333
|
+
if ((decision.kind === "local" || decision.kind === "refused") && decision.atCapacity && eas && placement !== "remote-only") decision = decideDevicePlacement({
|
|
334
|
+
...inputs(offers),
|
|
335
|
+
eas: await eas()
|
|
336
|
+
});
|
|
337
|
+
if (decision.kind === "refused") throw Object.assign(new Error(refusalText(decision, null)), {
|
|
338
|
+
code: "STIM_HOSTING_REFUSED",
|
|
339
|
+
remedy: placement === "remote-only" ? entries.length === 0 ? "Add an approved Mac to remote.machines (stim guide settings), or select a placement that may run here." : "Wait for a remote machine in remote.machines to have room, check stim doctor for the ones that are unreachable or unapproved, or select a placement that may run here." : "Enable an available member in remote.devicePoolDisabled or select a machine explicitly."
|
|
340
|
+
});
|
|
341
|
+
if (decision.kind === "eas") return viaEas(decision.code, decision.reason, decision.skipped);
|
|
342
|
+
if (decision.kind === "local") return local(decision.code, decision.reason, decision.skipped);
|
|
343
|
+
const machine = decision.machines[0].machine;
|
|
344
|
+
return hosted(probes.find((each) => each.probe.machine === machine)?.target ?? null, machine, decision.code, decision.reason, decision.skipped);
|
|
345
|
+
}
|
|
346
|
+
function devicePlacementLine(placement, skipped) {
|
|
347
|
+
return `${placement.machine ?? "local"}, ${placement.reason}${placement.decision !== "hosted" && skipped.length ? "; " + skipped.map((each) => `${each.machine}: ${each.reason}`).join("; ") : ""}`;
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
export { devicePlacementLine as n, probeHost as r, automaticDevicePlacement as t };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { D as ownership_claim_exports, S as process_identity_exports, c as throwIfCancelled, l as WorkspaceProcessCleanupError, s as cancelledError, t as getExecutor, u as withWorkspaceProcessLock } from "./exec-
|
|
2
|
-
import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-
|
|
3
|
-
import { p as getProject } from "./config-
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import {
|
|
6
|
-
import { b as isPackageResolvable, v as detectIsExpo } from "./project-
|
|
7
|
-
import { d as resolveProjectMetro } from "./metro-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-
|
|
13
|
-
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-
|
|
14
|
-
import { o as resolveWorkspaceMetroPort } from "./start-
|
|
1
|
+
import { D as ownership_claim_exports, S as process_identity_exports, c as throwIfCancelled, l as WorkspaceProcessCleanupError, s as cancelledError, t as getExecutor, u as withWorkspaceProcessLock } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { p as getProject } from "./config-Cn94Jc0g.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-C8R1KIvi.mjs";
|
|
5
|
+
import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-CY5JZlNN.mjs";
|
|
6
|
+
import { b as isPackageResolvable, v as detectIsExpo } from "./project-Sui52ywT.mjs";
|
|
7
|
+
import { d as resolveProjectMetro } from "./metro-BnhXV2Mj.mjs";
|
|
8
|
+
import { c as readNdjsonGenerations$1 } from "./ndjson-Dy2W4vRa.mjs";
|
|
9
|
+
import { Wt as readMetroRecords } from "./ccache-Bm_A1xX9.mjs";
|
|
10
|
+
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-B2QJbDwz.mjs";
|
|
11
|
+
import { ft as teardownBrowserHeld, x as resolveSupervisorTarget } from "./workspaces-CmOcceDN.mjs";
|
|
12
|
+
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-Phoi2POD.mjs";
|
|
13
|
+
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CQJlcj3x.mjs";
|
|
14
|
+
import { o as resolveWorkspaceMetroPort } from "./start-DYLk6GXn.mjs";
|
|
15
15
|
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
16
|
-
import { n as windowsLauncherArgs } from "./detached-entry-
|
|
17
|
-
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-
|
|
16
|
+
import { n as windowsLauncherArgs } from "./detached-entry-BPlSaCwC.mjs";
|
|
17
|
+
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-DyDWurWG.mjs";
|
|
18
18
|
import { randomUUID } from "node:crypto";
|
|
19
19
|
import { mkdirSync, openSync, statSync, watch } from "node:fs";
|
|
20
20
|
import { ambientEnv } from "@stim-cli/core";
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { c as throwIfCancelled, s as cancelledError, x as withDrainingCancellation } from "./exec-
|
|
2
|
-
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-
|
|
3
|
-
import { E as upsertProject, O as withConfigLockAsync, p as getProject, u as getConcurrencyLimits } from "./config-
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import {
|
|
6
|
-
import { f as projectRegistry, v as detectIsExpo } from "./project-
|
|
7
|
-
import { s as workspaceShareURL } from "./stim-desktop-
|
|
8
|
-
import { k as hostSystemImageArch } from "./android-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-
|
|
14
|
-
import {
|
|
15
|
-
import { m as listIosRuntimes } from "./ios-
|
|
1
|
+
import { c as throwIfCancelled, s as cancelledError, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { E as upsertProject, O as withConfigLockAsync, p as getProject, u as getConcurrencyLimits } from "./config-Cn94Jc0g.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-C8R1KIvi.mjs";
|
|
5
|
+
import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-CY5JZlNN.mjs";
|
|
6
|
+
import { f as projectRegistry, v as detectIsExpo } from "./project-Sui52ywT.mjs";
|
|
7
|
+
import { s as workspaceShareURL } from "./stim-desktop-CbWo21kb.mjs";
|
|
8
|
+
import { k as hostSystemImageArch } from "./android-CsPs-7Mg.mjs";
|
|
9
|
+
import { i as createNdjsonWriter } from "./ndjson-Dy2W4vRa.mjs";
|
|
10
|
+
import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-Bm_A1xX9.mjs";
|
|
11
|
+
import { $ as tapBuildLog, Q as startBuildProgress, St as acquireBuildSlot, Tt as releaseBuildSlot, X as recordFinishedBuild, ct as recordRunStats, it as readRunEstimates, lt as statsProjectKey, rt as createRunRecorder } from "./workspaces-CmOcceDN.mjs";
|
|
12
|
+
import { V as readBundleId, ot as runCancellationSignal, st as withNativeBuildRun } from "./toolchain-mLA_km-b.mjs";
|
|
13
|
+
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-DRMg4_mD.mjs";
|
|
14
|
+
import { T as storedAppId, x as providerUploadOutcome } from "./build-cache-CZULpXVl.mjs";
|
|
15
|
+
import { m as listIosRuntimes } from "./ios-B1DYuOjh.mjs";
|
|
16
16
|
import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { t as acquireIosArtifact } from "./artifact-CsAP6AGK.mjs";
|
|
17
|
+
import { S as setRemoteLogSink } from "./client-YxCer6ab.mjs";
|
|
18
|
+
import { d as resolveBuildPlacement } from "./selection-CXgM_VK_.mjs";
|
|
19
|
+
import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-BtlJKjyQ.mjs";
|
|
20
|
+
import { f as settleFingerprintCheck } from "./prebuild-k8d_tqOq.mjs";
|
|
21
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-DG4Rodzj.mjs";
|
|
22
|
+
import { t as acquireAndroidArtifact } from "./artifact-bFkfD3vf.mjs";
|
|
23
|
+
import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-BIcXREyC.mjs";
|
|
24
|
+
import { o as lastBuildRecord } from "./ios-project-CR4mZ7CH.mjs";
|
|
25
|
+
import { t as acquireIosArtifact } from "./artifact-DYtHjxsn.mjs";
|
|
27
26
|
import { constants, promises } from "node:fs";
|
|
28
27
|
import { basename, join } from "node:path";
|
|
29
28
|
import { hostSimulatorArch } from "@stim-cli/core";
|
|
@@ -117,13 +116,14 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
|
|
|
117
116
|
let directory;
|
|
118
117
|
let built = null;
|
|
119
118
|
let failureAfterCleanup = null;
|
|
120
|
-
const finishRecord = (status, errorCode) => persistLastBuild({
|
|
119
|
+
const finishRecord = (status, errorCode, message) => persistLastBuild({
|
|
121
120
|
root,
|
|
122
121
|
record,
|
|
123
122
|
startedAt,
|
|
124
123
|
durationMs: Date.now() - started,
|
|
125
124
|
status,
|
|
126
125
|
errorCode,
|
|
126
|
+
message,
|
|
127
127
|
out: note,
|
|
128
128
|
recordBuild: (at, entry) => recordFinishedBuild(at, entry, { artifactOnly: true })
|
|
129
129
|
});
|
|
@@ -223,7 +223,7 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
|
|
|
223
223
|
};
|
|
224
224
|
} catch (error) {
|
|
225
225
|
const failure = runCancellationSignal(context)?.aborted ? cancelledError("Android build", error) : error;
|
|
226
|
-
finishRecord("failed", failure.code);
|
|
226
|
+
finishRecord("failed", failure.code, failure instanceof Error ? failure.message : String(failure));
|
|
227
227
|
stats.record({
|
|
228
228
|
failed: true,
|
|
229
229
|
durationMs: Date.now() - started
|
|
@@ -233,7 +233,7 @@ async function buildAndroidOperation(context, root, options, { artifactScope, ca
|
|
|
233
233
|
await artifact?.release();
|
|
234
234
|
failureAfterCleanup = built && runCancellationSignal(context)?.aborted ? cancelledError("Android build") : null;
|
|
235
235
|
if (failureAfterCleanup) {
|
|
236
|
-
finishRecord("failed", failureAfterCleanup.code);
|
|
236
|
+
finishRecord("failed", failureAfterCleanup.code, failureAfterCleanup.message);
|
|
237
237
|
stats.record({
|
|
238
238
|
failed: true,
|
|
239
239
|
durationMs: Date.now() - started
|
|
@@ -346,9 +346,13 @@ async function buildIosOperation(context, root, options) {
|
|
|
346
346
|
let directory;
|
|
347
347
|
let built = null;
|
|
348
348
|
let failureAfterCleanup = null;
|
|
349
|
-
const finish = (status, appPath, errorCode) => {
|
|
349
|
+
const finish = (status, appPath, errorCode, message) => {
|
|
350
350
|
try {
|
|
351
351
|
recordFinishedBuild(root, lastBuildRecord({
|
|
352
|
+
ledger: {
|
|
353
|
+
scheme: buildScheme,
|
|
354
|
+
message
|
|
355
|
+
},
|
|
352
356
|
startedAt,
|
|
353
357
|
status,
|
|
354
358
|
appPath,
|
|
@@ -477,7 +481,7 @@ async function buildIosOperation(context, root, options) {
|
|
|
477
481
|
};
|
|
478
482
|
} catch (error) {
|
|
479
483
|
const failure = runCancellationSignal(context)?.aborted ? cancelledError("iOS build", error) : error;
|
|
480
|
-
finish("failed", void 0, failure.code);
|
|
484
|
+
finish("failed", void 0, failure.code, failure instanceof Error ? failure.message : String(failure));
|
|
481
485
|
stats.record({
|
|
482
486
|
failed: true,
|
|
483
487
|
durationMs: Date.now() - started
|
|
@@ -488,7 +492,7 @@ async function buildIosOperation(context, root, options) {
|
|
|
488
492
|
await artifact?.release();
|
|
489
493
|
failureAfterCleanup = built && runCancellationSignal(context)?.aborted ? cancelledError("iOS build") : null;
|
|
490
494
|
if (failureAfterCleanup) {
|
|
491
|
-
finish("failed", void 0, failureAfterCleanup.code);
|
|
495
|
+
finish("failed", void 0, failureAfterCleanup.code, failureAfterCleanup.message);
|
|
492
496
|
stats.record({
|
|
493
497
|
failed: true,
|
|
494
498
|
durationMs: Date.now() - started
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { c as throwIfCancelled, t as getExecutor, x as withDrainingCancellation } from "./exec-
|
|
2
|
-
import { y as sharedBuildCache } from "./workspace-state-
|
|
3
|
-
import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-
|
|
4
|
-
import { m as defaultAndroidLayout } from "./settings-
|
|
5
|
-
import { r as register } from "./cache-manifest-
|
|
6
|
-
import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-
|
|
1
|
+
import { c as throwIfCancelled, t as getExecutor, x as withDrainingCancellation } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { y as sharedBuildCache } from "./workspace-state-kIZrdlSg.mjs";
|
|
3
|
+
import { a as killOnAbort, c as gitQuiet, o as git, r as childEnvironment, s as gitAsync } from "./operation-exec-Dp4FuIGR.mjs";
|
|
4
|
+
import { m as defaultAndroidLayout } from "./settings-CY5JZlNN.mjs";
|
|
5
|
+
import { r as register } from "./cache-manifest-DEjqGGat.mjs";
|
|
6
|
+
import { r as writeSignedTail, t as computeSignedTail } from "./apk-signed-tail-CQbwM0qO.mjs";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { artifactIn, buildCacheKey, resolveArtifact, storeArtifactAsync } from "@stim-cli/core";
|
|
11
|
+
import { trace } from "@stim-cli/core/state";
|
|
11
12
|
import { basename as basename$1, isAbsolute as isAbsolute$1, join as join$1, posix as posix$1, relative as relative$1, resolve as resolve$1, sep as sep$1 } from "path";
|
|
12
13
|
import { existsSync as existsSync$1, lstatSync as lstatSync$1, mkdirSync as mkdirSync$1, readFileSync as readFileSync$1, readdirSync as readdirSync$1, realpathSync as realpathSync$1, rmSync as rmSync$1, statSync as statSync$1 } from "fs";
|
|
13
|
-
import { readdir, writeFile } from "node:fs/promises";
|
|
14
|
+
import { readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
14
15
|
import { isDeepStrictEqual } from "util";
|
|
15
16
|
import * as expoFingerprint from "@expo/fingerprint";
|
|
16
17
|
import { loadConfigAsync } from "@expo/fingerprint/build/Config.js";
|
|
@@ -391,17 +392,19 @@ async function fingerprintOptions(projectRoot, { platform, iosProjectPath = "ios
|
|
|
391
392
|
};
|
|
392
393
|
}
|
|
393
394
|
async function fingerprintProject(projectRoot, { createFingerprint = expoFingerprint.createFingerprintAsync, debug = false, ...target } = {}) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
395
|
+
return trace.spanAsync("fingerprint", async () => {
|
|
396
|
+
const options = await fingerprintOptions(projectRoot, target);
|
|
397
|
+
const result = await createFingerprint(projectRoot, debug ? {
|
|
398
|
+
...options,
|
|
399
|
+
debug
|
|
400
|
+
} : options);
|
|
401
|
+
const hash = result?.hash ?? null;
|
|
402
|
+
if (!hash) return null;
|
|
403
|
+
return {
|
|
404
|
+
hash,
|
|
405
|
+
sources: Array.isArray(result?.sources) ? result.sources : []
|
|
406
|
+
};
|
|
407
|
+
}, { platform: target.platform });
|
|
405
408
|
}
|
|
406
409
|
/** The env files @expo/env loads for the config: @expo/fingerprint 0.21 evaluates it in development mode. */
|
|
407
410
|
function expoEnvFiles(env = {}) {
|
|
@@ -424,8 +427,8 @@ async function gitignoredFingerprintInputs(projectRoot, sources, target, { env,
|
|
|
424
427
|
if (sources.some((source) => source.type === "contents" && source.id === "expoConfig")) {
|
|
425
428
|
for (const name of expoEnvFiles(env)) if (lstatSync$1(join$1(projectRoot, name), { throwIfNoEntry: false })?.isFile()) found.add(name);
|
|
426
429
|
}
|
|
427
|
-
const top = realpathSync$1(await gitAsync(projectRoot, ["rev-parse", "--show-toplevel"], { signal }));
|
|
428
|
-
const base = realpathSync$1(projectRoot);
|
|
430
|
+
const top = realpathSync$1.native(await gitAsync(projectRoot, ["rev-parse", "--show-toplevel"], { signal }));
|
|
431
|
+
const base = realpathSync$1.native(projectRoot);
|
|
429
432
|
const pathspecs = sources.flatMap((source) => {
|
|
430
433
|
if (source.type === "contents" || inNodeModules(source.filePath)) return [];
|
|
431
434
|
const inRepo = relative$1(top, resolve$1(base, source.filePath));
|
|
@@ -544,6 +547,25 @@ async function storeBuild(platform, key, buildPath, rootOrOptions = {}) {
|
|
|
544
547
|
throw error;
|
|
545
548
|
}
|
|
546
549
|
}
|
|
550
|
+
/** Removes a stored build by renaming its entry aside first, so no run sees a half-deleted entry. */
|
|
551
|
+
async function evictBuild(platform, key, root = sharedBuildCache()) {
|
|
552
|
+
const dir = entryDir(platform, key, root);
|
|
553
|
+
const evicted = `${dir}.evicted-${process.pid}`;
|
|
554
|
+
try {
|
|
555
|
+
await rm(evicted, {
|
|
556
|
+
recursive: true,
|
|
557
|
+
force: true
|
|
558
|
+
});
|
|
559
|
+
await rename(dir, evicted);
|
|
560
|
+
} catch {
|
|
561
|
+
return false;
|
|
562
|
+
}
|
|
563
|
+
await rm(evicted, {
|
|
564
|
+
recursive: true,
|
|
565
|
+
force: true
|
|
566
|
+
}).catch(() => {});
|
|
567
|
+
return true;
|
|
568
|
+
}
|
|
547
569
|
const PROVIDER_DOWNLOAD_DIR = "cache-provider";
|
|
548
570
|
function providerDownloadPath(workspacePath) {
|
|
549
571
|
return join$1(workspacePath, PROVIDER_DOWNLOAD_DIR);
|
|
@@ -832,4 +854,4 @@ function fingerprintDiffRecord({ changed, previousHash, hash }) {
|
|
|
832
854
|
};
|
|
833
855
|
}
|
|
834
856
|
//#endregion
|
|
835
|
-
export {
|
|
857
|
+
export { untrackedNativeFiles as A, resolveBuild as C, storedSources as D, storedAssetManifest as E, captureAssetManifest as M, compareAssetManifests as N, trackedFingerprintPaths as O, readAssetManifest as P, refingerprintAfterMutation as S, storedAppId as T, inputsChangedDuringBuild as _, configInputsChanged as a, providerDownloadPath as b, evictBuild as c, filesystemBuildCapability as d, fingerprintDiffRecord as f, ignoredFingerprintPaths as g, gitignoredFingerprintInputs as h, compareSourceLists as i, assetDiffReason as j, untrackedMissLine as k, expoConfigContents as l, fingerprintProject as m, buildCacheKey as n, diffFingerprintSources as o, fingerprintOptions as p, changedDuringBuildLine as r, entryDir as s, artifactIn as t, expoEnvFiles as u, packageIn as v, storeBuild as w, providerUploadOutcome as x, prepareProviderDownloadDir as y };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { T as trackReportResource } from "./exec-
|
|
2
|
-
import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { T as trackReportResource } from "./exec-aULwtNly.mjs";
|
|
2
|
+
import { i as formatDuration, l as phaseLine, m as shortHash, u as plural } from "./command-output-C8R1KIvi.mjs";
|
|
3
|
+
import { an as makeTemporaryDirectory, sn as removeTemporaryEntryAsync } from "./settings-CY5JZlNN.mjs";
|
|
4
|
+
import { jn as easAuthNote } from "./ccache-Bm_A1xX9.mjs";
|
|
5
|
+
import { at as readStats, q as estimateBuild } from "./workspaces-CmOcceDN.mjs";
|
|
6
|
+
import { s as entryDir, t as artifactIn } from "./build-cache-CZULpXVl.mjs";
|
|
7
|
+
import { l as predictBuildMiss, o as staleNativeDirRefusal } from "./prebuild-k8d_tqOq.mjs";
|
|
7
8
|
import chalk from "chalk";
|
|
8
9
|
import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, resolveTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
|
|
9
10
|
//#region src/commands/build-plan.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as getConfigDir } from "./config-
|
|
1
|
+
import { d as getConfigDir } from "./config-Cn94Jc0g.mjs";
|
|
2
2
|
import { cacheDirRefusal, readCacheManifest, updateCacheManifest } from "@stim-cli/core";
|
|
3
3
|
import { join, resolve } from "path";
|
|
4
4
|
import { existsSync } from "fs";
|
package/dist/cache-manifest.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-
|
|
1
|
+
import { a as unregister, i as registeredCaches, n as readManifest, r as register, t as manifestPath } from "./cache-manifest-DEjqGGat.mjs";
|
|
2
2
|
export { manifestPath, readManifest, register, registeredCaches, unregister };
|