Page MenuHomePhabricator

[guix] build the the source package only once
ClosedPublic

Authored by PiRK on Mar 6 2024, 09:13.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC41048c586954: [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

Diff Detail

Repository
rABC Bitcoin ABC
Branch
guix_stuff
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 27726
Build 55015: Build Diff
Build 55014: arc lint + arc unit

Event Timeline

PiRK requested review of this revision.Mar 6 2024, 09:13
PiRK edited the test plan for this revision. (Show Details)
contrib/guix/libexec/build.sh
377 ↗(On Diff #45960)
$ ninja print-version
[1/1] Print the current bitcoin-abc version
0.28.10
$ v=$(ninja print-version)
$ echo $v
[1/1] Print the current bitcoin-abc version 0.28.10
$ v=$(ninja print-version |  sed '$!d')
$ echo $v
0.28.10
Fabien added inline comments.
contrib/guix/libexec/build.sh
252 ↗(On Diff #45960)

Would be good to not hardcode outdir-base so we can change the location

274 ↗(On Diff #45960)

You're not doing anything with this ?

448 ↗(On Diff #45960)

Same here, not sure the cd is needed at all

contrib/guix/libexec/build.sh
252 ↗(On Diff #45960)

Makes sense. We also hardcode "/bitcoin" in this script, the same comment probably applies.

274 ↗(On Diff #45960)

Yes, for now it is just meant as a log info line.
I considered printing it at the end, but then it would be printed for every host, not just the one doing the packaging.

The alternative would be to set a flag here and print it conditionally at the end (and include it in the SHA256SUMS file?), or always print it. Not sure what is the best.

448 ↗(On Diff #45960)

The effect of the cd here is to have relative paths in the sha256sum outputs, see $PWD below
Otherwise it would be something like /outdir-base/...

PiRK planned changes to this revision.Mar 6 2024, 11:04

use a OUTPUT_BASE var, improve the sha256sum creation for the archive (add it to the SHA256SUM.parts of the host that generated the tarball)

Fabien added inline comments.
contrib/guix/libexec/build.sh
464
This revision is now accepted and ready to land.Mar 8 2024, 08:59
This revision was automatically updated to reflect the committed changes.