Skip to content

Commit

Permalink
Merge pull request #48 from OwenRay/master
Browse files Browse the repository at this point in the history
update to 0.12.4.0
  • Loading branch information
OwenRay committed Mar 29, 2024
2 parents da68b6a + c1cda58 commit 9a0c644
Show file tree
Hide file tree
Showing 358 changed files with 65,754 additions and 19,648 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ libconftest.dylib*
*.o-*
.zeroone
*.patch
!depends/patches/*/*.patch
*.a
*.pb.cc
*.pb.h
Expand Down
111 changes: 42 additions & 69 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,80 @@
# errata:
# - A travis bug causes caches to trample eachother when using the same
# compiler key (which we don't use anyway). This is worked around for now by
# replacing the "compilers" with a build name prefixed by the no-op ":"
# command. See: https://github.com/travis-ci/travis-ci/issues/4393
# - sudo/dist/group are set so as to get Blue Box VMs, necessary for [loopback]
# IPv6 support

sudo: required
dist: trusty
group: deprecated-2017Q3

os: linux
language: generic

addons:
apt:
packages:
# Use more recent docker version
- docker-ce
# Can be removed if Travis ever upgrades to Bionic
- realpath

services:
- docker

cache:
apt: true
ccache: true
directories:
- depends/built
- depends/sdk-sources
- $HOME/.ccache
- $HOME/cache

env:
global:
# DOCKER_HUB_USER
- secure: "J0T+zrRBBzBnxoioCD378cRSJUF8Vms32QMmrENVVfuJl03oBQv0QxSatLEiD4PtRPrN00mJ8/k/HdqFQ0SN1yg6a00duOZ6C9jk6t/fExBO1LNhp3Z7lcaMUrNEyRN6sgfVeznDVTGj9jBQU2HNlwHk0UD9BNp/k+Bjhrtw7Njp9JTLZKBgxrXk0WZmfk0d75Q+9DajA1j2tSfWVpwzv6HMGfqIH1wsVEakBY+tnaE6EO3IdzdWHhf/iV+Tx0tL0Qz/6mejgSuoGLTJLmeTrceTTmsDlN3B95y+XfcYDs6EP7gpzN8Ffg/mLV8xJ2Myj7+b1o+smMJZE5tLuPIeAu0YsfkPNa/tNLotOlDxF72per0kXyNYb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TRAVIS_BUILD_ID
- CCACHE_SIZE=400M
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- BASE_OUTDIR=$TRAVIS_BUILD_DIR/out
- SDK_URL=https://bitcoincore.org/depends-sources/sdks
- PYTHON_DEBUG=1
- WINEDEBUG=fixme-all
- DOCKER_BUILD=false

matrix:
# ARM
- HOST=arm-linux-gnueabihf PPA="ppa:bitcoin/bitcoin" PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" CHECK_DOC=1 GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
# Win32
- HOST=i686-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PPA="ppa:bitcoin/bitcoin" PACKAGES="python3 nsis g++-mingw-w64-i686 wine1.7 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" MAKEJOBS="-j4"
# 32-bit + zeroone
- HOST=i686-pc-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="g++-multilib bc python3-zmq" DEP_OPTS="NO_QT=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash" PYZMQ=true
# Win64
- HOST=x86_64-w64-mingw32 DPKG_ADD_ARCH="i386" DEP_OPTS="NO_QT=1" PPA="ppa:bitcoin/bitcoin" PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine1.7 bc" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" MAKEJOBS="-j4"
# zerooned
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="bc python3-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports" CPPFLAGS="-DDEBUG_LOCKORDER -DENABLE_ZEROONE_DEBUG" PYZMQ=true
# No wallet
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="python3" DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
# Cross-Mac
- HOST=x86_64-apple-darwin11 PPA="ppa:bitcoin/bitcoin" PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev" BITCOIN_CONFIG="--enable-gui --enable-reduce-exports" OSX_SDK=10.11 GOAL="deploy"
# zerooned release build (for docker)
- HOST=x86_64-unknown-linux-gnu PPA="ppa:bitcoin/bitcoin" PACKAGES="bc python3-zmq" DEP_OPTS="NO_QT=1 NO_UPNP=1" GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports" PYZMQ=true DOCKER_BUILD=true
- BUILD_TARGET=arm-linux
- BUILD_TARGET=win32
- BUILD_TARGET=win64
- BUILD_TARGET=linux32
- BUILD_TARGET=linux64
- BUILD_TARGET=linux64_nowallet
- BUILD_TARGET=linux64_release DOCKER_BUILD=true
- BUILD_TARGET=mac

before_cache:
# Save builder image
- docker save dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER $(docker history -q dash-builder-$BUILD_TARGET-$TRAVIS_JOB_NUMBER | grep -v \<missing\>) | gzip -2 > $HOME/cache/docker/dash-builder-$BUILD_TARGET.tar.gz

before_install:
- git clone https://github.com/zocteam/zeroone_hash
- travis_retry sudo apt-get install python3-pip python3-dev
- travis_retry sudo add-apt-repository ppa:ubuntu-wine/ppa -y
- export PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
install:
- if [ "$PYZMQ" = "true" ]; then pip3 install pyzmq --user ; fi
- if [ -n "$PPA" ]; then travis_retry sudo add-apt-repository "$PPA" -y; fi
- if [ -n "$DPKG_ADD_ARCH" ]; then sudo dpkg --add-architecture "$DPKG_ADD_ARCH" ; fi
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get update; fi
- if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi
- cd zeroone_hash && python3 setup.py install --user && cd ..
# Our scripts try to be Travis agnostic
- export PULL_REQUEST="$TRAVIS_PULL_REQUEST"
- export JOB_NUMBER="$TRAVIS_JOB_NUMBER"
- export HOST_SRC_DIR=$TRAVIS_BUILD_DIR
- export HOST_CACHE_DIR=$HOME/cache
- source ./ci/matrix.sh
- mkdir -p $HOST_CACHE_DIR/docker && mkdir -p $HOST_CACHE_DIR/ccache && mkdir -p $HOST_CACHE_DIR/depends && mkdir -p $HOST_CACHE_DIR/sdk-sources
# Keep this as it makes caching related debugging easier
- ls -lah $HOST_CACHE_DIR && ls -lah $HOST_CACHE_DIR/depends && ls -lah $HOST_CACHE_DIR/ccache && ls -lah $HOST_CACHE_DIR/docker
# Load cached builder image
- if [ -f $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz ]; then zcat $HOST_CACHE_DIR/docker/dash-builder-$BUILD_TARGET.tar.gz | docker load || true; fi
- docker build --pull -t $BUILDER_IMAGE_NAME --build-arg=USER_ID=$UID --build-arg=GROUP_ID=$UID --build-arg=BUILD_TARGET=$BUILD_TARGET -f ci/Dockerfile.builder ci
before_script:
- unset CC; unset CXX
- unset DISPLAY
# Make sure stdout is in blocking mode. Otherwise builds will fail due to large writes to stdout
# See https://github.com/travis-ci/travis-ci/issues/4704. If this gets fixed, this line can also be removed.
- python3 -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
#- if [ "$CHECK_DOC" = 1 ]; then contrib/devtools/check-doc.py; fi TODO reenable after all Bitcoin PRs have been merged and docs fully fixed
- mkdir -p depends/SDKs depends/sdk-sources
- if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi
- make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
script:
- export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`
- if [ -n "$USE_SHELL" ]; then export CONFIG_SHELL="$USE_SHELL"; fi
- OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST
- BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib"
- depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE
- test -n "$USE_SHELL" && eval '"$USE_SHELL" -c "./autogen.sh"' || ./autogen.sh
- mkdir build && cd build
- ../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
- make distdir VERSION=$HOST
- cd zeroonecore-$HOST
- ./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)
- make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false )
- export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib
- if [ "$RUN_TESTS" = "true" ]; then travis_wait 30 make $MAKEJOBS check VERBOSE=1; fi
- if [ "$RUN_TESTS" = "true" ]; then qa/pull-tester/rpc-tests.py --coverage; fi
- cd ../..
- if [ "$DOCKER_BUILD" = "true" ]; then BUILD_DIR=build/zeroonecore-$HOST ./docker/build-docker.sh; fi
# Our scripts try to be Travis agnostic
- $DOCKER_RUN_IN_BUILDER ./ci/build_depends.sh;
# Gracefully stop build without running into timeouts (which won't update caches) when building depends took too long
# Next build should fix this situation as it will start with a populated depends cache
- if [ $SECONDS -gt 1200 ]; then export DEPENDS_TIMEOUT="true"; false; fi # The "false" here ensures that the build is marked as failed even though the whole script returns 0
- test "$DEPENDS_TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/build_src.sh
- test "$DEPENDS_TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/test_unittests.sh
- test "$DEPENDS_TIMEOUT" != "true" && $DOCKER_RUN_IN_BUILDER ./ci/test_integrationtests.sh -parallel=3
- test "$DEPENDS_TIMEOUT" != "true" && if [ "$DOCKER_BUILD" = "true" ]; then BUILD_DIR=build-ci/dashcore-$BUILD_TARGET ./docker/build-docker.sh; fi
after_script:
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_COMMIT_LOG
Expand Down
85 changes: 73 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,76 @@
cmake_minimum_required(VERSION 3.3)
project(bitcoin)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

add_custom_target(build-zeroone ALL
COMMAND ./autogen.sh
COMMAND ./configure
COMMAND $(MAKE) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND $(MAKE) install)

add_custom_target(debug-zerooned ALL)
add_custom_target(debug-zeroonetest ALL)
add_custom_target(debug-zeroone-qt ALL)
set(CMAKE_CXX_STANDARD 14)

include_directories(
src
src/qt/forms
src/leveldb/include
src/univalue/include
)

if(UNIX AND NOT APPLE)
set(DEPENDS_PREFIX depends/x86_64-pc-linux-gnu)
elseif(APPLE)
set(DEPENDS_PREFIX depends/x86_64-apple-darwin11)
elseif(WIN32)
set(DEPENDS_PREFIX depends/x86_64-w64-mingw32)
endif()

message(STATUS "DEPENDS_PREFIX: ${DEPENDS_PREFIX}")

if(DEFINED DEPENDS_PREFIX)
include_directories(${DEPENDS_PREFIX}/include)
include_directories(${DEPENDS_PREFIX}/include/QtWidgets)
endif()

add_definitions(
-DENABLE_WALLET=1
)

file(GLOB SOURCE_FILES
src/bench/*.cpp
src/bench/*.h
src/compat/*.cpp
src/compat/*.h
src/consensus/*.h
src/consensus/*.cpp
src/crypto/*.c
src/crypto/*.h
src/crypto/*.cpp
src/leveldb/db/*.cc
src/leveldb/db/*.h
src/leveldb/include/*.h
src/policy/*.cpp
src/policy/*.h
src/primitives/*.cpp
src/primitives/*.h
src/qt/test/*.cpp
src/qt/test/*.h
src/qt/*.cpp
src/qt/*.h
src/script/*.cpp
src/script/*.h
src/secp256k1/include/*.h
src/test/*.cpp
src/test/*.h
src/univalue/include/*.h
src/univalue/lib/*.cpp
src/univalue/lib/*.h
src/wallet/test/*.cpp
src/wallet/*.cpp
src/wallet/*.h
src/zmq/*.cpp
src/zmq/*.h
src/*.cpp
src/*.h
src/evo/*.h
src/evo/*.cpp
src/llmq/*.h
src/llmq/*.cpp
src/rpc/*.cpp
src/rpc/*.h
)

add_executable(dash ${SOURCE_FILES})
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ In general, all pull requests must:
the project (for example refactoring for modularisation);
- be well peer reviewed;
- have unit tests and functional tests where appropriate;
- follow code style guidelines;
- follow [code style guidelines](/doc/developer-notes.md);
- not break the existing test suite;
- where bugs are fixed, where possible, there should be unit tests
demonstrating the bug and also proving the fix. This helps prevent regression.
Expand Down
100 changes: 100 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// This Jenkinsfile will build a builder image and then run the actual build and tests inside this image
// It's very important to not execute any scripts outside of the builder container, as it's our protection against
// external developers bringing in harmful code into Jenkins.
// Jenkins will only run the build if this Jenkinsfile was not modified in an external pull request. Only branches
// which are part of the Dash repo will allow modification to the Jenkinsfile.

def targets = [
'win32',
'win64',
'linux32',
'linux64',
'linux64_nowallet',
'linux64_release',
'mac',
]

def tasks = [:]
for(int i = 0; i < targets.size(); i++) {
def target = targets[i]

tasks["${target}"] = {
node {
def BUILD_NUMBER = sh(returnStdout: true, script: 'echo $BUILD_NUMBER').trim()
def BRANCH_NAME = sh(returnStdout: true, script: 'echo $BRANCH_NAME').trim()
def UID = sh(returnStdout: true, script: 'id -u').trim()
def HOME = sh(returnStdout: true, script: 'echo $HOME').trim()
def pwd = sh(returnStdout: true, script: 'pwd').trim()

checkout scm

def env = [
"BUILD_TARGET=${target}",
"PULL_REQUEST=false",
"JOB_NUMBER=${BUILD_NUMBER}",
]
withEnv(env) {
def builderImageName="dash-builder-${target}"

def builderImage
stage("${target}/builder-image") {
builderImage = docker.build("${builderImageName}", "--build-arg BUILD_TARGET=${target} ci -f ci/Dockerfile.builder")
}

builderImage.inside("-t") {
// copy source into fixed path
// we must build under the same path everytime as otherwise caches won't work properly
sh "cp -ra ${pwd}/. /dash-src/"

// restore cache
def hasCache = false
try {
copyArtifacts(projectName: "dashpay-dash/${BRANCH_NAME}", optional: true, selector: lastSuccessful(), filter: "ci-cache-${target}.tar.gz")
} catch (Exception e) {
}
if (fileExists("ci-cache-${target}.tar.gz")) {
hasCache = true
echo "Using cache from dashpay-dash/${BRANCH_NAME}"
} else {
try {
copyArtifacts(projectName: 'dashpay-dash/develop', optional: true, selector: lastSuccessful(), filter: "ci-cache-${target}.tar.gz");
} catch (Exception e) {
}
if (fileExists("ci-cache-${target}.tar.gz")) {
hasCache = true
echo "Using cache from dashpay-dash/develop"
}
}

if (hasCache) {
sh "cd /dash-src && tar xzf ${pwd}/ci-cache-${target}.tar.gz"
} else {
sh "mkdir -p /dash-src/ci-cache-${target}"
}

stage("${target}/depends") {
sh 'cd /dash-src && ./ci/build_depends.sh'
}
stage("${target}/build") {
sh 'cd /dash-src && ./ci/build_src.sh'
}
stage("${target}/test") {
sh 'cd /dash-src && ./ci/test_unittests.sh'
}
stage("${target}/test") {
sh 'cd /dash-src && ./ci/test_integrationtests.sh'
}

// archive cache and copy it into the jenkins workspace
sh "cd /dash-src && tar czfv ci-cache-${target}.tar.gz ci-cache-${target} && cp ci-cache-${target}.tar.gz ${pwd}/"
}

// upload cache
archiveArtifacts artifacts: "ci-cache-${target}.tar.gz", fingerprint: true
}
}
}
}

parallel tasks

0 comments on commit 9a0c644

Please sign in to comment.