I have been investigating some reproducibility problems using Guix and
diffoscope. We have all the tools to make possible but it's not
automated yet.

I've attached the crude shell script I've been using to build, rebuild,
and generate a diffoscope report. Perhaps it will help others and
inspire more work in this area :)

You use it from within your Guix checkout, and the only argument it
accepts is the name of a package.

BTW, the rsync options are adapted from --archive, but modified to alter
symlinks so that they do not point into the store. I'm sure they could
be improved.
#!/bin/sh

set -u
set -e

main() {
        if [ $# -lt 1 ]; then
                printf "Give a package name.\n"
                exit 1
        fi
        package=$1
        shift

        if [ $# -ne 0 ]; then
                printf "Unknown parameter %s\n" "$1"
                exit 1
        fi

        mkdir a
        mkdir b

        mypath="$(./pre-inst-env guix build --no-substitutes $package)" \
        && rsync -rLptgoD "$mypath" ./a \
        && guix gc -d "$mypath" \
        && mypath="$(./pre-inst-env guix build --no-substitutes $package)" \
        && rsync -rLptgoD "$mypath" ./b \
        && guix gc -d "$mypath" \
        && diffoscope --html ./report ./a ./b
}
main "$@"

Reply via email to