From 93cb974980c578c459c15fd28e565c9722a1627d Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 2 Oct 2019 11:57:28 -0400 Subject: [PATCH 1/5] gitian: Use split-debug.sh for Win builds Debug splitting was first introduced in 7e7eb2724, then gitian-linux.yml changed to using split-debug.sh in 9d2536208. Here we change gitian-win.yml to use split-debug.sh as well. --- contrib/gitian-descriptors/gitian-win.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index f227c6ad92..5674c65f52 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -164,8 +164,8 @@ script: | find . -name "lib*.la" -delete find . -name "lib*.a" -delete rm -rf ${DISTNAME}/lib/pkgconfig - find ${DISTNAME}/bin -type f -executable -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \; - find ${DISTNAME}/lib -type f -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \; + find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg + find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip cd ../../ From c4a3c25ba11b20871699e570fc7b98a7b8472503 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 2 Oct 2019 11:58:11 -0400 Subject: [PATCH 2/5] gitian: Fix README inclusion in archives Linux: The README was originally added in 8550f1fb2, but included the README under the docs directory, which has a bunch of internal links that won't make sense in a release tarball. In this patch, we include the root level README instead, which makes more sense. Windows: .md files are inconvenient to open on windows and the line endings differ, so we use README_windows.txt instead. --- contrib/gitian-descriptors/gitian-linux.yml | 2 +- contrib/gitian-descriptors/gitian-win.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index c50750ed44..a3bdfe1d15 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -181,7 +181,7 @@ script: | rm -rf ${DISTNAME}/lib/pkgconfig find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg - cp ../doc/README.md ${DISTNAME}/ + cp ../README.md ${DISTNAME}/ find ${DISTNAME} -not -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz find ${DISTNAME} -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz cd ../../ diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 5674c65f52..eee44cc283 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -166,6 +166,7 @@ script: | rm -rf ${DISTNAME}/lib/pkgconfig find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg + cp ../doc/README_windows.txt ${DISTNAME}/readme.txt find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip cd ../../ From 999a9a5f5b4165dbdcb032c8d58c0ac1085ddcd1 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 2 Oct 2019 11:58:52 -0400 Subject: [PATCH 3/5] gitian: Smaller diff with gitian-linux.yml --- contrib/gitian-descriptors/gitian-win.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index eee44cc283..59a1fae447 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -124,14 +124,11 @@ script: | make dist SOURCEDIST=`echo bitcoin-*.tar.gz` DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` - # Correct tar file order mkdir -p temp pushd temp tar -xf ../$SOURCEDIST find bitcoin-* | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST - mkdir -p $OUTDIR/src - cp ../$SOURCEDIST $OUTDIR/src popd # Workaround for tarball not building with the bare tag version (prep) @@ -172,6 +169,8 @@ script: | cd ../../ rm -rf distsrc-${i} done + mkdir -p $OUTDIR/src + mv $SOURCEDIST $OUTDIR/src cp -rf contrib/windeploy $BUILD_DIR cd $BUILD_DIR/windeploy mkdir unsigned From 71949a97a7d050d4cd511731062a9ffe471ac438 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 2 Oct 2019 14:34:44 -0400 Subject: [PATCH 4/5] gitian: Eliminate rename dependency --- contrib/gitian-descriptors/gitian-win.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 59a1fae447..c30e0466a6 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -22,7 +22,6 @@ packages: - "zip" - "ca-certificates" - "python3" -- "rename" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" @@ -154,8 +153,10 @@ script: | make ${MAKEOPTS} -C src check-security make deploy make install DESTDIR=${INSTALLPATH} - rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe - cp -f bitcoin-*setup*.exe $OUTDIR/ + ( + SETUP_EXE="$(basename "$(echo ./*-setup.exe)")" + cp -f "$SETUP_EXE" "${OUTDIR}/${SETUP_EXE/%-setup.exe/-setup-unsigned.exe}" + ) cd installed mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/ find . -name "lib*.la" -delete From 9d1f971c7554bd5eb80792a1b9a692e0145ed516 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Wed, 2 Oct 2019 16:19:33 -0400 Subject: [PATCH 5/5] gitian: Put things in the right place to begin with --- contrib/gitian-descriptors/gitian-win.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index c30e0466a6..aeb937d5c7 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -165,8 +165,8 @@ script: | find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg cp ../doc/README_windows.txt ${DISTNAME}/readme.txt - find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip - find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip + find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i//x86_64-w64-mingw32/win64}.zip + find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i//x86_64-w64-mingw32/win64}-debug.zip cd ../../ rm -rf distsrc-${i} done @@ -177,5 +177,3 @@ script: | mkdir unsigned cp $OUTDIR/bitcoin-*setup-unsigned.exe unsigned/ find . | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz - mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip - mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip