Skip to content

fix(workspace): scrub ambient NIX_CONFIG in host Nix version probe - #1217

Merged
c-vigo merged 2 commits into
release/1.4.0from
bugfix/1216-detect-nix-config-scrub
Jul 20, 2026
Merged

c-vigo merged 2 commits into
release/1.4.0from
bugfix/1216-detect-nix-config-scrub

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #1216 (found during rc5 consumer-lane validation): the direnv-mode "Detect host Nix" step captured nix --version 2>&1 (#1198) with the runner's ambient NIX_CONFIG in effect. On a self-hosted runner whose service env carries a malformed NIX_CONFIG (exo-fleet's meatgrinder, live evidence in exo-pet/exo-fleet#230 run 29738048251), nix errors on the config before printing the version, so the log records a parse error instead of the version the probe exists to capture.

The probe now runs env -u NIX_CONFIG nix --version 2>&1 (env -u over NIX_CONFIG= to stay shellcheck-clean, SC1007), keeping the stderr fold for other failure shapes. Scope: the probe line only — has-nix detection, the gated install, and "Configure host Nix" are untouched. Single action copy (scaffold template; no devkit-own twin, not manifest-synced — verified).

TDD

  • RED 238cf1a6: stub nix errors on malformed ambient NIX_CONFIG before --version — reproduces the exact meatgrinder log symptom.
  • GREEN fe97f457: 24/24 in tests/test_setup_toolchain_env.py.
  • Full pre-commit suite green (verified by orchestrator).

Requires an rc6 cut after merge; live proof = exo-fleet lane re-bump on meatgrinder.

Refs: #1216

c-vigo added 2 commits July 20, 2026 13:31
A malformed ambient NIX_CONFIG on a self-hosted runner's service
environment makes `nix --version` fail with a config parse error before
printing the version, so the detect log captures the error instead of
the version the diagnostic aims to record. This test drives the "Detect
host Nix" step against a stub `nix` that rejects a malformed NIX_CONFIG,
and asserts the log shows the version, not the parse error.

Refs: #1216
The direnv-mode "Detect host Nix" step captured `nix --version 2>&1`
(#1198) with the runner's ambient NIX_CONFIG in effect. On a self-hosted
runner whose service environment carries a malformed NIX_CONFIG
(exo-fleet's meatgrinder), nix rejects the config before printing the
version, so the detect log recorded a config parse error instead of the
version. Run the probe with `env -u NIX_CONFIG` so the captured string is
the version even when the runner environment is broken, keeping the
`2>&1` fold as a fallback for other failure shapes.

Refs: #1216
@c-vigo
c-vigo merged commit 0633f0c into release/1.4.0 Jul 20, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1216-detect-nix-config-scrub branch July 20, 2026 11:44
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