Repository navigation
Local release build scripts: macOS native and Windows cross-compile - #2630
Merged
Merged
Conversation
…uild build:macos wraps the existing tauri:build pipeline for naming/discoverability consistency with the two Windows scripts. build:windows:quick (Tier 1) cross-compiles nodespaced/nodespace and the NSIS installer from macOS via cargo-xwin, no VM required. Checks every prerequisite up front with an actionable install command -- cargo-xwin, llvm/clang-cl, lld-link, ninja, and makensis all confirmed required by actually running the build end-to-end on a clean machine (lld-link and ninja split out of/required beyond what the source issue's prerequisite list named; makensis needed because Tauri's NSIS bundler shells out to it as its last step, after the entire Rust build has already succeeded). Also required `tauri build --runner cargo-xwin` rather than a plain --target: without it, Tauri CLI's own cargo invocation for the src-tauri crate has none of cargo-xwin's CC/CXX/linker environment and fails compiling `ring` against the host's own compiler. Verified for real: produces a genuine, valid NodeSpace_<version>_x64-setup.exe. build-skill.ts gained an explicit `--target <rust-triple>` override (bunCompileTarget, parseTargetArg) so the skill-installer sidecar can be cross-compiled to match the target triple rather than always compiling for the host -- every other caller (dev:tauri, tauri:build, CI) still gets its unchanged host-triple default. build:windows (Tier 2) drives a pre-configured Parallels VM over SSH for full CI parity (both installer formats, real MSVC toolchain). It never provisions Parallels or the VM -- gracefully exits with actionable setup instructions when either is missing, which is the only path exercised here since no VM exists on this machine. Adversarial review of the structurally-checked-only remainder caught and fixed a real bug in copyArtifactsBack: its two scp sources were built by interpolating a ~-prefixed remote path directly inside Bun's $ shell template, which both dropped the user@host: prefix on one source and let $ tilde-expand the other against the local host instead of the remote one. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This was referenced Sep 15, 2026
mstomar125
added a commit
that referenced
this pull request
Sep 15, 2026
…ge review (#2635) A code-review pass on #2630 that arrived after it merged found several genuine gaps in Tier 2's untested-against-a-real-VM path: - SSH_HOST/SSH_USER/REPO_PATH used `process.env.X ?? fallback`, which only catches null/undefined -- an explicitly-empty-string override (a real shell/CI misconfiguration shape) silently produced '' instead of the documented default. Added envOrDefault() to treat empty-string as unset too. - isVmRunning()'s JSON.parse had no try/catch, unlike the near-identical call in checkPrerequisites() which is guarded -- an unexpected `prlctl list --json` shape threw uncaught instead of failing gracefully. - copyArtifactsBack() hardcoded the literal Windows target triple instead of using the file's own TARGET constant that buildRemoteScript() already uses everywhere else. - `prlctl stop`'s exit code was discarded via bare `.nothrow()` -- a failed stop (wedged VM) printed the same message as a successful one. Now checks and reports the exit code. - `prlctl start` ran before the try/finally responsible for stopping the VM, so a start that rejects after the VM has actually begun starting left nothing to run the cleanup. Moved inside the try. - buildRemoteScript()'s `cd ${repoPath}` was unquoted in the single command line sent to the remote shell -- a repo path containing a space (a real shape for an operator-configurable REPO_PATH) would word-split and break the very first step of the remote build. Quoted. Also dropped an unused, misleadingly-named `crate` field from build-windows-quick.ts's SIDECAR_BINARIES (nodespaced/nodespace are binary names, not the cargo package names the field's values would suggest to a future maintainer wiring it into a `-p` flag by analogy with the sibling build-sidecar-binaries.ts, which does use `crate` for that). Closes #2634 Co-authored-by: Claude Sonnet 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bun run build:macos— thin wrapper around the existingtauri:buildpipeline.bun run build:windows:quick(Tier 1) — cross-compiles the Windows NSIS installer from macOS via cargo-xwin, no VM required. Checks every prerequisite up front with an actionable install command.bun run build:windows(Tier 2) — drives a pre-configured Parallels VM over SSH for full CI parity (both installer formats). Gracefully errors with setup instructions when Parallels/the VM aren't present, per its own acceptance criteria.scripts/build-skill.tsgained an explicit--target <rust-triple>override so the skill-installer sidecar can be cross-compiled to match a non-host target — every other caller keeps its unchanged host-triple default.package.json.docs/development/local-builds.md(innodespace-docs, see PR #87) documents prerequisites for both tiers and one-time VM setup for Tier 2.What was actually verified end-to-end vs. structurally only
Tier 1 — fully verified, real build. Ran
bun run build:windows:quickto completion on this machine and it produced a genuine, validNodeSpace_0.2.10_x64-setup.exe(confirmed viafile: Nullsoft self-extracting installer). Also verified: the prerequisite-check failure path (empty PATH), CWD independence, partial-binary-copy failure mode,--targetedge cases inbuild-skill.ts, and idempotency (second run reuses cached artifacts).Running it for real surfaced three real toolchain gaps the issue's own prerequisite list didn't mention, each fixed and documented:
lld-linkshipping in a separatelldHomebrew formula (no longer bundled withllvm),ninjabeing required becausellama-cpp-sys-2's CMake build forces the Ninja generator when cross-compiling, andmakensis(Homebrew formula name, notnsis) being needed for Tauri's NSIS bundler — the Rust build can fully succeed and it still fails at the very last step without it. Also requiredtauri build --runner cargo-xwinrather than a plain--target, since Tauri CLI's owncargo buildfor thesrc-tauricrate otherwise has none of cargo-xwin's cross-compilation environment and fails compilingringagainst the host's own compiler.Tier 2 — structurally verified only. No Parallels VM exists on this machine, so only the graceful-degradation path (missing
prlctl/VM) was actually run. The remainder (SSH build, scp artifacts back) is implemented per the issue's technical spec, type-checked and unit-tested where it's pure string-building, but unverified against a live VM — documented explicitly inlocal-builds.md, with a manual verification checklist for whoever sets up the first VM.Adversarial review
Dispatched an independent adversarial-review agent against the diff. It found one real bug in
copyArtifactsBack()(Tier 2's scp-artifacts-back step): the two remote source paths were built by interpolating a~-prefixed remote path directly inside Bun's$shell template, which (a) dropped theuser@host:prefix on the second (msi) source entirely, and (b) let Bun's$tilde-expand the other source against the local Mac host instead of the remote VM, since the defaultREPO_PATH(~/nodespace-core) starts with~. Fixed by extracting a purebuildScpSources()helper that builds each completeuser@host:pathstring in plain JS first (mirroring the existingbuildRemoteScriptpattern), with regression tests. Full review verdict and everything else it tried (mutation-testing, CWD independence, prerequisite-failure paths, idempotency) is in the PR discussion / session notes.Test plan
bun run build:windows:quickrun to completion for real — produced a valid NSIS installerbun test scripts/— 420/420 pass (incl. new tests for all three scripts and thebuild-skill.ts--targetoverride)bun run quality:scripts:check— cleanbun run test:all,cargo build --bin nodespaced,test:e2e) — greenCloses #1438
🤖 Generated with Claude Code