Skip to content

Commit 5735322

Browse files
committed
Merge #574: configure option --enable-liquid for default liquidv1 chain
ff12bf7 QT: --enable-liquid needs to use different QAPP name for QSettings (Gregory Sanders) f475780 QT: WalletModel should always check for balance changes once (Gregory Sanders) 93e2660 QT: dummy address needs fully valid pubkey (Gregory Sanders) c227c65 QT: Cache the blinded destination values on transactions we create, like -cli (Gregory Sanders) 5622a83 QT: remove GetAmounts calls or put behind bitcoind mode only (Gregory Sanders) 17229bf QT: Add bracket to not reassign values on non-tx (Gregory Sanders) 88c256f Split out liquid gitian build descriptors (Gregory Sanders) 7bd0667 Change gitian defaults back to elements, leave commented out lines as switch (Gregory Sanders) 6d6ddc5 Rename binaries to liquid naming at end of gitian process (Gregory Sanders) aa2af38 --enable-liquid: liquid.conf and liquid.pid (Gregory Sanders) 3b1ca17 --enable-liquid: change default datadir to .liquid (Gregory Sanders) 1f67fec --enable-liquid for gitian builds (Gregory Sanders) 1fdc059 Add travis build for --enable-liquid (Gregory Sanders) 7eea59a configure option --enable-liquid for default liquidv1 chain (Gregory Sanders) Pull request description: The only behavior it modifies is that the default chain becomes `liquidv1`. Also added a Travis test for coverage and adapted a unit test, and enabled this mode for gitian descriptors. Tree-SHA512: 9a19267a51ee7a8906b6a8af9c511a4838ec529c5ea2873de215eb849111d2d2380679b524e7198f53606810b47cd85ef46a8fc5816c86e78ebedd8c30de0da7
2 parents 28ae91d + ff12bf7 commit 5735322

15 files changed

+663
-17
lines changed

.travis.yml

+10
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,13 @@ jobs:
172172
RUN_FEDPEG_BITCOIND_TEST=true
173173
GOAL="install"
174174
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=no --disable-tests --disable-bench CPPFLAGS=-DDEBUG_LOCKORDER"
175+
# x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout), no functional tests, LIQUID BUILD
176+
- stage: test
177+
env: >-
178+
HOST=x86_64-unknown-linux-gnu
179+
PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev"
180+
DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
181+
GOAL="install"
182+
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug --enable-liquid CXXFLAGS=\"-g0 -O2\""
183+
RUN_FUNCTIONAL_TESTS=false
184+

configure.ac

+12
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,20 @@ AC_ARG_ENABLE([asm],
194194
[use_asm=$enableval],
195195
[use_asm=yes])
196196

197+
AC_ARG_ENABLE([liquid],
198+
[AS_HELP_STRING([--enable-liquid],
199+
[Enable build that defaults to -chain=liquidv1])],
200+
[liquid_build=yes],
201+
[liquid_build=no])
202+
197203
if test "x$use_asm" = xyes; then
198204
AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
199205
fi
200206

207+
if test "x$liquid_build" = xyes; then
208+
AC_DEFINE(LIQUID, 1, [Define this symbol for Liquid builds])
209+
fi
210+
201211
AC_ARG_WITH([system-univalue],
202212
[AS_HELP_STRING([--with-system-univalue],
203213
[Build with system UniValue (default is no)])],
@@ -1378,6 +1388,7 @@ AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
13781388
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
13791389
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
13801390
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
1391+
AM_CONDITIONAL([LIQUID],[test x$liquid_build = xyes])
13811392

13821393
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
13831394
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
@@ -1510,6 +1521,7 @@ echo " with test = $use_tests"
15101521
echo " with bench = $use_bench"
15111522
echo " with upnp = $use_upnp"
15121523
echo " use asm = $use_asm"
1524+
echo " liquid_build = $liquid_build"
15131525
echo " sanitizers = $use_sanitizers"
15141526
echo " debug enabled = $enable_debug"
15151527
echo " gprof enabled = $enable_gprof"

contrib/gitian-descriptors/gitian-linux.yml

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ script: |
186186
find . -name "lib*.la" -delete
187187
find . -name "lib*.a" -delete
188188
rm -rf ${DISTNAME}/lib/pkgconfig
189+
189190
find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
190191
find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
191192
cp ../doc/README.md ${DISTNAME}/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
---
2+
name: "elements-linux-0.18"
3+
enable_cache: true
4+
suites:
5+
- "bionic"
6+
architectures:
7+
- "amd64"
8+
packages:
9+
- "curl"
10+
- "g++-aarch64-linux-gnu"
11+
- "g++-8-aarch64-linux-gnu"
12+
- "gcc-8-aarch64-linux-gnu"
13+
- "binutils-aarch64-linux-gnu"
14+
- "g++-arm-linux-gnueabihf"
15+
- "g++-8-arm-linux-gnueabihf"
16+
- "gcc-8-arm-linux-gnueabihf"
17+
- "binutils-arm-linux-gnueabihf"
18+
- "g++-riscv64-linux-gnu"
19+
- "g++-8-riscv64-linux-gnu"
20+
- "gcc-8-riscv64-linux-gnu"
21+
- "binutils-riscv64-linux-gnu"
22+
- "g++-8-multilib"
23+
- "gcc-8-multilib"
24+
- "binutils-gold"
25+
- "git"
26+
- "icnsutils"
27+
- "imagemagick"
28+
- "librsvg2-bin"
29+
- "pkg-config"
30+
- "autoconf"
31+
- "libtool"
32+
- "automake"
33+
- "faketime"
34+
- "bsdmainutils"
35+
- "ca-certificates"
36+
- "python"
37+
remotes:
38+
- "url": "https://github.com/ElementsProject/elements.git"
39+
"dir": "elements"
40+
files: []
41+
script: |
42+
43+
WRAP_DIR=$HOME/wrapped
44+
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
45+
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests --enable-liquid"
46+
FAKETIME_HOST_PROGS="gcc g++"
47+
FAKETIME_PROGS="date ar ranlib nm"
48+
HOST_CFLAGS="-O2 -g"
49+
HOST_CXXFLAGS="-O2 -g"
50+
HOST_LDFLAGS=-static-libstdc++
51+
52+
export QT_RCC_TEST=1
53+
export QT_RCC_SOURCE_DATE_OVERRIDE=1
54+
export GZIP="-9n"
55+
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
56+
export TZ="UTC"
57+
export BUILD_DIR=`pwd`
58+
mkdir -p ${WRAP_DIR}
59+
if test -n "$GBUILD_CACHE_ENABLED"; then
60+
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
61+
export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
62+
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
63+
fi
64+
65+
ls librsvg*.deb || wget http://mirrors.kernel.org/ubuntu/pool/main/libr/librsvg/librsvg2-2_2.40.13-3_amd64.deb
66+
dpkg -x librsvg*.deb new-rsvg
67+
export LD_LIBRARY_PATH="$(echo $PWD/new-rsvg/usr/lib/*/)"
68+
69+
function create_global_faketime_wrappers {
70+
for prog in ${FAKETIME_PROGS}; do
71+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
72+
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
73+
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
74+
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
75+
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
76+
chmod +x ${WRAP_DIR}/${prog}
77+
done
78+
}
79+
80+
function create_per-host_faketime_wrappers {
81+
for i in $HOSTS; do
82+
for prog in ${FAKETIME_HOST_PROGS}; do
83+
if which ${i}-${prog}-8
84+
then
85+
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
86+
echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
87+
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
88+
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
89+
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
90+
chmod +x ${WRAP_DIR}/${i}-${prog}
91+
fi
92+
done
93+
done
94+
}
95+
96+
# Faketime for depends so intermediate results are comparable
97+
export PATH_orig=${PATH}
98+
create_global_faketime_wrappers "2000-01-01 12:00:00"
99+
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
100+
export PATH=${WRAP_DIR}:${PATH}
101+
102+
EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
103+
mkdir -p $EXTRA_INCLUDES_BASE
104+
105+
# x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
106+
# but we can't write there. Instead, create a link here and force it to be included in the
107+
# search paths by wrapping gcc/g++.
108+
109+
mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
110+
rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
111+
ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
112+
113+
for prog in gcc g++; do
114+
rm -f ${WRAP_DIR}/${prog}
115+
cat << EOF > ${WRAP_DIR}/${prog}
116+
#!/usr/bin/env bash
117+
REAL="`which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1`"
118+
for var in "\$@"
119+
do
120+
if [ "\$var" = "-m32" ]; then
121+
export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
122+
export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
123+
break
124+
fi
125+
done
126+
\$REAL \$@
127+
EOF
128+
chmod +x ${WRAP_DIR}/${prog}
129+
done
130+
131+
cd elements
132+
BASEPREFIX=`pwd`/depends
133+
# Build dependencies for each host
134+
for i in $HOSTS; do
135+
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
136+
if [ -d "$EXTRA_INCLUDES" ]; then
137+
export HOST_ID_SALT="$EXTRA_INCLUDES"
138+
fi
139+
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
140+
unset HOST_ID_SALT
141+
done
142+
143+
# Faketime for binaries
144+
export PATH=${PATH_orig}
145+
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
146+
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
147+
export PATH=${WRAP_DIR}:${PATH}
148+
149+
# Create the release tarball using (arbitrarily) the first host
150+
./autogen.sh
151+
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
152+
make dist
153+
SOURCEDIST=`echo elements-*.tar.gz`
154+
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
155+
# Correct tar file order
156+
mkdir -p temp
157+
pushd temp
158+
tar xf ../$SOURCEDIST
159+
find elements-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
160+
popd
161+
162+
# Workaround for tarball not building with the bare tag version (prep)
163+
make -C src obj/build.h
164+
165+
ORIGPATH="$PATH"
166+
# Extract the release tarball into a dir for each host and build
167+
for i in ${HOSTS}; do
168+
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
169+
mkdir -p distsrc-${i}
170+
cd distsrc-${i}
171+
INSTALLPATH=`pwd`/installed/${DISTNAME}
172+
mkdir -p ${INSTALLPATH}
173+
tar --strip-components=1 -xf ../$SOURCEDIST
174+
175+
# Workaround for tarball not building with the bare tag version
176+
echo '#!/bin/true' >share/genbuild.sh
177+
mkdir src/obj
178+
cp ../src/obj/build.h src/obj/
179+
180+
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}"
181+
make ${MAKEOPTS}
182+
make ${MAKEOPTS} -C src check-security
183+
make ${MAKEOPTS} -C src check-symbols
184+
make install DESTDIR=${INSTALLPATH}
185+
cd installed
186+
find . -name "lib*.la" -delete
187+
find . -name "lib*.a" -delete
188+
rm -rf ${DISTNAME}/lib/pkgconfig
189+
190+
mv ${DISTNAME}/bin/elements-qt ${DISTNAME}/bin/liquid-qt
191+
mv ${DISTNAME}/bin/elements-cli ${DISTNAME}/bin/liquid-cli
192+
mv ${DISTNAME}/bin/elementsd ${DISTNAME}/bin/liquidd
193+
mv ${DISTNAME}/bin/elements-tx ${DISTNAME}/bin/liquid-tx
194+
195+
find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
196+
find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
197+
cp ../doc/README.md ${DISTNAME}/
198+
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
199+
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
200+
cd ../../
201+
rm -rf distsrc-${i}
202+
done
203+
mkdir -p $OUTDIR/src
204+
mv $SOURCEDIST $OUTDIR/src

0 commit comments

Comments
 (0)