Skip to content

Commit 19ea173

Browse files
committed
Merge #8167: gitian: Ship debug tarballs/zips with debug symbols
7e7eb27 gitian: create debug packages for linux/windows (Cory Fields) ad38204 gitian: use CONFIG_SITE rather than hijacking the prefix (Cory Fields) b676f38 depends: allow for CONFIG_SITE to be used rather than stealing prefix (Cory Fields)
2 parents 4286f43 + 7e7eb27 commit 19ea173

File tree

4 files changed

+49
-30
lines changed

4 files changed

+49
-30
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ files: []
2626
script: |
2727
WRAP_DIR=$HOME/wrapped
2828
HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu"
29-
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests LDFLAGS=-static-libstdc++"
29+
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
3030
FAKETIME_HOST_PROGS=""
31-
FAKETIME_PROGS="date ar ranlib nm strip"
31+
FAKETIME_PROGS="date ar ranlib nm strip objcopy"
32+
HOST_CFLAGS="-O2 -g"
33+
HOST_CXXFLAGS="-O2 -g"
34+
HOST_LDFLAGS=-static-libstdc++
3235
3336
export QT_RCC_TEST=1
3437
export GZIP="-9n"
@@ -74,7 +77,7 @@ script: |
7477
7578
# Create the release tarball using (arbitrarily) the first host
7679
./autogen.sh
77-
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
80+
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
7881
make dist
7982
SOURCEDIST=`echo bitcoin-*.tar.gz`
8083
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
@@ -95,20 +98,26 @@ script: |
9598
mkdir -p ${INSTALLPATH}
9699
tar --strip-components=1 -xf ../$SOURCEDIST
97100
98-
./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
101+
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
99102
make ${MAKEOPTS}
100103
make ${MAKEOPTS} -C src check-security
101104
make ${MAKEOPTS} -C src check-symbols
102-
make install-strip
105+
make install DESTDIR=${INSTALLPATH}
103106
cd installed
104107
find . -name "lib*.la" -delete
105108
find . -name "lib*.a" -delete
106109
rm -rf ${DISTNAME}/lib/pkgconfig
107-
find ${DISTNAME} | 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
110+
find ${DISTNAME}/bin -type f -executable -exec objcopy --only-keep-debug {} {}.dbg \; -exec strip -s {} \; -exec objcopy --add-gnu-debuglink={}.dbg {} \;
111+
find ${DISTNAME}/lib -type f -exec objcopy --only-keep-debug {} {}.dbg \; -exec strip -s {} \; -exec objcopy --add-gnu-debuglink={}.dbg {} \;
112+
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
113+
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
108114
cd ../../
115+
rm -rf distsrc-${i}
109116
done
110117
mkdir -p $OUTDIR/src
111118
mv $SOURCEDIST $OUTDIR/src
119+
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.tar.gz ${OUTDIR}/${DISTNAME}-linux64-debug.tar.gz
120+
mv ${OUTDIR}/${DISTNAME}-i686-*-debug.tar.gz ${OUTDIR}/${DISTNAME}-linux32-debug.tar.gz
112121
mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz
113122
mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz
114123

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ script: |
9090
9191
# Create the release tarball using (arbitrarily) the first host
9292
./autogen.sh
93-
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
93+
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
9494
make dist
9595
SOURCEDIST=`echo bitcoin-*.tar.gz`
9696
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
@@ -112,9 +112,9 @@ script: |
112112
mkdir -p ${INSTALLPATH}
113113
tar --strip-components=1 -xf ../$SOURCEDIST
114114
115-
./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
115+
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
116116
make ${MAKEOPTS}
117-
make install-strip
117+
make install-strip DESTDIR=${INSTALLPATH}
118118
119119
make osx_volname
120120
make deploydir

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ script: |
3030
WRAP_DIR=$HOME/wrapped
3131
HOSTS="x86_64-w64-mingw32 i686-w64-mingw32"
3232
CONFIGFLAGS="--enable-reduce-exports --disable-gui-tests"
33-
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip"
33+
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip objcopy"
3434
FAKETIME_PROGS="date makensis zip"
35+
HOST_CFLAGS="-O2 -g"
36+
HOST_CXXFLAGS="-O2 -g"
3537
3638
export QT_RCC_TEST=1
3739
export GZIP="-9n"
@@ -101,7 +103,7 @@ script: |
101103
102104
# Create the release tarball using (arbitrarily) the first host
103105
./autogen.sh
104-
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
106+
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
105107
make dist
106108
SOURCEDIST=`echo bitcoin-*.tar.gz`
107109
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
@@ -125,22 +127,28 @@ script: |
125127
mkdir -p ${INSTALLPATH}
126128
tar --strip-components=1 -xf ../$SOURCEDIST
127129
128-
./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
130+
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}"
129131
make ${MAKEOPTS}
130132
make ${MAKEOPTS} -C src check-security
131133
make deploy
132-
make install-strip
134+
make install DESTDIR=${INSTALLPATH}
133135
cp -f bitcoin-*setup*.exe $OUTDIR/
134136
cd installed
135137
mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/
136138
find . -name "lib*.la" -delete
137139
find . -name "lib*.a" -delete
138140
rm -rf ${DISTNAME}/lib/pkgconfig
139-
find ${DISTNAME} -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip
140-
cd ../..
141+
find ${DISTNAME}/bin -type f -executable -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \;
142+
find ${DISTNAME}/lib -type f -exec ${i}-objcopy --only-keep-debug {} {}.dbg \; -exec ${i}-strip -s {} \; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \;
143+
find ${DISTNAME} -not -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip
144+
find ${DISTNAME} -name "*.dbg" -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip
145+
cd ../../
146+
rm -rf distsrc-${i}
141147
done
142148
cd $OUTDIR
143149
rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe
144150
find . -name "*-setup-unsigned.exe" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz
151+
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip
152+
mv ${OUTDIR}/${DISTNAME}-i686-*-debug.zip ${OUTDIR}/${DISTNAME}-win32-debug.zip
145153
mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip
146154
mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip

depends/config.site.in

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
1+
depends_prefix="`dirname ${ac_site_file}`/.."
2+
13
cross_compiling=maybe
24
host_alias=@HOST@
35
ac_tool_prefix=${host_alias}-
46

57
if test -z $with_boost; then
6-
with_boost=$prefix
8+
with_boost=$depends_prefix
79
fi
810
if test -z $with_qt_plugindir; then
9-
with_qt_plugindir=$prefix/plugins
11+
with_qt_plugindir=$depends_prefix/plugins
1012
fi
1113
if test -z $with_qt_translationdir; then
12-
with_qt_translationdir=$prefix/translations
14+
with_qt_translationdir=$depends_prefix/translations
1315
fi
1416
if test -z $with_qt_bindir; then
15-
with_qt_bindir=$prefix/native/bin
17+
with_qt_bindir=$depends_prefix/native/bin
1618
fi
1719
if test -z $with_protoc_bindir; then
18-
with_protoc_bindir=$prefix/native/bin
20+
with_protoc_bindir=$depends_prefix/native/bin
1921
fi
2022
if test -z $with_comparison_tool; then
21-
with_comparison_tool=$prefix/native/share/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar
23+
with_comparison_tool=$depends_prefix/native/share/BitcoindComparisonTool_jar/BitcoindComparisonTool.jar
2224
fi
2325

2426

@@ -41,32 +43,32 @@ fi
4143

4244
if test x@host_os@ = xmingw32; then
4345
if test -z $with_qt_incdir; then
44-
with_qt_incdir=$prefix/include
46+
with_qt_incdir=$depends_prefix/include
4547
fi
4648
if test -z $with_qt_libdir; then
47-
with_qt_libdir=$prefix/lib
49+
with_qt_libdir=$depends_prefix/lib
4850
fi
4951
fi
5052

51-
PATH=$prefix/native/bin:$PATH
53+
PATH=$depends_prefix/native/bin:$PATH
5254
PKG_CONFIG="`which pkg-config` --static"
5355

5456
# These two need to remain exported because pkg-config does not see them
5557
# otherwise. That means they must be unexported at the end of configure.ac to
5658
# avoid ruining the cache. Sigh.
5759

58-
export PKG_CONFIG_LIBDIR=$prefix/lib/pkgconfig
59-
export PKG_CONFIG_PATH=$prefix/share/pkgconfig
60+
export PKG_CONFIG_LIBDIR=$depends_prefix/lib/pkgconfig
61+
export PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig
6062

61-
CPPFLAGS="-I$prefix/include/ $CPPFLAGS"
62-
LDFLAGS="-L$prefix/lib $LDFLAGS"
63+
CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
64+
LDFLAGS="-L$depends_prefix/lib $LDFLAGS"
6365

6466
CC="@CC@"
6567
CXX="@CXX@"
6668
OBJC="${CC}"
6769
OBJCXX="${CXX}"
68-
CCACHE=$prefix/native/bin/ccache
69-
PYTHONPATH=$prefix/native/lib/python/dist-packages:$PYTHONPATH
70+
CCACHE=$depends_prefix/native/bin/ccache
71+
PYTHONPATH=$depends_prefix/native/lib/python/dist-packages:$PYTHONPATH
7072

7173
if test -n "@AR@"; then
7274
AR=@AR@

0 commit comments

Comments
 (0)