Nordix / hiredis-cluster

C client library for Valkey/Redis Cluster. This project is used and sponsored by Ericsson. It is a fork of the now unmaintained hiredis-vip.
BSD 3-Clause "New" or "Revised" License
87 stars 42 forks source link

Compilation error LIBEVENT_INCLUDES-NOTFOUND #170

Closed selcukaltinay closed 10 months ago

selcukaltinay commented 1 year ago

Hey everyone,

I'm taking an error when I try to compile hiredis-cluster with latest version of both hiredis and hircluster.

The compilation steps listed below;

mkdir build cmake .. -Dhiredis_DIR:PATH=$HIREDISPATH

Then the error occurs like listed below;

CMake Error in tests/CMakeLists.txt: Found relative path while evaluating include directories of "clusterclient_reconnect_async": "LIBEVENT_INCLUDES-NOTFOUND" I'm trying to use libevent library from /usr/lib64 and its already added to LD_LIBRARY_PATH.

I'm trying to fix another error. When I use the async apis for subscription, I'm taking crash. During publishing a message, the subscriber process giving a message like that redisProcessCallbacks: Assertion `(c->flags & 0x20 || c->flags & 0x40)' failed.

I assumed that the problem can be caused for this compilation error. Thanks for answers :)

bjosv commented 1 year ago

Lets see if I can cover all your issues.

To avoid the LIBEVENT_INCLUDES-NOTFOUND error you can use -DDISABLE_TESTS=ON as an argument to cmake, see build instructions. This will skip tests which require libevent.

If I understand correctly you have a specific hiredis downloaded which you want to use. Would this example help? Its an example of building hiredis and hiredis-cluster separate using CMake.

By default hiredis-cluster will download and build hiredis v1.1.0 in a CMake build, unless you disable that with -DDOWNLOAD_HIREDIS=OFF, see build options.

The assert seems to indicate that your build uses an old, possibly system-installed, hiredis.

zuiderkwast commented 1 year ago

Additionally, pubsub doesn't work in hiredis-cluster...

bjosv commented 10 months ago

Closing since the build instructions covers the issues. The missing pubsub support in covered by #27.