Skip to content

Commit

Permalink
zcash v1.0.11 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bitcoinz committed Sep 20, 2017
1 parent 5ad4b26 commit 2a440ef
Show file tree
Hide file tree
Showing 124 changed files with 1,507 additions and 776 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ libzcashconsensus.pc

contrib/debian/files
contrib/debian/substvars

.idea/
*.iml
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ matrix:
fast_finish: true
include:
- compiler: ": ARM"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="NO_QT=1" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
env: HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" DEP_OPTS="" GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Win32"
env: HOST=i686-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-i686 g++-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2"
- compiler: ": 32-bit + dash"
env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib bc python-zmq" PPA="ppa:chris-lea/zeromq" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++" USE_SHELL="/bin/dash"
- compiler: ": Win64"
env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev wine bc" RUN_TESTS=true GOAL="deploy" BITCOIN_CONFIG="--enable-reduce-exports" MAKEJOBS="-j2"
- compiler: ": bitcoind"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" PPA="ppa:chris-lea/zeromq" 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"
env: HOST=x86_64-unknown-linux-gnu PACKAGES="bc python-zmq" PPA="ppa:chris-lea/zeromq" DEP_OPTS="DEBUG=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-zmq --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER"
- compiler: ": No wallet"
env: HOST=x86_64-unknown-linux-gnu DEP_OPTS="NO_WALLET=1" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat --enable-reduce-exports"
- compiler: ": Cross-Mac"
Expand Down
3 changes: 1 addition & 2 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ open-source licenses. For further details see 'contrib/debian/copyright'.

This product includes software developed by the OpenSSL Project for use in the
OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic
software written by Eric Young ([email protected]),
and UPnP software written by Thomas Bernard.
software written by Eric Young ([email protected]).


Although almost all of the Zcash code is licensed under "permissive" open source
Expand Down
55 changes: 2 additions & 53 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 10)
define(_CLIENT_VERSION_BUILD, 51)
define(_CLIENT_VERSION_REVISION, 11)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down Expand Up @@ -94,18 +94,6 @@ AC_ARG_ENABLE([rust],
[enable_rust=$enableval],
[enable_rust=yes])

AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])],
[use_upnp=$withval],
[use_upnp=auto])

AC_ARG_ENABLE([upnp-default],
[AS_HELP_STRING([--enable-upnp-default],
[if UPNP is enabled, turn it on at startup (default is no)])],
[use_upnp_default=$enableval],
[use_upnp_default=no])

AC_ARG_ENABLE([proton],
[AS_HELP_STRING([--disable-proton],
[disable Proton (AMQP messaging)])],
Expand Down Expand Up @@ -556,15 +544,6 @@ else
AC_DEFINE(ENABLE_PROTON, 0, [Define to 1 to enable Proton functions])
fi

dnl Check for libminiupnpc (optional)
if test x$use_upnp != xno; then
AC_CHECK_HEADERS(
[miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
[AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
[have_miniupnpc=no]
)
fi

if test x$build_bitcoin_utils$build_bitcoind$use_tests = xnonono; then
use_boost=no
else
Expand Down Expand Up @@ -876,33 +855,6 @@ else
AC_MSG_RESULT(no)
fi

dnl enable upnp support
AC_MSG_CHECKING([whether to build with support for UPnP])
if test x$have_miniupnpc = xno; then
if test x$use_upnp = xyes; then
AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
fi
AC_MSG_RESULT(no)
else
if test x$use_upnp != xno; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([whether to build with UPnP enabled by default])
use_upnp=yes
upnp_setting=0
if test x$use_upnp_default != xno; then
use_upnp_default=yes
upnp_setting=1
fi
AC_MSG_RESULT($use_upnp_default)
AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
if test x$TARGET_OS = xwindows; then
MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
fi
else
AC_MSG_RESULT(no)
fi
fi

AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])

AM_CONDITIONAL([ENABLE_PROTON], [test "x$use_proton" = "xyes"])
Expand Down Expand Up @@ -955,12 +907,9 @@ AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)

AC_SUBST(RELDFLAGS)
AC_SUBST(LIBTOOL_APP_LDFLAGS)
AC_SUBST(USE_UPNP)
AC_SUBST(BOOST_LIBS)
AC_SUBST(TESTDEFS)
AC_SUBST(LEVELDB_TARGET_FLAGS)
AC_SUBST(MINIUPNPC_CPPFLAGS)
AC_SUBST(MINIUPNPC_LIBS)
AC_SUBST(GMP_LIBS)
AC_SUBST(GMPXX_LIBS)
AC_SUBST(LIBSNARK_LIBS)
Expand Down
62 changes: 62 additions & 0 deletions contrib/ci-workers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Zcash CI workers

This folder contains the Ansible playbooks for configuring a fresh OS
installation for use as a Buildbot worker in Zcash's CI.

# Criteria for Adding Workers

a. Don't add workers until users complain about a problem on a platform
that doesn't yet have workers or if we anticipate many users will use
a platform, we may pre-emptively add an unsupported worker for it.

b. Prioritize the platforms that seem to have the most users.

c. When adding workers start by adding workers for the "most common"
variant of any distro, then if users later encounter problems with a
sub-variant, we can consider adding new workers at that point.
Example: add Ubuntu Desktop before Xubuntu, on the assumption the
former has a larger population base.

# Setting up a latent worker on Amazon EC2

- Add a regular (non-latent) worker to the master.cfg for dev-ci.z.cash, and
deploy the changes.
- This enables the Ansible playbook to run to completion, ending in the worker
connecting to the master.

- Start a basic EC2 instance using the template AMI for the target OS.
- Choose the smallest instance size, it won't be used for building Zcash.

- Figure out which user to log into the instance with.
- E.g. for the Ubuntu template, use "ubuntu" instead of "root"
- If you get an Ansible error later with a message like "Failed to connect to
the host via ssh: Received message too long 1349281121\r\n", that means the
instance is sending a text string in response to the SSH connection, and the
Ansible protocol is balking. Try manually logging in with the same
credentials to diagnose.

- Create `inventory/hosts` containing the following:

[zcash-ci-worker-unix]
some-name ansible_host=<INSTANCE_IP> ansible_ssh_user=<USERNAME>

- Run `ansible-playbook -e buildbot_worker_host_template=templates/host.ec2.j2 -i inventory/hosts unix.yml`,
passing in the worker's Buildbot name and password.
- After a successful run, the worker should be connected to dev-ci.z.cash and
visible in its worker list.

- Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for dev-ci.z.cash.
- 16 GB of storage should be sufficient.

- SSH into the instance, and edit the worker config to connect to ci.z.cash.

- Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for ci.z.cash.
- 16 GB of storage should be sufficient.

- Delete the instance (it is no longer needed).

- Edit the master.cfg to turn the new worker into a latent (using the new AMI
IDs), add it to the appropriate worker groups, set up new builders etc.
- Deploy this via the normal PR review process.
2 changes: 2 additions & 0 deletions contrib/ci-workers/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[ssh_connection]
pipelining = True
8 changes: 8 additions & 0 deletions contrib/ci-workers/tasks/install-pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Fetch pip installer
get_url:
url: https://bootstrap.pypa.io/get-pip.py
dest: /tmp/get-pip.py

- name: Install pip
command: "{{ ansible_python.executable }} /tmp/get-pip.py"
17 changes: 17 additions & 0 deletions contrib/ci-workers/templates/buildbot-worker.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=Buildbot worker
Wants=network.target
After=network.target

[Service]
Type=forking
PIDFile=/home/{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/twistd.pid
WorkingDirectory=/home/{{ buildbot_worker_user }}
ExecStart={{ pip_bin_dir }}/buildbot-worker start {{ buildbot_worker_name }}
ExecReload={{ pip_bin_dir }}/buildbot-worker restart {{ buildbot_worker_name }}
ExecStop={{ pip_bin_dir }}/buildbot-worker stop {{ buildbot_worker_name }}
Restart=always
User={{ buildbot_worker_user }}

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions contrib/ci-workers/templates/host.ec2.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
3 changes: 3 additions & 0 deletions contrib/ci-workers/templates/host.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
Memory: {{ ansible_memtotal_mb }} MB
CPU: {{ ansible_processor[1] }}
152 changes: 152 additions & 0 deletions contrib/ci-workers/unix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
- name: Configure a Buildbot worker for Zcash CI
hosts: zcash-ci-worker-unix
become: true
gather_facts: False

vars_files:
- vars/default.yml
- vars/buildbot.yml

vars_prompt:
- name: "buildbot_worker_admin"
prompt: "Admin details"
default: "Zcash <[email protected]>"
- name: "buildbot_worker_name"
prompt: "Buildbot worker name (provided by ZECC)"
private: no
- name: "buildbot_worker_password"
prompt: "Buildbot worker password (provided by ZECC)"

pre_tasks:
- name: Install Python 2.7 for Ansible and Buildbot
raw: test -e /usr/bin/python || test -e /usr/bin/python2 || test -e /usr/bin/python2.7 || test -e /usr/local/bin/python2.7 || (test -e /usr/bin/apt && apt -qqy update && apt install -qqy python) || (test -e /usr/bin/dnf && dnf install -qqy python2) || (test -e /usr/sbin/pkg && pkg install -qqy python2)
register: output
changed_when:
- output.stdout != ""
- output.stdout != "\r\n"

- name: Check if Python is in the configured location
raw: test -e {{ ansible_python_interpreter }}
ignore_errors: true
register: python_check
when: ansible_python_interpreter is defined

- name: Fail if configured Python is unavailable
fail:
msg: "Python is not accessible at {{ ansible_python_interpreter }} on this host! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2.7 binary."
when: ansible_python_interpreter is defined and python_check.rc == 1

- name: Check if Python is in the default location
raw: test -e /usr/bin/python
ignore_errors: true
register: python_check
when: ansible_python_interpreter is undefined

- name: Fail if default Python is unavailable
fail:
msg: Python is not accessible at /usr/bin/python on this host! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2.7 binary.
when: ansible_python_interpreter is undefined and python_check.rc == 1

- name: Gathering Facts
setup:

- name: Fail if Python is the wrong version
fail:
msg: "The Python binary at {{ ansible_python.executable }} is version {{ ansible_python_version }}! Please set the inventory variable 'ansible_python_interpreter' to the location of the Python 2.7 binary."
when: ansible_python.version.major != 2 or ansible_python.version.minor != 7

tasks:
- name: Get dependencies for distribution
include_vars: "{{ item }}"
with_first_found:
- files:
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version | int }}.yml"
- "vars/{{ ansible_distribution }}.yml"
- "vars/{{ ansible_os_family }}.yml"
skip: true

- name: Collate dependencies
set_fact:
package_deps: "{{ buildbot_deps + fetch_deps + conf_deps + build_deps + link_deps + dist_deps }}"
python_modules: "{{ buildbot_modules + rpc_test_modules }}"

- name: Update rolling release [Arch Linux]
pacman:
update_cache: yes
upgrade: yes
when: ansible_distribution == 'Archlinux'

- name: Install required packages
package:
name: "{{ item }}"
state: present
with_items: "{{ package_deps }}"

- name: Install pip [CentOS]
include: tasks/install-pip.yml
when: ansible_distribution == 'CentOS'

- name: Install required Python modules
pip:
name: "{{ item }}"
state: latest
with_items: "{{ python_modules }}"
notify: restart buildbot-worker

- name: Set up the Buildbot worker user
user:
name: "{{ buildbot_worker_user }}"
comment: Buildbot worker
shell: /bin/bash
state: present

- name: Create Buildbot worker
command: >
buildbot-worker create-worker ~/{{ buildbot_worker_name }}
{{ buildbot_master_host }}:{{ buildbot_master_port }}
{{ buildbot_worker_name|quote }} {{ buildbot_worker_password|quote }}
args:
creates: "~/{{ buildbot_worker_name }}/buildbot.tac"
become_user: "{{ buildbot_worker_user }}"

- name: Set admin details for Buildbot worker
copy:
content: "{{ buildbot_worker_admin }}"
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/admin"
owner: "{{ buildbot_worker_user }}"
group: "{{ buildbot_worker_user }}"
mode: "0644"

- name: Set host details for Buildbot worker
template:
src: "{{ buildbot_worker_host_template }}"
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/host"
owner: "{{ buildbot_worker_user }}"
group: "{{ buildbot_worker_user }}"
mode: "0644"

- name: Copy Buildbot worker systemd service unit
template:
src: templates/buildbot-worker.service.j2
dest: "/etc/systemd/system/buildbot-worker.service"
owner: root
group: root
mode: "0644"
notify: reload systemd

- name: Start Buildbot worker.
service:
name: buildbot-worker
state: started
enabled: yes

handlers:
- name: restart buildbot-worker
service:
name: buildbot-worker
state: restarted

- name: reload systemd
command: /bin/systemctl daemon-reload
7 changes: 7 additions & 0 deletions contrib/ci-workers/vars/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
buildbot_deps:
- python2-pip
build_deps:
- multilib/gcc
- make
pip_bin_dir: /usr/bin
Loading

0 comments on commit 2a440ef

Please sign in to comment.