-
Notifications
You must be signed in to change notification settings - Fork 34
.travis: Fix installation of non-stock cppzmq #598
Conversation
To be fair, NON_STOCK_CPPZMQ was added in 86174ee and the logic simply reproduced what we had before where we were installing a custom cppzmq version on all Debian versions except Debian 8 which was already coming with a compatible zmq.hpp In the mean time, the compilation issue when using these different zmq.hpp files versions got fixed, so I think it is a good idea to do the tests with the zmq.hpp file coming from the Debian distribution. |
7a339cc to
4954113
Compare
|
@bourtemb Thx. I've corrected the referenced commit. |
|
The wheezy build fails with the stock cppzmq. The version check for the zmq socket having the disconnect method is wrong. It currently reads but this check the libzmq version and not the cppzmq version. A proper solution would be to instead of checking the version checking the existance of the method in cmake and set the define from that. Or just use a non-stock cppzmq for wheezy. |
I agree this would be the cleanest. Could you please do that? |
4954113 to
b4f7b5b
Compare
|
@bourtemb I've added a feature check for zmq::socket::disconnect. I'm only doing that on non-windows platforms, as windows should be unproblematic. Let's see what CI says. |
b4f7b5b to
ec6650b
Compare
|
@bourtemb Wheezy now builds with stock cppzmq. |
|
Thanks for the fix. For the Tango source distribution, we are still using the autotools. We are in a strange situation where CMake is actually used to generate some files ( I think we may have to do something on the autoconf side to make it work for this use case, or we should provide a different package version, or instructions for the persons using an old version of zmq.hpp file, or a configure flag, ...? There is a plan in the future to use CMake instead of configure to compile cpptango in the source distribution provided to the users. |
I'll find a autoconf version as well. |
|
I did some research and I think we don't need to do anything. In the tango source distribution configure.ac file https://github.com/tango-controls/TangoSourceDistribution/blob/8a63f208b27c6cec36b76a24cdc02b673804da25/assets/configure.ac#L194 we require libzmq >=4.05. This is the version which was shipped with debian jessie (oldoldstable). And I just looked into that package and there zmq::socket_t::disconnect exists. According to https://docs.travis-ci.com/user/reference/linux#default travis uses ubuntu xenial by default so cmake (running on travis) and the user running |
Debian Jessie (Debian 8) is fine... And this exactly why we didn't need to install a recent version of cppzmq on Debian 8 travis tests.
Not if the user is on an old debian 7 (or older) without the correct cppzmq... We can also consider it is his responsibility to get it right (or to use a more recent OS), but then we need to document it well. I think there is something we can improve too in this PR. It is to avoid to clone cppzmq repository when STOCK_CPPZMQ=ON |
In 86174ee (Travis Tests: Avoid code duplication, 2019-06-05) we added support for using the environment variable NON_STOCK_CPPZMQ to say if we use the stock version or the non-stock version. That commit got the logic wrong. Flip the naming to have now one less negation. STOCK_CPPZMQ=ON means that the system cppzmq is used, =OFF that we use the latest cppzmq from the repo.
Since 9c02de3 (- Commit after merge with NextRelease branch at release 22135, 2013-02-22) we check the libzmq version to decide if cppzmq's socket class has a disconnect method or not. This currently fails on debian wheezy. As that is also the wrong approach in general, we now use a compilation test in the cmake setup phase to determine if we have the disconnect method or not. This is only done on non-Windows platforms, on Windows we assume that we have a disconnect method (we currently always compile against a cppzmq version which has it). In addition the define got also renamed from ZMQ_HAS_DISCONNECT to TANGO_ZMQ_HAS_DISCONNECT to make it clear that this is our define.
ec6650b to
907aae9
Compare
Done.
I'll add an autotools check as well, see tango-controls/TangoSourceDistribution#54.
I've opened #606 to enhance the installation instructions. |
bourtemb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good to me.
(Adapted from fedback in #598 (comment))