Subject: option to run diffoscope with guix build --rounds=N and --check

From: Vagrant Cascadian <[email-masked]>
Date: Mon, 06 Jun 2022 14:09:23 -0700

When I do:

  guix build --rounds=2 PACKAGE

And the results differ, the process of actually running diffoscope on
the results is very manual and a bit hard to automate. I might get
output like:

  guix build: error: derivation
  `/gnu/store/dn50zya4d1zh21q6s3nh7f394s7ksknv-autogen-5.18.16.drv' may
  not be deterministic: output
  `/gnu/store/04byv4py1firka28h3nl70bj1g0a3n6k-autogen-5.18.16' differs
  from
  ?/gnu/store/04byv4py1firka28h3nl70bj1g0a3n6k-autogen-5.18.16-check?

First of all, I have to actually remember to run:

  guix build --rounds=2 --keep-failed PACKAGE

Would it be crazy for --rounds=N resonably assume --keep-failed ?

Then it'll actually keep the produced /gnu/store/*-check ... then I have
to screen-scrape the right files, sometimes accidentally grabbing the
.drv instead of the right directory, and pass both the regular store
item and the /gnu/store/*-check item ... if i get everything right I end
up with:

  diffoscope /gnu/store/HASH-PACKAGE-VERSION /gnu/store/HASH-PACKAGE-VERSION-check

And that basically works... but it is a very manual process...

guix already has a similar tool to handle this sort of thing:

  guix challenge --diff=diffoscope PACKAGE

But that assumes you are comparing things from your local build and the
substitute server or servers, not two locally built things.

How plausible would it be to implement something simile to "guix
challenge --diff=diffoscope" like:

  guix build --rounds=2 --keep-failed --diff=diffoscope

(or could --diff=diffoscope *assume* --keep-failed ?)

Oh, and... basically all of the above applies for:

  guix build --check PACKAGE

e.g. --keep-failed by default, option to support --diff=diffoscope, etc.

Thanks for considering!

live well,
  vagrant