Skip to content

Local release build scripts: macOS native and Windows cross-compile #1438

Closed

Description

@malibio

Overview

The only way to produce a release build today is to trigger GitHub Actions and wait for CI. There is no local path for quick iteration on the build process or for producing a Windows artifact without a CI round-trip.

Problem Statement

Two pain points:

  1. Debugging CI build failures requires a push + wait cycle (~30-45 min per attempt)
  2. No way to produce and inspect a Windows installer locally before tagging a release

Evaluated alternatives:

  • Tart: macOS/Linux VMs only — no Windows support
  • act (nektos): Docker-based, cannot emulate windows-latest runner — dead end
  • OrbStack: Linux containers only — no Windows
  • cargo-xwin: Cross-compiles Rust from Mac targeting x86_64-pc-windows-msvc via MSVC toolchain emulation. Produces a working NSIS .exe installer. Cannot produce .msi (WiX requires a real Windows host).
  • Parallels + prlctl: Only fully automated VM path that produces identical CI output (both .msi + NSIS, real MSVC toolchain, code signing). Scriptable via SSH into VM triggered by prlctl start.

Proposed Solution

Two-tier local build system:

Tier 1 — Fast, no VM (bun run build:windows:quick)

Uses cargo-xwin to cross-compile from Mac. Good for verifying the Rust build compiles and testing the NSIS installer. Prerequisites: brew install llvm && cargo install --locked cargo-xwin && rustup target add x86_64-pc-windows-msvc.

Produces: NodeSpace_<version>_x64-setup.exe (NSIS only)
Does not produce: .msi

Tier 2 — Full parity (bun run build:windows)

Uses Parallels Desktop + a pre-configured Windows ARM VM (Rust MSVC toolchain + WiX installed). Automation: prlctl start "NodeSpace-Build-Win", SSH in, execute build script, copy artifacts back to host.

Produces: identical output to CI (both installer formats)
Requires: Parallels Desktop license + one-time VM setup (documented)

macOS wrapper (bun run build:macos)

Thin wrapper around the existing tauri:build for consistency and discoverability.

Acceptance Criteria

  • bun run build:macos — native macOS ARM build producing .dmg and .app
  • bun run build:windows:quick — cargo-xwin NSIS build from Mac, no VM required
  • bun run build:windows — Parallels-automated full build; gracefully errors with setup instructions if Parallels or VM not found
  • All scripts live in scripts/ and are registered in root package.json
  • docs/development/local-builds.md documents prerequisites and one-time VM setup for Tier 2
  • bun run build:windows:quick succeeds on a clean Mac with only the documented prerequisites installed

Technical Specifications

Reference Files

  • Release workflow: .github/workflows/release.yml — source of truth for what each platform build does
  • Existing sidecar script: scripts/build-sidecars.ts — pattern to follow for local build scripts
  • Tauri config: packages/desktop-app/src-tauri/tauri.conf.json

Implementation Details

build:windows:quick script should:

  1. Check cargo-xwin and llvm are installed, error with install instructions if not
  2. Run cargo xwin build --release --bin nodespaced --target x86_64-pc-windows-msvc
  3. Run cargo xwin build --release --bin nodespace --target x86_64-pc-windows-msvc
  4. Copy binaries to packages/desktop-app/src-tauri/binaries/ with correct triple suffix
  5. Run bunx tauri build --target x86_64-pc-windows-msvc (NSIS only, skip .msi)

build:windows Tier 2 script should:

  1. Check prlctl exists, error with setup link if not
  2. prlctl start "NodeSpace-Build-Win" and wait for SSH to become available
  3. SSH in, git pull, run the equivalent of the CI Windows job steps
  4. scp artifacts back to target/windows-release/
  5. Optionally stop VM after build

cargo-xwin notes

  • Requires llvm for the linker (lld-link)
  • First run downloads the Windows SDK — subsequent runs are cached
  • NSIS bundler works cross-platform; WiX does not

Related Issues

Activity

  1. self-assigned this
    on Aug 6, 2026
  2. mstomar125 commented on Aug 7, 2026

    @mstomar125
    Contributor

    Board → Blocked (needs a Windows build environment). This is #[cfg(windows)] code; the current remote is darwin, and the pre-push gate builds the macOS nodespaced and never compiles the Windows cfg block — so it can't be implemented or verified here. Pick up on a Windows toolchain. (Note: #1498 unblocks nodespace-sync#246.)

  3. mstomar125 commented on Sep 15, 2026

    @mstomar125
    Contributor

    Correction to the earlier Blocked comment — it doesn't fit this issue.

    That comment said this needs a Windows build environment because it's #[cfg(windows)] code the darwin pre-push gate can't compile. That's not what this issue is: it's local build automation scripts (Tier 1 cargo-xwin cross-compile from Mac, Tier 2 optional Parallels VM automation, macOS wrapper), not runtime code gated behind #[cfg(windows)]. It never needed a Windows host — Tier 1 cross-compiles Rust from Mac, and the issue's own acceptance criteria already requires Tier 2 to gracefully degrade with setup instructions when Parallels/the VM isn't present, so a missing VM was never a hard blocker either. The earlier comment looks like it got mixed up with the separate batch of genuinely #[cfg(windows)]-gated issues (#1452/#1498/#1519/#2137) that did need real Windows verification.

    Unblocking — moving to Todo, self-assigning, picking this up now.

  4. self-assigned this
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions