Major updates integration from all upstreams

This commit is contained in:
miketout
2018-09-18 14:33:53 -07:00
396 changed files with 25517 additions and 6854 deletions

View File

@@ -33,15 +33,7 @@ if [[ -z "${HOST-}" ]]; then
HOST="$BUILD"
fi
# Allow override to $CC and $CXX for porters. Most users will not need it.
if [[ -z "${CC-}" ]]; then
CC=gcc
fi
if [[ -z "${CXX-}" ]]; then
CXX=g++
fi
# Allow users to set arbitary compile flags. Most users will not need this.
# Allow users to set arbitrary compile flags. Most users will not need this.
if [[ -z "${CONFIGURE_FLAGS-}" ]]; then
CONFIGURE_FLAGS=""
fi
@@ -54,7 +46,7 @@ Usage:
$0 --help
Show this help message and exit.
$0 [ --enable-lcov || --disable-tests ] [ --disable-mining ] [ --disable-rust ] [ --enable-proton ] [ --disable-libs ] [ MAKEARGS... ]
$0 [ --enable-lcov || --disable-tests ] [ --disable-mining ] [ --enable-proton ] [ --disable-libs ] [ MAKEARGS... ]
Build Zcash and most of its transitive dependencies from
source. MAKEARGS are applied to both dependencies and Zcash itself.
@@ -65,15 +57,9 @@ $0 [ --enable-lcov || --disable-tests ] [ --disable-mining ] [ --disable-rust ]
If --disable-mining is passed, Zcash is configured to not build any mining
code. It must be passed after the test arguments, if present.
If --disable-rust is passed, Zcash is configured to not build any Rust language
assets. It must be passed after test/mining arguments, if present.
If --enable-proton is passed, Zcash is configured to build the Apache Qpid Proton
library required for AMQP support. This library is not built by default.
It must be passed after the test/mining/Rust arguments, if present.
If --disable-libs is passed, Zcash is configured to not build any libraries like
'libzcashconsensus'.
It must be passed after the test/mining arguments, if present.
EOF
exit 0
fi
@@ -103,14 +89,6 @@ then
shift
fi
# If --disable-rust is the next argument, disable Rust code:
RUST_ARG=''
if [ "x${1:-}" = 'x--disable-rust' ]
then
RUST_ARG='--enable-rust=no'
shift
fi
# If --enable-proton is the next argument, enable building Proton code:
PROTON_ARG='--enable-proton=no'
if [ "x${1:-}" = 'x--enable-proton' ]
@@ -119,27 +97,16 @@ then
shift
fi
# If --disable-libs is the next argument, build without libs:
LIBS_ARG=''
if [ "x${1:-}" = 'x--disable-libs' ]
then
LIBS_ARG='--without-libs'
shift
fi
PREFIX="$(pwd)/depends/$BUILD/"
eval "$MAKE" --version
eval "$CC" --version
eval "$CXX" --version
as --version
ld -v
HOST="$HOST" BUILD="$BUILD" NO_RUST="$RUST_ARG" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1
HOST="$HOST" BUILD="$BUILD" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1
./autogen.sh
#<<<<<<< HEAD
#CC="$CC" CXX="$CXX" ./configure --prefix="${PREFIX}" --host="$HOST" --build="$BUILD" "$RUST_ARG" "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" CXXFLAGS='-fwrapv -fno-strict-aliasing -g'
#=======
CC="$CC" CXX="$CXX" ./configure --prefix="${PREFIX}" --host="$HOST" --build="$BUILD" "$RUST_ARG" "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" "$LIBS_ARG" $CONFIGURE_FLAGS --enable-werror CXXFLAGS='-g'
#CC="$CC" CXX="$CXX" ./configure --prefix="${PREFIX}" --host="$HOST" --build="$BUILD" "$RUST_ARG" "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" "$LIBS_ARG" $CONFIGURE_FLAGS --enable-werror CXXFLAGS='-g'
#>>>>>>> zcash/master
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" $CONFIGURE_FLAGS CXXFLAGS='-g'
"$MAKE" "$@" V=1

View File

@@ -10,6 +10,9 @@ fi
SPROUT_PKEY_NAME='sprout-proving.key'
SPROUT_VKEY_NAME='sprout-verifying.key'
SAPLING_SPEND_NAME='sapling-spend.params'
SAPLING_OUTPUT_NAME='sapling-output.params'
SAPLING_SPROUT_GROTH16_NAME='sprout-groth16.params'
SPROUT_URL="https://z.cash/downloads"
SPROUT_IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo"
@@ -18,10 +21,12 @@ SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')"
WGETCMD="$(command -v wget || echo '')"
IPFSCMD="$(command -v ipfs || echo '')"
CURLCMD="$(command -v curl || echo '')"
# fetch methods can be disabled with ZC_DISABLE_SOMETHING=1
ZC_DISABLE_WGET="${ZC_DISABLE_WGET:-}"
ZC_DISABLE_IPFS="${ZC_DISABLE_IPFS:-}"
ZC_DISABLE_CURL="${ZC_DISABLE_CURL:-}"
function fetch_wget {
if [ -z "$WGETCMD" ] || ! [ -z "$ZC_DISABLE_WGET" ]; then
@@ -60,6 +65,26 @@ EOF
ipfs get --output "$dlname" "$SPROUT_IPFS/$filename"
}
function fetch_curl {
if [ -z "$CURLCMD" ] || ! [ -z "$ZC_DISABLE_CURL" ]; then
return 1
fi
local filename="$1"
local dlname="$2"
cat <<EOF
Retrieving (curl): $SPROUT_URL/$filename
EOF
curl \
--output "$dlname" \
-# -L -C - \
"$SPROUT_URL/$filename"
}
function fetch_failure {
cat >&2 <<EOF
@@ -68,6 +93,7 @@ Try installing one of the following programs and make sure you're online:
* ipfs
* wget
* curl
EOF
exit 1
@@ -81,7 +107,7 @@ function fetch_params {
if ! [ -f "$output" ]
then
for method in wget ipfs failure; do
for method in wget ipfs curl failure; do
if "fetch_$method" "$filename" "$dlname"; then
echo "Download successful!"
break
@@ -106,12 +132,20 @@ EOF
# Use flock to prevent parallel execution.
function lock() {
local lockfile=/tmp/fetch_params.lock
# create lock file
eval "exec 200>/$lockfile"
# acquire the lock
flock -n 200 \
&& return 0 \
|| return 1
if [[ "$OSTYPE" == "darwin"* ]]; then
if shlock -f ${lockfile} -p $$; then
return 0
else
return 1
fi
else
# create lock file
eval "exec 200>$lockfile"
# acquire the lock
flock -n 200 \
&& return 0 \
|| return 1
fi
}
function exit_locked_error {
@@ -160,8 +194,14 @@ EOF
cd "$PARAMS_DIR"
# Sprout parameters:
fetch_params "$SPROUT_PKEY_NAME" "$PARAMS_DIR/$SPROUT_PKEY_NAME" "8bc20a7f013b2b58970cddd2e7ea028975c88ae7ceb9259a5344a16bc2c0eef7"
fetch_params "$SPROUT_VKEY_NAME" "$PARAMS_DIR/$SPROUT_VKEY_NAME" "4bd498dae0aacfd8e98dc306338d017d9c08dd0918ead18172bd0aec2fc5df82"
# Sapling parameters:
fetch_params "$SAPLING_SPEND_NAME" "$PARAMS_DIR/$SAPLING_SPEND_NAME" "8e48ffd23abb3a5fd9c5589204f32d9c31285a04b78096ba40a79b75677efc13"
fetch_params "$SAPLING_OUTPUT_NAME" "$PARAMS_DIR/$SAPLING_OUTPUT_NAME" "2f0ebbcbb9bb0bcffe95a397e7eba89c29eb4dde6191c339db88570e3f3fb0e4"
fetch_params "$SAPLING_SPROUT_GROTH16_NAME" "$PARAMS_DIR/$SAPLING_SPROUT_GROTH16_NAME" "b685d700c60328498fbde589c8c7c484c722b788b265b72af448a5bf0ee55b50"
}
main

View File

@@ -217,7 +217,7 @@ def patch_version_in_files(release, releaseprev):
patch_gitian_linux_yml(release, releaseprev)
@phase('Patching release height for auto-senescence.')
@phase('Patching release height for end-of-support halt.')
def patch_release_height(releaseheight):
rgx = re.compile(
r'^(static const int APPROX_RELEASE_HEIGHT = )\d+(;)$',

View File

@@ -1,4 +1,4 @@
import re, sys, os, os.path
import re, os, os.path
import subprocess
import argparse
from itertools import islice