Repository navigation
Fix undersized Windows .msi: bundle embedding model on the Windows release leg - #2776
Conversation
The macOS release job downloads nomic-embed-text-v1.5.Q8_0.gguf into resources/models/ before tauri build so bundle.resources (resources/models/**/*) has content to package. The Windows job never had this step, so on a fresh windows-latest runner the gitignored resources/models/ directory stays empty; tauri-bundler treats an empty glob as zero matched files rather than an error, so the .msi/.exe built and uploaded successfully with the embedding model silently missing — no build-time signal. The published v0.3.0 .msi (65MB) is roughly the model's compressed size smaller than the macOS .dmg (186MB) for the same release, consistent with this gap. Adds the same download step to the Windows leg, mirroring the macOS job exactly (same model, same destination path). Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ild scripts The pragmatic-code-review on this PR found that both local Windows build paths (scripts/build-windows.ts Tier 2 VM build, scripts/build-windows-quick.ts Tier 1 cross-compile) explicitly document themselves as mirroring release.yml's Windows build-tauri leg "as closely as a non-Windows host allows" / with "full CI parity", but neither was updated to download the embedding model before `tauri build` -- so both would reproduce the exact undersized-installer bug this PR fixes only in CI, with no error anywhere in the pipeline. Fixed both the same way as release.yml: download nomic-embed-text-v1.5.Q8_0.gguf into resources/models/ before the Tauri build step, using --skip-existing (not --clobber, unlike the CI steps) since both scripts are re-run repeatedly against a persistent checkout, not a fresh CI runner. build-windows-quick.ts also gained a `gh` CLI prerequisite check, consistent with its own stated design of checking every prerequisite up front with an actionable error. Also reordered release.yml's new Windows download step to run before the sidecar build (matching the macOS job's ordering) so a flaky ~146MB download fails fast instead of only surfacing after a full Rust build. Skipped, with reasoning (out of scope for this narrow, release-blocking installer-size fix -- filed as follow-up considerations rather than implemented here): - SHA256 verification of the downloaded model in either CI step: a pre-existing gap shared identically by the macOS step this PR mirrors, not introduced by this change. Hardening both together is a distinct supply-chain improvement deserving its own review, not a same-day addition to a release-day CI fix. - resolve_model_path() (packages/daemon/src/services/assembly.rs) never reads the Tauri-bundled resources/models/ path, only ~/.nodespace/models/ -- a real, pre-existing question about whether bundling the model enables anything at runtime on either platform, but a separate architectural question from "the installer is undersized" and outside this issue's acceptance criteria. Worth a maintainer decision, not a scope addition here. - scripts/test-app-units.ts's resources/models glob check is satisfied by the tracked .gitkeep alone, by explicit, documented design (a local dev build-prerequisite check, not a release-asset audit) -- real verification of the shipped bundle's contents belongs in CI, not this script. - No shared composite action across the platform jobs, no caching of the ~146MB download, no retry/backoff around `gh release download`: all pre-existing patterns this PR mirrors rather than introduces (the retry and caching gaps already existed on macOS); each is a reasonable future improvement but expands this fix's scope and risk under release-deadline pressure. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Address-review summaryRan ✅ Addressed (3)
Both scripts' test suites ( ⏭️ Skipped, with reasoning (6)All out of scope for this narrow, release-blocking installer-size fix — flagged as follow-up considerations rather than implemented here:
Re-Review DecisionDecision: RE-REVIEW NEEDED (borderline) — recommend a lightweight one, not a full pass. Rationale: The follow-up commit added real code to two previously-unreviewed scripts (not just config), including a new prerequisite check and behavior in |
… locally Second pragmatic-code-review pass on this PR found that all three touched call sites (release.yml's new Windows step, build-windows.ts Tier 2, build-windows-quick.ts Tier 1) hand-roll `gh release download models-v2` instead of the repo's existing SHA-256-verified downloader (scripts/download-models.ts, ADR-058, already the documented canonical producer for this exact resources/models path per test-app-units.ts's own PRODUCERS map) -- and that the resulting `--skip-existing` matches by filename only, so a truncated file from an interrupted run would be silently reused on the next build instead of re-verified. Verified `models-v2` (a GitHub Release, not the model's HuggingFace source) was deliberately created to give CI a pre-vetted, GitHub-hosted copy for build-pipeline reliability -- release.yml's Windows step (and the pre-existing macOS one it mirrors) is left exactly as-is, matching that established, already-proven-in-production CI pattern rather than introducing a live HuggingFace dependency into the release pipeline under today's release-deadline pressure. The two local-only developer scripts have no such constraint, so both now call `bun run download:models:bundle` directly: it hashes an already-downloaded file before reusing it (fixing the skip-existing corruption gap for real, not just by flag choice), and needs no `gh` auth at all -- so build-windows-quick.ts's `hasGh` prerequisite check from the previous commit is removed as no longer needed, along with the `gh auth login` one-time-setup doc line. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Address-review summary (round 2)Ran ✅ AddressedAll three touched call sites (release.yml's new Windows step, I checked whether
Re-Review DecisionDecision: NO RE-REVIEW NEEDED. Rationale: This round's changes are a straightforward swap of one already-reviewed download mechanism for another within code the last two review rounds have now examined closely (including the exact reasoning for why CI stays on PR should be ready to merge pending final approval. |
Summary
The published v0.3.0 Windows
.msi(65MB) is far smaller than the macOS.dmg(186MB) for the same release — much larger than the platform binary-size difference alone accounts for.Root cause:
tauri.conf.json'sbundle.resourcesincludesresources/models/**/*, which is populated by a "Download embedding model for bundling" CI step that downloadsnomic-embed-text-v1.5.Q8_0.gguf(146MB) from themodels-v2release intopackages/desktop-app/src-tauri/resources/models/beforetauri buildruns. That directory is gitignored (resources/.gitignore), so it's empty on a fresh checkout unless a step populates it.The macOS release job (
build-tauri-macos-arm) has always had this download step. The Windows release job (build-tauri,windows-latestleg) never did — confirmed by reading.github/workflows/release.ymlend to end and bygit log -S/git showon the commit that reintroduced Windows builds (b59c40f9, "Windows daemon support"). A resource glob that matches zero files is not atauri-bundlererror, so the build succeeded and uploaded every time, silently missing the embedding model, with no build-time signal. This means the gap predates v0.3.0 — v0.2.10's.msi(65.7MB vs. its own.dmgat 185MB) shows the identical pattern.Fix
Add the same "Download embedding model for bundling" step to the Windows leg of
build-tauri, gated onmatrix.platform == 'windows-latest'like the job's other Windows-specific steps, placed beforeBuild Tauri app(mirroring the macOS job's ordering).Verification
No Windows device or Windows CI run was available in this session to install and inspect the resulting
.msidirectly. Verification performed instead:gh release view/gh api:.msi68,337,664 bytes vs..dmg186,311,986 bytes vs..pkg201,042,460 bytes.msi65,679,360 bytes vs..dmg185,261,891 bytes — same pattern, confirming this isn't new to v0.3.0models-v2release assetnomic-embed-text-v1.5.Q8_0.gguf: 146,146,432 bytes — closely tracks the gaptauri.conf.json'sbundle.resources(applies to every platform, no Windows-specific override or second config file) to confirm the model is meant to ship in every installer,.msiincluded.github/workflows/release.ymlend to end: confirmed the download step exists only inbuild-tauri-macos-arm, confirmed no equivalent forwindows-latestinbuild-tauri, confirmedresources/models/is gitignored so a fresh runner starts with it emptygit log -S "Download embedding model"/git show b59c40f9to confirm the Windows leg never had this step, even when Windows builds were reintroducedbun run testbaseline (5229 passed) and the full pre-push gate (test:all+cargo build --bin nodespaced+test:e2e) both pass with this change — this is a CI-workflow-only diff, so the closest available confirmation is that the new step's shell logic (mkdir -p+gh release download+ls) is identical to the proven-working macOS step, just re-targeted at thewindows-latestleg withshell: bash(the pattern already used by this job's other Windows-specific steps)This could not be verified by actually re-running the Windows release build or installing a fresh
.msi, since no Windows device or spare release tag is available in this session. A next session with CI/device access should trigger aworkflow_dispatchrun withplatform: windows-x86(or wait for the next real release) and confirm the resulting.msi/.exegrows to roughly the macOS.dmg's size and that the installed app'sresources/models/directory contains the.gguffile.Closes #2771
🤖 Generated with Claude Code