Implement native macOS environment access for amd64 and arm64
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
## 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.
Contributor guide
Research direction
Start with std/sys/macos/amd64/env.wave and std/sys/macos/arm64/env.wave, then compare their provider contract with std/env/environ.wave. Identify the documented Darwin environment entry point or narrowly scoped system-library adapter, preserving the stated error distinctions. Done means both architectures provide NUL-separated environment data, native CI checks present and missing variables, and no normal-access ERR_NOT_IMPLEMENTED path remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100