Skip to content

Commit 22dd7bf

Browse files
dzuttolaanwj
andauthored
Merge bitcoin#13578: [depends, zmq, doc] upgrade zeromq to 4.2.5 and avoid deprecated zeromq api functions (dashpay#4397)
f1bd03e [depends, zmq, doc] upgrade zeromq to 4.2.5 and avoid deprecated zeromq api functions (mruddy) Pull request description: Upgrade the ZeroMQ dependency from version 4.2.3 to the latest stable version 4.2.5. This PR Follows the lead of bitcoin#11986. I upgraded both patch files to correspond to the version `4.2.5` libzmq files. I assume doing so is still necessary and correct. Without updating the patch line numbers, things appear to work, but you get extra log messages while building `depends` because things don't exactly match, e.g.: ``` /bitcoin/depends> make zeromq Extracting zeromq... /bitcoin/depends/sources/zeromq-4.2.5.tar.gz: OK Preprocessing zeromq... patching file src/windows.hpp Hunk #1 succeeded at 58 (offset 3 lines). patching file src/thread.cpp Hunk #1 succeeded at 307 with fuzz 2 (offset 87 lines). Hunk #2 succeeded at 323 with fuzz 2 (offset 90 lines). ``` Updating the patches seemed cleaner, so I did it. Note that libzmq had some whitespace changes, so that's why the updated patches do too. More info: https://github.com/zeromq/libzmq/releases/tag/v4.2.5 tags: libzmq, zmq, 0mq Tree-SHA512: 78659dd276b5311e40634b1bbebb802ddd6b69662ba3c84995ef1e3795c49a78b1635112c7fd72a405ea36e2cc3bdeb84e6d00d4e491a349bba1dafff50e2fa5 Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com>
1 parent 0c1ad8c commit 22dd7bf

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

depends/packages/zeromq.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package=zeromq
2-
$(package)_version=4.2.3
2+
$(package)_version=4.2.5
33
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
5-
$(package)_sha256_hash=8f1e2b2aade4dbfde98d82366d61baef2f62e812530160d2e6d0a5bb24e40bc0
5+
$(package)_sha256_hash=cc9090ba35713d59bb2f7d7965f877036c49c5558ea0c290b0dcc6f2a17e489f
66

77
define $(package)_set_vars
88
$(package)_config_opts=--without-docs --disable-shared --disable-curve --disable-curve-keygen --disable-perf --disable-Werror --disable-drafts

doc/zmq.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ buffering or reassembly.
3333

3434
## Prerequisites
3535

36-
The ZeroMQ feature in Dash Core requires ZeroMQ API version 4.x or
37-
newer. Typically, it is packaged by distributions as something like
36+
The ZeroMQ feature in Dash Core requires the ZeroMQ API >= 4.0.0
37+
[libzmq](https://github.com/zeromq/libzmq/releases).
38+
For version information, see [dependencies.md](dependencies.md).
39+
Typically, it is packaged by distributions as something like
3840
*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed.
3941

4042
In order to run the example Python client scripts in the `contrib/zmq/`

src/zmq/zmqnotificationinterface.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::Create()
8484
// Called at startup to conditionally set up ZMQ socket(s)
8585
bool CZMQNotificationInterface::Initialize()
8686
{
87+
int major = 0, minor = 0, patch = 0;
88+
zmq_version(&major, &minor, &patch);
89+
LogPrint(BCLog::ZMQ, "zmq: version %d.%d.%d\n", major, minor, patch);
90+
8791
LogPrint(BCLog::ZMQ, "zmq: Initialize notification interface\n");
8892
assert(!pcontext);
8993

90-
pcontext = zmq_init(1);
94+
pcontext = zmq_ctx_new();
9195

9296
if (!pcontext)
9397
{
@@ -117,7 +121,7 @@ void CZMQNotificationInterface::Shutdown()
117121
LogPrint(BCLog::ZMQ, "zmq: Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
118122
notifier->Shutdown();
119123
}
120-
zmq_ctx_destroy(pcontext);
124+
zmq_ctx_term(pcontext);
121125

122126
pcontext = nullptr;
123127
}

0 commit comments

Comments
 (0)