Skip to content

Commit b6baf6d

Browse files
dzuttolaanwj
authored andcommitted
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 <[email protected]>
1 parent 0864ced commit b6baf6d

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

depends/packages/zeromq.mk

Lines changed: 2 additions & 2 deletions
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 --without-libsodium --disable-curve --disable-curve-keygen --disable-perf --disable-Werror

doc/zmq.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ buffering or reassembly.
3333

3434
## Prerequisites
3535

36-
The ZeroMQ feature in Cosanta Core requires ZeroMQ API version 4.x or
37-
newer. Typically, it is packaged by distributions as something like
36+
The ZeroMQ feature in Cosanta 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 contrib/ one must

src/zmq/zmqnotificationinterface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,14 @@ CZMQNotificationInterface* CZMQNotificationInterface::Create()
9696
// Called at startup to conditionally set up ZMQ socket(s)
9797
bool CZMQNotificationInterface::Initialize()
9898
{
99+
int major = 0, minor = 0, patch = 0;
100+
zmq_version(&major, &minor, &patch);
101+
LogPrint(BCLog::ZMQ, "zmq: version %d.%d.%d\n", major, minor, patch);
102+
99103
LogPrint(BCLog::ZMQ, "zmq: Initialize notification interface\n");
100104
assert(!pcontext);
101105

102-
pcontext = zmq_init(1);
106+
pcontext = zmq_ctx_new();
103107

104108
if (!pcontext)
105109
{
@@ -142,7 +146,7 @@ void CZMQNotificationInterface::Shutdown()
142146
LogPrint(BCLog::ZMQ, " Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress());
143147
notifier->Shutdown();
144148
}
145-
zmq_ctx_destroy(pcontext);
149+
zmq_ctx_term(pcontext);
146150

147151
pcontext = nullptr;
148152
}

0 commit comments

Comments
 (0)