9b87f27b

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

nix-ci-eval: a fast, parallel flake-output discoverer

A small tool that discovers a flake's buildable outputs for one system,
purpose-built for NixCI's show jobs. It links only the LGPL-2.1 Nix
evaluator libraries.

Given a flake reference and a system it streams one newline-delimited
JSON object per discovered output, tagged by type (job / error /
dependency), then the dependency edges between the outputs. Each
attribute path carries its system component so it names the attribute
exactly as `nix build` takes it, and a failing attribute becomes an
error line rather than aborting the run.

A coordinator forks worker processes, each with its own Nix evaluator.
--workers is a ceiling, not a count: the pool grows on demand, sized from
what the run measures an evaluation and a worker to cost, so a small
flake never forks a pool it cannot keep busy and a large one still ramps
to the ceiling.

Tested by pure unit tests for the Nix-free helpers and a hermetic
integration test that drives the built binary against a fixture flake
with no inputs and diffs a golden.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 3m30s 2s 2s 3m32s 3m30s
Eval 3m37s 7s 7s 3m44s 4s
Build 3m41s 9s 8m16s 11m57s 8m03s
Suite 3m30s 18s 8m27s 11m57s 11m39s

Timeline

0s3m40s11m50s