ci(windows): cache Rust builds in the release-windows-check lane - #4476
ci(windows): cache Rust builds in the release-windows-check lane#4476Rangsh wants to merge 2 commits into
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Approving. I went looking for the failure mode where the save step never fires — github.ref_name == default_branch is false on every pull_request run — but this workflow's on: also carries schedule: '17 5 * * *' and workflow_dispatch, so the nightly on main populates the cache on its own. The job-level defaults.run.shell: bash covers the new bash-syntax steps on windows-2025, and the wiring matches windows-sandbox-w0.yml step for step.
One correction for the PR body rather than the diff: it says "This workflow is PR-triggered and does not save cache from feature-branch runs", which reads as if a maintainer has to seed the cache by hand after merge. The nightly does it — no manual workflow_dispatch needed.
|
@Astro-Han Thanks for the review and the catch on the Rollout section — you're right. I've updated the PR description to note that the nightly run on |
|
One thing to take with a rebase: #4461 added |
Add Kache install, restore, report, and save steps to the package job so the runtime-host-peer and sandbox launcher release builds reuse a warm cache on windows-2025, following the pattern already used in windows-sandbox-w0.yml.
release-windows-check now installs Kache, so bump the workflow-policy count that apache#4461 pinned at five. Co-authored-by: Cursor <cursoragent@cursor.com>
3f91a1d to
4dc5cea
Compare
|
@Astro-Han Thanks — rebased onto latest main and bumped the kache@0.16.0 workflow count from 5 to 6 in scripts/ci-workflow-policy.test.mjs. The revision-suffixed key and default-branch Save assertions already matched; node --test scripts/ci-workflow-policy.test.mjs is green locally. |
Add Kache install, restore, report, and save steps to the package job so the runtime-host-peer and sandbox launcher release builds reuse a warm cache on windows-2025, following the pattern already used in windows-sandbox-w0.yml.
Summary
Release Windows checkis the slowest PR lane in this repository and the only one that compiles Rust without a build cache. ThePackage the Windows installer and ZIPstep alone averages ~10m54s, largely because it runs two cold Rust release builds onwindows-2025:npm run build:runtime-host-peer(native/runtime-host-peer,cdylib)cargo build --manifest-path experiments/windows-sandbox/launcher/Cargo.toml --release --locked(sandbox launcher)This PR adds Kache install, restore, report, and save steps to the
packagejob in.github/workflows/release-windows-check.yml, following the same pattern already used inwindows-sandbox-w0.yml:kache@0.16.0via the same pinnedtaiki-e/install-actionKACHE_CACHE_DIR,KACHE_RUNTIME_DIR, andRUSTC_WRAPPER=kacheinjected before packagingwindows-2025,rustcversion, and commit revisionkache reportwritten to the GitHub Actions step summary for warm-cache measurementNo verification logic changes. The lane still runs the same end-to-end checks, including
Verify the Windows release, so a stale cache cannot silently pass.Fixes #4470
Verification
.github/workflows/release-windows-check.ymlagainstwindows-sandbox-w0.ymland confirmed the Kache wiring matches the existing repository pattern (install pin, env vars, restore/save actions, default-branch save guard).scripts/package-windows-x64.mjsbuilds both Rust targets inside the cached step and inheritsprocess.env, soRUSTC_WRAPPER=kacheapplies to bothbuild:runtime-host-peerand the sandbox launchercargo build.npm run cleanonly removes TypeScriptdistoutputs and does not delete Rusttarget/directories, so it does not defeat Kache.Release Windows checkworkflow onwindows-2025— not run locally; requires CI to measure warm-cache impact against the ~10m54s baseline from the issue.Expected CI evidence after merge:
kache reportappears in the workflow step summaryPackage the Windows installer and ZIPis faster on a warm cache than the issue baselineVerify the Windows releaseRollout
The save step only runs when
github.ref_name == github.event.repository.default_branch, sopull_requestruns restore the cache but do not write it. That is fine: this workflow also runs on a nightly schedule (17 5 * * *) and viaworkflow_dispatch, both onmain, so the default-branch cache is populated automatically without any manual seeding after merge.On Windows, Kache caches
runtime-host-peerfully as acdylib. The sandbox launcher is abincrate, so dependency crates are cached but the final.exemay still be rebuilt unlessKACHE_CACHE_EXECUTABLESis enabled later. That matches the currentwindows-sandbox-w0.ymlbehavior and is acceptable for this issue's scope.AI use
Select exactly one:
Tool(s) and scope:
Cursor (Auto) drafted the workflow change and PR description based on issue #4470 and the existing
windows-sandbox-w0.ymlreference implementation.Checklist
Does this PR entail a change in behavior?