Docs promise a managed Zig download on every platform; the Windows CLI has no download table at all

Open
#773 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
zig
Domain
build-system

Research direction

Start with src/tooling/toolchain.zig, where currentDownload() selects platform entries and install() currently unpacks .tar.xz; inspect the release assets and relevant toolchain tests. Confirm the Windows asset’s format and checksum, then ensure Windows can install the pinned Zig toolchain or update the documented limitation and error message. Done when Windows behavior and the three cited documentation pages agree.

Written by the indexing model from the issue text.

Description

Environment

  • @native-sdk/cli 0.11.1 (win32-x64)
  • Windows 11, Node 24.22.2, no zig on PATH, no ~/.native/toolchains/

What happens

$ native build shelltest --yes
zig 0.16.0 is required but was not found, and this platform has no
managed toolchain download. Install it from the official Zig
download page, then re-run.

--yes does not help, because the failure is not a consent problem.

Why: the Windows binary is compiled without any Zig download entries

src/tooling/toolchain.zig selects the download table at comptime:

fn currentDownload() ?Download {
    return switch (builtin.target.os.tag) {
        .macos => switch (builtin.target.cpu.arch) { .aarch64 => ..., .x86_64 => ..., else => null },
        .linux => switch (builtin.target.cpu.arch) { .aarch64 => ..., .x86_64 => ..., else => null },
        else   => null,
    };
}

offerInstall turns that null straight into a hard error:

const download = currentDownload() orelse {
    // "this platform has no managed toolchain download"
    return error.UnsupportedPlatform;
};

I confirmed this is decided at build time, not at runtime, by inspecting the shipped
cli-win32-x64/bin/native.exe:

needle occurrences in native.exe
managed toolchain download 1
zig-aarch64-macos-0.16.0 0
zig-x86_64-linux-0.16.0 0
zig-x86_64-windows-0.16.0 0

The macOS/Linux archive names are dead-code-eliminated on a Windows build, so no
runtime condition could ever reach them. Adding zig-x86_64-windows-0.16.0 to
currentDownload() is the whole fix — the release index already publishes
zig-x86_64-windows-0.16.0.zip (sha256 68659eb5f1e4eb1437a722f1dd889c5a322c9954607f5edcf337bc3684a75a7e,
verified locally). Note install() currently unpacks .tar.xz, so the Windows
entry would need a .zip branch (or point at the .tar.xz asset, which ziglang.org
also ships for Windows).

What the docs say

/docs/quick-start lists the prerequisite as "macOS 14+ or newer, Linux, or Windows",
then, with no platform qualifier:

The Zig toolchain. native dev|build|test use the Zig on your PATH when its version
is compatible, and otherwise offer to download the pinned version into
~/.native/toolchains/ (checksum-verified; pass --yes to skip the prompt in scripts).

/docs/zig repeats it:

native dev, native build, and native test use zig from PATH when its version
matches; otherwise, they offer to download the pinned, checksum-verified version into
~/.native/toolchains/.

/docs/platform-support states "macOS, Linux, and Windows run full desktop apps through
their own platform hosts" and does not flag the toolchain as a Windows gap anywhere on
the page.

Three pages promise the download on a platform where it cannot happen.

Expected

Either (a) ship the Windows entry so --yes works as documented, or (b) if that is
deliberate, document it as a per-platform limitation in the Zig toolchain section and in
the platform-support matrix, and change the message to say "on Windows, install Zig
0.16.0 yourself" rather than implying every platform lacks it.

Dominant language
Zig
Stars
7.9k
Forks
335
Avg merge
10h 33m
Merged PRs (30d)
147

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel-labs/native

All issues in vercel-labs/native

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.