Npb: Nixpkgs PR build diff CLI inspired by nixpkgs-review

Hello!

While reviewing Nixpkgs PRs written by myself and others, I’ve found it difficult to keep track of which build failures were preexisting and which are regressions introduced by the PR itself. So I built a tool called npb which produces reports that are similar to nixpkgs-review, but show both before and after, instead of just after.

While building this, I also included some other features I had found myself wanting previously, such as:

  • automatically including passthru.tests
  • caching build failures in a local database
  • reducing memory usage of Nix evaluations
  • speeding up Nix evaluations via parallelism
  • giving each report a command that reproduces the same report
  • providing progress indicators during long-running operations

I hope you find it useful!

Disclosure, quoting the project’s README:

The development of this project was AI-assisted. There is no AI-generated text in this README, npb --help, or npb’s generated reports.

7 Likes

Those are nice features; I especially like the “show both before and after [build report], instead of just after”.

Did/are you considering upstreaming those features into nixpkgs-review?

1 Like

I did consider it, but the features I care about the most have already been PRs or issues on the nixpkgs-review repo for years:

And for the other stuff like caching, it didn’t seem like it’d really fit into the nixpkgs-review ethos. If I understand correctly, the idea of nixpkgs-review is a bit more “stateful”: you get dropped into a worktree with a shell containing all the stuff that got built, and then you can play around. In contrast, npb is more stateless: it never does anything to your working tree or your shell at all, it just does some work and then hands you the Markdown.

With nixpkgs-review, I always kind of felt like I was “holding it wrong”: after I ran it and got the report, I’d always think “ah, I wish I had done this one thing slightly differently, let me tweak it and re-run” but then it’d take a really long time. I wanted a tool that I could have as part of my development workflow, and just re-run it repeatedly with slightly different tweaks until I was happy with the final report.

4 Likes

Bit OT, but the juxtaposition of the words samestep and npd is hilarious for german speaking readership, no pun intended :wink:

Actually “npd” is not hilarious to me. It is a German national socialist political party. Please consider renaming your tool. In the US it is also the common abbreviation for narcissistic personality disorder.

6 Likes

Apologies, I was not aware of these associations. I will rename the tool.

10 Likes

I’ve renamed the tool from npd to npb. This time I did my best to try to check for issues, but please let me know if I still missed something.

9 Likes