[guix] build the the source package only once
Summary:
If the source package was produced for a previous host, don't redo it, just use the existing one
With this change, it becomes necessary to manually delete the output/ dir when running the build on a different commit or on a different version, or else the source package will not be recreated. A sanity check is added to catch the case of an existing source tarball with a different release version.
Test Plan:
Check that the build fails if an old source tarball is present in outputs:
mkdir output touch output/bitcoin-abc-0.28.9.tar.gz contrib/guix/guix-build
rm -Rf output/ HOSTS="arm-linux-gnueabihf x86_64-linux-gnu" contrib/guix/guix-build &> ../guix.log
$ ls output/* output/bitcoin-abc-0.28.10.tar.gz output/arm-linux-gnueabihf: bitcoin-abc-0.28.10-arm-linux-gnueabihf-debug.tar.gz bitcoin-abc-0.28.10-arm-linux-gnueabihf.tar.gz SHA256SUMS.part output/x86_64-linux-gnu: bitcoin-abc-0.28.10-x86_64-linux-gnu-debug.tar.gz bitcoin-abc-0.28.10-x86_64-linux-gnu.tar.gz SHA256SUMS.part
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D15642