stim 1.32.0 → 1.33.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-CI9fIokp.mjs → acquire-artifact-DTh_LxrE.mjs} +2 -2
- package/dist/{act-BfChMxcU.mjs → act-Cur4YKtK.mjs} +22 -22
- package/dist/{activity-yjH7Q3zn.mjs → activity-C8kBq9w0.mjs} +6 -6
- package/dist/{agent-device-usage-output-DO412bsG.mjs → agent-device-usage-output-BTRaK_up.mjs} +5 -5
- package/dist/{android-BeeC15Ve.mjs → android-B2DSKg-A.mjs} +2 -2
- package/dist/{android-BNm5A40S.mjs → android-BL-QqHjc.mjs} +87 -53
- package/dist/{android-D56S_GX3.mjs → android-D5mCdVl2.mjs} +5 -5
- package/dist/{android-DsEj2CCs.mjs → android-Iq0M2t2d.mjs} +27 -15
- package/dist/{android-cas-CbumHXIq.mjs → android-cas-Dhcjkys1.mjs} +4 -4
- package/dist/android-cas-compiler.mjs +1 -1
- package/dist/android-image-DFk26aY6.mjs +254 -0
- package/dist/{android-project-CCEQyYJK.d.mts → android-project-BDlPnfmL.d.mts} +1 -1
- package/dist/api.d.mts +2 -1
- package/dist/api.mjs +28 -28
- package/dist/{apk-signed-tail-B9Usseps.mjs → apk-signed-tail-CPpA-3vu.mjs} +2 -2
- package/dist/{artifact-C8Nvp07y.mjs → artifact-BMjubIP2.mjs} +13 -13
- package/dist/{artifact-k1x9Jrn0.mjs → artifact-BufzdGbT.mjs} +34 -21
- package/dist/{artifact-platform-BO2Uvk_A.mjs → artifact-platform-DqCWUieN.mjs} +1 -1
- package/dist/{auto-placement--nfdQ9rp.mjs → auto-placement-D7P98glJ.mjs} +11 -9
- package/dist/{browser-web-6RDAeH0z.mjs → browser-web-C74et-Nv.mjs} +15 -15
- package/dist/{build-VXX_dtl5.mjs → build-DFBGWOTc.mjs} +23 -23
- package/dist/{build-cache-BsKim4V7.mjs → build-cache-Cqj4FGnX.mjs} +20 -8
- package/dist/{build-plan-BK34X2iY.mjs → build-plan-T3Hi24ax.mjs} +7 -7
- package/dist/{cache-manifest-CfiEny4T.mjs → cache-manifest-8JX9S1QJ.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-BrwGIxmV.mjs → ccache-BXtzEL6M.mjs} +34 -24
- package/dist/{cdp-C3svvXiE.mjs → cdp-C216kOAn.mjs} +1 -1
- package/dist/{chrome-DyDWurWG.mjs → chrome-C8sC5tdl.mjs} +1 -1
- package/dist/{cli-Jc7obreB.mjs → cli-B2YSjc9s.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/{client-lDmA-5jx.mjs → client-0_Mnfz0a.mjs} +29 -9
- package/dist/collector-run.mjs +7 -7
- package/dist/{command-output-CfPW1bKP.mjs → command-output-DWI9tGPU.mjs} +1 -1
- package/dist/{config-D5qNWJEP.mjs → config-BW0fAtoK.mjs} +256 -246
- package/dist/{dependencies-DkZ8681S.mjs → dependencies-CgvBZbXD.mjs} +39 -39
- package/dist/{dependency-state-DZVln1P9.mjs → dependency-state-mL5g4H6K.mjs} +2 -2
- package/dist/{detached-entry-BPlSaCwC.mjs → detached-entry-tfrgGVWb.mjs} +1 -1
- package/dist/{dev-client-eDZy6RoX.mjs → dev-client-ChsHwgrn.mjs} +2 -2
- package/dist/{device-CeIikWac.mjs → device-B0htCt2u.mjs} +13 -13
- package/dist/{device-CTozKhU0.mjs → device-DOehZpyx.mjs} +11 -11
- package/dist/{device-android-zgD9We85.mjs → device-android-B8TQP5AX.mjs} +10 -10
- package/dist/{device-capacity-Bki6B-7h.mjs → device-capacity-BAkETfIl.mjs} +9 -9
- package/dist/device-host-worker.mjs +58 -17
- package/dist/{device-ios-TE5ejeXx.mjs → device-ios-DFaYFdar.mjs} +9 -9
- package/dist/{device-lease-run-DeNGjJZM.mjs → device-lease-run-DpiCnRbZ.mjs} +5 -5
- package/dist/{device-pool-mjyUYaau.mjs → device-pool-DP4sCeCC.mjs} +3 -3
- package/dist/{device-provision-j_B7G0e6.mjs → device-provision-CnNOIxCF.mjs} +10 -10
- package/dist/{doctor-sSLtn-j1.mjs → doctor-9GrW5YSP.mjs} +30 -17
- package/dist/{doctor-CNZuvTSe.mjs → doctor-C6Xn96RS.mjs} +1 -1
- package/dist/{doctor-fingerprint-o7ZI9YLn.mjs → doctor-fingerprint-DqWvIhMb.mjs} +1 -1
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-BlrcoQ7B.mjs → doctor-nRLBoajo.mjs} +54 -25
- package/dist/{doctor-watchman-CCuboyj1.mjs → doctor-watchman-CDhpC3Oh.mjs} +5 -5
- package/dist/{eas-build-CaG-Sfs9.mjs → eas-build-CpJ4h9tG.mjs} +4 -4
- package/dist/{eas-fallback-BpX1lpco.mjs → eas-fallback-B3z5nL1g.mjs} +6 -6
- package/dist/{eas-session-ledger-B-nTfdfk.mjs → eas-session-ledger-Bspy-VJQ.mjs} +6 -6
- package/dist/{error-diagnostics-q56Im4D8.mjs → error-diagnostics-DoLGklYX.mjs} +10 -10
- package/dist/{exec-aULwtNly.mjs → exec-CGuDzt40.mjs} +103 -103
- package/dist/{gc-By2Kc-Ek.mjs → gc-BWoOp9q7.mjs} +2 -2
- package/dist/{gc-Dv6nb9nf.mjs → gc-DolXpMSB.mjs} +25 -54
- package/dist/{guide-CwpsGWTJ.mjs → guide-CmZB0GtP.mjs} +139 -44
- package/dist/{hosted-android-c5nPJA6S.mjs → hosted-android-ByG-ICuh.mjs} +4 -4
- package/dist/{hosted-client-Hs-fD4L3.mjs → hosted-client-D19Lv0tg.mjs} +6 -5
- package/dist/{hosted-logs-BteXG8rm.mjs → hosted-logs-D7anR6Dk.mjs} +7 -7
- package/dist/{hosted-logs-sync-B8bjLEMs.mjs → hosted-logs-sync-D182b1eJ.mjs} +5 -5
- package/dist/{hosted-macos-B4byscei.mjs → hosted-macos-D0DDQxvl.mjs} +6 -6
- package/dist/{hosted-native-Bh9IJ_t5.mjs → hosted-native-BzXIy97W.mjs} +14 -10
- package/dist/{idle-shutdown-BaeCo4ps.mjs → idle-shutdown-6i8CHoNq.mjs} +6 -6
- package/dist/{ios-D1XKSITX.mjs → ios-AdhPKXO3.mjs} +8 -8
- package/dist/{ios-CdAV4-1E.mjs → ios-BdZdNsAj.mjs} +6 -6
- package/dist/{ios-CsRVik64.mjs → ios-Qam0bT9n.mjs} +1 -1
- package/dist/{ios-D3oK9-O4.mjs → ios-dbXzjTxx.mjs} +28 -28
- package/dist/{ios-device-CiBA-er9.mjs → ios-device-DLdEDWJj.mjs} +1 -1
- package/dist/{ios-device-D7Gi3e1I.mjs → ios-device-DXbHZfFe.mjs} +3 -3
- package/dist/{ios-project-DDQlX_jX.mjs → ios-project-BzfLigfh.mjs} +7 -7
- package/dist/{ios-signing-BJzvDPfU.mjs → ios-signing-D-tSX1iF.mjs} +2 -2
- package/dist/{ios-state-BEIJRJ7P.mjs → ios-state-CWsBysyN.mjs} +1 -1
- package/dist/{js-swap-C8N5DXHl.mjs → js-swap-EDVOJmqx.mjs} +6 -6
- package/dist/{launch-DxpvL6il.mjs → launch-CKHpthsw.mjs} +20 -20
- package/dist/{lightened-Df6II_XI.mjs → lightened-Cv4ToJRX.mjs} +5 -5
- package/dist/{logs-zv3ge7c6.mjs → logs-DCQ3_tGS.mjs} +6 -6
- package/dist/{logs-CuWJWF88.mjs → logs-IagR9dWI.mjs} +7 -7
- package/dist/{macos-C6U-4Iip.mjs → macos-Ch7vuM-G.mjs} +22 -22
- package/dist/{macos-CbRZheLw.mjs → macos-pc0aVVbN.mjs} +1 -1
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +6 -6
- package/dist/{metro-mKHEMO-a.mjs → metro-B5PVz0Wv.mjs} +4 -4
- package/dist/{metro-request-DODHNXCN.mjs → metro-request-2LmFpC1z.mjs} +2 -2
- package/dist/{named-ports-B0hCk2v-.mjs → named-ports-CA0nB9Yw.mjs} +3 -3
- package/dist/{native-android-9dVFqvTT.mjs → native-android-B3CEDq4R.mjs} +29 -19
- package/dist/{native-gradle-artifact-inputs-BlY97pt8.mjs → native-gradle-artifact-inputs-BLnO2hHR.mjs} +5 -5
- package/dist/{native-runtime-DQfxW5Au.mjs → native-runtime-e1OU8gEN.mjs} +6 -6
- package/dist/{native-source-D1AzWiuP.mjs → native-source-ChAGj7R1.mjs} +1 -1
- package/dist/{native-xcode-inputs-tDuUvSU8.mjs → native-xcode-inputs-DL3ETb8s.mjs} +3 -3
- package/dist/{native-xcode-ios-CG-PD-7g.mjs → native-xcode-ios-D4e8k2Jy.mjs} +17 -17
- package/dist/offload-worker.d.mts +3 -1
- package/dist/offload-worker.mjs +37 -23
- package/dist/{operation-exec-Dp4FuIGR.mjs → operation-exec-DKlBcKAL.mjs} +1 -1
- package/dist/{ownership-CCfiBfOP.mjs → ownership-hC7xvvxF.mjs} +3 -3
- package/dist/{page-CQJlcj3x.mjs → page-Dj8IqvGM.mjs} +2 -2
- package/dist/{phone-reverses-CnNwdz9A.mjs → phone-reverses-rvyxW1Fl.mjs} +4 -4
- package/dist/{placement-log-CRL0IY-k.mjs → placement-log-nnGnu8mo.mjs} +1 -1
- package/dist/{plan-placement-2imvnlWP.mjs → plan-placement-D3JD-T-K.mjs} +6 -6
- package/dist/{ports-CKktj5lV.mjs → ports-CZJJfJ8Q.mjs} +3 -3
- package/dist/{prebuild-CyNrUWgV.mjs → prebuild-Bhs7TTcz.mjs} +12 -12
- package/dist/{project-Crtcbfl0.mjs → project-DWEXiBA9.mjs} +16 -16
- package/dist/{pull-request-BzLmzAIQ.mjs → pull-request-BpMTNkMB.mjs} +2 -2
- package/dist/pull-requests.mjs +1 -1
- package/dist/{react-native-android-Cabe2YER.mjs → react-native-android-C6Y270GS.mjs} +37 -33
- package/dist/{react-native-build-DhWBUV_H.mjs → react-native-build-DaPfzf_e.mjs} +10 -10
- package/dist/{react-native-doctor-D-twmBon.mjs → react-native-doctor-DGMPxkPS.mjs} +6 -6
- package/dist/{react-native-ios-u_ley41B.mjs → react-native-ios-dX48_92n.mjs} +21 -17
- package/dist/{recordings-BWnIlhZH.mjs → recordings-AKZfsW2W.mjs} +1 -1
- package/dist/{registration-BwCe64PH.mjs → registration-DKjJGQ6p.mjs} +1 -1
- package/dist/{reload-f9hvEHE9.mjs → reload-BGwblBJ9.mjs} +1 -1
- package/dist/{reload-D2TpUlns.mjs → reload-DsOByDfy.mjs} +17 -17
- package/dist/{remote-BsBAjlD2.mjs → remote-D0uJZ76R.mjs} +9 -9
- package/dist/{result-EOsWV6sp.mjs → result-DuimMZKJ.mjs} +24 -20
- package/dist/{run-2CHAJ9Oj.mjs → run-N-BbRxnC.mjs} +2 -2
- package/dist/{selection-C4ZQz_ER.mjs → selection-xS50Mt0V.mjs} +5 -4
- package/dist/{server-bare-CFyVFZXJ.mjs → server-bare-BTlICuaX.mjs} +2 -2
- package/dist/{server-command-BMyKtnjH.mjs → server-command-BC0EgMfY.mjs} +5 -5
- package/dist/{server-expo-BLxcN2x2.mjs → server-expo-15RjL0ir.mjs} +3 -3
- package/dist/server-expo-gYIypb0-.mjs +2 -0
- package/dist/{settings-C6UTYW2K.mjs → settings-B5IBDfTx.mjs} +4 -4
- package/dist/{settings-jeS0WmUF.mjs → settings-CuP55ieT.mjs} +2 -2
- package/dist/{settings-payload-CrX933Xi.mjs → settings-payload-BIGGQ3or.mjs} +5 -5
- package/dist/{settings-write-DMcT23Kl.mjs → settings-write-D85j8mej.mjs} +6 -6
- package/dist/settings.schema.json +38 -0
- package/dist/{simslim-93xmPh-d.mjs → simslim-DKdJx0LL.mjs} +2 -2
- package/dist/{slot-launch-CSpQcFZw.mjs → slot-launch-D4oREwhx.mjs} +6 -6
- package/dist/{stage-Cf9uSM1a.mjs → stage-DKC6tDXu.mjs} +2 -2
- package/dist/{start-CLN_r9EG.mjs → start-BsEV4S-s.mjs} +12 -12
- package/dist/{start-CquYgzVf.mjs → start-DfPSLc__.mjs} +1 -1
- package/dist/{state-CM_HvvkS.mjs → state-CtmYTRWm.mjs} +4 -4
- package/dist/{state-CiflgxTP.mjs → state-DSOUqO-o.mjs} +2 -2
- package/dist/{stats-BVEZuSlg.mjs → stats-ByEUblPr.mjs} +5 -5
- package/dist/{stats-report-B86Cv7Uc.mjs → stats-report-BVRCqwWA.mjs} +1 -1
- package/dist/{status-D0ruTmPl.mjs → status-C6hLlDqW.mjs} +37 -28
- package/dist/{status-GQ-JqvRi.mjs → status-DTFhDnd1.mjs} +1 -1
- package/dist/{status-Bhdy07v0.mjs → status-FP1MH9qn.mjs} +1 -1
- package/dist/{status-watch-DSu_hhg6.mjs → status-watch-D8s823CZ.mjs} +5 -5
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-1XxET4S8.mjs → stim-desktop-_WTria-r.mjs} +2 -2
- package/dist/{stop-RZqER_Ww.mjs → stop-5LKfVv-0.mjs} +2 -2
- package/dist/{stop-W4DK8qZq.mjs → stop-BVI2-L7s.mjs} +16 -16
- package/dist/{stop-B616ZyTv.mjs → stop-CpTy6bod.mjs} +5 -5
- package/dist/supervisor-run.mjs +16 -16
- package/dist/{support-S_5nkkzs.mjs → support-CqyWfZZI.mjs} +18 -8
- package/dist/{support-NxnD8QXd.mjs → support-D8OH0z98.mjs} +9 -9
- package/dist/{swiftpm-artifact-inputs-yp8D5LE4.mjs → swiftpm-artifact-inputs-uq5oV7xR.mjs} +4 -4
- package/dist/{swiftpm-macos-Gtq9bNQb.mjs → swiftpm-macos-BuhqYB3n.mjs} +11 -11
- package/dist/{toolchain-B2bN8jEo.mjs → toolchain-D_jotUG7.mjs} +1 -1
- package/dist/{toolchain-Bnm8vUCV.mjs → toolchain-s5ZmG42Z.mjs} +25 -14
- package/dist/{trigger-CfnOfpDd.mjs → trigger-BtB4kbe0.mjs} +2 -2
- package/dist/trigger-D8B7QR0q.mjs +2 -0
- package/dist/{warm-progress-_aTMvkIH.mjs → warm-progress-q11Vdvhh.mjs} +6 -6
- package/dist/{web-BdWG8b5_.mjs → web-DwYCTFdh.mjs} +9 -9
- package/dist/web-cCfM8kwV.mjs +2 -0
- package/dist/web-run.mjs +8 -8
- package/dist/windows-report.mjs +1 -1
- package/dist/{workspace-state-3bF4TB8P.mjs → workspace-state-BdZ-QgmB.mjs} +3 -3
- package/dist/{workspaces-C59v9bpD.mjs → workspaces-B3ahAHZc.mjs} +14 -14
- package/dist/{worktree-CinoSsGy.mjs → worktree-BhsML6GV.mjs} +77 -31
- package/dist/{worktree-K9F50fD_.mjs → worktree-CrjsPIs2.mjs} +1 -1
- package/package.json +7 -7
- package/dist/server-expo-DwR3eD-a.mjs +0 -2
- package/dist/trigger-DBZ-GBrl.mjs +0 -2
- package/dist/web-DwuluWJt.mjs +0 -2
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { D as ownership_claim_exports, T as process_identity_exports, l as cancellableSleep, t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { it as settingValueAt } from "./settings-B5IBDfTx.mjs";
|
|
3
|
+
import { Q as pickDefaultSystemImage, d as androidToolPath, j as hostSystemImageArch, kt as recordInstalledSystemImageAsync, o as androidHome, z as listInstalledSystemImages } from "./android-Iq0M2t2d.mjs";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { existsSync, readFileSync, realpathSync, statfsSync } from "node:fs";
|
|
6
|
+
import { isAbsolute, join } from "node:path";
|
|
7
|
+
import { configDir } from "@stim-cli/core";
|
|
8
|
+
//#region src/devices/android-image.ts
|
|
9
|
+
const RECOMMENDED_ANDROID_API = 36;
|
|
10
|
+
const IMAGE_INSTALL_FREE_BYTES = 8 * 1024 ** 3;
|
|
11
|
+
const IMAGE_INSTALL_TIMEOUT_MS = 18e5;
|
|
12
|
+
const CLAIM_POLL_MS = 2e3;
|
|
13
|
+
const SYSTEM_IMAGE_PACKAGE = /^system-images;android-\d+;[^;\s]+;([^;\s]+)$/;
|
|
14
|
+
const LICENSE_NOT_ACCEPTED = /license is not accepted|licenses or those of the packages they depend on were not accepted/i;
|
|
15
|
+
function recommendedSystemImage(arch = hostSystemImageArch()) {
|
|
16
|
+
return `system-images;android-${RECOMMENDED_ANDROID_API};google_apis;${arch}`;
|
|
17
|
+
}
|
|
18
|
+
function androidImageInstallPolicy(settings) {
|
|
19
|
+
return settingValueAt(settings, "android.installImages") === "never" ? "never" : "auto";
|
|
20
|
+
}
|
|
21
|
+
function sdkmanagerCommand(args, env) {
|
|
22
|
+
const tool = androidToolPath("sdkmanager", process.platform, env);
|
|
23
|
+
return `${isAbsolute(tool) ? JSON.stringify(tool) : tool} ${args}`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Decides which system image an owned AVD uses: the requested one, else the newest installed image for the host, else
|
|
27
|
+
* Stim's recommended image. An image that is not installed is installed only when the policy allows it and its ABI is
|
|
28
|
+
* the host's.
|
|
29
|
+
*/
|
|
30
|
+
function decideSystemImage({ requested, installed, policy, hostArch = hostSystemImageArch(), env }) {
|
|
31
|
+
if (requested && installed.some((image) => image.pkg === requested)) return {
|
|
32
|
+
kind: "installed",
|
|
33
|
+
pkg: requested
|
|
34
|
+
};
|
|
35
|
+
const picked = requested ? null : pickDefaultSystemImage([...installed], { hostArch });
|
|
36
|
+
if (picked) return {
|
|
37
|
+
kind: "installed",
|
|
38
|
+
pkg: picked.pkg
|
|
39
|
+
};
|
|
40
|
+
const pkg = requested ?? recommendedSystemImage(hostArch);
|
|
41
|
+
const arch = SYSTEM_IMAGE_PACKAGE.exec(pkg)?.[1];
|
|
42
|
+
if (arch !== hostArch) return {
|
|
43
|
+
kind: "refuse",
|
|
44
|
+
code: "STIM_BAD_ARG",
|
|
45
|
+
message: arch ? `The Android system image "${pkg}" is not installed, and Stim installs only ${hostArch} images on this machine.` : `"${pkg}" is not an Android system image package id.`,
|
|
46
|
+
remedy: `Pass \`--system-image\` (or set android.systemImage) to an installed image, or to one Stim can install for ${hostArch} such as "${recommendedSystemImage(hostArch)}".`
|
|
47
|
+
};
|
|
48
|
+
if (policy === "never") return {
|
|
49
|
+
kind: "refuse",
|
|
50
|
+
code: requested ? "STIM_BAD_ARG" : "STIM_NO_DEVICE",
|
|
51
|
+
message: `${requested ? `The Android system image "${pkg}" is not installed` : `No ${hostArch} Android system image is installed`}, and android.installImages is never, so Stim does not install one.`,
|
|
52
|
+
remedy: `${requested ? "Pass `--system-image` (or set android.systemImage) to an installed image, run" : "Run"} \`${sdkmanagerCommand(`--install "${pkg}"`, env)}\` on this machine, or set android.installImages to auto, then try again.`
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
kind: "install",
|
|
56
|
+
pkg
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function freeBytes(path) {
|
|
60
|
+
try {
|
|
61
|
+
const disk = statfsSync(path);
|
|
62
|
+
return disk.bavail * disk.bsize;
|
|
63
|
+
} catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function licenseAccepted(sdk) {
|
|
68
|
+
try {
|
|
69
|
+
return readFileSync(join(sdk, "licenses", "android-sdk-license"), "utf8").trim().length > 0;
|
|
70
|
+
} catch {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function imageComplete(sdk, pkg) {
|
|
75
|
+
const directory = join(sdk, ...pkg.split(";"));
|
|
76
|
+
return existsSync(join(directory, "package.xml")) && !existsSync(join(directory, ".installer"));
|
|
77
|
+
}
|
|
78
|
+
function claimRoot(sdk) {
|
|
79
|
+
let canonical = sdk;
|
|
80
|
+
try {
|
|
81
|
+
canonical = realpathSync(sdk);
|
|
82
|
+
} catch {}
|
|
83
|
+
const key = createHash("sha256").update(canonical).digest("hex").slice(0, 16);
|
|
84
|
+
return join(configDir(), "android-sdk-installs", key);
|
|
85
|
+
}
|
|
86
|
+
function failureLine(text) {
|
|
87
|
+
const lines = text.split(/[\r\n]+/).map((line) => line.trim()).filter((line) => line && !line.startsWith("["));
|
|
88
|
+
return lines.find((line) => /^(Warning|Error):/.test(line)) ?? lines.at(-1) ?? "";
|
|
89
|
+
}
|
|
90
|
+
const gb = (bytes) => (bytes / 1024 ** 3).toFixed(1);
|
|
91
|
+
const refuse = (message, remedy, code = "STIM_NO_DEVICE") => ({
|
|
92
|
+
ok: false,
|
|
93
|
+
code,
|
|
94
|
+
message,
|
|
95
|
+
remedy
|
|
96
|
+
});
|
|
97
|
+
function outputOf(error) {
|
|
98
|
+
const field = (name) => {
|
|
99
|
+
const value = error && typeof error === "object" ? Reflect.get(error, name) : void 0;
|
|
100
|
+
return typeof value === "string" ? value : "";
|
|
101
|
+
};
|
|
102
|
+
return `${field("stdout")}\n${field("stderr")}`;
|
|
103
|
+
}
|
|
104
|
+
/** Makes sure the system image an owned AVD needs is installed. `installed` is true when it was missing at the start of this call, whichever run installed it. */
|
|
105
|
+
async function ensureSystemImage({ requested, policy, env, signal, note }) {
|
|
106
|
+
const decision = decideSystemImage({
|
|
107
|
+
requested,
|
|
108
|
+
installed: listInstalledSystemImages(void 0, env),
|
|
109
|
+
policy,
|
|
110
|
+
env
|
|
111
|
+
});
|
|
112
|
+
if (decision.kind === "refuse") return {
|
|
113
|
+
ok: false,
|
|
114
|
+
code: decision.code,
|
|
115
|
+
message: decision.message,
|
|
116
|
+
remedy: decision.remedy
|
|
117
|
+
};
|
|
118
|
+
if (decision.kind === "installed") return {
|
|
119
|
+
ok: true,
|
|
120
|
+
installed: false
|
|
121
|
+
};
|
|
122
|
+
const result = await installSystemImage({
|
|
123
|
+
pkg: decision.pkg,
|
|
124
|
+
env,
|
|
125
|
+
signal,
|
|
126
|
+
note
|
|
127
|
+
});
|
|
128
|
+
return result.ok ? {
|
|
129
|
+
ok: true,
|
|
130
|
+
installed: true
|
|
131
|
+
} : result;
|
|
132
|
+
}
|
|
133
|
+
const licensesRefusal = (pkg, sdk, env) => ({
|
|
134
|
+
code: "STIM_NO_DEVICE",
|
|
135
|
+
message: `The Android SDK licenses ${pkg} needs are not accepted in ${sdk}, and Stim does not accept them for you.`,
|
|
136
|
+
remedy: `Run \`${sdkmanagerCommand("--licenses", env)}\` on this machine and accept them, then try again.`
|
|
137
|
+
});
|
|
138
|
+
/** Why this machine cannot install `pkg` now, checked before any download: no sdkmanager, no accepted license, or too little disk. */
|
|
139
|
+
function systemImageInstallProblem(pkg, env) {
|
|
140
|
+
const sdk = androidHome(env);
|
|
141
|
+
if (!isAbsolute(androidToolPath("sdkmanager", process.platform, env))) return {
|
|
142
|
+
code: "STIM_NO_DEVICE",
|
|
143
|
+
message: `The Android SDK command-line tools are not installed in ${sdk}, so Stim cannot install ${pkg}.`,
|
|
144
|
+
remedy: "Install \"Android SDK Command-line Tools (latest)\" from the SDK Manager in Android Studio, then try again."
|
|
145
|
+
};
|
|
146
|
+
if (!licenseAccepted(sdk)) return licensesRefusal(pkg, sdk, env);
|
|
147
|
+
const free = freeBytes(sdk);
|
|
148
|
+
if (free !== null && free < IMAGE_INSTALL_FREE_BYTES) return {
|
|
149
|
+
code: "STIM_NO_DEVICE",
|
|
150
|
+
message: `${gb(free)} GB free on the volume of ${sdk}, needs ${gb(IMAGE_INSTALL_FREE_BYTES)} GB to download and unpack ${pkg}.`,
|
|
151
|
+
remedy: `Free space on that volume (\`stim gc\` lists what Stim can reclaim), or run \`${sdkmanagerCommand(`--install "${pkg}"`, env)}\` yourself, then try again.`
|
|
152
|
+
};
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Installs one system image with the SDK's own sdkmanager, never accepting a license for the user. One install runs per
|
|
157
|
+
* SDK root and Stim home: a second caller waits for the first and returns without installing when the image is there.
|
|
158
|
+
*/
|
|
159
|
+
async function installSystemImage({ pkg, env, signal, note }) {
|
|
160
|
+
const sdk = androidHome(env);
|
|
161
|
+
const tool = androidToolPath("sdkmanager", process.platform, env);
|
|
162
|
+
const manual = sdkmanagerCommand(`--install "${pkg}"`, env);
|
|
163
|
+
const licenses = () => ({
|
|
164
|
+
ok: false,
|
|
165
|
+
...licensesRefusal(pkg, sdk, env)
|
|
166
|
+
});
|
|
167
|
+
const root = claimRoot(sdk);
|
|
168
|
+
let claim;
|
|
169
|
+
let waited = false;
|
|
170
|
+
while (!claim) {
|
|
171
|
+
try {
|
|
172
|
+
claim = (0, ownership_claim_exports.tryAcquireClaim)({
|
|
173
|
+
root,
|
|
174
|
+
mode: "exclusive",
|
|
175
|
+
details: {
|
|
176
|
+
sdk,
|
|
177
|
+
package: pkg
|
|
178
|
+
},
|
|
179
|
+
label: "Android system image install"
|
|
180
|
+
}).acquired;
|
|
181
|
+
} catch (error) {
|
|
182
|
+
const failure = (0, ownership_claim_exports.claimFailure)(error, null);
|
|
183
|
+
if (failure) return refuse(failure.message, failure.remedy, failure.code);
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
if (claim) break;
|
|
187
|
+
if (!waited) note(`waiting for another Stim process that installs an Android system image in ${sdk}`);
|
|
188
|
+
waited = true;
|
|
189
|
+
await cancellableSleep(CLAIM_POLL_MS, {
|
|
190
|
+
signal,
|
|
191
|
+
what: "wait for the Android system image install"
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const held = claim;
|
|
195
|
+
let unresolved = false;
|
|
196
|
+
try {
|
|
197
|
+
if (imageComplete(sdk, pkg)) return {
|
|
198
|
+
ok: true,
|
|
199
|
+
installed: false
|
|
200
|
+
};
|
|
201
|
+
const problem = systemImageInstallProblem(pkg, env);
|
|
202
|
+
if (problem) return {
|
|
203
|
+
ok: false,
|
|
204
|
+
...problem
|
|
205
|
+
};
|
|
206
|
+
note(`installing ${pkg} with sdkmanager (about 2 GB)`);
|
|
207
|
+
let output;
|
|
208
|
+
(0, ownership_claim_exports.markClaimChildPending)(held);
|
|
209
|
+
try {
|
|
210
|
+
output = await getExecutor().runFileAsync(tool, [
|
|
211
|
+
`--sdk_root=${sdk}`,
|
|
212
|
+
"--install",
|
|
213
|
+
pkg
|
|
214
|
+
], {
|
|
215
|
+
timeoutMs: IMAGE_INSTALL_TIMEOUT_MS,
|
|
216
|
+
input: "n\n",
|
|
217
|
+
signal,
|
|
218
|
+
containProcessTree: true,
|
|
219
|
+
onSpawn: (child) => {
|
|
220
|
+
if (child.pid === void 0) return;
|
|
221
|
+
const captured = (0, process_identity_exports.captureProcessIdentity)(child.pid);
|
|
222
|
+
if (!captured.ok) throw new Error(`Cannot record the sdkmanager process: ${captured.reason}`);
|
|
223
|
+
(0, ownership_claim_exports.setClaimChild)(held, {
|
|
224
|
+
pid: child.pid,
|
|
225
|
+
processToken: captured.token
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
} catch (error) {
|
|
230
|
+
if (error instanceof Error && "reportCleanup" in error) {
|
|
231
|
+
unresolved = true;
|
|
232
|
+
throw error;
|
|
233
|
+
}
|
|
234
|
+
signal?.throwIfAborted();
|
|
235
|
+
const text = outputOf(error);
|
|
236
|
+
if (LICENSE_NOT_ACCEPTED.test(text)) return licenses();
|
|
237
|
+
return refuse(`sdkmanager could not install ${pkg}: ${failureLine(text) || (error instanceof Error ? error.message : String(error))}`, `Run \`${manual}\` on this machine to see the full error, then try again.`);
|
|
238
|
+
} finally {
|
|
239
|
+
if (!unresolved) (0, ownership_claim_exports.clearClaimChild)(held);
|
|
240
|
+
}
|
|
241
|
+
if (LICENSE_NOT_ACCEPTED.test(output)) return licenses();
|
|
242
|
+
const directory = join(sdk, ...pkg.split(";"));
|
|
243
|
+
if (!imageComplete(sdk, pkg)) return refuse(`sdkmanager finished without installing ${pkg}: ${failureLine(output) || "it printed no error"}`, `Run \`${manual}\` on this machine to see the full output, then try again.`);
|
|
244
|
+
await recordInstalledSystemImageAsync(realpathSync(directory));
|
|
245
|
+
return {
|
|
246
|
+
ok: true,
|
|
247
|
+
installed: true
|
|
248
|
+
};
|
|
249
|
+
} finally {
|
|
250
|
+
if (!unresolved) (0, ownership_claim_exports.releaseClaim)(held);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
export { systemImageInstallProblem as a, installSystemImage as i, decideSystemImage as n, ensureSystemImage as r, androidImageInstallPolicy as t };
|
|
@@ -3,9 +3,9 @@ import { r as createNdjsonWriter } from "./exec-DnYc4HGH.mjs";
|
|
|
3
3
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { StimContext, hostSimulatorArch } from "@stim-cli/core";
|
|
5
5
|
import { ANDROID_EMULATOR_APPS, BuildPhase, BuildPlanPayload, Endpoint, RunEstimates, SettingScope, WebViewport, machineCapacity } from "@stim-cli/core/state";
|
|
6
|
-
import "@stim-cli/core/noise-session";
|
|
7
6
|
import { readFileSync as readFileSync$1 } from "fs";
|
|
8
7
|
import { Command } from "commander";
|
|
8
|
+
import "@stim-cli/core/noise-session";
|
|
9
9
|
import "@expo/fingerprint";
|
|
10
10
|
import { CacheProviderConfig, loadCacheProvider } from "@stim-cli/cache";
|
|
11
11
|
import { BuildReactNativeArtifactQuery, BuildSwiftpmArtifactQuery, GradleOffloadInputs, HelloResult, RemoteDiagnosis } from "@stim-cli/core/protocol";
|
package/dist/api.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as CompilationCacheActivity, a as BuildMachinesInspection, c as TailnetMachineIo, d as BudgetReport, f as DoctorPlatform, g as CcacheActivity, h as AndroidFacts, n as WebLaunched, o as GeneratedTickets, p as Finding, s as KeyConfirmer, v as IosFacts } from "./android-project-
|
|
1
|
+
import { _ as CompilationCacheActivity, a as BuildMachinesInspection, c as TailnetMachineIo, d as BudgetReport, f as DoctorPlatform, g as CcacheActivity, h as AndroidFacts, n as WebLaunched, o as GeneratedTickets, p as Finding, s as KeyConfirmer, v as IosFacts } from "./android-project-BDlPnfmL.mjs";
|
|
2
2
|
import { a as WorkspaceLaunchPlatform } from "./ios-CDvlmUs7.mjs";
|
|
3
3
|
import "./exec-DnYc4HGH.mjs";
|
|
4
4
|
import "./pull-request-eODyIqZF.mjs";
|
|
@@ -776,6 +776,7 @@ interface InventorySystemImage {
|
|
|
776
776
|
package: string;
|
|
777
777
|
directory: string;
|
|
778
778
|
avdCount: number;
|
|
779
|
+
stimInstalled: boolean;
|
|
779
780
|
command: string;
|
|
780
781
|
}
|
|
781
782
|
interface GcInventory {
|
package/dist/api.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir$1, v as ensureWorkspaceStorageAsync } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { Vt as repoRootAsync, Z as resolveProjectSettingsAsync, _ as inertSettingWarning, a as SETTING_SHAPE_REMEDY, p as cacheProviderSettingError, rt as settingShapeErrors, st as unknownSettingKeys } from "./settings-
|
|
6
|
-
import { c as projectProblem, f as projectRegistry, i as findProjectRoot$1, r as findCommandWorkspaceAsync, t as NO_PROJECT_REFUSAL } from "./project-
|
|
7
|
-
import { n as macosDir } from "./state-
|
|
8
|
-
import { c as ensureHomeIdentity, s as workspaceShareURL } from "./stim-desktop-
|
|
1
|
+
import { C as operationState, D as ownership_claim_exports, a as trackReportResource, d as throwIfCancelled, f as WorkspaceProcessCleanupError, i as runReport, u as cancelledError } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir$1, v as ensureWorkspaceStorageAsync } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { D as upsertProject, _t as validateDeviceSlot, b as refuseRelativeStimPaths, k as withConfigLockAsync$1, m as getProject } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { Vt as repoRootAsync, Z as resolveProjectSettingsAsync, _ as inertSettingWarning, a as SETTING_SHAPE_REMEDY, p as cacheProviderSettingError, rt as settingShapeErrors, st as unknownSettingKeys } from "./settings-B5IBDfTx.mjs";
|
|
6
|
+
import { c as projectProblem, f as projectRegistry, i as findProjectRoot$1, r as findCommandWorkspaceAsync, t as NO_PROJECT_REFUSAL } from "./project-DWEXiBA9.mjs";
|
|
7
|
+
import { n as macosDir } from "./state-DSOUqO-o.mjs";
|
|
8
|
+
import { c as ensureHomeIdentity, s as workspaceShareURL } from "./stim-desktop-_WTria-r.mjs";
|
|
9
9
|
import { i as createNdjsonWriter } from "./ndjson-CrjIsGzw.mjs";
|
|
10
|
-
import { $ as tapBuildLog, Q as startBuildProgress, X as recordFinishedBuild, tt as errorRemedy } from "./workspaces-
|
|
11
|
-
import { ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-
|
|
12
|
-
import { d as resolveBuildPlacement } from "./selection-
|
|
13
|
-
import { c as stopWorkspaceNow } from "./stop-
|
|
14
|
-
import { r as runReload } from "./reload-
|
|
15
|
-
import { m as warmWorktreeTarget, p as removeWorktreeTarget } from "./worktree-
|
|
16
|
-
import { i as restoreLightenedDependencies } from "./lightened-
|
|
17
|
-
import { c as startDevServer } from "./start-
|
|
18
|
-
import { s as recordDoctorCheck } from "./doctor-watchman-
|
|
19
|
-
import { c as readSettingsPayload, s as readSettingsContext, t as SettingsRefusal } from "./settings-payload-
|
|
20
|
-
import { a as readDoctorReport } from "./doctor-
|
|
21
|
-
import { i as readGcReport, n as executeGc, o as withGcMaintenanceClaim } from "./gc-
|
|
22
|
-
import { r as readWorkspaceLogs, t as followWorkspaceLogs } from "./logs-
|
|
23
|
-
import { t as readProjectStats } from "./stats-report-
|
|
24
|
-
import { n as buildAndroidOperation, t as buildIosOperation } from "./build-
|
|
25
|
-
import { a as readAndroidBuildPlan, i as runAndroidOperation } from "./android-
|
|
26
|
-
import { i as readIosBuildPlan, r as runIosOperation } from "./ios-
|
|
27
|
-
import { a as buildMacosBundle, i as planMacos, n as runMacos } from "./macos-
|
|
28
|
-
import { t as runWeb } from "./web-
|
|
29
|
-
import { t as mutateSetting } from "./settings-write-
|
|
10
|
+
import { $ as tapBuildLog, Q as startBuildProgress, X as recordFinishedBuild, tt as errorRemedy } from "./workspaces-B3ahAHZc.mjs";
|
|
11
|
+
import { ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
|
|
12
|
+
import { d as resolveBuildPlacement } from "./selection-xS50Mt0V.mjs";
|
|
13
|
+
import { c as stopWorkspaceNow } from "./stop-BVI2-L7s.mjs";
|
|
14
|
+
import { r as runReload } from "./reload-DsOByDfy.mjs";
|
|
15
|
+
import { m as warmWorktreeTarget, p as removeWorktreeTarget } from "./worktree-BhsML6GV.mjs";
|
|
16
|
+
import { i as restoreLightenedDependencies } from "./lightened-Cv4ToJRX.mjs";
|
|
17
|
+
import { c as startDevServer } from "./start-BsEV4S-s.mjs";
|
|
18
|
+
import { s as recordDoctorCheck } from "./doctor-watchman-CDhpC3Oh.mjs";
|
|
19
|
+
import { c as readSettingsPayload, s as readSettingsContext, t as SettingsRefusal } from "./settings-payload-BIGGQ3or.mjs";
|
|
20
|
+
import { a as readDoctorReport } from "./doctor-9GrW5YSP.mjs";
|
|
21
|
+
import { i as readGcReport, n as executeGc, o as withGcMaintenanceClaim } from "./gc-DolXpMSB.mjs";
|
|
22
|
+
import { r as readWorkspaceLogs, t as followWorkspaceLogs } from "./logs-DCQ3_tGS.mjs";
|
|
23
|
+
import { t as readProjectStats } from "./stats-report-BVRCqwWA.mjs";
|
|
24
|
+
import { n as buildAndroidOperation, t as buildIosOperation } from "./build-DFBGWOTc.mjs";
|
|
25
|
+
import { a as readAndroidBuildPlan, i as runAndroidOperation } from "./android-BL-QqHjc.mjs";
|
|
26
|
+
import { i as readIosBuildPlan, r as runIosOperation } from "./ios-dbXzjTxx.mjs";
|
|
27
|
+
import { a as buildMacosBundle, i as planMacos, n as runMacos } from "./macos-Ch7vuM-G.mjs";
|
|
28
|
+
import { t as runWeb } from "./web-DwYCTFdh.mjs";
|
|
29
|
+
import { t as mutateSetting } from "./settings-write-D85j8mej.mjs";
|
|
30
30
|
import { randomBytes } from "node:crypto";
|
|
31
31
|
import { mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync } from "node:fs";
|
|
32
32
|
import { stripVTControlCharacters } from "node:util";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { y as sharedBuildCache } from "./workspace-state-
|
|
2
|
-
import { O as findBuildTool } from "./android-
|
|
1
|
+
import { y as sharedBuildCache } from "./workspace-state-BdZ-QgmB.mjs";
|
|
2
|
+
import { O as findBuildTool } from "./android-Iq0M2t2d.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import { closeSync, fstatSync, openSync, readFileSync, readSync, realpathSync, renameSync, rmSync } from "node:fs";
|
|
5
5
|
import { basename, dirname, join } from "node:path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { D as ownership_claim_exports,
|
|
2
|
-
import { E as workspaceDir } from "./workspace-state-
|
|
3
|
-
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
4
|
-
import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote, n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-
|
|
5
|
-
import { $ as cancelledFailure, st as runCancellationSignal } from "./toolchain-
|
|
6
|
-
import { b as
|
|
7
|
-
import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-
|
|
8
|
-
import { a as missingPackageManagerRemedy, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-
|
|
9
|
-
import { f as formatDiagnostic } from "./react-native-build-
|
|
10
|
-
import { u as skippedMissReason } from "./prebuild-
|
|
11
|
-
import { t as buildPlacementRecord } from "./placement-log-
|
|
12
|
-
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-
|
|
13
|
-
import { a as PLATFORM, h as displayPath } from "./support-
|
|
1
|
+
import { D as ownership_claim_exports, d as throwIfCancelled, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote, n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-BXtzEL6M.mjs";
|
|
5
|
+
import { $ as cancelledFailure, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
|
|
6
|
+
import { b as prepareProviderDownloadDir, x as providerDownloadPath } from "./build-cache-Cqj4FGnX.mjs";
|
|
7
|
+
import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-0_Mnfz0a.mjs";
|
|
8
|
+
import { a as missingPackageManagerRemedy, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-xS50Mt0V.mjs";
|
|
9
|
+
import { f as formatDiagnostic } from "./react-native-build-DaPfzf_e.mjs";
|
|
10
|
+
import { u as skippedMissReason } from "./prebuild-Bhs7TTcz.mjs";
|
|
11
|
+
import { t as buildPlacementRecord } from "./placement-log-nnGnu8mo.mjs";
|
|
12
|
+
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DTh_LxrE.mjs";
|
|
13
|
+
import { a as PLATFORM, h as displayPath } from "./support-CqyWfZZI.mjs";
|
|
14
14
|
import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
|
|
15
15
|
import { rmSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { D as ownership_claim_exports,
|
|
2
|
-
import { E as workspaceDir } from "./workspace-state-
|
|
3
|
-
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
4
|
-
import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote } from "./ccache-
|
|
5
|
-
import { $ as cancelledFailure, A as COMPILATION_CACHE_NOT_RUN, F as compilationCacheActivityLine, st as runCancellationSignal } from "./toolchain-
|
|
6
|
-
import {
|
|
7
|
-
import { C as COMPILATION_CACHE_CORRUPT, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, s as offloadCheck, u as remotePhaseText, w as clearCorruptCompilationCache } from "./client-
|
|
8
|
-
import { a as missingPackageManagerRemedy, c as podsFailedRemedy, h as predictedRefusal, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-
|
|
9
|
-
import { S as xcodeFailureReport, p as printDiagnostics } from "./support-
|
|
10
|
-
import { f as settleFingerprintCheck, u as skippedMissReason } from "./prebuild-
|
|
11
|
-
import { t as buildPlacementRecord } from "./placement-log-
|
|
12
|
-
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-
|
|
13
|
-
import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-
|
|
1
|
+
import { D as ownership_claim_exports, d as throwIfCancelled, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { Dn as RESOLVE_TIMEOUT_MS, Mn as isEasAuthFailureText, jn as easAuthNote } from "./ccache-BXtzEL6M.mjs";
|
|
5
|
+
import { $ as cancelledFailure, A as COMPILATION_CACHE_NOT_RUN, F as compilationCacheActivityLine, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
|
|
6
|
+
import { E as storedAppId, S as providerUploadOutcome, b as prepareProviderDownloadDir, x as providerDownloadPath } from "./build-cache-Cqj4FGnX.mjs";
|
|
7
|
+
import { C as COMPILATION_CACHE_CORRUPT, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, s as offloadCheck, u as remotePhaseText, w as clearCorruptCompilationCache } from "./client-0_Mnfz0a.mjs";
|
|
8
|
+
import { a as missingPackageManagerRemedy, c as podsFailedRemedy, h as predictedRefusal, i as fingerprintMismatchRemedy, l as requireLocalBuild, n as automaticBuild, o as namedBuildMachine, t as OffloadRefusal } from "./selection-xS50Mt0V.mjs";
|
|
9
|
+
import { S as xcodeFailureReport, p as printDiagnostics } from "./support-D8OH0z98.mjs";
|
|
10
|
+
import { f as settleFingerprintCheck, u as skippedMissReason } from "./prebuild-Bhs7TTcz.mjs";
|
|
11
|
+
import { t as buildPlacementRecord } from "./placement-log-nnGnu8mo.mjs";
|
|
12
|
+
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DTh_LxrE.mjs";
|
|
13
|
+
import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-BzfLigfh.mjs";
|
|
14
14
|
import { rmSync } from "node:fs";
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { machineCapacity } from "@stim-cli/core/state";
|
|
@@ -455,15 +455,28 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
455
455
|
let stored = null;
|
|
456
456
|
let reason = outcome.ok ? null : outcome.reason;
|
|
457
457
|
if (outcome.ok) {
|
|
458
|
+
const rekeyed = outcome.builtFingerprint ? recipe.offload?.rekeyed?.(outcome.builtFingerprint) : void 0;
|
|
458
459
|
if (!await recipe.offload.unchanged()) reason = "the checkout here changed while it built";
|
|
459
|
-
else
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
460
|
+
else {
|
|
461
|
+
if (rekeyed) {
|
|
462
|
+
note(chalk.dim(phaseLine("fingerprint", `${shortHash(storeHash)} -> ${shortHash(rekeyed.hash)} (as ${outcome.machine} built it)`)));
|
|
463
|
+
storeHash = rekeyed.hash;
|
|
464
|
+
storeKey = rekeyed.key;
|
|
465
|
+
buildFailure = {
|
|
466
|
+
...buildFailure,
|
|
467
|
+
fingerprint: storeHash,
|
|
468
|
+
cacheKey: storeKey
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
stored = await recipe.cache().store({
|
|
473
|
+
...cacheTarget(storeKey),
|
|
474
|
+
sourcePath: outcome.artifactPath,
|
|
475
|
+
overwrite: !useBuildCache
|
|
476
|
+
}) ?? null;
|
|
477
|
+
} catch (e) {
|
|
478
|
+
reason = `could not store the app: ${e?.message || e}`;
|
|
479
|
+
}
|
|
467
480
|
}
|
|
468
481
|
}
|
|
469
482
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as getExecutor } from "./exec-
|
|
1
|
+
import { t as getExecutor } from "./exec-CGuDzt40.mjs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
//#region src/macos/artifact-platform.ts
|
|
4
4
|
async function validateMacosArtifactPlatform(context, bundle, product, signal, nodeArch = process.arch) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { m as getProject, v as loadConfig$1 } from "./config-
|
|
2
|
-
import { m as peekBudget } from "./ccache-
|
|
3
|
-
import { z as readHostMemoryPressureAsync } from "./ios-
|
|
4
|
-
import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-
|
|
5
|
-
import {
|
|
6
|
-
import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-
|
|
7
|
-
import { i as prepareHostedNative } from "./hosted-native-
|
|
8
|
-
import { d as peekDeviceSlots, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-
|
|
1
|
+
import { m as getProject, v as loadConfig$1 } from "./config-BW0fAtoK.mjs";
|
|
2
|
+
import { m as peekBudget } from "./ccache-BXtzEL6M.mjs";
|
|
3
|
+
import { z as readHostMemoryPressureAsync } from "./ios-BdZdNsAj.mjs";
|
|
4
|
+
import { _ as hostingMachines, o as namedBuildMachine, u as resolveBuildMachine } from "./selection-xS50Mt0V.mjs";
|
|
5
|
+
import { h as requireHostedAppMode, l as call, u as connectHost } from "./hosted-client-D19Lv0tg.mjs";
|
|
6
|
+
import { c as writeHostedNativeAsync, r as readHostedNative } from "./ios-state-CWsBysyN.mjs";
|
|
7
|
+
import { i as prepareHostedNative } from "./hosted-native-BzXIy97W.mjs";
|
|
8
|
+
import { d as peekDeviceSlots, t as DEFAULT_DEVICE_SLOT_WAIT_MS } from "./device-capacity-BAkETfIl.mjs";
|
|
9
9
|
import { ambientEnv } from "@stim-cli/core";
|
|
10
10
|
import { automaticMachineEnabled, isJsonObject, machineCapacity, mayRunHere, parseHostedChoice, parseHostedNativeOffer, prefersRemote } from "@stim-cli/core/state";
|
|
11
11
|
import { setTimeout } from "node:timers/promises";
|
|
@@ -169,6 +169,7 @@ async function probeHost(machine, platform, selectors, appMode, signal) {
|
|
|
169
169
|
let choice = platform === "ios" ? offer.platform === "ios" ? parseHostedChoice(offer.choice) : null : parsed?.platform === platform ? parsed.choice : null;
|
|
170
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
171
|
if (!isJsonObject(offer.capacity) || offer.declined !== null && typeof offer.declined !== "string") throw new Error("unreadable device offer");
|
|
172
|
+
const installImage = parsed?.platform === "android" ? parsed.installImage : void 0;
|
|
172
173
|
return {
|
|
173
174
|
probe: {
|
|
174
175
|
machine,
|
|
@@ -188,7 +189,8 @@ async function probeHost(machine, platform, selectors, appMode, signal) {
|
|
|
188
189
|
...choice && ("runtime" in choice || "systemImage" in choice) ? { target: {
|
|
189
190
|
host,
|
|
190
191
|
choice,
|
|
191
|
-
session: null
|
|
192
|
+
session: null,
|
|
193
|
+
...installImage ? { installImage } : {}
|
|
192
194
|
} } : {}
|
|
193
195
|
};
|
|
194
196
|
} catch (error) {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { D as ownership_claim_exports,
|
|
2
|
-
import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-
|
|
6
|
-
import { b as isPackageResolvable, v as detectIsExpo } from "./project-
|
|
7
|
-
import { d as resolveProjectMetro } from "./metro-
|
|
1
|
+
import { D as ownership_claim_exports, T as process_identity_exports, d as throwIfCancelled, f as WorkspaceProcessCleanupError, p as withWorkspaceProcessLock, t as getExecutor, u as cancelledError } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { m as getProject } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { N as metroPortSetting, a as SETTING_SHAPE_REMEDY, ct as webSettings } from "./settings-B5IBDfTx.mjs";
|
|
6
|
+
import { b as isPackageResolvable, v as detectIsExpo } from "./project-DWEXiBA9.mjs";
|
|
7
|
+
import { d as resolveProjectMetro } from "./metro-B5PVz0Wv.mjs";
|
|
8
8
|
import { c as readNdjsonGenerations$1 } from "./ndjson-CrjIsGzw.mjs";
|
|
9
|
-
import { Wt as readMetroRecords } from "./ccache-
|
|
10
|
-
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-
|
|
11
|
-
import { ft as teardownBrowserHeld, x as resolveSupervisorTarget } from "./workspaces-
|
|
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-
|
|
9
|
+
import { Wt as readMetroRecords } from "./ccache-BXtzEL6M.mjs";
|
|
10
|
+
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-CtmYTRWm.mjs";
|
|
11
|
+
import { ft as teardownBrowserHeld, x as resolveSupervisorTarget } from "./workspaces-B3ahAHZc.mjs";
|
|
12
|
+
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-CA0nB9Yw.mjs";
|
|
13
|
+
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-Dj8IqvGM.mjs";
|
|
14
|
+
import { o as resolveWorkspaceMetroPort } from "./start-BsEV4S-s.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-tfrgGVWb.mjs";
|
|
17
|
+
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-C8sC5tdl.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,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-
|
|
6
|
-
import { f as projectRegistry, v as detectIsExpo } from "./project-
|
|
7
|
-
import { s as workspaceShareURL } from "./stim-desktop-
|
|
8
|
-
import { j as hostSystemImageArch } from "./android-
|
|
1
|
+
import { d as throwIfCancelled, u as cancelledError, w as withDrainingCancellation } from "./exec-CGuDzt40.mjs";
|
|
2
|
+
import { E as workspaceDir, a as recordWorkspaceUseAsync, k as workspaceLogsDir } from "./workspace-state-BdZ-QgmB.mjs";
|
|
3
|
+
import { l as phaseLine } from "./command-output-DWI9tGPU.mjs";
|
|
4
|
+
import { D as upsertProject, k as withConfigLockAsync, m as getProject, u as getConcurrencyLimits } from "./config-BW0fAtoK.mjs";
|
|
5
|
+
import { J as resolveCacheProviderConfig, Z as resolveProjectSettingsAsync, a as SETTING_SHAPE_REMEDY } from "./settings-B5IBDfTx.mjs";
|
|
6
|
+
import { f as projectRegistry, v as detectIsExpo } from "./project-DWEXiBA9.mjs";
|
|
7
|
+
import { s as workspaceShareURL } from "./stim-desktop-_WTria-r.mjs";
|
|
8
|
+
import { j as hostSystemImageArch } from "./android-Iq0M2t2d.mjs";
|
|
9
9
|
import { i as createNdjsonWriter } from "./ndjson-CrjIsGzw.mjs";
|
|
10
|
-
import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-
|
|
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-
|
|
12
|
-
import { H as readBundleId, ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-
|
|
13
|
-
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-
|
|
14
|
-
import {
|
|
15
|
-
import { m as listIosRuntimes } from "./ios-
|
|
10
|
+
import { An as checkEasAuth, Rn as resolveRemote, zn as uploadRemote } from "./ccache-BXtzEL6M.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-B3ahAHZc.mjs";
|
|
12
|
+
import { H as readBundleId, ct as withNativeBuildRun, st as runCancellationSignal } from "./toolchain-s5ZmG42Z.mjs";
|
|
13
|
+
import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-C8kBq9w0.mjs";
|
|
14
|
+
import { E as storedAppId, S as providerUploadOutcome } from "./build-cache-Cqj4FGnX.mjs";
|
|
15
|
+
import { m as listIosRuntimes } from "./ios-BdZdNsAj.mjs";
|
|
16
16
|
import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
|
|
17
|
-
import { S as setRemoteLogSink } from "./client-
|
|
18
|
-
import { d as resolveBuildPlacement } from "./selection-
|
|
19
|
-
import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-
|
|
20
|
-
import { f as settleFingerprintCheck } from "./prebuild-
|
|
21
|
-
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-
|
|
22
|
-
import { t as acquireAndroidArtifact } from "./artifact-
|
|
23
|
-
import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-
|
|
24
|
-
import { o as lastBuildRecord } from "./ios-project-
|
|
25
|
-
import { t as acquireIosArtifact } from "./artifact-
|
|
17
|
+
import { S as setRemoteLogSink } from "./client-0_Mnfz0a.mjs";
|
|
18
|
+
import { d as resolveBuildPlacement } from "./selection-xS50Mt0V.mjs";
|
|
19
|
+
import { c as iosProjectPathError, g as resolveIosBuildSetup, m as resolveConfiguration, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-D8OH0z98.mjs";
|
|
20
|
+
import { f as settleFingerprintCheck } from "./prebuild-Bhs7TTcz.mjs";
|
|
21
|
+
import { n as ensureWorkspaceStorageSafely } from "./native-runtime-e1OU8gEN.mjs";
|
|
22
|
+
import { t as acquireAndroidArtifact } from "./artifact-BMjubIP2.mjs";
|
|
23
|
+
import { a as persistLastBuild, l as resolveAndroidBuildPlan, n as finishAndroidUpload } from "./result-DuimMZKJ.mjs";
|
|
24
|
+
import { o as lastBuildRecord } from "./ios-project-BzfLigfh.mjs";
|
|
25
|
+
import { t as acquireIosArtifact } from "./artifact-BufzdGbT.mjs";
|
|
26
26
|
import { constants, promises } from "node:fs";
|
|
27
27
|
import { basename, join } from "node:path";
|
|
28
28
|
import { hostSimulatorArch } from "@stim-cli/core";
|