Skip to content

Rewrite any in Zig 0.17.0 #1

Summary

  • Replaces the Rust workspace (any-* crates, Cargo.toml, Cargo.lock) with a single Zig 0.17.0 binary under src/.
  • Ports the domain pieces: ids/status/SHA-256 in core.zig, config in config.zig, HTTP framing in protocol.zig, stores in store.zig, service/leader/sync in service.zig, unix-socket client in client.zig.
  • Ports tls.zig on top of the vendored BearSSL 0.6 with a C shim, and keeps system CA bundle lookup at runtime.
  • Ports tty.zig (raw mode, window size, SIGTERM flag), tui.zig, commands.zig, and cli.zig for the TUI and CLI behavior.
  • Confines all extern/pointer work to sqlite.zig, tls.zig, and tty.zig; other modules stay ordinary Zig.
  • Adds build.zig / build.zig.zon that compile the vendored SQLite amalgamation and BearSSL sources, plus a run and test step.
  • Moves the approved C libraries to a shared vendor/ tree with a README, leaving no third-party Zig dependencies.
  • Updates mise.toml to the Zig toolchain and adds [env] _.path entries for zig-out/bin and ~/.local/bin, so the built and installed any binary resolve on PATH in mise-activated shells and tasks.
  • Updates AGENTS.md and the plan docs to describe the Zig layout, FFI boundaries, and test/e2e expectations.

Testing

  • mise run check — formatting, build, and unit tests pass.
  • mise exec zig@0.17.0 -- zig build test --summary all — 4/4 steps succeeded.
  • mise tasks validate — all 10 tasks valid.
  • mise run install — installs the binary to ~/.local/bin/any.
  • mise exec -- any --version — prints any 0.1.0.
  • mise run e2e — Not run (sync and TUI e2e still to be re-validated against the new binary).

Sign in to comment on this pull request.