stim 1.20.2 → 1.22.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 +141 -8
- package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
- package/dist/act-DsuqEkiM.mjs +2801 -0
- package/dist/activity-CMLmzp7o.mjs +1397 -0
- package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
- package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
- package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
- package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
- package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
- package/dist/android-cas-compiler.mjs +2 -2
- package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
- package/dist/android-project-BCAAmMwz.mjs +12 -0
- package/dist/android-project-DVWyCbWU.d.mts +391 -0
- package/dist/api.d.mts +810 -64
- package/dist/api.mjs +782 -1
- package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
- package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
- package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
- package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
- package/dist/budget-Cvwn54qV.mjs +9285 -0
- package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
- package/dist/build-cache-Dv7RN200.mjs +602 -0
- package/dist/build-plan-DUC8Ka9y.mjs +248 -0
- package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
- package/dist/cache-manifest.mjs +1 -1
- package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
- package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
- package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
- package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
- package/dist/cli.mjs +1 -1
- package/dist/client-OyRoEuSr.mjs +1577 -0
- package/dist/collector-run.d.mts +4 -40
- package/dist/collector-run.mjs +9 -8
- package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
- package/dist/config-DlrsduwG.mjs +955 -0
- package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
- package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
- package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
- package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
- package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
- package/dist/device-DklWZLqb.mjs +1068 -0
- package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
- package/dist/device-host-worker.mjs +76 -79
- package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
- package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
- package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
- package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
- package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
- package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
- package/dist/doctor-fingerprint.mjs +19 -0
- package/dist/doctor-thjWAV0z.mjs +2 -0
- package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
- package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
- package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
- package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
- package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
- package/dist/exec-DEoAhcze.mjs +858 -0
- package/dist/exec-DnYc4HGH.d.mts +78 -0
- package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
- package/dist/gc-DnNDQyaP.mjs +3 -0
- package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
- package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
- package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
- package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
- package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
- package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
- package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
- package/dist/idle-C4cZ757K.d.mts +24 -0
- package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
- package/dist/ios-CDvlmUs7.d.mts +24 -0
- package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
- package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
- package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
- package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
- package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
- package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
- package/dist/ios-signing-BtAffm0A.mjs +489 -0
- package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
- package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
- package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
- package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
- package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
- package/dist/logs-BfwwadsZ.mjs +479 -0
- package/dist/logs-jTS_lHSo.mjs +248 -0
- package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
- package/dist/macos-NfV2D7dO.mjs +694 -0
- package/dist/macos-run.mjs +1 -1
- package/dist/maintenance-run.mjs +123 -248
- package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
- package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
- package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
- package/dist/native-android-CqgnOgsT.mjs +645 -0
- package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
- package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
- package/dist/native-inputs-TRTTTRxt.mjs +91 -0
- package/dist/native-run-NwUuxbkg.mjs +276 -0
- package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
- package/dist/native-source-Y0yLhFyQ.mjs +133 -0
- package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
- package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
- package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
- package/dist/offload-worker.d.mts +59 -41
- package/dist/offload-worker.mjs +478 -115
- package/dist/operation-exec-BW0em61G.mjs +171 -0
- package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
- package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
- package/dist/paths-BsJMoPP2.mjs +12 -0
- package/dist/paths-DQtTgsBf.mjs +42 -0
- package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
- package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
- package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
- package/dist/prebuild-D4JoEAEs.mjs +484 -0
- package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
- package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
- package/dist/pull-request-eODyIqZF.d.mts +124 -0
- package/dist/pull-requests.d.mts +2 -120
- package/dist/pull-requests.mjs +2 -2
- package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
- package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
- package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
- package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
- package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
- package/dist/registration-BcRgF6Ox.mjs +51 -0
- package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
- package/dist/reload-D7AVlb8N.mjs +2 -0
- package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
- package/dist/result-D2Ykz_iD.mjs +435 -0
- package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
- package/dist/selection-DSMbWEX2.mjs +620 -0
- package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
- package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
- package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
- package/dist/server-expo-D58c9L0M.mjs +2 -0
- package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
- package/dist/settings-DpR-1Wnn.mjs +114 -0
- package/dist/settings-write-CzD60rOD.mjs +360 -0
- package/dist/settings.schema.json +176 -16
- package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
- package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
- package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
- package/dist/stage-Bps5oius.mjs +200 -0
- package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
- package/dist/start-EojN4WFz.mjs +1364 -0
- package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
- package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
- package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
- package/dist/stats-report-BzaPrRm6.mjs +16 -0
- package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
- package/dist/status-EvrK72L2.mjs +2 -0
- package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
- package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
- package/dist/status-worker.d.mts +1 -0
- package/dist/status-worker.mjs +19 -0
- package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
- package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
- package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
- package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
- package/dist/supervisor-run.d.mts +8 -17
- package/dist/supervisor-run.mjs +56 -28
- package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
- package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
- package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
- package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
- package/dist/toolchain-BY8X8HXx.mjs +2 -0
- package/dist/toolchain-DpJMHq0n.mjs +876 -0
- package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
- package/dist/trigger-yb_nFzPF.mjs +2 -0
- package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
- package/dist/web-CZ07gd77.mjs +2 -0
- package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
- package/dist/web-run.mjs +13 -12
- package/dist/windows-report.d.mts +1 -0
- package/dist/windows-report.mjs +18 -0
- package/dist/windows-report.ps1 +43 -0
- package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
- package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
- package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
- package/dist/worktree-ZqZVjD9K.mjs +2 -0
- package/dist/xcode-BXn9-xYx.mjs +896 -0
- package/package.json +7 -5
- package/shim/android-audio/Main.java +24 -0
- package/shim/android-audio/README.md +17 -0
- package/shim/android-audio.jar +0 -0
- package/shim/android-optimizations.gradle +7 -5
- package/dist/activity-BSV745Kz.mjs +0 -629
- package/dist/api-qvOzWyfO.mjs +0 -154
- package/dist/api-run.mjs +0 -294
- package/dist/app-install-BIKtMfPq.mjs +0 -896
- package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
- package/dist/budget-f7516Zk0.mjs +0 -4106
- package/dist/build-facts-DcLv2HSd.d.mts +0 -111
- package/dist/cancellation-C_22VQTH.mjs +0 -24
- package/dist/client-qQAaXSUs.mjs +0 -1771
- package/dist/config-BYDxlMY3.mjs +0 -562
- package/dist/device-DuiPJQSn.mjs +0 -290
- package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
- package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
- package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
- package/dist/exec-DqKo9GKJ.mjs +0 -268
- package/dist/git-DDfFzkMm.mjs +0 -45
- package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
- package/dist/logs-BGrEUaEs.mjs +0 -383
- package/dist/macos-Ch5VJmcS.mjs +0 -584
- package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
- package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
- package/dist/native-android-D5qc3-_v.mjs +0 -226
- package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
- package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
- package/dist/plan-C4TjdPsR.mjs +0 -260
- package/dist/prebuild-DYbucPXy.mjs +0 -212
- package/dist/preview-78a9kR_-.mjs +0 -1011
- package/dist/react-native-build-CtCccJtb.mjs +0 -239
- package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
- package/dist/remote-cache-OyOyVIS3.mjs +0 -526
- package/dist/result-CaJg5Iat.mjs +0 -186
- package/dist/server-expo-Bigriskl.mjs +0 -2
- package/dist/settings-BORNaaCO.mjs +0 -402
- package/dist/settings-vk3mJGSm.d.mts +0 -13
- package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
- package/dist/stage-KNTQopqv.mjs +0 -157
- package/dist/start-BWqzODpb.mjs +0 -1116
- package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
- package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
- package/dist/tailnet-Dh-qiYzG.mjs +0 -265
- package/dist/toolchain-BFkAcstd.mjs +0 -2
- package/dist/toolchain-DxSsNssu.mjs +0 -1657
- package/dist/trigger-9_USgmxz.mjs +0 -2
- package/dist/web-Dq-i3wzJ.mjs +0 -2
- package/dist/worktree-DpLdCHga.mjs +0 -2
- package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
- package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { h as withDrainingCancellation, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { d as workspaceDir } from "./paths-DQtTgsBf.mjs";
|
|
3
|
+
import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-gwpm28fu.mjs";
|
|
4
|
+
import { f as throwIfCancelled } from "./operation-exec-BW0em61G.mjs";
|
|
5
|
+
import { Hn as isEasAuthFailureText, Ln as RESOLVE_TIMEOUT_MS, Vn as easAuthNote } from "./budget-Cvwn54qV.mjs";
|
|
6
|
+
import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-NwUuxbkg.mjs";
|
|
7
|
+
import { d as prepareProviderDownloadDir, f as providerDownloadPath } from "./build-cache-Dv7RN200.mjs";
|
|
8
|
+
import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-Btwc36-I.mjs";
|
|
9
|
+
import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-OyRoEuSr.mjs";
|
|
10
|
+
import { a as requireLocalBuild, r as namedBuildMachine, t as OffloadRefusal } from "./selection-DSMbWEX2.mjs";
|
|
11
|
+
import { f as formatDiagnostic } from "./react-native-build-Dvd8hC21.mjs";
|
|
12
|
+
import { l as skippedMissReason } from "./prebuild-D4JoEAEs.mjs";
|
|
13
|
+
import { t as buildPlacementRecord } from "./placement-log-BnGgJRRZ.mjs";
|
|
14
|
+
import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-Co2k4f7O.mjs";
|
|
15
|
+
import { a as PLATFORM, h as displayPath } from "./support-yUiOjnVY.mjs";
|
|
16
|
+
import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
|
|
15
17
|
import { rmSync } from "node:fs";
|
|
16
18
|
import { join } from "node:path";
|
|
17
19
|
import { machineCapacity } from "@stim-cli/core/state";
|
|
18
|
-
import { createWarnOnce, resolveTieredBuild, storeTieredBuild } from "@stim-cli/cache";
|
|
19
20
|
import chalk from "chalk";
|
|
21
|
+
import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, buildUploadTimeoutMs, createWarnOnce, resolveTieredBuild, storeTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
|
|
20
22
|
//#region src/commands/android/artifact.ts
|
|
21
23
|
const FALLBACK_LINES = 5;
|
|
22
24
|
function fail(code, message, remedy, extra = {}) {
|
|
@@ -27,10 +29,10 @@ function fail(code, message, remedy, extra = {}) {
|
|
|
27
29
|
extra
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
|
-
async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOffloadRefusal, buildPlan, cacheProviderConfig, requestedBuildCache, easBuild, androidPackage: initialPackage, record, maxBuilds, progress }, { acquireLock, releaseLock, waitForBuild, easAuth, resolveRemoteBuild, uploadRemoteBuild, loadCacheProviderModule, acquireSlot, releaseSlot, now }) {
|
|
32
|
+
async function acquireAndroidArtifact({ context, root, buildLog, writer, recipe, targetOffloadRefusal, buildPlan, cacheProviderConfig, requestedBuildCache, easBuild, androidPackage: initialPackage, record, maxBuilds, progress }, { acquireLock, releaseLock, waitForBuild, easAuth, resolveRemoteBuild, uploadRemoteBuild, loadCacheProviderModule, acquireSlot, releaseSlot, now }) {
|
|
31
33
|
const { phase, out, stats, step, miss, hit: lateHit, place, waitingOn, waitingFor } = progress;
|
|
32
34
|
let fallbackMachine = null;
|
|
33
|
-
let hereReason = "no remote
|
|
35
|
+
let hereReason = "no remote machine is paired";
|
|
34
36
|
let slotWaitMs;
|
|
35
37
|
const buildMachine = record.buildMachine ?? "auto";
|
|
36
38
|
const fallBack = (reason, line = reason, info = {}) => {
|
|
@@ -51,7 +53,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
51
53
|
phase("build", `${line} -> building here`);
|
|
52
54
|
};
|
|
53
55
|
const { variant, cache: cachePolicy } = buildPlan;
|
|
54
|
-
const signal = runCancellationSignal() ??
|
|
56
|
+
const signal = runCancellationSignal(context) ?? context.signal;
|
|
55
57
|
const cacheTarget = (key) => ({
|
|
56
58
|
projectRoot: root,
|
|
57
59
|
platform: "android",
|
|
@@ -63,28 +65,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
63
65
|
let androidPackage = initialPackage;
|
|
64
66
|
let ccacheActivity = CCACHE_NOT_RUN;
|
|
65
67
|
let phaseFailure = null;
|
|
66
|
-
let
|
|
67
|
-
const releaseHeldLock = () => {
|
|
68
|
-
if (!buildLock) return;
|
|
69
|
-
const held = buildLock;
|
|
70
|
-
buildLock = null;
|
|
71
|
-
try {
|
|
72
|
-
releaseLock(held);
|
|
73
|
-
} catch (err) {
|
|
74
|
-
out(phaseLine("build", chalk.dim(`could not release the build lock at ${held.path}: ${err?.message || err}`)));
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
let buildSlot = null;
|
|
78
|
-
const releaseHeldSlot = () => {
|
|
79
|
-
if (!buildSlot) return;
|
|
80
|
-
const held = buildSlot;
|
|
81
|
-
buildSlot = null;
|
|
82
|
-
try {
|
|
83
|
-
releaseSlot(held);
|
|
84
|
-
} catch (err) {
|
|
85
|
-
out(phaseLine("build", chalk.dim(`could not release the build slot: ${err?.message || err}`)));
|
|
86
|
-
}
|
|
87
|
-
};
|
|
68
|
+
let run;
|
|
88
69
|
let hash = "";
|
|
89
70
|
let providerUpload = null;
|
|
90
71
|
let providerName = null;
|
|
@@ -92,7 +73,16 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
92
73
|
const cacheWarn = createWarnOnce((line) => phase("cache", chalk.yellow(line)));
|
|
93
74
|
const loadTieredProvider = cachePolicy.remote && cacheProviderConfig ? () => providerLoad ??= loadCacheProviderModule({
|
|
94
75
|
projectRoot: root,
|
|
95
|
-
config: cacheProviderConfig
|
|
76
|
+
config: cacheProviderConfig,
|
|
77
|
+
env: context.env,
|
|
78
|
+
timeoutMs: timeoutFromEnv(PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, context.env)
|
|
79
|
+
}).then((loaded) => {
|
|
80
|
+
if (!loaded.provider || !recipe.providerCache) return loaded;
|
|
81
|
+
const builds = recipe.providerCache(loaded.provider);
|
|
82
|
+
return {
|
|
83
|
+
...loaded,
|
|
84
|
+
provider: builds ? { builds } : {}
|
|
85
|
+
};
|
|
96
86
|
}) : null;
|
|
97
87
|
let cacheKey = "";
|
|
98
88
|
let storeHash = "";
|
|
@@ -140,7 +130,8 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
140
130
|
record.cacheKey = cacheKey;
|
|
141
131
|
storeHash = hash;
|
|
142
132
|
storeKey = cacheKey;
|
|
143
|
-
const found = await resolveTieredBuild({
|
|
133
|
+
const found = await withDrainingCancellation(context, signal, () => resolveTieredBuild({
|
|
134
|
+
timeoutMs: buildResolveTimeoutMs(context.env),
|
|
144
135
|
local: recipe.cache(),
|
|
145
136
|
loadProvider: loadTieredProvider,
|
|
146
137
|
target: {
|
|
@@ -149,10 +140,11 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
149
140
|
key: cacheKey
|
|
150
141
|
},
|
|
151
142
|
destinationDir: providerDownloadPath(workspaceDir(root)),
|
|
152
|
-
ensureDestination: prepareProviderDownloadDir,
|
|
143
|
+
ensureDestination: (dir) => prepareProviderDownloadDir(dir, root),
|
|
153
144
|
skipRead: !useBuildCache,
|
|
154
|
-
warn: cacheWarn
|
|
155
|
-
|
|
145
|
+
warn: cacheWarn,
|
|
146
|
+
signal
|
|
147
|
+
}));
|
|
156
148
|
const cached = found?.tier === "local" ? found.path : null;
|
|
157
149
|
record.cacheHit = cached ? "local" : false;
|
|
158
150
|
record.cacheSkipped = !useBuildCache;
|
|
@@ -169,13 +161,14 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
169
161
|
let abandonedRemote = false;
|
|
170
162
|
let uploadPending = null;
|
|
171
163
|
async function resolveRemoteArtifact() {
|
|
172
|
-
if (cacheIneligible || !recipe.
|
|
164
|
+
if (cacheIneligible || !recipe.expoCache) return;
|
|
173
165
|
if (!apkPath) {
|
|
174
|
-
const loaded = await recipe.
|
|
166
|
+
const loaded = await recipe.expoCache.load();
|
|
175
167
|
if (loaded?.unavailable) phase("cache", chalk.yellow(`provider not usable: ${loaded.unavailable}`));
|
|
176
168
|
else if (loaded?.provider) remote = loaded;
|
|
177
169
|
if (remote?.name === "eas") {
|
|
178
|
-
const auth = easAuth({
|
|
170
|
+
const auth = await easAuth({
|
|
171
|
+
context,
|
|
179
172
|
projectRoot: root,
|
|
180
173
|
owner: loaded?.owner || null
|
|
181
174
|
});
|
|
@@ -187,12 +180,13 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
187
180
|
if (remote && useBuildCache) {
|
|
188
181
|
const remoteTimer = stepTimer(now);
|
|
189
182
|
const hit = await resolveRemoteBuild({
|
|
183
|
+
context,
|
|
190
184
|
logWriter: writer,
|
|
191
185
|
provider: remote.provider,
|
|
192
186
|
platform: PLATFORM,
|
|
193
187
|
projectRoot: root,
|
|
194
188
|
fingerprintHash: hash,
|
|
195
|
-
runOptions: recipe.
|
|
189
|
+
runOptions: recipe.expoCache?.runOptions ?? null
|
|
196
190
|
});
|
|
197
191
|
if (hit?.appPath) {
|
|
198
192
|
let stored = null;
|
|
@@ -203,6 +197,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
203
197
|
overwrite: false
|
|
204
198
|
}) ?? null;
|
|
205
199
|
} catch (err) {
|
|
200
|
+
throwIfCancelled(signal, "build cache backfill");
|
|
206
201
|
phase("cache", chalk.yellow(`remote hit could not be stored locally: ${err?.message || err}`));
|
|
207
202
|
}
|
|
208
203
|
apkPath = stored || hit.appPath;
|
|
@@ -224,16 +219,9 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
224
219
|
let releasedWait = null;
|
|
225
220
|
async function awaitSharedBuild() {
|
|
226
221
|
if (!useBuildCache) return null;
|
|
227
|
-
const shared = await
|
|
228
|
-
platform: PLATFORM,
|
|
222
|
+
const shared = await run.claimSharedBuild({
|
|
229
223
|
key: cacheKey,
|
|
230
224
|
fingerprint: hash,
|
|
231
|
-
root,
|
|
232
|
-
logFile: buildLog,
|
|
233
|
-
command: "stim android",
|
|
234
|
-
acquire: acquireLock,
|
|
235
|
-
wait: waitForBuild,
|
|
236
|
-
now,
|
|
237
225
|
phase: (text) => {
|
|
238
226
|
step("wait");
|
|
239
227
|
phase("build", text);
|
|
@@ -247,7 +235,6 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
247
235
|
phaseFailure = fail(code, message, remedy, { lastBuildStatus: true });
|
|
248
236
|
throw new AndroidRecipeRefusal(phaseFailure);
|
|
249
237
|
}
|
|
250
|
-
buildLock = shared.lock;
|
|
251
238
|
releasedWait = shared.released;
|
|
252
239
|
if (shared.hit) {
|
|
253
240
|
apkPath = shared.hit.path;
|
|
@@ -256,26 +243,17 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
256
243
|
}
|
|
257
244
|
return apkPath;
|
|
258
245
|
}
|
|
259
|
-
let swapDir = null;
|
|
260
|
-
const releaseArtifact = () => {
|
|
261
|
-
if (!swapDir) return;
|
|
262
|
-
try {
|
|
263
|
-
rmSync(swapDir, {
|
|
264
|
-
recursive: true,
|
|
265
|
-
force: true
|
|
266
|
-
});
|
|
267
|
-
swapDir = null;
|
|
268
|
-
} catch (error) {
|
|
269
|
-
out(phaseLine("cleanup", chalk.yellow(`could not remove the temporary APK: ${error.message}`)));
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
246
|
const installableCachedApk = async (key, cachedPath) => {
|
|
273
247
|
const prepared = await recipe.materialize(key, cachedPath);
|
|
274
248
|
if (!prepared) {
|
|
275
249
|
swapFellBack = true;
|
|
276
250
|
return null;
|
|
277
251
|
}
|
|
278
|
-
|
|
252
|
+
if (prepared.directory) run.own(prepared.directory);
|
|
253
|
+
if (prepared.androidPackage) {
|
|
254
|
+
androidPackage = prepared.androidPackage;
|
|
255
|
+
record.bundleId = androidPackage;
|
|
256
|
+
}
|
|
279
257
|
return prepared.apkPath;
|
|
280
258
|
};
|
|
281
259
|
async function prepareCachedArtifact(cachedPath) {
|
|
@@ -316,16 +294,15 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
316
294
|
requireLocalBuild(buildMachine);
|
|
317
295
|
if (!maxBuilds) return true;
|
|
318
296
|
try {
|
|
319
|
-
|
|
297
|
+
slotWaitMs = (await run.takeBuildSlot({
|
|
298
|
+
signal,
|
|
320
299
|
automatic: buildMachine === "auto",
|
|
321
300
|
max: maxBuilds,
|
|
322
|
-
root,
|
|
323
|
-
logFile: buildLog,
|
|
324
301
|
out,
|
|
325
302
|
waitingFor: (info) => waitingFor?.(info, "build-slot")
|
|
326
|
-
});
|
|
327
|
-
slotWaitMs = buildSlot.slotWaitMs;
|
|
303
|
+
})).slotWaitMs;
|
|
328
304
|
} catch (err) {
|
|
305
|
+
throwIfCancelled(signal, "Android build");
|
|
329
306
|
requireLocalBuild(buildMachine);
|
|
330
307
|
const refusal = (0, ownership_claim_exports.claimFailure)(err, "stim android");
|
|
331
308
|
if (refusal) {
|
|
@@ -336,7 +313,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
336
313
|
}
|
|
337
314
|
return true;
|
|
338
315
|
}
|
|
339
|
-
/** Whether this build should leave this
|
|
316
|
+
/** Whether this build should leave this machine, before any machine is asked; null builds here. */
|
|
340
317
|
function placeBuild() {
|
|
341
318
|
if (cacheIneligible && !recipe.offload?.supportsUncachedArtifacts) {
|
|
342
319
|
if (namedBuildMachine(buildMachine)) throw new OffloadRefusal(buildMachine, cacheIneligible);
|
|
@@ -357,6 +334,14 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
357
334
|
});
|
|
358
335
|
if (!placement.offload) {
|
|
359
336
|
hereReason = placement.reason;
|
|
337
|
+
if (placement.code === "this-mac-free" && cachePolicy.read && cachePolicy.remote && (recipe.offload?.uncachedArtifacts || recipe.offload && !recipe.offload.request.native)) return {
|
|
338
|
+
cacheOnly: true,
|
|
339
|
+
mode,
|
|
340
|
+
here,
|
|
341
|
+
code: placement.code,
|
|
342
|
+
reason: placement.reason,
|
|
343
|
+
machines
|
|
344
|
+
};
|
|
360
345
|
writer.write(buildPlacementRecord({
|
|
361
346
|
platform: PLATFORM,
|
|
362
347
|
buildMachine,
|
|
@@ -369,6 +354,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
369
354
|
return null;
|
|
370
355
|
}
|
|
371
356
|
return {
|
|
357
|
+
cacheOnly: false,
|
|
372
358
|
mode,
|
|
373
359
|
here,
|
|
374
360
|
code: placement.code,
|
|
@@ -376,17 +362,19 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
376
362
|
machines
|
|
377
363
|
};
|
|
378
364
|
}
|
|
379
|
-
const openOffload = { choice: null };
|
|
380
365
|
/** Asks the paired machines once the post-mutation key is known; null builds here. */
|
|
381
366
|
async function chooseMachine(candidate) {
|
|
367
|
+
const offload = recipe.offload;
|
|
382
368
|
let asked = [];
|
|
383
369
|
let target;
|
|
384
370
|
try {
|
|
385
|
-
target =
|
|
371
|
+
target = await offload.target();
|
|
386
372
|
} catch (error) {
|
|
373
|
+
if (candidate.cacheOnly) return null;
|
|
387
374
|
fallBack(error.message);
|
|
388
375
|
return null;
|
|
389
376
|
}
|
|
377
|
+
const request = offload.request;
|
|
390
378
|
const choice = await chooseBuildMachine({
|
|
391
379
|
projectRoot: root,
|
|
392
380
|
target,
|
|
@@ -395,9 +383,23 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
395
383
|
note: (line) => phase("build", chalk.dim(`offload: ${line}`)),
|
|
396
384
|
machines: candidate.machines,
|
|
397
385
|
selected: buildMachine,
|
|
398
|
-
onCandidates: (each) => asked = each
|
|
386
|
+
onCandidates: (each) => asked = each,
|
|
387
|
+
cacheOnly: candidate.cacheOnly,
|
|
388
|
+
...cachePolicy.read && cachePolicy.remote && storeHash && !request.native ? { reactNativeArtifact: {
|
|
389
|
+
fingerprint: storeHash,
|
|
390
|
+
request
|
|
391
|
+
} } : {},
|
|
392
|
+
...cachePolicy.read && cachePolicy.remote && request.native?.provider === "gradle" && request.android.variant ? { gradleArtifact: {
|
|
393
|
+
sourceDigest: request.native.transfer.digest,
|
|
394
|
+
inputs: request.native.transfer.declaration,
|
|
395
|
+
android: {
|
|
396
|
+
...request.android,
|
|
397
|
+
variant: request.android.variant
|
|
398
|
+
}
|
|
399
|
+
} } : {}
|
|
399
400
|
});
|
|
400
401
|
if (typeof choice === "string") {
|
|
402
|
+
if (candidate.cacheOnly) return null;
|
|
401
403
|
const only = candidate.machines.length === 1 ? candidate.machines[0].machine : null;
|
|
402
404
|
if (only && choice.startsWith(`${only}: `)) fallbackMachine = only;
|
|
403
405
|
fallBack(choice, choice, {
|
|
@@ -406,7 +408,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
406
408
|
});
|
|
407
409
|
return null;
|
|
408
410
|
}
|
|
409
|
-
openOffload
|
|
411
|
+
run.openOffload(() => closeOffload(choice));
|
|
410
412
|
writer.write(buildPlacementRecord({
|
|
411
413
|
platform: PLATFORM,
|
|
412
414
|
buildMachine,
|
|
@@ -421,7 +423,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
421
423
|
}
|
|
422
424
|
/** Builds on the chosen machine and stores the APK under the post-mutation key; false builds here instead unless a machine was named. */
|
|
423
425
|
async function compileElsewhere(choice, candidate) {
|
|
424
|
-
const uncached = Boolean(cacheIneligible && recipe.offload?.supportsUncachedArtifacts);
|
|
426
|
+
const uncached = Boolean(recipe.offload?.uncachedArtifacts || cacheIneligible && recipe.offload?.supportsUncachedArtifacts);
|
|
425
427
|
if ((!storeKey || !storeHash) && !uncached) {
|
|
426
428
|
const reason = "the build fingerprint or cache key is unavailable";
|
|
427
429
|
if (namedBuildMachine(buildMachine)) fallBack(reason, reason, { machine: choice.machine });
|
|
@@ -438,7 +440,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
438
440
|
return false;
|
|
439
441
|
}
|
|
440
442
|
const stagingDir = join(workspaceDir(root), "offload", PLATFORM);
|
|
441
|
-
|
|
443
|
+
const disownStaging = uncached ? run.own(stagingDir) : null;
|
|
442
444
|
const outcome = await offloadBuild({
|
|
443
445
|
choice,
|
|
444
446
|
expectedFingerprint: uncached ? null : storeHash,
|
|
@@ -475,7 +477,6 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
475
477
|
else {
|
|
476
478
|
stored = outcome.artifactPath;
|
|
477
479
|
androidPackage = outcome.androidPackage;
|
|
478
|
-
swapDir = stagingDir;
|
|
479
480
|
}
|
|
480
481
|
} else try {
|
|
481
482
|
stored = await recipe.cache().store({
|
|
@@ -487,17 +488,19 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
487
488
|
reason = `could not store the APK: ${err?.message || err}`;
|
|
488
489
|
}
|
|
489
490
|
}
|
|
490
|
-
|
|
491
|
-
|
|
491
|
+
if (!uncached || !stored) {
|
|
492
|
+
disownStaging?.();
|
|
493
|
+
try {
|
|
492
494
|
rmSync(stagingDir, {
|
|
493
495
|
recursive: true,
|
|
494
496
|
force: true
|
|
495
497
|
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
498
|
+
} catch {}
|
|
499
|
+
}
|
|
500
|
+
throwIfCancelled(signal, "offloaded build cache copy");
|
|
499
501
|
step("compile");
|
|
500
502
|
if (!outcome.ok || !stored) {
|
|
503
|
+
if (candidate.cacheOnly) return false;
|
|
501
504
|
const why = reason ?? "the APK was not stored";
|
|
502
505
|
fallbackMachine = choice.machine;
|
|
503
506
|
fallBack(`${choice.machine}: ${why}`, `offload failed: ${why}`, {
|
|
@@ -514,6 +517,13 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
514
517
|
return false;
|
|
515
518
|
}
|
|
516
519
|
const { timings } = outcome;
|
|
520
|
+
if (uncached) {
|
|
521
|
+
record.fingerprint = null;
|
|
522
|
+
record.cacheKey = null;
|
|
523
|
+
record.cacheHit = outcome.cacheHit ? "remote" : false;
|
|
524
|
+
record.cacheSkipped = !outcome.cacheHit;
|
|
525
|
+
}
|
|
526
|
+
if (outcome.cacheHit) lateHit();
|
|
517
527
|
apkPath = stored;
|
|
518
528
|
handoff = outcome.handoff ?? null;
|
|
519
529
|
record.builtOn = outcome.machine;
|
|
@@ -525,13 +535,13 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
525
535
|
buildMs: timings.totalMs
|
|
526
536
|
});
|
|
527
537
|
ccacheActivity = outcome.ccache;
|
|
528
|
-
phase("build",
|
|
538
|
+
phase("build", `${outcome.cacheHit ? "reused from" : "built on"} ${outcome.machine} in ${formatDuration(timings.totalMs)}: offer ${formatDuration(timings.offerMs)}, sync ${formatDuration(timings.syncMs)}, build ${formatDuration(timings.workerMs)}, fetch ${formatDuration(timings.fetchMs)}`);
|
|
529
539
|
phase("cache", `compilation cache on ${outcome.machine} ${ccacheActivityLine(ccacheActivity)}`);
|
|
530
540
|
writer.write({
|
|
531
541
|
src: "build",
|
|
532
542
|
level: "info",
|
|
533
543
|
event: "offload_done",
|
|
534
|
-
msg:
|
|
544
|
+
msg: `${outcome.cacheHit ? "reused from" : "built on"} ${outcome.machine}`,
|
|
535
545
|
timings
|
|
536
546
|
});
|
|
537
547
|
return true;
|
|
@@ -593,7 +603,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
593
603
|
explainMiss(rekeyedBy);
|
|
594
604
|
step("compile");
|
|
595
605
|
}
|
|
596
|
-
if (offload) stats.setPlacement({
|
|
606
|
+
if (offload && !offload.cacheOnly) stats.setPlacement({
|
|
597
607
|
decision: "fell-back",
|
|
598
608
|
slotWaitMs,
|
|
599
609
|
deviceSlotWaitMs: stats.deviceSlotWaitMs(),
|
|
@@ -660,7 +670,8 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
660
670
|
if (cachePolicy.write) {
|
|
661
671
|
const local = recipe.cache(true);
|
|
662
672
|
try {
|
|
663
|
-
const stored = await storeTieredBuild({
|
|
673
|
+
const stored = await withDrainingCancellation(context, signal, () => storeTieredBuild({
|
|
674
|
+
timeoutMs: buildUploadTimeoutMs(context.env),
|
|
664
675
|
local,
|
|
665
676
|
loadProvider: loadTieredProvider,
|
|
666
677
|
target: {
|
|
@@ -670,91 +681,119 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
|
|
|
670
681
|
},
|
|
671
682
|
sourcePath: artifactPath,
|
|
672
683
|
overwrite: !useBuildCache || swapFellBack,
|
|
673
|
-
warn: cacheWarn
|
|
674
|
-
|
|
675
|
-
|
|
684
|
+
warn: cacheWarn,
|
|
685
|
+
signal
|
|
686
|
+
}));
|
|
687
|
+
const pending = stored.providerUpload;
|
|
688
|
+
providerUpload = pending ? withDrainingCancellation(context, signal, () => pending) : null;
|
|
689
|
+
providerUpload?.catch(() => {});
|
|
676
690
|
providerName = stored.providerName ?? providerName;
|
|
677
691
|
} catch (err) {
|
|
692
|
+
throwIfCancelled(signal, "build cache storage");
|
|
678
693
|
phase("cache", chalk.yellow(`could not store the build: ${err?.message || err}`));
|
|
679
694
|
}
|
|
680
695
|
}
|
|
681
|
-
if (remote)
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
696
|
+
if (remote) {
|
|
697
|
+
uploadPending = uploadRemoteBuild({
|
|
698
|
+
context,
|
|
699
|
+
logWriter: writer,
|
|
700
|
+
provider: remote.provider,
|
|
701
|
+
platform: PLATFORM,
|
|
702
|
+
projectRoot: root,
|
|
703
|
+
fingerprintHash: storeHash,
|
|
704
|
+
buildPath: artifactPath,
|
|
705
|
+
runOptions: recipe.expoCache?.runOptions ?? null
|
|
706
|
+
});
|
|
707
|
+
uploadPending.catch(() => {});
|
|
708
|
+
}
|
|
690
709
|
}
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
if (apkPath) lateHit();
|
|
711
|
-
else if (swapFellBack) miss(reasonForMiss([]).reason);
|
|
712
|
-
return apkPath;
|
|
713
|
-
},
|
|
714
|
-
build: {
|
|
715
|
-
placement: {
|
|
716
|
-
select: placeBuild,
|
|
717
|
-
acquire: acquireRemoteArtifact
|
|
710
|
+
const acquired = await acquireArtifact({
|
|
711
|
+
platform: PLATFORM,
|
|
712
|
+
command: "stim android",
|
|
713
|
+
lifecycle: (driver) => {
|
|
714
|
+
run = driver;
|
|
715
|
+
return {
|
|
716
|
+
resolve: async () => {
|
|
717
|
+
if (!await resolveInitialFingerprint()) throw new AndroidRecipeRefusal(phaseFailure);
|
|
718
|
+
if (easBuild) return {
|
|
719
|
+
kind: "ready",
|
|
720
|
+
artifact: apkPath
|
|
721
|
+
};
|
|
722
|
+
await resolveRemoteArtifact();
|
|
723
|
+
if (apkPath) return {
|
|
724
|
+
kind: "cached",
|
|
725
|
+
artifact: apkPath
|
|
726
|
+
};
|
|
727
|
+
miss(reasonForMiss([]).reason);
|
|
728
|
+
return { kind: "miss" };
|
|
718
729
|
},
|
|
719
|
-
|
|
720
|
-
|
|
730
|
+
claim: useBuildCache ? awaitSharedBuild : void 0,
|
|
731
|
+
reuse: async (cached) => {
|
|
732
|
+
apkPath = await prepareCachedArtifact(cached);
|
|
733
|
+
if (apkPath) lateHit();
|
|
734
|
+
else if (swapFellBack) miss(reasonForMiss([]).reason);
|
|
735
|
+
return apkPath;
|
|
721
736
|
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
if (error instanceof OffloadRefusal) {
|
|
737
|
-
const { code, message, remedy } = error;
|
|
738
|
-
return {
|
|
739
|
-
ok: false,
|
|
740
|
-
failure: fail(code, message, remedy, { lastBuildStatus: true }),
|
|
741
|
-
ccache: ccacheActivity
|
|
737
|
+
build: {
|
|
738
|
+
placement: {
|
|
739
|
+
select: placeBuild,
|
|
740
|
+
acquire: acquireRemoteArtifact
|
|
741
|
+
},
|
|
742
|
+
admit: async () => {
|
|
743
|
+
if (!await takeBuildSlot()) throw new AndroidRecipeRefusal(phaseFailure);
|
|
744
|
+
},
|
|
745
|
+
prepare: prepareSource,
|
|
746
|
+
revalidate: revalidateSource,
|
|
747
|
+
compile: compileHere,
|
|
748
|
+
validate: validateCompiled,
|
|
749
|
+
store: storeArtifact
|
|
750
|
+
}
|
|
742
751
|
};
|
|
752
|
+
},
|
|
753
|
+
settleFailed: async () => {
|
|
754
|
+
await settleArtifactUploads(uploadPending, providerUpload);
|
|
755
|
+
},
|
|
756
|
+
refuse: (error) => {
|
|
757
|
+
if (error instanceof OffloadRefusal) {
|
|
758
|
+
const { code, message, remedy } = error;
|
|
759
|
+
return fail(code, message, remedy, { lastBuildStatus: true });
|
|
760
|
+
}
|
|
761
|
+
if (error instanceof AndroidRecipeRefusal) return error.failure;
|
|
762
|
+
const cancelled = cancelledFailure(context, PLATFORM, {
|
|
763
|
+
code: "STIM_CANCELLED",
|
|
764
|
+
message: "during app preparation"
|
|
765
|
+
});
|
|
766
|
+
return cancelled ? fail(cancelled.code, cancelled.message, cancelled.remedy, { lastBuildStatus: true }) : null;
|
|
767
|
+
},
|
|
768
|
+
releaseFailed: (subject, err) => out(phaseLine("build", chalk.dim(`could not release ${subject}: ${err?.message || err}`))),
|
|
769
|
+
temporaryReleaseFailed: (error) => out(phaseLine("cleanup", chalk.yellow(`could not remove the temporary APK: ${error.message}`)))
|
|
770
|
+
}, {
|
|
771
|
+
root,
|
|
772
|
+
logFile: buildLog,
|
|
773
|
+
deps: {
|
|
774
|
+
acquireBuildLock: acquireLock,
|
|
775
|
+
releaseBuildLock: releaseLock,
|
|
776
|
+
waitForBuild,
|
|
777
|
+
acquireBuildSlot: acquireSlot,
|
|
778
|
+
releaseBuildSlot: releaseSlot,
|
|
779
|
+
now
|
|
743
780
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}
|
|
781
|
+
});
|
|
782
|
+
if (!acquired.ok) return {
|
|
783
|
+
ok: false,
|
|
784
|
+
failure: acquired.failure,
|
|
785
|
+
ccache: ccacheActivity
|
|
786
|
+
};
|
|
751
787
|
return {
|
|
752
788
|
ok: true,
|
|
753
789
|
artifact: {
|
|
754
|
-
apkPath,
|
|
790
|
+
apkPath: acquired.artifact,
|
|
755
791
|
handoff,
|
|
756
792
|
androidPackage,
|
|
757
|
-
release:
|
|
793
|
+
release: async () => {
|
|
794
|
+
await settleArtifactUploads(providerUpload, uploadPending);
|
|
795
|
+
acquired.release();
|
|
796
|
+
},
|
|
758
797
|
waitedForBuild,
|
|
759
798
|
ccache: ccacheActivity,
|
|
760
799
|
uploadPending,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { t as getExecutor } from "./exec-DEoAhcze.mjs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
//#region src/macos/artifact-platform.ts
|
|
4
|
+
async function validateMacosArtifactPlatform(context, bundle, product, signal) {
|
|
5
|
+
const binary = join(bundle, "Contents", "MacOS", product);
|
|
6
|
+
const options = {
|
|
7
|
+
timeoutMs: 3e4,
|
|
8
|
+
signal,
|
|
9
|
+
declareFor: context
|
|
10
|
+
};
|
|
11
|
+
const architecture = process.arch === "x64" ? "x86_64" : process.arch;
|
|
12
|
+
const archs = await getExecutor().runFileAsync("xcrun", [
|
|
13
|
+
"lipo",
|
|
14
|
+
"-archs",
|
|
15
|
+
binary
|
|
16
|
+
], options);
|
|
17
|
+
const platform = await getExecutor().runFileAsync("xcrun", [
|
|
18
|
+
"vtool",
|
|
19
|
+
"-arch",
|
|
20
|
+
architecture,
|
|
21
|
+
"-show-build",
|
|
22
|
+
binary
|
|
23
|
+
], options);
|
|
24
|
+
if (!archs.trim().split(/\s+/).includes(architecture) || !/^\s*platform\s+MACOS\s*$/m.test(platform)) throw new Error("The cached macOS executable does not match this platform and architecture.");
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { validateMacosArtifactPlatform as t };
|