Here is an updated version of this patch set.
I have removed the "dirty check" stuff. It didn't really work well/was
buggy under meson, and it failed mysteriously on the Linux CI tasks. So
let's just drop that functionality for now.
I have also added a more complete commit message and some more code
comments.
I have extracted the freebsd CI script fix into a separate patch (0002).
I think this is useful even if we don't take the full CI patch (0003).
About the 0003 patch: It seems useful in principle to test these things
continuously. The dist script runs about 10 seconds in each task, and
takes a bit of disk space for the artifacts. I'm not sure to what
degree this might bother someone.