Auto merge of #4766 - str4d:update-zeromq, r=str4d

Update ZeroMQ

Includes changes cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#9254
- bitcoin/bitcoin#13578
- bitcoin/bitcoin#15844
- bitcoin/bitcoin#16370
  - Only the ZeroMQ changes.
- bitcoin/bitcoin#16949
This commit is contained in:
Homu 2020-10-08 17:37:41 +00:00
commit 6e4090d840
8 changed files with 59 additions and 14 deletions

View File

@ -135,7 +135,7 @@ $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_build_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_stage_env+=PATH="$(build_prefix)/bin:$(PATH)"
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
$(1)_autoconf=./configure --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)"
ifneq ($($(1)_nm),)
$(1)_autoconf += NM="$$($(1)_nm)"

View File

@ -5,6 +5,9 @@ The package "mylib" will be used here as an example
General tips:
- mylib_foo is written as $(package)_foo in order to make recipes more similar.
- Secondary dependency packages relative to the Zcash binaries/libraries (i.e.
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) should
be built statically. See [below](#secondary-dependencies) for more details.
## Identifiers
Each package is required to define at least these variables:
@ -146,3 +149,38 @@ $($(package)_config_opts) will be appended.
Most autotools projects can be properly staged using:
$(MAKE) DESTDIR=$($(package)_staging_dir) install
## Build outputs:
In general, the output of a depends package should not contain any libtool
archives. Instead, the package should output `.pc` (`pkg-config`) files where
possible.
From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives):
> Libtool pulls in all direct and indirect dependencies into the .la files it
> creates. This leads to massive overlinking, which is toxic to the Gentoo
> ecosystem, as it leads to a massive number of unnecessary rebuilds.
## Secondary dependencies:
Secondary dependency packages relative to the Zcash binaries/libraries (i.e.
those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`)
should be built statically. The arguments for statically linking secondary
dependencies are similar to those for primary dependencies: it is preferable
for promptness of security updates; consensus compatibility; ease of
debugging and reproduction of user issues; avoiding unintended breakage
due to incompatible changes; and portability across OS distributions. It also
improves general build reliability as illustrated by the following example:
When linking an executable against a shared library `libprimary` that has its
own shared dependency `libsecondary`, we may need to specify the path to
`libsecondary` on the link command using the `-rpath/-rpath-link` options, it is
not sufficient to just say `libprimary`.
For us, it's much easier to just link a static `libsecondary` into a shared
`libprimary`. Especially because in our case, we are linking against a dummy
`libprimary` anyway that we'll throw away. We don't care if the end-user has a
static or dynamic `libseconday`, that's not our concern. With a static
`libseconday`, when we need to link `libprimary` into our executable, there's no
dependency chain to worry about as `libprimary` has all the symbols.

View File

@ -6,7 +6,7 @@ $(package)_sha256_hash=47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea2
$(package)_build_subdir=build_unix
define $(package)_set_vars
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication
$(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking
$(package)_config_opts_mingw32=--enable-mingw
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic

View File

@ -11,6 +11,7 @@ endef
define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
$(package)_config_opts += --disable-dependency-tracking --enable-option-checking
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic
@ -29,4 +30,5 @@ define $(package)_stage_cmds
endef
define $(package)_postprocess_cmds
rm lib/*.la
endef

View File

@ -1,11 +1,14 @@
package=zeromq
$(package)_version=4.3.1
$(package)_version=4.3.3
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=bcbabe1e2c7d0eec4ed612e10b94b112dd5f06fcefa994a0c79a45d835cd21eb
$(package)_sha256_hash=9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2
define $(package)_set_vars
$(package)_config_opts=--without-docs --disable-shared --disable-curve
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf
$(package)_config_opts += --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci
$(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking
$(package)_config_opts += --disable-drafts --enable-option-checking
$(package)_config_opts_linux=--with-pic
$(package)_config_opts_freebsd=--with-pic
$(package)_cxxflags=-std=c++11
@ -24,5 +27,5 @@ define $(package)_stage_cmds
endef
define $(package)_postprocess_cmds
rm -rf bin share
rm -rf bin share lib/*.la
endef

View File

@ -33,9 +33,10 @@ buffering or reassembly.
## Prerequisites
The ZeroMQ feature in Zcash requires ZeroMQ API version 4.x or
newer, which you will need to install if you are not using the depends
system. Typically, it is packaged by distributions as something like
The ZeroMQ feature in Zcash requires the ZeroMQ API >= 4.0.0
[libzmq](https://github.com/zeromq/libzmq/releases), which you will
need to install if you are not using the depends system.
Typically, it is packaged by distributions as something like
*libzmq5-dev*. The C++ wrapper for ZeroMQ is *not* needed.
In order to run the example Python client scripts in contrib/ one must

View File

@ -9,9 +9,6 @@ native_rust 1.45.0 2021-01-20
native_rust 1.45.1 2021-01-20
native_rust 1.45.2 2021-01-20
native_rust 1.46.0 2021-01-20
zeromq 4.3.2 2021-01-20
leveldb 1.19 2021-01-20
leveldb 1.20 2021-01-20
rust 1.45.0 2021-01-20
rust 1.45.1 2021-01-20

View File

@ -73,10 +73,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::CreateWithArguments(const
// Called at startup to conditionally set up ZMQ socket(s)
bool CZMQNotificationInterface::Initialize()
{
int major = 0, minor = 0, patch = 0;
zmq_version(&major, &minor, &patch);
LogPrint("zmq", "zmq: version %d.%d.%d\n", major, minor, patch);
LogPrint("zmq", "zmq: Initialize notification interface\n");
assert(!pcontext);
pcontext = zmq_init(1);
pcontext = zmq_ctx_new();
if (!pcontext)
{
@ -119,7 +123,7 @@ void CZMQNotificationInterface::Shutdown()
LogPrint("zmq", " Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
notifier->Shutdown();
}
zmq_ctx_destroy(pcontext);
zmq_ctx_term(pcontext);
pcontext = 0;
}