Skip to content

Commit 12408d3

Browse files
committed
Merge #15549: gitian: Improve error handling
32da92b gitian: Improve error handling (Wladimir J. van der Laan) Pull request description: Improve error handling in gitian builds: - Set fail-on-error and pipefail flag, this causes a command to fail when either of the pipe stages fails, not only when the last of the stages fails, so this improves error detection. - Also use `xargs` instead of `find -exec`, because `find` will not propagate errors in the executed command, but `xargs` will. This will avoid some issues like #15541 where non-determinism is silently introduced due to errors caused by environment conditions (such as lack of disk space in that case). Tree-SHA512: d5d3f22ce2d04a75e5c25e935744327c3adc704c2d303133f2918113573a564dff3d3243d5569a2b93ee7eb0e97f8e1b1ba81767e966af9015ea711a14091035
2 parents efed980 + 32da92b commit 12408d3

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

contrib/devtools/split-debug.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
2+
set -e
33
if [ $# -ne 3 ];
44
then echo "usage: $0 <input> <stripped-binary> <debug-binary>"
55
fi

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ remotes:
3636
"dir": "bitcoin"
3737
files: []
3838
script: |
39+
set -e -o pipefail
3940
4041
WRAP_DIR=$HOME/wrapped
4142
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
@@ -179,8 +180,8 @@ script: |
179180
find . -name "lib*.la" -delete
180181
find . -name "lib*.a" -delete
181182
rm -rf ${DISTNAME}/lib/pkgconfig
182-
find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
183-
find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
183+
find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
184+
find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
184185
cp ../doc/README.md ${DISTNAME}/
185186
find ${DISTNAME} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
186187
find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ remotes:
1212
files:
1313
- "bitcoin-osx-unsigned.tar.gz"
1414
script: |
15+
set -e -o pipefail
16+
1517
WRAP_DIR=$HOME/wrapped
1618
mkdir -p ${WRAP_DIR}
1719
export PATH=`pwd`:$PATH

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ remotes:
3333
files:
3434
- "MacOSX10.11.sdk.tar.gz"
3535
script: |
36+
set -e -o pipefail
37+
3638
WRAP_DIR=$HOME/wrapped
3739
HOSTS="x86_64-apple-darwin14"
3840
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"

contrib/gitian-descriptors/gitian-win-signer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ files:
1616
- "osslsigncode-Backports-to-1.7.1.patch"
1717
- "bitcoin-win-unsigned.tar.gz"
1818
script: |
19+
set -e -o pipefail
20+
1921
BUILD_DIR=`pwd`
2022
SIGDIR=${BUILD_DIR}/signature/win
2123
UNSIGNED_DIR=${BUILD_DIR}/unsigned

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ remotes:
2727
"dir": "bitcoin"
2828
files: []
2929
script: |
30+
set -e -o pipefail
31+
3032
WRAP_DIR=$HOME/wrapped
3133
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
3234
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"

0 commit comments

Comments
 (0)