Skip to content

refactor: add environment accessor for Zig 0.16 prep - #374

Merged
forketyfork merged 5 commits into
mainfrom
prep/env-accessor
Aug 31, 2026
Merged

refactor: add environment accessor for Zig 0.16 prep#374
forketyfork merged 5 commits into
mainfrom
prep/env-accessor

Conversation

@forketyfork

Copy link
Copy Markdown
Owner

Issue

Prepare the environment-access and allocator portions of the staged Zig 0.16 migration (Task 3).

Solution

  • Add and register src/env.zig with the planned process-environment accessor and tests.
  • Route all 23 getenv call sites across 11 files through env.get, including aliased posix.getenv calls in shell.zig and logging.zig.
  • Rename both GeneralPurposeAllocator instances to DebugAllocator.
  • Add the minimal build-graph alias required for the existing standalone MCP control module to resolve the plan-prescribed relative environment import.
  • Check off only the completed Step 3 items in the migration plan.

Context

This is the Zig 0.15.2-compatible preparation commit for the later Zig 0.16 toolchain flip. The environment accessor retains the exact std.posix.getenv return type. The MCP build-graph alias is necessary because Task 2 compiles src/app/control.zig as a separate module whose root otherwise rejects ../env.zig as outside its module path.

Test plan

  • zig build — passed locally with directly installed Zig 0.15.2.
  • zig build test — passed locally, run unpiped for the exit-code verdict.
  • just lint — passed locally; test registry reports all 45 test files registered.
  • zig fmt --check src/ and ./scripts/check-test-registry.sh — passed.
  • The plan Step 3 manual check (run the app and exercise config loading, recent folders, and ~ path abbreviation) could not be performed in this Linux sandbox because it requires the SDL3/macOS UI. A human on macOS or CI with an appropriate runtime must perform/cover it; it is not being claimed as completed.

Zig 0.16 removes both std.posix.getenv and

std.heap.GeneralPurposeAllocator. DebugAllocator is what

GeneralPurposeAllocator already aliases in 0.15.2, so this is a rename.
@forketyfork
forketyfork merged commit 21292bf into main Aug 31, 2026
4 checks passed
@forketyfork
forketyfork deleted the prep/env-accessor branch August 31, 2026 20:00
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