Skip to content

Conversation

@jozip
Copy link

@jozip jozip commented Jan 5, 2026

See https://codeberg.org/ziglang/zig/pulls/30644

The global os.environ is no longer available, and environment data need to be explicitly passed along like io and allocator.

I've tried my best to adhere to the principles and make as few disruptive incisions as possible, but there are one noteworthy exception:

DefaultSystem has an internal arena allocator backed by std.heap.page_allocator in order to satisfy the condition of the caller not owning the memory. This means that getenv no longer need the allocator parameter.

See https://codeberg.org/ziglang/zig/pulls/30644

The global `os.environ` is no longer available, and environment
data need to be explicitly passed along like `io` and `allocator`.

I've tried my best to adhere to the principles and make as few
disruptive incisions as possible, but there are one noteworthy
exception:

`DefaultSystem` has an internal arena allocator backed by
std.heap.page_allocator` in order to satisfy the condition of the
caller not owning the memory. This means that `getenv` no longer need
the allocator parameter.
@Techatrix
Copy link
Member

There are some things that I would request to be changed in this PR:

  • Use std.process.Environ.Map instead of std.process.Environ which also avoids this arena allocator backed by page allocator hack
  • why is there a special case for error.Unexpected
  • tests should not have access to the process's environ
  • the minimum_zig_version is not available as a prebuilt binary on ziglang.org

To avoid any further delays in getting this project updated, I already implemented this in #65. Thank you nonetheless.

@Techatrix Techatrix closed this Jan 7, 2026
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