Skip to content

Commit 3315e6d

Browse files
authored
feat: Update to hiredis 1.3 (#485)
CMake removed support for projects targeting CMake 3.5, hiredis 1.3 moved to CMake 3.7. Both are less than our required version. This also updates redis-plus-plus which is a C++ wrapper around hiredis. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Upgrades Redis dependencies (hiredis 1.3, newer redis-plus-plus), switches to new redis++ include path, updates CI to Boost 1.87 using Boost_DIR, and suppresses AppleClang deprecated-builtin warnings. > > - **Build/CMake**: > - Update `cmake/redis-plus-plus.cmake` to hiredis `1.3.0` and a newer `redis-plus-plus` commit; adjust `SOURCE_DIR` for hiredis. > - Add compile options to suppress `-Wno-deprecated-builtins` for Clang/AppleClang in `CMakeLists.txt`. > - **Redis Integration**: > - Replace `#include <redis++.h>` with `#include <sw/redis++/redis++.h>` across Redis source/tests. > - **CI/CD**: > - Windows workflows move from Boost 1.81 to 1.87 and pass `Boost_DIR`; add `Boost_DIR` env to composite CI and Windows release step. > - **Docs**: > - `cmake-tests/README.md` now documents `Boost_DIR` instead of `BOOST_ROOT`. > - **Vendor**: > - Bump `vendor/foxy/cmake/certify.cmake` to a newer commit. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1b2488c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent e33f2b1 commit 3315e6d

File tree

12 files changed

+32
-17
lines changed

12 files changed

+32
-17
lines changed

.github/actions/ci/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ runs:
4949
run: ./scripts/build.sh ${{ inputs.cmake_target }} ON
5050
env:
5151
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
52+
Boost_DIR: ${{ steps.install-boost.outputs.Boost_DIR }}
5253
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
5354
- name: Build Tests
5455
id: build-tests
@@ -57,6 +58,7 @@ runs:
5758
run: ./scripts/build.sh gtest_${{ inputs.cmake_target }} ON
5859
env:
5960
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
61+
Boost_DIR: ${{ steps.install-boost.outputs.Boost_DIR }}
6062
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
6163
- name: Run Tests
6264
if: steps.build-tests.outcome == 'success'
@@ -80,3 +82,4 @@ runs:
8082
env:
8183
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
8284
OPENSSL_ROOT_DIR: ${{ steps.install-openssl.outputs.OPENSSL_ROOT_DIR }}
85+
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'

.github/workflows/client.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ jobs:
5858
- uses: ilammy/msvc-dev-cmd@v1
5959
- uses: ./.github/actions/ci
6060
env:
61-
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
62-
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
61+
BOOST_LIBRARY_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
62+
BOOST_LIBRARYDIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
63+
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
6364
with:
6465
cmake_target: launchdarkly-cpp-client
6566
platform_version: 2022

.github/workflows/cmake.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- uses: ilammy/msvc-dev-cmd@v1
3838
- uses: ./.github/actions/cmake-test
3939
env:
40-
BOOST_ROOT: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
40+
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
4141
with:
4242
platform_version: 2022
4343
toolset: msvc

.github/workflows/server-redis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ jobs:
4444
- uses: ilammy/msvc-dev-cmd@v1
4545
- uses: ./.github/actions/ci
4646
env:
47-
BOOST_LIBRARY_DIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
48-
BOOST_LIBRARYDIR: 'C:\local\boost_1_81_0\lib64-msvc-14.3'
47+
BOOST_LIBRARY_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
48+
BOOST_LIBRARYDIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3'
49+
Boost_DIR: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0'
4950
with:
5051
cmake_target: launchdarkly-cpp-server-redis-source
5152
platform_version: 2022

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ project(
1212
LANGUAGES CXX C
1313
)
1414

15+
# Boost is using some deprecated built-ins which causes build errors when compiling foxy on mac.
16+
# For now disable the warnings for deprecated built-ins while using Apple's toolchains.
17+
add_compile_options(
18+
$<$<OR:$<C_COMPILER_ID:Clang>,$<C_COMPILER_ID:AppleClang>>:-Wno-deprecated-builtins>
19+
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Wno-deprecated-builtins>
20+
)
21+
22+
1523
# Allow BOOST_ROOT to be set by CI without warnings.
1624
if (POLICY CMP0074)
1725
cmake_policy(SET CMP0074 NEW)

cmake-tests/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ Without setting these, the test would fail to build with the same compilers as t
5151

5252
Additionally, certain variables must be forwarded to each test project CMake configuration.
5353

54-
| Variable | Explanation |
55-
|--------------------|------------------|
56-
| `BOOST_ROOT` | Path to Boost. |
57-
| `OPENSSL_ROOT_DIR` | Path to OpenSSL. |
54+
| Variable | Explanation |
55+
|--------------------|---------------------------------------------------------------------------------------------------------|
56+
| `Boost_DIR` | Path to boost CMAKE configuration. Example: 'C:\local\boost_1_87_0\lib64-msvc-14.3\cmake\Boost-1.87.0' |
57+
| `OPENSSL_ROOT_DIR` | Path to OpenSSL. |
5858

5959
## Tests
6060

cmake/redis-plus-plus.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ include(FetchContent)
55

66
FetchContent_Declare(hiredis
77
GIT_REPOSITORY https://github.com/redis/hiredis.git
8-
GIT_TAG 60e5075d4ac77424809f855ba3e398df7aacefe8
8+
# 1.3.0
9+
GIT_TAG ccad7ebaf99310957004661d1c5f82d2a33ebd10
910
GIT_SHALLOW TRUE
10-
SOURCE_DIR _deps/hiredis
11+
SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/hiredis
1112
OVERRIDE_FIND_PACKAGE
1213
)
1314

@@ -22,7 +23,8 @@ set(REDIS_PLUS_PLUS_BUILD_TEST OFF CACHE BOOL "" FORCE)
2223
# when it tries to do feature detection on hiredis.
2324
FetchContent_Declare(redis-plus-plus
2425
GIT_REPOSITORY https://github.com/sewenew/redis-plus-plus.git
25-
GIT_TAG 1.3.7
26+
# Post 1.3.15. Required to support FetchContent post 1.3.7 where it was broken.
27+
GIT_TAG 84f37e95d9112193fd433f65402d3d183f0b9cf7
2628
GIT_SHALLOW TRUE
2729
)
2830

libs/server-sdk-redis-source/src/bindings/redis/redis_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <launchdarkly/detail/c_binding_helpers.hpp>
66
#include <launchdarkly/error.hpp>
77

8-
#include <redis++.h>
8+
#include <sw/redis++/redis++.h>
99

1010
using namespace launchdarkly::server_side::integrations;
1111

libs/server-sdk-redis-source/src/redis_source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <launchdarkly/server_side/integrations/redis/redis_source.hpp>
22

3-
#include <redis++.h>
3+
#include <sw/redis++/redis++.h>
44

55
namespace launchdarkly::server_side::integrations {
66
tl::expected<std::unique_ptr<RedisDataSource>, std::string>

libs/server-sdk-redis-source/tests/prefixed_redis_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <launchdarkly/serialization/json_segment.hpp>
55

66
#include <gtest/gtest.h>
7-
#include <redis++.h>
7+
#include <sw/redis++/redis++.h>
88
#include <boost/json.hpp>
99

1010
#include <string>

0 commit comments

Comments
 (0)