-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcompat.redis-plus-plus.lua
More file actions
169 lines (160 loc) · 8.14 KB
/
Copy pathcompat.redis-plus-plus.lua
File metadata and controls
169 lines (160 loc) · 8.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
-- compat.redis-plus-plus — redis-plus-plus 1.3.13, C++ client for Redis.
--
-- Shape A (C++-source compat) with one small Shape-E trait: the single header
-- upstream's CMake would generate (hiredis_features.h) is snapshotted through
-- generated_files — exactly like compat.curl's curl_config.h. The base build
-- is the SYNC client only (17 TUs from upstream CMake's
-- `REDIS_PLUS_PLUS_SOURCES` plus patterns/redlock.cpp); async (libuv) and TLS
-- (OpenSSL) TUs are not compiled, so this package has exactly one dependency:
-- compat.hiredis.
--
-- INCLUDE LAYOUT mirrors upstream's own target_include_directories:
-- */src -> `#include <sw/redis++/redis++.h>`
-- */src/sw/redis++/cxx17 -> `sw/redis++/cxx_utils.h` (the C++17 variant,
-- selected because mcpp compiles C++23)
-- */src/sw/redis++/no_tls -> `sw/redis++/tls.h` (upstream's no-op TLS stub)
-- mcpp_generated -> the generated hiredis_features.h
-- The compat.hiredis dependency's include dirs propagate, so
-- `<hiredis/hiredis.h>` resolves through its `hiredis/` wrapper headers.
--
-- generated_files snapshot: connection.h includes
-- `sw/redis++/hiredis_features.h`, which upstream produces via
-- configure_file(hiredis_features.h.in). hiredis 1.2.0 HAS
-- redisEnableKeepAliveWithInterval, so the define is on.
--
-- VERSION / MULTI-VERSION UNION. Two versions today, one on each side of the
-- source-structure watershed:
-- * 1.3.13 (2024-10) — the classic stable release, long-standing vcpkg/conan
-- default before the 2025 releases; 1.3.6+ all share this exact source list
-- (diffed against 1.3.15: identical .cpp set), so 1.3.14/1.3.15 later are
-- just new xpm rows.
-- * 1.3.3 (2021-12) — the pre-watershed structure: 15 sync TUs (it lacks
-- redis_uri.cpp and patterns/redlock.cpp, both added in 1.3.6+), no
-- hiredis_features.h (connection.h never includes it, so the generated
-- header is simply unused), and its no_tls stub is FLAT (no_tls/tls.h,
-- included as "tls.h") instead of namespaced.
-- One mcpp block serves both because the two layouts are a SUBSET/SUPERSET
-- pair (same trick as compat.catch2's disjoint union, but simpler): the source
-- list below is 1.3.13's 17 TUs, and for 1.3.3 exactly two globs match nothing
-- (redis_uri.cpp, patterns/redlock.cpp) — a zero-hit glob is a warning, not an
-- error. Re-check the table when adding a version (mcpp-community/mcpp#290 is
-- the long-term per-version build blocks that removes this assumption).
--
-- No CN mirror yet: plain-string upstream URL (see compat.hiredis).
package = {
spec = "1",
namespace = "compat",
name = "redis-plus-plus",
description = "C++ client for Redis (sync API; built from source, depends on compat.hiredis)",
licenses = {"Apache-2.0"},
repo = "https://github.com/sewenew/redis-plus-plus",
type = "package",
xpm = {
linux = {
["1.3.3"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.3.tar.gz",
sha256 = "23689059b7ba50fcd8fa673c5dbb7bdb010b896b14abad5aa80a5ec48eb64f26",
},
["1.3.13"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.13.tar.gz",
sha256 = "678a61898ed72f0c692102c7ce103a1bcae1e6ff85a4ad03e6002c1ba8fe1e08",
},
},
macosx = {
["1.3.3"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.3.tar.gz",
sha256 = "23689059b7ba50fcd8fa673c5dbb7bdb010b896b14abad5aa80a5ec48eb64f26",
},
["1.3.13"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.13.tar.gz",
sha256 = "678a61898ed72f0c692102c7ce103a1bcae1e6ff85a4ad03e6002c1ba8fe1e08",
},
},
windows = {
["1.3.3"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.3.tar.gz",
sha256 = "23689059b7ba50fcd8fa673c5dbb7bdb010b896b14abad5aa80a5ec48eb64f26",
},
["1.3.13"] = {
url = "https://github.com/sewenew/redis-plus-plus/archive/refs/tags/1.3.13.tar.gz",
sha256 = "678a61898ed72f0c692102c7ce103a1bcae1e6ff85a4ad03e6002c1ba8fe1e08",
},
},
},
mcpp = {
language = "c++23",
import_std = false,
include_dirs = {
"*/src",
"*/src/sw/redis++/cxx17",
"*/src/sw/redis++/no_tls",
"*/src/sw/redis++/future/std", -- async only: "sw/redis++/async_utils.h"
"mcpp_generated",
},
-- Upstream CMake `REDIS_PLUS_PLUS_SOURCES` (sync core) +
-- patterns/redlock.cpp. async_*.cpp / event_loop.cpp /
-- tls/sw/redis++/tls.cpp are intentionally absent — they need
-- libuv / OpenSSL, which this base build does not pull in.
sources = {
"*/src/sw/redis++/command.cpp",
"*/src/sw/redis++/command_options.cpp",
"*/src/sw/redis++/connection.cpp",
"*/src/sw/redis++/connection_pool.cpp",
"*/src/sw/redis++/crc16.cpp",
"*/src/sw/redis++/errors.cpp",
"*/src/sw/redis++/pipeline.cpp",
"*/src/sw/redis++/redis.cpp",
"*/src/sw/redis++/redis_cluster.cpp",
"*/src/sw/redis++/redis_uri.cpp",
"*/src/sw/redis++/reply.cpp",
"*/src/sw/redis++/sentinel.cpp",
"*/src/sw/redis++/shards.cpp",
"*/src/sw/redis++/shards_pool.cpp",
"*/src/sw/redis++/subscriber.cpp",
"*/src/sw/redis++/transaction.cpp",
"*/src/sw/redis++/patterns/redlock.cpp",
},
-- `async` — upstream REDIS_PLUS_PLUS_BUILD_ASYNC=libuv: the 9 async
-- TUs (event_loop.cpp runs uv_run on a background thread) plus the
-- compat.libuv dependency. For 1.3.3 exactly two of the nine globs
-- match nothing (async_subscriber*.cpp were added in 1.3.6) — the
-- same subset/superset union as the sync core. The include dirs the
-- async TUs need (<uv.h> from compat.libuv, <hiredis/adapters/libuv.h>
-- from compat.hiredis) arrive through the deps' propagated include
-- dirs when this feature is active.
features = {
["async"] = {
sources = {
"*/src/sw/redis++/async_connection.cpp",
"*/src/sw/redis++/async_connection_pool.cpp",
"*/src/sw/redis++/async_redis.cpp",
"*/src/sw/redis++/async_redis_cluster.cpp",
"*/src/sw/redis++/async_sentinel.cpp",
"*/src/sw/redis++/async_shards_pool.cpp",
"*/src/sw/redis++/async_subscriber.cpp",
"*/src/sw/redis++/async_subscriber_impl.cpp",
"*/src/sw/redis++/event_loop.cpp",
},
deps = { ["compat.libuv"] = "1.48.0" },
},
},
targets = { ["redis_plus_plus"] = { kind = "lib" } },
deps = { ["compat.hiredis"] = "1.2.0" },
generated_files = {
["mcpp_generated/sw/redis++/hiredis_features.h"] = "#define REDIS_PLUS_PLUS_HAS_redisEnableKeepAliveWithInterval\n",
},
-- 1.3.3's utils.h declares `uint16_t crc16(...)` WITHOUT including
-- <cstdint> (upstream added the include in 1.3.6+). clang's libc++
-- pulls it in transitively, but the vendored gcc/libstdc++ sysroot
-- does not, so the 1.3.3 build fails with "'uint16_t' does not name a
-- type" on the linux-default (gcc) CI leg. -include cstdint forces the
-- header into every C++ TU; harmless for 1.3.13 (which includes it
-- itself). Recipe repair with CI regression evidence (PR #188).
cxxflags = { "-include", "cstdint" },
windows = {
-- Upstream CMake adds NOMINMAX to its static-lib target on WIN32;
-- ws2_32 arrives through compat.hiredis' propagated ldflags.
cxxflags = { "-DNOMINMAX" },
},
},
}