Skip to content

v0.1.1 — Windows support and --app-file fix

Choose a tag to compare

@bidah bidah released this 21 Sep 13:44
· 13 commits to main since this release

Two reported bugs, both of which made a correctly installed setup look broken.

GitHub CLI reported as missing on Windows (#2)

native-sim doctor showed ✗ git and ✗ gh CLI, and native-sim up failed with
GitHub CLI not found. Install it: brew install gh — on machines where gh was
installed and logged in.

Every tool probe went through which, which does not exist on Windows. The tell in
the report was that the same run's gh repo view succeeded: gh ran fine, only the
probe for it failed.

native-sim now resolves commands against PATH in Node, honouring PATHEXT, so gh
finds gh.exe and agent-device finds its .cmd shim. Along the way:

  • .cmd / .bat shims (how npm installs CLIs on Windows) are run through cmd.exe,
    since spawn cannot execute a script directly. Arguments are quoted here rather
    than left for cmd.exe to re-split, so paths with spaces survive.
  • Lookup searches PATH only, never the working directory — a checked-out repo
    cannot shadow gh or git with its own binary.
  • Opening the browser at the end of a session used the macOS-only open. On Windows
    and Linux its ENOENT surfaced as an uncaught exception after the stream was
    already live. It now uses start / xdg-open and never throws.
  • gh secret list output is CRLF on Windows, which left a trailing \r on every
    secret name.
  • The "not found" message now suggests the right installer per platform.

--app-file failed on the runner after a full boot (#1)

--app-file uploaded the build to a draft release, and the workflow job runs with
contents: read by design. GitHub only returns draft releases to callers with push
access, so gh release download 404'd with release not found — after a runner had
spun up and billed for the whole boot. Everything upstream (tunnel, serve-sim, auth
gate, agent-device proxy) was healthy, which made it hard to read.

Raising the job to contents: write would fix the symptom by handing repo write
access to a job that also opens a public tunnel. That is the worse trade, so
native-sim publishes the release instead:

  • Private repo — no change in exposure. Release assets inherit repo visibility, so
    the build stays readable only by people who can already read the repo.
  • Public repo — the asset is genuinely downloadable by anyone. up and upload
    now say so at upload time and point at --r2 to keep the build private.

A draft native-sim-build release left by an earlier version is published on next use,
so no manual step is needed. If the workflow ever does meet a draft, it now explains the
cause instead of failing with a bare release not found.

Upgrading

npm install -g native-sim@0.1.1
native-sim init     # refreshes the workflow to template v19

The workflow template is versioned; native-sim init updates an out-of-date one in
place and leaves a deliberately customised one alone.

Full changelog: v0.1.0...v0.1.1