Skip to content

Migrate to modern Zig standard library APIs - #10

Merged
akashshah-dev merged 6 commits into
masterfrom
upgrade/zig-v0.16.0
Jul 27, 2026
Merged

Migrate to modern Zig standard library APIs#10
akashshah-dev merged 6 commits into
masterfrom
upgrade/zig-v0.16.0

Conversation

@akashshah-dev

Copy link
Copy Markdown
Contributor

Updates the codebase to be compatible with the latest Zig standard library, replacing deprecated APIs with current constructs. This ensures forward compatibility and leverages improved abstractions introduced in recent compiler versions.

Key updates include:

  • Compat module: Introduces ArrayList alias for std.array_list.Managed and a bufPrint helper to streamline buffer building without per‑call allocator passing.
  • Networking and I/O: Replaces std.net.Stream and direct socket reads/writes with std.Io and structured interfaces (writer, connect, sleep), centralizing latency and timeouts via Io.Clock.
  • Logging: Migrates from raw stderr writes to std.debug.lockStderr for thread‑safe output and uses Io.Timestamp for timestamp generation.
  • Process management: Uses std.process.spawn/run with an Io provider instead of std.process.Child.init/Child.run, simplifying process lifetime handling.
  • Environment variables: Adopts std.process.Environ.Map for a cleaner, allocation‑aware way to read environment variables.
  • Allocator: Switches from GeneralPurposeAllocator to smp_allocator for the main allocator.
  • JSON handling: Updates json.ObjectMap initialization to the new two‑argument constructor, reducing reliance on external helper put patterns.
  • Build system: Changes macOS linking from exe.linkLibC() to exe.root_module.link_libc = true to match the newer build API.

All modules (dap, mcp, logger, main, build) have been consistently updated, maintaining behavior while aligning with the evolving Zig ecosystem.

@akashshah-dev
akashshah-dev merged commit daa8c52 into master Jul 27, 2026
1 of 3 checks passed
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.

1 participant