Skip to content

libutil-tests: Fix crash on Windows#15235

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:os-environ
Feb 15, 2026
Merged

libutil-tests: Fix crash on Windows#15235
Ericson2314 merged 2 commits intoNixOS:masterfrom
obsidiansystems:os-environ

Conversation

@artemist
Copy link
Member

Motivation

libutil tests were crashing on Windows due to issues finding environ. Replace process creation of getEnv with a new getEnvOs function that uses native windows APIs.

Context

We already had a getEnvOs function to return a single variable, but none that would return all keys.
Using OsString environment variables reduces round-trips.

The old code also did not properly handle overriding environment variables, it would place them in the map twice.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@artemist artemist requested a review from edolstra as a code owner February 13, 2026 21:58
@Ericson2314 Ericson2314 self-requested a review as a code owner February 15, 2026 01:39
@github-actions github-actions bot added new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger fetching Networking with the outside (non-Nix) world, input locking labels Feb 15, 2026
artemist and others added 2 commits February 14, 2026 20:39
libutil tests were crashing on Windows due to issues finding `environ`.
Replace process creation of `getEnv` with a new `getEnvOs` function that
uses native windows APIs.

Also convert a bunch of `RunOptions` fields to use `OsString` to better
reflect the underlying interfaces.

Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
@Ericson2314 Ericson2314 added this pull request to the merge queue Feb 15, 2026
Merged via the queue into NixOS:master with commit 7c915b3 Feb 15, 2026
14 checks passed
@Ericson2314 Ericson2314 deleted the os-environ branch February 15, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command repl The Read Eval Print Loop, "nix repl" command and debugger

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants