Skip to content

Implement native macOS environment access for amd64 and arm64 #428

Closed

Description

@LunaStev

Summary

The macOS amd64 and arm64 std::sys::env providers currently validate their arguments and then return ERR_NOT_IMPLEMENTED. As a result, the portable std::env API compiles on macOS but cannot read the process environment.

Relevant code

  • std/sys/macos/amd64/env.wave
  • std/sys/macos/arm64/env.wave
  • std/env/environ.wave

Scope

Implement a native Darwin environment provider for both supported macOS architectures. Use a documented process environment entry point or a narrowly scoped system-library adapter; do not make high-level std::env depend directly on std::libc.

Acceptance criteria

  • env_read returns the process environment as the NUL-separated format expected by std::env.
  • amd64 and arm64 use the same public provider contract.
  • Invalid pointers and capacities retain deterministic negative errors.
  • Buffer exhaustion is distinguishable from an empty or unavailable environment.
  • Native macOS CI verifies a known injected variable and a missing variable.
  • No ERR_NOT_IMPLEMENTED path remains for normal environment access.

Activity

  1. added
    enhancement
    help wanted
    os compatibility
    cross-platform
    on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-platformenhancementhelp wantedos compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions