Compila el mismo código fuente dos veces en entornos diferentes y luego verifica si existen diferencias entre los binarios generados en cada compilación. Si se encuentran diferencias, se puede utilizar diffscope o, si no está disponible, diff para visualizarlas en detalle y analizarlas posteriormente. Sirve para verificar que los paquetes se construyen de manera reproducible, independientemente del entorno donde se compilen.
$ reprotest auto .
$ reprotest auto . -- null -d
$ reprotest auto paquete_1.0.dsc -- schroot unstable-amd64-sbuild
$ reprotest "make clean && make" mi_binario
$ reprotest "python3 setup.py bdist" "dist/*.tar.gz"
$ reprotest "python3 setup.py bdist_wheel" "dist/*.whl"
$ reprotest "debuild -b -uc -us" "../*.deb"
$ reprotest "dpkg-buildpackage -b --no-sign" "*.deb *.changes"
$ reprotest --variations "+time" "make" "mi_programa"
$ reprotest --dont-vary "time,timezone" "make" "mi_programa"
$ reprotest --variations "build_path,umask" "make" "mi_programa"
$ reprotest "debuild -b -uc -us" "../*.deb" -- chroot /srv/chroot/sid
$ reprotest "make" "mi_binario" qemu /path/to/qemu.img
$ reprotest "make" "mi_binario" lxc nombre-contenedor
$ reprotest "make" "mi_binario" ssh usuario@servidor
$ reprotest --testbed-init 'apt-get update && apt-get install -y disorderfs faketime' "dpkg-buildpackage -uc -us -b" "../*.deb" -- schroot unstable-amd64-sbuild
$ reprotest --store-dir ./artefactos "make" "mi_binario"
Crear archivo de configuración en el directorio del proyecto
$ nano .reprotestrc
[basics]
build_command = python3 setup.py sdist
artifact = dist/mi_paquete-1.0.tar.gz
source_root = .
variations =
environment
build_path
home
time
Luego simplemente ejecutar:
$ reprotest
Nota.- Cuando hay diferencias, reprotest indica qué variación específica causa el problema, lo que facilita arreglar el no-determinismo en el sistema de build.