rebuild-nexus: print evaluation warnings once #63

Merged
vnprc merged 1 commit from agent/eval-warnings-once into master 2026-09-19 23:36:29 +01:00
Member

rebuild-nexus now prints each Home Manager evaluation warning once instead of twice, so the Flake:, Attribute: and Toplevel: preview lines print together. Nothing else changes: the eval, the refusal without DEPLOY_FLAKE, and the nixos-rebuild call are as before, and a failed eval still shows its full error. The test suite pins both paths and runs inside the provisioning-contract flake check. If it is wrong, revert this PR.

What changes

  • scripts/rebuild-nexus: the toplevel nix eval sends stderr to a temp file. On failure the file is echoed to stderr before die, and the recorder is never invoked. On success it is discarded, because nixos-rebuild evaluates the same attribute moments later and prints the same warnings.
  • tests/rebuild-nexus.sh: the nix stub always writes a fixture warning to stderr. The success test asserts the warning is absent from the script's output; the failing-eval test asserts the warning and the stub's error are present and the recorder log does not exist.

Risk

R1. Localized to one script; both paths are pinned by the suite; rollback is a revert.

Validation

Run by the integrator at 7a33867: bash tests/rebuild-nexus.sh reports 8 passed; nix build .#checks.x86_64-linux.provisioning-contract --rebuild exits 0 with the suite's pass line in the build log. No external review pass at R1.

Closes allod/nexus#62

`rebuild-nexus` now prints each Home Manager evaluation warning once instead of twice, so the `Flake:`, `Attribute:` and `Toplevel:` preview lines print together. Nothing else changes: the eval, the refusal without `DEPLOY_FLAKE`, and the `nixos-rebuild` call are as before, and a failed eval still shows its full error. The test suite pins both paths and runs inside the `provisioning-contract` flake check. If it is wrong, revert this PR. ## What changes - `scripts/rebuild-nexus`: the toplevel `nix eval` sends stderr to a temp file. On failure the file is echoed to stderr before `die`, and the recorder is never invoked. On success it is discarded, because `nixos-rebuild` evaluates the same attribute moments later and prints the same warnings. - `tests/rebuild-nexus.sh`: the `nix` stub always writes a fixture warning to stderr. The success test asserts the warning is absent from the script's output; the failing-eval test asserts the warning and the stub's error are present and the recorder log does not exist. ## Risk R1. Localized to one script; both paths are pinned by the suite; rollback is a revert. ## Validation Run by the integrator at 7a33867: `bash tests/rebuild-nexus.sh` reports 8 passed; `nix build .#checks.x86_64-linux.provisioning-contract --rebuild` exits 0 with the suite's pass line in the build log. No external review pass at R1. Closes allod/nexus#62
Capture the toplevel eval's stderr and print it only when the eval
fails; on success the same warnings arrive again from nixos-rebuild's
own evaluation moments later, so nothing is lost by dropping the
duplicate copy here.

Refs allod/nexus#62
vnprc force-pushed agent/eval-warnings-once from 7a338673ad to b358b697a6 2026-09-19 23:35:52 +01:00 Compare
vnprc approved these changes 2026-09-19 23:36:24 +01:00
vnprc merged commit b358b697a6 into master 2026-09-19 23:36:29 +01:00
vnprc deleted branch agent/eval-warnings-once 2026-09-19 23:36:29 +01:00
Sign in to join this conversation.
No description provided.