On macOS, the version suffix of a shared library comes before the
`.dylib` suffix, which is different from the convention on other
systems. Currently, the Makefile only overrides `DYLIB_MINOR_NAME` for
macOS, but does not handle the other similar variables, namely
`DYLIB_MAJOR_NAME`, `SSL_DYLIB_MINOR_NAME`, and `SSL_DYLIB_MAJOR_NAME`.
This commit fixes the issue by overriding all these variables for macOS.
Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
This change addresses the issue discussed in #1202 and should make it
possible in the future to update minor versions without requiring
re-linking binaries.
The installation path for openssl may vary depending on the way
used for its installation and the macOS version.
This commit attempts to find the correct path for openssl to use.
Improve coverage (#734)
* Remove duplicate tests
- double covered by:
"Can parse RESP3 doubles"
- bool covered via:
"Can parse RESP3 bool"
* Make (connect) timeout in test config general
* Set error string in Unix connect with invalid timeout
Restructure testcase since redisConnectWithTimeout() and
redisConnectUnixWithTimeout() now behaves similar.
* Use quiet flag in lcov/genhtml instead of piping to /dev/null
* Fixup of redisCommandArgv test case
* Update test case to match what it covers
Use new test case info text since the previous one seemed copy&pasted.
The sought coverage was the handling of the parent-chaining
for a double object, which the test case now focuses on.
Co-authored-by: Ariel <ashtul@gmail.com>
* Update include example in README
* Update pkg-config installed via CMake
Gives the include directory to enable the use of:
#include <hiredis/hiredis.h>
but keeps the existing include dir. for backwards compatibility.
Example:
> pkg-config hiredis --cflags
-D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include
* Update pkg-config installed via Make
Gives the include directory to enable the use of:
#include <hiredis/hiredis.h>
but keeps the existing include path for backwards compatibility.
Example:
> pkg-config hiredis --cflags
-D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include
* Add docker support to test.sh
specifying a REDIS_DOCKER env var will run this as a server.
* Add initial test workflow
* Add workflow test to test 32 bit build
* Add ARM x compilation tests
* Add tests for windows platform
* Test with valgrind
Move SSL options into two blocks to make it easy to read:
1, first part: SSL variables part
1, second part: SSL building rules part
and change global rules to make it easy to maintain. For the further
step, it gets extensible to add another type.
New version of the library building rule:
static: $(STLIBNAME) $(SSL_STLIB)
dynamic: $(DYLIBNAME) $(SSL_DYLIB)
Compare with the orignal version:
dynamic: $(DYLIBNAME)
static: $(STLIBNAME)
ifeq ($(USE_SSL),1)
dynamic: $(SSL_DYLIBNAME)
static: $(SSL_STLIBNAME)
endif
If we want to add a new type(Ex, RDMA), for the new version, we can
do like this:
########### RDMA variables start ###############
.....
########### RDMA variables end ###############
static: $(STLIBNAME) $(SSL_STLIB) $(RDMA_STLIB)
dynamic: $(DYLIBNAME) $(SSL_DYLIB) $(RDMA_DYLIB)
########### RDMA building rules start ###############
.....
########### RDMA building rules end ###############
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
* BSD linkage fix proposal
* Touch up the Makefile to fix BSD builds
Fixes#984
* Add a build in FreeBSD to GitHub Actions
Lots of people use hiredis in FreeBSD so this should reduce some pain
moving forward.
Co-authored-by: David Carlier <devnexen@gmail.com>
Asynchronous testcases that requires the event library `libevent`
can be built and enabled by using the added build flags:
- ENABLE_ASYNC_TESTS when using CMake
- TEST_ASYNC when using Make
The async tests are disabled by default to avoid adding new requirements,
but the testcases are built and run in CI.
* Exclude includes from /usr in coverage reporting
* Correct build target `coverage` for enabled ssl
`USE_SSL=1 make coverage` will now build the test binary with the
forwarded define HIREDIS_TEST_SSL. This avoids inconsistency between
built test binary and the testrunner `test.sh`.
This enables test coverage measurements for SSL too.
Proper support for RESP3 PUSH messages.
By default, PUSH messages are now intercepted and the reply memory freed.
This means existing code should work unchanged when connecting to Redis
>= 6.0.0 even if `CLIENT TRACKING` were then enabled.
Additionally, we define two callbacks users can configure if they wish to handle
these messages in a custom way:
void redisPushFn(void *privdata, void *reply);
void redisAsyncPushFn(redisAsyncContext *ac, void *reply);
See #825
* Adds an indirection to every allocation/deallocation to allow users to
plug in ones of their choosing (use custom functions, jemalloc, etc).
* Gracefully handle OOM everywhere in hiredis. This should make it possible
for users of the library to have more flexibility in how they handle such situations.
* Changes `redisReaderTask->elements` from an `int` to a `long long` to prevent
a possible overflow when transferring the task elements into a `redisReply`.
* Adds a configurable `max elements` member to `redisReader` that defaults to
2^32 - 1. This can be set to "unlimited" by setting the value to zero.
* Fix linker problems when building with SSL enabled on OSX
* Corrects `HIREDIS_SSL=ON` to `USE_SSL=ON` so we test building with
SSL enabled on travis.
-dynamiclib is the correct documented flag to use to create dynamic
libraries on macOS. Newer toolchains recognize -shared as a synonym
of -dynamiclib but older toolchains don't.