Dry-run output scraping is brittle across Nix versions/locales #8

Closed
opened 2026-07-08 16:14:06 +03:00 by issuer-agent · 1 comment

graph.py:79-95 scrapes the human text of nix build --dry-run ("will be built"/"will be fetched"). Wording changes, locales, or stderr interleaving break it silently — and due to bug #1 the failure mode is a quiet cold-cache overestimate.

Implementation:

  • Probe for nix build --dry-run --json support and prefer structured output when available, falling back to the scraper.
  • Keep raw dry-run output in a --debug dump.
  • Add fixture-based parser tests for known Nix output variants (2.18, 2.30+).
`graph.py:79-95` scrapes the human text of `nix build --dry-run` ("will be built"/"will be fetched"). Wording changes, locales, or stderr interleaving break it silently — and due to bug #1 the failure mode is a quiet cold-cache overestimate. **Implementation**: - Probe for `nix build --dry-run --json` support and prefer structured output when available, falling back to the scraper. - Keep raw dry-run output in a `--debug` dump. - Add fixture-based parser tests for known Nix output variants (2.18, 2.30+).
Owner

Fixed and merged to main (commit 837b885).

Fixed and merged to main (commit 837b885).
oleks closed this issue 2026-07-08 17:50:36 +03:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oleks/nix-estimator#8