Skip to content

migrate zig v0.15.x > v0.16.0#41

Closed
notxorand wants to merge 1 commit intoclojurewasm:mainfrom
notxorand:zig-v0.16.0
Closed

migrate zig v0.15.x > v0.16.0#41
notxorand wants to merge 1 commit intoclojurewasm:mainfrom
notxorand:zig-v0.16.0

Conversation

@notxorand
Copy link
Copy Markdown
Contributor

No description provided.

@notxorand
Copy link
Copy Markdown
Contributor Author

@chaploud, just a few conflicts and no update to the flake, yet. do you think you can work with this?

@chaploud
Copy link
Copy Markdown
Contributor

Hi @notxorand, thank you very much for taking the time to put this migration together — it's genuinely appreciated.

Heads-up on ordering: we have another PR (#28, "Support explicit cancellation of Wasm execution") that touches src/vm.zig, src/cli.zig, and src/types.zig — the same files as this migration — and it's already CI-green and ready to land. To keep the review surface manageable and avoid forcing either side into a painful rebase, we're planning to merge #28 first on the current Zig 0.15.2 toolchain, and then turn to the 0.16.0 migration work right after.

Once #28 is in, we'll circle back to this PR. Thanks again for kicking things off on 0.16 — we'll follow up here with next steps.

@chaploud
Copy link
Copy Markdown
Contributor

Hi @notxorand — thank you so much for starting this migration work and opening this PR. It gave the effort a concrete shape early on, and the approach here informed a lot of what ended up landing.

Because the Zig 0.16.0 migration turned out to touch quite a few additional surfaces (new std.Io interface, link_libc requirement for WASI on Linux, Windows std.c.fd_t == HANDLE issue that broke all WASI real-world compat, size-guard accommodation, cancellation test timespec on Windows, etc.), the work was consolidated into #45 so everything could ship atomically as v1.10.0. Your PR is effectively superseded — but very much not wasted; the shape of the migration followed the path you opened.

Final result in #45: all CI green on macOS / Ubuntu x86_64 / Windows x86_64 (62,263 spec / 796 E2E / 46 real-world compat / FFI + static link on all three), Zig 0.16.0 toolchain, link_libc = true for WASI, and full Windows WASI compatibility preserved via Win32 WriteFile/ReadFile/SetFilePointerEx routing. See #45.

Thanks again — and please feel free to contribute to any of the follow-ups (e.g. the Zig-philosophy-aligned un-link-libc migration tracked as W46).

chaploud added a commit that referenced this pull request Apr 24, 2026
Zig 0.15.2 → 0.16.0 toolchain migration, shipping as v1.10.0.

Platforms: macOS aarch64 + Ubuntu x86_64 + Windows x86_64 all CI-green
(62,263 spec / 796 E2E / 46 real-world compat / FFI + static link + minimal build).

Notable surprises resolved in this PR:
- Windows `std.c.fd_t == HANDLE` vs MSVCRT `_write(int fd, …)` ABI mismatch →
  WASI fd I/O routed through Win32 `WriteFile`/`ReadFile`/`SetFilePointerEx`.
- `link_libc = true` required on Linux/Mac for WASI (std.posix lost `fsync`,
  `mkdirat`, `unlinkat`, `renameat`, `dup`, `pread`/`pwrite`, `futimens`, …).
  Linux ELF stripped binary grew ~290 KB, size guard 1.50 → 1.80 MB.
- `std.posix.timespec` is `void` on Windows — cancellation tests use a
  comptime-branched Sleep helper.

Deferred to follow-ups:
- W46: Un-link libc (migrate to `std.Io` / `std.posix.system`). Returns Linux
  binary to 1.50 MB and aligns with 0.16's stated direction.
- W47: `tgo_strops_cached` +24% regression on Mac aarch64 (20 other
  benchmarks improved 10-76% — GC paths notably faster).

Thanks to @notxorand (#41) for opening the migration effort.
@notxorand notxorand closed this Apr 24, 2026
chaploud added a commit that referenced this pull request Apr 24, 2026
…-migration

Empty commit crediting @notxorand as co-author (#41 superseded by #45). No code changes, no CI gate needed.
@chaploud
Copy link
Copy Markdown
Contributor

Hi @notxorand — one more follow-up, this time an apology.

When #45 landed and shipped as v1.10.0, your contribution did not make it onto the repository's GitHub Contributors graph. The right thing to do at merge time would have been either to cherry-pick your commit (a0e049b1) or to add a Co-authored-by: trailer on #45's commits — I did neither. I'm sorry about that.

To correct it without rewriting the v1.10.0 tag history (which downstream projects such as ClojureWasm pin to), I've landed a small empty commit on main via #50 that carries a Co-authored-by: @notxorand trailer:

bd14773

You should now appear on https://github.com/clojurewasm/zwasm/graphs/contributors — GitHub can take a few minutes to refresh the graph after a merge.

Thanks again for opening #41. The 0.16 work started here, even if the final migration ended up taking a different path.

notxorand added a commit to notxorand/zwasm that referenced this pull request Apr 24, 2026
…rewasm#41)

PR clojurewasm#41 was the first attempt at migrating zwasm to Zig 0.16.0, opened
by @notxorand. The final 0.16.0 migration shipped in v1.10.0 via clojurewasm#45
which took a different path, so clojurewasm#41 was closed without merge and
@notxorand's commit (a0e049b) was not cherry-picked nor referenced
via a Co-authored-by trailer on clojurewasm#45.

This empty commit retroactively credits @notxorand so their
contribution appears on the repository's GitHub Contributors graph
(https://github.com/clojurewasm/zwasm/graphs/contributors) without
rewriting the v1.10.0 tag history (which downstream projects pin to).

Co-authored-by: notxorand <66304707+notxorand@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants