stim 1.25.0 → 1.26.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/README.md +1 -1
- package/dist/{acquire-artifact-zA4S7RHE.mjs → acquire-artifact-DVsvSwf7.mjs} +1 -1
- package/dist/{act-BbHS3oV8.mjs → act-C-BqJEpu.mjs} +157 -35
- package/dist/{activity-BpjwrQXU.mjs → activity-Lnb_EoRY.mjs} +4 -5
- package/dist/{agent-device-usage-output-Bnkerfod.mjs → agent-device-usage-output-DbXy5tg8.mjs} +4 -4
- package/dist/{android-saBeB4lr.mjs → android-B5P81yI-.mjs} +1 -1
- package/dist/{android-CNZgRC-4.mjs → android-CSbLRD53.mjs} +5 -5
- package/dist/{android-BGwuK3Mc.mjs → android-CiNQw3kq.mjs} +73 -49
- package/dist/{android-Cjcj8MCw.mjs → android-DTAcRwBC.mjs} +81 -34
- package/dist/{android-cas-BVqh2Zep.mjs → android-cas-BTVhZ0Qs.mjs} +4 -4
- package/dist/{android-project-CTYaETc0.d.mts → android-project-DUGMbq28.d.mts} +55 -1
- package/dist/api.d.mts +8 -5
- package/dist/api.mjs +27 -27
- package/dist/apk-signed-tail-B46U9hXc.mjs +142 -0
- package/dist/{artifact-Co8zixVx.mjs → artifact-BxREhAaV.mjs} +23 -18
- package/dist/{artifact-DN8JNwqS.mjs → artifact-CsAP6AGK.mjs} +35 -20
- package/dist/{attempt-DW-mQqM7.mjs → attempt-ClyJlZPT.mjs} +4 -2
- package/dist/{browser-web-CCgZsHmI.mjs → browser-web-rYPyqhTf.mjs} +11 -12
- package/dist/{budget-HyShrIpL.mjs → budget-k2mZGvvk.mjs} +196 -33
- package/dist/{build-CAiw8Ezm.mjs → build-DPhApsjV.mjs} +26 -23
- package/dist/{build-cache-CKCzxzxA.mjs → build-cache-DrXNCy3T.mjs} +103 -21
- package/dist/{build-plan-zCuHGlA8.mjs → build-plan-DrMMdayj.mjs} +5 -5
- package/dist/{cache-manifest-BPXRONJz.mjs → cache-manifest-BEZ9Bpl1.mjs} +1 -1
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-h1FKhZeg.mjs → ccache-Bx5TbxwG.mjs} +6 -6
- package/dist/{cli-C4w607Pz.mjs → cli-BBKFGOFl.mjs} +19 -19
- package/dist/cli.mjs +1 -1
- package/dist/{client-BQsmyp_-.mjs → client-D9CaRks-.mjs} +36 -61
- package/dist/collector-run.mjs +4 -4
- package/dist/{command-output-BBvS1H6v.mjs → command-output-BF5AR2dL.mjs} +1 -1
- package/dist/{config-BZhXY15H.mjs → config-BktkY_zC.mjs} +321 -15
- package/dist/{launch-DscF1QfM.mjs → dependencies-Dw6wfQdv.mjs} +258 -255
- package/dist/{dependency-state-BwNCYG5Q.mjs → dependency-state-DFB41vfr.mjs} +1 -1
- package/dist/{dev-client-CHoXXZeg.mjs → dev-client-DXR_tPVY.mjs} +2 -2
- package/dist/{device-B9FqTBYW.mjs → device-BK-zwyd_.mjs} +13 -13
- package/dist/{device-F5-4z9ef.mjs → device-BcYeHSFu.mjs} +14 -14
- package/dist/{device-capacity-ZYaRALv5.mjs → device-capacity-DCSvUF0l.mjs} +10 -17
- package/dist/device-host-worker.mjs +11 -13
- package/dist/{device-ios-DkHBrmvH.mjs → device-ios-BLGfXQeK.mjs} +49 -17
- package/dist/{device-lease-run-ogEeJ62K.mjs → device-lease-run-BmvIl7bI.mjs} +4 -4
- package/dist/{device-pool-BIg8MU8l.mjs → device-pool-Dluix4H3.mjs} +3 -3
- package/dist/{doctor-k3P3PizH.mjs → doctor-Bhg1ii70.mjs} +14 -14
- package/dist/{doctor-A_Nr_fDe.mjs → doctor-Cp-BhzTS.mjs} +1 -1
- package/dist/{doctor-Bm8TVpGn.mjs → doctor-OnwP94ne.mjs} +72 -23
- package/dist/{doctor-fingerprint-zlujA1Gs.mjs → doctor-fingerprint-D3a04Mhu.mjs} +8 -2
- package/dist/doctor-fingerprint.mjs +1 -1
- package/dist/{doctor-watchman-BovI1y3-.mjs → doctor-watchman-BStK05nt.mjs} +4 -4
- package/dist/{eas-build-CyDKNTBP.mjs → eas-build-Dsj93iM9.mjs} +2 -2
- package/dist/{eas-fallback-gaZi-dJL.mjs → eas-fallback-FwkeqqGi.mjs} +10 -10
- package/dist/{eas-session-ledger-BMCA1gdO.mjs → eas-session-ledger-B5vygTiD.mjs} +5 -5
- package/dist/{error-diagnostics-B1Mj_-7h.mjs → error-diagnostics-BOOm9Db7.mjs} +8 -8
- package/dist/{gc-eaz403W6.mjs → gc-C_79zvz4.mjs} +2 -2
- package/dist/{gc-B9jcnmIk.mjs → gc-ldgr-hXU.mjs} +74 -43
- package/dist/{guide-DR0K0xW9.mjs → guide-D7K0X6KG.mjs} +272 -52
- package/dist/{hosted-android-Bvb2-ZxD.mjs → hosted-android-Bk54ej6n.mjs} +3 -3
- package/dist/{hosted-client-rsRqysJc.mjs → hosted-client-fHO8yqzc.mjs} +5 -5
- package/dist/{hosted-ios-RtVcJH3u.mjs → hosted-ios-D55QhYaD.mjs} +1 -1
- package/dist/{hosted-logs-CWKGYWNX.mjs → hosted-logs-BfbmDM4M.mjs} +17 -11
- package/dist/hosted-logs-sync-B0pvmOk-.mjs +195 -0
- package/dist/{hosted-macos-d0pv9Tth.mjs → hosted-macos-CPl0OZ9h.mjs} +5 -5
- package/dist/{hosted-native-BxTizGU2.mjs → hosted-native-CpDB3-PO.mjs} +6 -7
- package/dist/{idle-shutdown-BIyfl0Zj.mjs → idle-shutdown-FfxL1KdG.mjs} +22 -9
- package/dist/{ios-Dvt97HgQ.mjs → ios-B7-lToDu.mjs} +8 -8
- package/dist/{ios-BQzvJlzw.mjs → ios-WxpDJ5T1.mjs} +72 -5
- package/dist/{ios-device-CKSvk0bu.mjs → ios-device-CsyryvpT.mjs} +1 -1
- package/dist/{ios-BRVM8b0P.mjs → ios-ftxdQbJS.mjs} +74 -46
- package/dist/{ios-project-DCUDo06I.mjs → ios-project-Ty5pHl9O.mjs} +6 -6
- package/dist/{ios-state-CT9nV5SP.mjs → ios-state-Cw7-WQf2.mjs} +1 -1
- package/dist/{js-swap-Z9HbC4cj.mjs → js-swap-BMhXYVDS.mjs} +4 -4
- package/dist/{launch-D0lPvFFu.mjs → launch-DOp8RjDz.mjs} +31 -26
- package/dist/{logs-BsIRre8x.mjs → logs-dQDki6Tt.mjs} +9 -173
- package/dist/{logs-Crs9y34Z.mjs → logs-s1dRIG1E.mjs} +85 -36
- package/dist/{macos-CcUlJPMu.mjs → macos-B0VEV3Gf.mjs} +1 -1
- package/dist/{macos-D477nfzH.mjs → macos-DBBPNnIA.mjs} +18 -19
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +28 -11
- package/dist/{metro-1pJgCX4U.mjs → metro-CjC10t6E.mjs} +2 -2
- package/dist/{metro-gateway-Bp9gJQAN.mjs → metro-gateway-B6_PgD0L.mjs} +2 -3
- package/dist/{named-ports-BVbn8SvC.mjs → named-ports-BG0j1X4g.mjs} +2 -2
- package/dist/{native-android-BvMizJn1.mjs → native-android-CL2NGiik.mjs} +17 -17
- package/dist/{native-gradle-artifact-inputs-BJscK4vN.mjs → native-gradle-artifact-inputs-btSUulme.mjs} +3 -3
- package/dist/{native-run-D5OJsGwA.mjs → native-run-BfIDFKLH.mjs} +2 -3
- package/dist/{native-runtime-B9w_Qyz3.mjs → native-runtime-Dq3RBcON.mjs} +6 -7
- package/dist/{native-xcode-inputs-Cv4l-obn.mjs → native-xcode-inputs-BW7H8JGu.mjs} +2 -2
- package/dist/{native-xcode-ios-DGrg90hE.mjs → native-xcode-ios-CBXJAxfC.mjs} +15 -16
- package/dist/offload-worker.d.mts +3 -1
- package/dist/offload-worker.mjs +31 -21
- package/dist/{ownership-jxxz-19m.mjs → ownership-BjYvMNX_.mjs} +2 -2
- package/dist/{phone-reverses-CYb7RRAx.mjs → phone-reverses-lmj6kcPm.mjs} +3 -3
- package/dist/{placement-log-DjOXJRIH.mjs → placement-log-DIFPQAXp.mjs} +1 -1
- package/dist/{plan-placement-BqKgKHCi.mjs → plan-placement-IiiSQhtz.mjs} +3 -3
- package/dist/{ports-DtS1Amb0.mjs → ports-C2_w1Z0Z.mjs} +3 -3
- package/dist/prebuild-gmouvmJZ.mjs +1247 -0
- package/dist/{project-BiC68mIp.mjs → project-BUu6Is4k.mjs} +15 -16
- package/dist/{react-native-android-DRYqoJc4.mjs → react-native-android-Cgg99REN.mjs} +47 -33
- package/dist/{react-native-build-CwZB-agu.mjs → react-native-build-oNwqF5Wb.mjs} +7 -7
- package/dist/{react-native-doctor-BCrytK7h.mjs → react-native-doctor-BhA3KUte.mjs} +49 -8
- package/dist/{react-native-ios-Cr1buNFo.mjs → react-native-ios-B-nf4rjN.mjs} +37 -23
- package/dist/{recordings-BaoQ0t-J.mjs → recordings-BldzVKq0.mjs} +1 -1
- package/dist/{reload-Beftw2X3.mjs → reload-C9OduiNc.mjs} +1 -1
- package/dist/{reload-FbSgMF8x.mjs → reload-CCR7KC_l.mjs} +14 -14
- package/dist/{remote-BuZj6AyU.mjs → remote-C8S7FlPF.mjs} +7 -7
- package/dist/{result-CR2vk2cj.mjs → result-7F5hEwQJ.mjs} +16 -16
- package/dist/{run-BtzE09Dl.mjs → run-BqB0v3pt.mjs} +1 -1
- package/dist/{selection-D5cxEl3t.mjs → selection-BNPBZ6T5.mjs} +155 -42
- package/dist/{server-bare-CH9X0RLn.mjs → server-bare-A75rDIdD.mjs} +1 -1
- package/dist/{server-command-CaBbDNU2.mjs → server-command-CssKFOD7.mjs} +4 -4
- package/dist/{server-expo-Ck8EIidM.mjs → server-expo-eQfOdydb.mjs} +2 -2
- package/dist/server-expo-wvcj5tiZ.mjs +2 -0
- package/dist/{settings-B5tCoq9N.mjs → settings-CosW5X-S.mjs} +1 -1
- package/dist/{settings-DzH9mGQZ.mjs → settings-OaGQF-ri.mjs} +1 -1
- package/dist/{settings-write-n0zwfohx.mjs → settings-write-QjYfSrjF.mjs} +5 -5
- package/dist/settings.schema.json +33 -6
- package/dist/{simslim-BjxszUAb.mjs → simslim-Bax1qcxu.mjs} +3 -2
- package/dist/{slot-launch-QeuJMlnJ.mjs → slot-launch-CYCEhfBY.mjs} +6 -6
- package/dist/{stage-D8xlRU2D.mjs → stage-jKQ7CP_B.mjs} +1 -1
- package/dist/{start-C1JLjkNw.mjs → start-C_wefNKB.mjs} +1 -1
- package/dist/{start-YMpNwLhh.mjs → start-_BdJ32cZ.mjs} +9 -10
- package/dist/{state-DMRNP7-4.mjs → state-C1i2nMOP.mjs} +2 -3
- package/dist/{state-DPaM3u5K.mjs → state-C4OdpOTF.mjs} +1 -2
- package/dist/{stats-CP7STzZw.mjs → stats-tEpEEH-u.mjs} +4 -4
- package/dist/{status-cNw6i0_t.mjs → status-B9M7x4CZ.mjs} +1 -1
- package/dist/{status-Fect2w9R.mjs → status-CRXz-Gtj.mjs} +1 -1
- package/dist/{status-CRLiJ-O_.mjs → status-DQrqodLj.mjs} +22 -23
- package/dist/{status-watch-Bc2J4TZn.mjs → status-watch-B5wDIH_o.mjs} +4 -4
- package/dist/status-worker.mjs +1 -1
- package/dist/{stim-desktop-DS0mzR8U.mjs → stim-desktop-6Dqp-gjX.mjs} +1 -1
- package/dist/{stop-Br7LKxBE.mjs → stop-CmdNhGlC.mjs} +2 -2
- package/dist/{stop-Db9Kh-UA.mjs → stop-DRqQVqDJ.mjs} +21 -19
- package/dist/{stop-COP6PQqw.mjs → stop-ySNQHXMG.mjs} +4 -5
- package/dist/supervisor-run.d.mts +1 -0
- package/dist/supervisor-run.mjs +14 -15
- package/dist/{support-Cxj9CmII.mjs → support-BGSCBoib.mjs} +4 -4
- package/dist/{support-qKcbgmI5.mjs → support-CVOCp0Ft.mjs} +9 -9
- package/dist/{swiftpm-artifact-inputs-iY9fsmOc.mjs → swiftpm-artifact-inputs-CfUzt_0Z.mjs} +1 -1
- package/dist/{swiftpm-macos-Bp_sn9P4.mjs → swiftpm-macos-x6HPpl_2.mjs} +9 -9
- package/dist/toolchain-DoavrvIA.mjs +2 -0
- package/dist/toolchain-J4J8MrAr.mjs +2107 -0
- package/dist/trigger-DzJu208Q.mjs +2 -0
- package/dist/{trigger-CBMe2YLH.mjs → trigger-KVaWWNyn.mjs} +1 -1
- package/dist/{warm-progress-BV3ZPmcY.mjs → warm-progress-DvhTX_eu.mjs} +3 -4
- package/dist/web-BFLueSh-.mjs +2 -0
- package/dist/{web-B4Yjyt1G.mjs → web-Bihbf7-u.mjs} +8 -9
- package/dist/web-run.mjs +4 -4
- package/dist/{workspace-state-CPSp3mav.mjs → workspace-state-pUg3_RRA.mjs} +45 -7
- package/dist/{workspaces-C9w4aeXF.mjs → workspaces-g2lhdBXF.mjs} +17 -17
- package/dist/{worktree-CclFIe1Z.mjs → worktree-BKuklFh_.mjs} +34 -31
- package/dist/{worktree-Ct9Gk3KL.mjs → worktree-Bm4cb-nU.mjs} +1 -1
- package/package.json +8 -8
- package/dist/created-devices-D2Aca-xu.mjs +0 -52
- package/dist/paths-DQtTgsBf.mjs +0 -42
- package/dist/prebuild-JUaqOLpc.mjs +0 -501
- package/dist/server-expo-C16Zf2k7.mjs +0 -2
- package/dist/toolchain-DB1aeqxO.mjs +0 -2
- package/dist/toolchain-VzLJzZ7O.mjs +0 -908
- package/dist/trigger-BLsHgAGR.mjs +0 -2
- package/dist/web-DS4UDWvf.mjs +0 -2
- package/dist/xcode-CiIIDnuD.mjs +0 -910
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { y as sharedBuildCache } from "./workspace-state-pUg3_RRA.mjs";
|
|
2
|
+
import { E as findBuildTool } from "./android-DTAcRwBC.mjs";
|
|
3
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
+
import { closeSync, fstatSync, openSync, readFileSync, readSync, realpathSync, renameSync, rmSync } from "node:fs";
|
|
5
|
+
import { basename, dirname, join } from "node:path";
|
|
6
|
+
import { writeFile } from "node:fs/promises";
|
|
7
|
+
//#region src/engine/apk-signed-tail.ts
|
|
8
|
+
const SIGNED_TAIL_FILE = "apk-signed-tail.json";
|
|
9
|
+
const EOCD_SIGNATURE = 101010256;
|
|
10
|
+
const EOCD_MIN_BYTES = 22;
|
|
11
|
+
const EOCD_SEARCH_BYTES = 65557;
|
|
12
|
+
const SIGNING_BLOCK_FOOTER_BYTES = 24;
|
|
13
|
+
const SIGNING_BLOCK_MAGIC = "APK Sig Block 42";
|
|
14
|
+
const SIGNATURE_SCHEME_IDS = /* @__PURE__ */ new Set([1896449818, 4031998144]);
|
|
15
|
+
const SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
16
|
+
const VERIFIED_V2_OR_V3 = /^Verified using v[23] scheme \(APK Signature Scheme v[23]\): true\s*$/m;
|
|
17
|
+
/**
|
|
18
|
+
* The offset where an APK's v2 or v3 signing block starts, or null when the file has no such block, is ZIP64, or is
|
|
19
|
+
* malformed. https://source.android.com/docs/security/features/apksigning/v2#apk-signing-block
|
|
20
|
+
*/
|
|
21
|
+
function signingBlockOffset(size, read) {
|
|
22
|
+
if (size < EOCD_MIN_BYTES) return null;
|
|
23
|
+
const searched = Math.min(size, EOCD_SEARCH_BYTES);
|
|
24
|
+
const end = read(size - searched, searched);
|
|
25
|
+
let eocd = -1;
|
|
26
|
+
for (let i = end.length - EOCD_MIN_BYTES; i >= 0; i--) if (end.readUInt32LE(i) === EOCD_SIGNATURE && i + EOCD_MIN_BYTES + end.readUInt16LE(i + 20) === end.length) {
|
|
27
|
+
eocd = i;
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
if (eocd < 0) return null;
|
|
31
|
+
const directoryOffset = end.readUInt32LE(eocd + 16);
|
|
32
|
+
if (directoryOffset === 4294967295 || directoryOffset < 32) return null;
|
|
33
|
+
const footer = read(directoryOffset - SIGNING_BLOCK_FOOTER_BYTES, SIGNING_BLOCK_FOOTER_BYTES);
|
|
34
|
+
if (footer.subarray(8).toString("latin1") !== SIGNING_BLOCK_MAGIC) return null;
|
|
35
|
+
const blockSize = footer.readBigUInt64LE(0);
|
|
36
|
+
if (blockSize < BigInt(SIGNING_BLOCK_FOOTER_BYTES) || blockSize + 8n > BigInt(directoryOffset)) return null;
|
|
37
|
+
const start = directoryOffset - Number(blockSize) - 8;
|
|
38
|
+
const pairs = read(start, Number(blockSize) + 8 - SIGNING_BLOCK_FOOTER_BYTES);
|
|
39
|
+
if (pairs.readBigUInt64LE(0) !== blockSize) return null;
|
|
40
|
+
let position = 8;
|
|
41
|
+
while (position + 12 <= pairs.length) {
|
|
42
|
+
const length = pairs.readBigUInt64LE(position);
|
|
43
|
+
if (length < 4n || length > BigInt(pairs.length - position - 8)) return null;
|
|
44
|
+
if (SIGNATURE_SCHEME_IDS.has(pairs.readUInt32LE(position + 8))) return start;
|
|
45
|
+
position += 8 + Number(length);
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
function readSignedTail(apkPath) {
|
|
50
|
+
let fd = null;
|
|
51
|
+
try {
|
|
52
|
+
fd = openSync(apkPath, "r");
|
|
53
|
+
const open = fd;
|
|
54
|
+
const size = fstatSync(open).size;
|
|
55
|
+
const read = (position, length) => {
|
|
56
|
+
const buffer = Buffer.alloc(length);
|
|
57
|
+
if (readSync(open, buffer, 0, length, position) !== length) throw new Error("short read");
|
|
58
|
+
return buffer;
|
|
59
|
+
};
|
|
60
|
+
const tailOffset = signingBlockOffset(size, read);
|
|
61
|
+
if (tailOffset === null) return null;
|
|
62
|
+
const tailSha256 = createHash("sha256").update(read(tailOffset, size - tailOffset)).digest("hex");
|
|
63
|
+
return {
|
|
64
|
+
file: basename(apkPath),
|
|
65
|
+
size,
|
|
66
|
+
tailOffset,
|
|
67
|
+
tailSha256
|
|
68
|
+
};
|
|
69
|
+
} catch {
|
|
70
|
+
return null;
|
|
71
|
+
} finally {
|
|
72
|
+
if (fd !== null) try {
|
|
73
|
+
closeSync(fd);
|
|
74
|
+
} catch {}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const apksignerPath = () => findBuildTool(["apksigner"])?.path ?? null;
|
|
78
|
+
async function computeSignedTail(apkPath, run, findSigner = apksignerPath) {
|
|
79
|
+
const tail = readSignedTail(apkPath);
|
|
80
|
+
if (!tail) return null;
|
|
81
|
+
const signer = findSigner();
|
|
82
|
+
if (!signer) return null;
|
|
83
|
+
try {
|
|
84
|
+
if (!VERIFIED_V2_OR_V3.test(String(await run(signer, [
|
|
85
|
+
"verify",
|
|
86
|
+
"--verbose",
|
|
87
|
+
apkPath
|
|
88
|
+
])))) return null;
|
|
89
|
+
} catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
const after = readSignedTail(apkPath);
|
|
93
|
+
return after && after.size === tail.size && after.tailSha256 === tail.tailSha256 ? tail : null;
|
|
94
|
+
}
|
|
95
|
+
function recordedSignedTail(apkPath) {
|
|
96
|
+
try {
|
|
97
|
+
const parsed = JSON.parse(readFileSync(join(dirname(apkPath), SIGNED_TAIL_FILE), "utf-8"));
|
|
98
|
+
if (!parsed || typeof parsed !== "object" || !("file" in parsed) || !("size" in parsed) || !("tailOffset" in parsed) || !("tailSha256" in parsed)) return null;
|
|
99
|
+
const { file, size, tailOffset, tailSha256 } = parsed;
|
|
100
|
+
if (file !== basename(apkPath) || typeof size !== "number" || typeof tailOffset !== "number" || typeof tailSha256 !== "string" || !SHA256_HEX.test(tailSha256) || !Number.isSafeInteger(size) || !Number.isSafeInteger(tailOffset) || tailOffset < 0 || tailOffset >= size) return null;
|
|
101
|
+
const current = readSignedTail(apkPath);
|
|
102
|
+
if (!current || current.size !== size || current.tailOffset !== tailOffset || current.tailSha256 !== tailSha256) return null;
|
|
103
|
+
return {
|
|
104
|
+
file,
|
|
105
|
+
size,
|
|
106
|
+
tailOffset,
|
|
107
|
+
tailSha256
|
|
108
|
+
};
|
|
109
|
+
} catch {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function writeSignedTail(dir, tail) {
|
|
114
|
+
const target = join(dir, SIGNED_TAIL_FILE);
|
|
115
|
+
const temporary = `${target}.${randomUUID()}.tmp`;
|
|
116
|
+
try {
|
|
117
|
+
await writeFile(temporary, JSON.stringify(tail));
|
|
118
|
+
renameSync(temporary, target);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
rmSync(temporary, { force: true });
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function inBuildCacheEntry(apkPath) {
|
|
125
|
+
try {
|
|
126
|
+
return realpathSync(dirname(dirname(apkPath))) === realpathSync(join(sharedBuildCache(), "android"));
|
|
127
|
+
} catch {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async function signedTailFor(apkPath, run, findSigner) {
|
|
132
|
+
const recorded = recordedSignedTail(apkPath);
|
|
133
|
+
if (recorded || !inBuildCacheEntry(apkPath)) return recorded;
|
|
134
|
+
const computed = await computeSignedTail(apkPath, run, findSigner);
|
|
135
|
+
if (!computed) return null;
|
|
136
|
+
try {
|
|
137
|
+
await writeSignedTail(dirname(apkPath), computed);
|
|
138
|
+
} catch {}
|
|
139
|
+
return computed;
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { signedTailFor as n, writeSignedTail as r, computeSignedTail as t };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, c as throwIfCancelled, x as withDrainingCancellation } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
4
|
-
import {
|
|
5
|
-
import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-
|
|
6
|
-
import {
|
|
7
|
-
import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-
|
|
8
|
-
import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-
|
|
9
|
-
import { i as namedBuildMachine,
|
|
10
|
-
import { f as formatDiagnostic } from "./react-native-build-
|
|
11
|
-
import { u as skippedMissReason } from "./prebuild-
|
|
12
|
-
import { t as buildPlacementRecord } from "./placement-log-
|
|
13
|
-
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-
|
|
14
|
-
import { a as PLATFORM, h as displayPath } from "./support-
|
|
2
|
+
import { E as workspaceDir } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BF5AR2dL.mjs";
|
|
4
|
+
import { Jn as easAuthNote, Wn as RESOLVE_TIMEOUT_MS, Yn as isEasAuthFailureText } from "./budget-k2mZGvvk.mjs";
|
|
5
|
+
import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-BfIDFKLH.mjs";
|
|
6
|
+
import { v as prepareProviderDownloadDir, y as providerDownloadPath } from "./build-cache-DrXNCy3T.mjs";
|
|
7
|
+
import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-Bx5TbxwG.mjs";
|
|
8
|
+
import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-D9CaRks-.mjs";
|
|
9
|
+
import { i as namedBuildMachine, r as fingerprintMismatchRemedy, s as requireLocalBuild, t as OffloadRefusal } from "./selection-BNPBZ6T5.mjs";
|
|
10
|
+
import { f as formatDiagnostic } from "./react-native-build-oNwqF5Wb.mjs";
|
|
11
|
+
import { u as skippedMissReason } from "./prebuild-gmouvmJZ.mjs";
|
|
12
|
+
import { t as buildPlacementRecord } from "./placement-log-DIFPQAXp.mjs";
|
|
13
|
+
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DVsvSwf7.mjs";
|
|
14
|
+
import { a as PLATFORM, h as displayPath } from "./support-BGSCBoib.mjs";
|
|
15
15
|
import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
|
|
16
16
|
import { rmSync } from "node:fs";
|
|
17
17
|
import { join } from "node:path";
|
|
@@ -780,11 +780,14 @@ async function acquireAndroidArtifact({ context, root, buildLog, writer, recipe,
|
|
|
780
780
|
now
|
|
781
781
|
}
|
|
782
782
|
});
|
|
783
|
-
if (!acquired.ok)
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
783
|
+
if (!acquired.ok) {
|
|
784
|
+
recipe.fingerprintCheck?.()?.cancel();
|
|
785
|
+
return {
|
|
786
|
+
ok: false,
|
|
787
|
+
failure: acquired.failure,
|
|
788
|
+
ccache: ccacheActivity
|
|
789
|
+
};
|
|
790
|
+
}
|
|
788
791
|
return {
|
|
789
792
|
ok: true,
|
|
790
793
|
artifact: {
|
|
@@ -792,7 +795,9 @@ async function acquireAndroidArtifact({ context, root, buildLog, writer, recipe,
|
|
|
792
795
|
handoff,
|
|
793
796
|
androidPackage,
|
|
794
797
|
apkPackage: record.cacheHit && storeKey ? entryAppId(PLATFORM, storeKey) : null,
|
|
798
|
+
fingerprintCheck: recipe.fingerprintCheck?.() ?? null,
|
|
795
799
|
release: async () => {
|
|
800
|
+
recipe.fingerprintCheck?.()?.cancel();
|
|
796
801
|
await settleArtifactUploads(providerUpload, uploadPending);
|
|
797
802
|
acquired.release();
|
|
798
803
|
},
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { D as ownership_claim_exports, c as throwIfCancelled, x as withDrainingCancellation } from "./exec-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-
|
|
4
|
-
import {
|
|
5
|
-
import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { C as COMPILATION_CACHE_CORRUPT, c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText, w as clearCorruptCompilationCache } from "./client-
|
|
9
|
-
import { i as namedBuildMachine, o as
|
|
10
|
-
import { S as xcodeFailureReport, p as printDiagnostics } from "./support-
|
|
11
|
-
import { u as skippedMissReason } from "./prebuild-
|
|
12
|
-
import { t as buildPlacementRecord } from "./placement-log-
|
|
13
|
-
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-
|
|
14
|
-
import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-
|
|
2
|
+
import { E as workspaceDir } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BF5AR2dL.mjs";
|
|
4
|
+
import { Jn as easAuthNote, Wn as RESOLVE_TIMEOUT_MS, Yn as isEasAuthFailureText } from "./budget-k2mZGvvk.mjs";
|
|
5
|
+
import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-BfIDFKLH.mjs";
|
|
6
|
+
import { b as providerUploadOutcome, v as prepareProviderDownloadDir, w as storedAppId, y as providerDownloadPath } from "./build-cache-DrXNCy3T.mjs";
|
|
7
|
+
import { P as compilationCacheActivityLine, k as COMPILATION_CACHE_NOT_RUN } from "./toolchain-J4J8MrAr.mjs";
|
|
8
|
+
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-D9CaRks-.mjs";
|
|
9
|
+
import { i as namedBuildMachine, o as podsFailedRemedy, p as predictedRefusal, r as fingerprintMismatchRemedy, s as requireLocalBuild, t as OffloadRefusal } from "./selection-BNPBZ6T5.mjs";
|
|
10
|
+
import { S as xcodeFailureReport, p as printDiagnostics } from "./support-CVOCp0Ft.mjs";
|
|
11
|
+
import { f as settleFingerprintCheck, u as skippedMissReason } from "./prebuild-gmouvmJZ.mjs";
|
|
12
|
+
import { t as buildPlacementRecord } from "./placement-log-DIFPQAXp.mjs";
|
|
13
|
+
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-DVsvSwf7.mjs";
|
|
14
|
+
import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-Ty5pHl9O.mjs";
|
|
15
15
|
import { rmSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { machineCapacity } from "@stim-cli/core/state";
|
|
@@ -354,6 +354,13 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
354
354
|
if (mode !== "off") phase("build", `placement: here (${placement.reason})`);
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
|
+
const named = machines.find((each) => each.machine === buildMachine);
|
|
358
|
+
const offload = recipe.offload;
|
|
359
|
+
if (placement.code === "named" && named && offload && runtime) {
|
|
360
|
+
const { problems } = await offloadCheck(root, async () => [await offload.target(runtime)])(named);
|
|
361
|
+
const predicted = predictedRefusal(buildMachine, problems);
|
|
362
|
+
if (predicted) throw new OffloadRefusal(buildMachine, predicted.reason, predicted.remedy);
|
|
363
|
+
}
|
|
357
364
|
return {
|
|
358
365
|
cacheOnly: false,
|
|
359
366
|
mode,
|
|
@@ -364,14 +371,17 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
364
371
|
machines
|
|
365
372
|
};
|
|
366
373
|
}
|
|
374
|
+
let localCocoapods = null;
|
|
367
375
|
/** Asks the paired machines once the post-mutation key is known; null builds here. */
|
|
368
376
|
async function chooseMachine(candidate) {
|
|
369
377
|
const offload = recipe.offload;
|
|
370
378
|
if (!offload) return null;
|
|
371
379
|
let asked = [];
|
|
380
|
+
const target = await offload.target(candidate.runtime);
|
|
381
|
+
localCocoapods = target.platform === "ios" ? target.local.cocoapods : null;
|
|
372
382
|
const choice = await chooseBuildMachine({
|
|
373
383
|
projectRoot: root,
|
|
374
|
-
target
|
|
384
|
+
target,
|
|
375
385
|
mode: candidate.mode,
|
|
376
386
|
here: candidate.here,
|
|
377
387
|
note: (line) => note(chalk.dim(phaseLine("build", `offload: ${line}`))),
|
|
@@ -484,7 +494,7 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
484
494
|
fallBack(`${choice.machine}: ${why}`, `offload failed: ${why}`, {
|
|
485
495
|
code: corrupt === void 0 ? "offload-failed" : COMPILATION_CACHE_CORRUPT,
|
|
486
496
|
machine: choice.machine,
|
|
487
|
-
remedy: outcome.ok ? void 0 : fingerprintMismatchRemedy(outcome.reason)
|
|
497
|
+
remedy: outcome.ok ? void 0 : fingerprintMismatchRemedy(outcome.reason) ?? podsFailedRemedy(choice.machine, outcome.reason, localCocoapods)
|
|
488
498
|
});
|
|
489
499
|
logWriter().write({
|
|
490
500
|
src: "build",
|
|
@@ -778,11 +788,14 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
778
788
|
logFile,
|
|
779
789
|
deps: d
|
|
780
790
|
});
|
|
781
|
-
if (!acquired.ok)
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
791
|
+
if (!acquired.ok) {
|
|
792
|
+
recipe.fingerprintCheck?.()?.cancel();
|
|
793
|
+
return {
|
|
794
|
+
ok: false,
|
|
795
|
+
failure: acquired.failure,
|
|
796
|
+
compilationCache
|
|
797
|
+
};
|
|
798
|
+
}
|
|
786
799
|
appPath = acquired.artifact;
|
|
787
800
|
return {
|
|
788
801
|
ok: true,
|
|
@@ -822,8 +835,10 @@ async function acquireIosArtifact({ context, root, logFile, recipe, physical, co
|
|
|
822
835
|
if (outcome.warn) note(chalk.yellow(phaseLine("cache", outcome.line)));
|
|
823
836
|
else phase("cache", outcome.line);
|
|
824
837
|
}
|
|
838
|
+
await settleFingerprintCheck(recipe.fingerprintCheck?.() ?? null, "ios", (line) => note(chalk.yellow(phaseLine("fingerprint", line))), (record) => logWriter().write(record));
|
|
825
839
|
return abandonedRemote || uploadWasAbandoned;
|
|
826
840
|
},
|
|
841
|
+
cancelFingerprintCheck: () => recipe.fingerprintCheck?.()?.cancel(),
|
|
827
842
|
release: async () => {
|
|
828
843
|
await settleArtifactUploads(providerUpload, uploadPending);
|
|
829
844
|
acquired.release();
|
|
@@ -10,13 +10,15 @@ function due(state, settings, now, attemptedAt) {
|
|
|
10
10
|
pressure: settings.pressureCheckMinutes * 6e4,
|
|
11
11
|
size: settings.sizeCheckMinutes * 6e4,
|
|
12
12
|
worktree: settings.removeFinishedWorktrees ? settings.worktreeCheckMinutes * 6e4 : Infinity,
|
|
13
|
-
sweep: settings.sweepHours > 0 ? settings.sweepHours * 36e5 : Infinity
|
|
13
|
+
sweep: settings.sweepHours > 0 ? settings.sweepHours * 36e5 : Infinity,
|
|
14
|
+
idle: settings.idleCheckMinutes * 6e4
|
|
14
15
|
};
|
|
15
16
|
return [
|
|
16
17
|
"pressure",
|
|
17
18
|
"size",
|
|
18
19
|
"worktree",
|
|
19
|
-
"sweep"
|
|
20
|
+
"sweep",
|
|
21
|
+
"idle"
|
|
20
22
|
].filter((check) => {
|
|
21
23
|
if (intervalMs[check] === Infinity || elapsed(state?.deferredAt?.[check]) < DEFERRED_RETRY_MS) return false;
|
|
22
24
|
return elapsed(state?.lastAt[check]) >= intervalMs[check];
|
|
@@ -1,18 +1,17 @@
|
|
|
1
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-VFRpu1iA.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { p as getProject } from "./config-
|
|
4
|
-
import { l as phaseLine } from "./command-output-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { d as resolveProjectMetro } from "./metro-1pJgCX4U.mjs";
|
|
2
|
+
import { E as workspaceDir, k as workspaceLogsDir$1, l as withWorkspaceStateLockAsync, r as readWorkspaceState$1 } from "./workspace-state-pUg3_RRA.mjs";
|
|
3
|
+
import { p as getProject } from "./config-BktkY_zC.mjs";
|
|
4
|
+
import { l as phaseLine } from "./command-output-BF5AR2dL.mjs";
|
|
5
|
+
import { M as metroPortSetting, a as SETTING_SHAPE_REMEDY, ot as webSettings } from "./settings-CosW5X-S.mjs";
|
|
6
|
+
import { b as isPackageResolvable, v as detectIsExpo } from "./project-BUu6Is4k.mjs";
|
|
7
|
+
import { d as resolveProjectMetro } from "./metro-CjC10t6E.mjs";
|
|
9
8
|
import { s as readNdjsonGenerations$1 } from "./ndjson-CgE_o3Dl.mjs";
|
|
10
|
-
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-
|
|
11
|
-
import {
|
|
12
|
-
import { D as teardownBrowserHeld, g as resolveSupervisorTarget } from "./workspaces-
|
|
13
|
-
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-
|
|
9
|
+
import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-C1i2nMOP.mjs";
|
|
10
|
+
import { sn as readMetroRecords } from "./budget-k2mZGvvk.mjs";
|
|
11
|
+
import { D as teardownBrowserHeld, g as resolveSupervisorTarget } from "./workspaces-g2lhdBXF.mjs";
|
|
12
|
+
import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-BG0j1X4g.mjs";
|
|
14
13
|
import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CzEA_-5_.mjs";
|
|
15
|
-
import { o as resolveWorkspaceMetroPort } from "./start-
|
|
14
|
+
import { o as resolveWorkspaceMetroPort } from "./start-_BdJ32cZ.mjs";
|
|
16
15
|
import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
|
|
17
16
|
import { n as windowsLauncherArgs } from "./detached-entry-KmieOKgN.mjs";
|
|
18
17
|
import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-BvV8ssI3.mjs";
|