[Feature request] Conan recipe to build C++ client and publication to conan-center
Conan.io is a popular C++ package manager. It would be very handy to have a conan recipe to build the C++ client. It would make it easy to build even on Windows, even with MSVC. Ultimately, you could pre-build conan packages for various platforms and compilers and publish them to conan-center so that it's easy to include the client lib in a conan-enabled project.
I checked and all dependencies used by the C++ client seem to exist in conan except log4cxx (but it is optional, isn't it ?):
Boost, OpenSSL, zlib, json-cpp, curl, gtest/gmock --> conan-center
Boost-Python, protobuf --> bincrafters
Also the only Linux-only dependency seems to be the crc32 lib. Couldn't it be possible to use a cross-platform CRC32 so that the client can be built on Windows ?
Related to apache/pulsar#15 apache/pulsar#2461 apache/pulsar#2680
@cbornet I don't have any experience with Conan.io but it seems to be a good way to package the client lib.
log4cxx (but it is optional, isn't it ?):
Yes, log4cxx is optional and disabled by default
Boost-Python, protobuf --> bincrafters
boost-python is only needed at compile time (and we should refactor the CMakeList.txt to not require it at compile time as it's only used to build the python client wrapper).
Also the only Linux-only dependency seems to be the crc32 lib. Couldn't it be possible to use a cross-platform CRC32 so that the client can be built on Windows ?
We don't depend on crc32 libraries. We have a crc32-c implementation imported in our sources.
We don't depend on crc32 libraries. We have a crc32-c implementation imported in our sources.
Yes. My point was more that this crc32-c implementation depends on pthread which is not natively supported on windows. Sorry for not being clear enough. But there's actually a conan package for pthread on windows so maybe it could be used.
Oh, I see : https://github.com/apache/pulsar/blob/579e0dc74039c081301662e5fd55209c1a4abe5c/pulsar-client-cpp/lib/checksum/crc32c_sw.cc#L47
It should be easy to just switch to same thing from boost https://www.boost.org/doc/libs/1_68_0/doc/html/thread/synchronization.html#thread.synchronization.once
We actually use that in another place: https://github.com/apache/pulsar/blob/8b2929b3e5403fb44653976dc74be287666f7b96/pulsar-client-cpp/lib/c/c_MessageId.cc#L37
Yes that's even better
ITNOA
__builtin_expect does not exist in Windows on MSVC, did you any plan to resolve this?
I think vcpkg is popular package manager too, so I think adding pulsar to vcpkg is important too, but we can see many errors on this procedure
related to apache/pulsar#3800