diff options
| author | Remi Collet <remi@remirepo.net> | 2026-04-29 10:12:26 +0200 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2026-04-29 10:12:26 +0200 |
| commit | 9a6befc359f5f645723a20f8e2da70763078b2ac (patch) | |
| tree | 0ecd7f4682f65e7ea06568f280f00e1d99c08ddc | |
| parent | f749de279c602dde6a49cc046a7f2bc03f2defcc (diff) | |
drop rdma patch, keep upstream feature to dlopen librdmacm and libibverbs
Drop lua module (built statically)
| -rw-r--r-- | valkey-loadmod.patch | 128 | ||||
| -rw-r--r-- | valkey-lua.patch | 54 | ||||
| -rw-r--r-- | valkey-rdma.patch | 26 | ||||
| -rw-r--r-- | valkey.spec | 21 |
4 files changed, 68 insertions, 161 deletions
diff --git a/valkey-loadmod.patch b/valkey-loadmod.patch index 74c016e..5fcd2f0 100644 --- a/valkey-loadmod.patch +++ b/valkey-loadmod.patch @@ -1,23 +1,7 @@ -From cae829f497550d175331d3d6cd0bbf4aed0965a4 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Sat, 4 Oct 2025 07:23:52 +0200 -Subject: [PATCH] Fix #2678 don't add loadmodule when from config - -only protect loadmodule from include files - -Signed-off-by: Remi Collet <remi@remirepo.net> ---- - src/config.c | 8 ++++++-- - src/module.c | 17 ++++++++++++----- - src/module.h | 4 ++-- - src/server.c | 2 +- - 4 files changed, 21 insertions(+), 10 deletions(-) - -diff --git a/src/config.c b/src/config.c -index 93ef289e3..dc4116383 100644 ---- a/src/config.c -+++ b/src/config.c -@@ -450,6 +450,8 @@ static int updateClientOutputBufferLimit(sds *args, int arg_len, const char **er +diff -up ./src/config.c.loadmod ./src/config.c +--- ./src/config.c.loadmod 2026-04-28 18:32:37.000000000 +0200 ++++ ./src/config.c 2026-04-29 09:34:55.668568785 +0200 +@@ -455,6 +455,8 @@ static int updateClientOutputBufferLimit * within conf file parsing. This is only needed to support the deprecated * abnormal aggregate `save T C` functionality. Remove in the future. */ static int reading_config_file; @@ -26,7 +10,7 @@ index 93ef289e3..dc4116383 100644 void loadServerConfigFromString(sds config) { deprecatedConfig deprecated_configs[] = { -@@ -541,7 +543,9 @@ void loadServerConfigFromString(sds config) { +@@ -547,7 +549,9 @@ void loadServerConfigFromString(sds conf /* Execute config directives */ if (!strcasecmp(argv[0], "include") && argc == 2) { @@ -36,7 +20,7 @@ index 93ef289e3..dc4116383 100644 } else if (!strcasecmp(argv[0], "rename-command") && argc == 3) { struct serverCommand *cmd = lookupCommandBySds(argv[1]); -@@ -574,7 +578,7 @@ void loadServerConfigFromString(sds config) { +@@ -580,7 +584,7 @@ void loadServerConfigFromString(sds conf goto loaderr; } } else if (!strcasecmp(argv[0], "loadmodule") && argc >= 2) { @@ -45,20 +29,19 @@ index 93ef289e3..dc4116383 100644 } else if (strchr(argv[0], '.')) { if (argc < 2) { err = "Module config specified without value"; -@@ -1618,7 +1622,7 @@ void rewriteConfigLoadmoduleOption(struct rewriteConfigState *state) { - while ((de = dictNext(di)) != NULL) { +@@ -1625,7 +1629,7 @@ void rewriteConfigLoadmoduleOption(struc struct ValkeyModule *module = dictGetVal(de); + if (module->is_static_module) continue; line = moduleLoadQueueEntryToLoadmoduleOptionStr(module, "loadmodule"); - rewriteConfigRewriteLine(state, "loadmodule", line, 1); + if (line) rewriteConfigRewriteLine(state, "loadmodule", line, 1); } dictReleaseIterator(di); /* Mark "loadmodule" as processed in case modules is empty. */ -diff --git a/src/module.c b/src/module.c -index de5a5510e..2638268e1 100644 ---- a/src/module.c -+++ b/src/module.c -@@ -84,6 +84,7 @@ +diff -up ./src/module.c.loadmod ./src/module.c +--- ./src/module.c.loadmod 2026-04-28 18:32:37.000000000 +0200 ++++ ./src/module.c 2026-04-29 09:47:30.216571253 +0200 +@@ -83,6 +83,7 @@ struct moduleLoadQueueEntry { sds path; @@ -75,7 +58,7 @@ index de5a5510e..2638268e1 100644 int i; struct moduleLoadQueueEntry *loadmod; -@@ -687,6 +688,7 @@ void moduleEnqueueLoadModule(sds path, sds *argv, int argc) { +@@ -687,6 +688,7 @@ void moduleEnqueueLoadModule(sds path, s loadmod->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL; loadmod->path = sdsnew(path); loadmod->argc = argc; @@ -83,7 +66,7 @@ index de5a5510e..2638268e1 100644 for (i = 0; i < argc; i++) { loadmod->argv[i] = createRawStringObject(argv[i], sdslen(argv[i])); } -@@ -697,6 +699,10 @@ sds moduleLoadQueueEntryToLoadmoduleOptionStr(ValkeyModule *module, +@@ -697,6 +699,10 @@ sds moduleLoadQueueEntryToLoadmoduleOpti const char *config_option_str) { sds line; @@ -94,7 +77,7 @@ index de5a5510e..2638268e1 100644 line = sdsnew(config_option_str); line = sdscatlen(line, " ", 1); line = sdscatsds(line, module->loadmod->path); -@@ -12629,7 +12635,7 @@ void moduleLoadFromQueue(void) { +@@ -13148,7 +13154,7 @@ void moduleLoadFromQueue(void) { listRewind(server.loadmodule_queue, &li); while ((ln = listNext(&li))) { struct moduleLoadQueueEntry *loadmod = ln->value; @@ -103,24 +86,51 @@ index de5a5510e..2638268e1 100644 serverLog(LL_WARNING, "Can't load module from %s: server aborting", loadmod->path); exit(1); } -@@ -12818,7 +12824,7 @@ void moduleUnregisterCleanup(ValkeyModule *module) { +@@ -13346,7 +13352,7 @@ static int moduleInitPostOnLoadResolved( + void **module_argv, + int module_argc, + int is_loadex, +- int is_static) { ++ int is_static, int from_include) { + ValkeyModuleCtx ctx; + moduleCreateContext(&ctx, NULL, VALKEYMODULE_CTX_TEMP_CLIENT); /* We pass NULL since we don't have a module yet. */ + if (onload((void *)&ctx, module_argv, module_argc) == VALKEYMODULE_ERR) { +@@ -13383,6 +13389,7 @@ static int moduleInitPostOnLoadResolved( + ctx.module->loadmod->path = sdsnew(display_name); + ctx.module->loadmod->argv = module_argc ? zmalloc(sizeof(robj *) * module_argc) : NULL; + ctx.module->loadmod->argc = module_argc; ++ ctx.module->loadmod->from_include = from_include; + for (int i = 0; i < module_argc; i++) { + ctx.module->loadmod->argv[i] = module_argv[i]; + incrRefCount(ctx.module->loadmod->argv[i]); +@@ -13427,7 +13434,7 @@ static int moduleInitPostOnLoadResolved( /* Load a module and initialize it. On success C_OK is returned, otherwise * C_ERR is returned. */ -int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loadex) { +int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loadex, int from_include) { - int (*onload)(void *, void **, int); + ModuleLoadFunc onload; void *handle; -@@ -12893,6 +12899,7 @@ int moduleLoad(const char *path, void **module_argv, int module_argc, int is_loa - ctx.module->loadmod->path = sdsnew(path); - ctx.module->loadmod->argv = module_argc ? zmalloc(sizeof(robj *) * module_argc) : NULL; - ctx.module->loadmod->argc = module_argc; -+ ctx.module->loadmod->from_include = from_include; - for (int i = 0; i < module_argc; i++) { - ctx.module->loadmod->argv[i] = module_argv[i]; - incrRefCount(ctx.module->loadmod->argv[i]); -@@ -13961,7 +13968,7 @@ void moduleCommand(client *c) { +@@ -13476,7 +13483,7 @@ int moduleLoad(const char *path, void ** + path); + return C_ERR; + } +- return moduleInitPostOnLoadResolved(onload, handle, path, module_argv, module_argc, is_loadex, 0); ++ return moduleInitPostOnLoadResolved(onload, handle, path, module_argv, module_argc, is_loadex, 0, from_include); + } + + /* Resolve a symbol from a statically linked module. The symbol is looked up +@@ -13542,7 +13549,7 @@ int moduleLoadStatic(const char *module_ + return C_ERR; + } + return moduleInitPostOnLoadResolved(onload, handle, module_name, module_argv, module_argc, +- is_loadex, 1); ++ is_loadex, 1, 1); + } + + static int moduleUnloadInternal(struct ValkeyModule *module, const char **errmsg) { +@@ -14582,7 +14589,7 @@ void moduleCommand(client *c) { argv = &c->argv[3]; } @@ -129,7 +139,7 @@ index de5a5510e..2638268e1 100644 addReply(c, shared.ok); else addReplyError(c, "Error loading the extension. Please check the server logs."); -@@ -13976,7 +13983,7 @@ void moduleCommand(client *c) { +@@ -14597,7 +14604,7 @@ void moduleCommand(client *c) { /* If this is a loadex command we want to populate server.module_configs_queue with * sds NAME VALUE pairs. We also want to increment argv to just after ARGS, if supplied. */ if (parseLoadexArguments((ValkeyModuleString ***)&argv, &argc) == VALKEYMODULE_OK && @@ -138,11 +148,10 @@ index de5a5510e..2638268e1 100644 addReply(c, shared.ok); else { dictEmpty(server.module_configs_queue, NULL); -diff --git a/src/module.h b/src/module.h -index c7ad384c6..3b12efbaf 100644 ---- a/src/module.h -+++ b/src/module.h -@@ -169,7 +169,7 @@ static inline void moduleInitDigestContext(ValkeyModuleDigest *mdvar) { +diff -up ./src/module.h.loadmod ./src/module.h +--- ./src/module.h.loadmod 2026-04-28 18:32:37.000000000 +0200 ++++ ./src/module.h 2026-04-29 09:35:56.783998866 +0200 +@@ -174,7 +174,7 @@ static inline void moduleInitDigestConte memset(mdvar->x, 0, sizeof(mdvar->x)); } @@ -151,28 +160,13 @@ index c7ad384c6..3b12efbaf 100644 sds moduleLoadQueueEntryToLoadmoduleOptionStr(ValkeyModule *module, const char *config_option_str); ValkeyModuleCtx *moduleAllocateContext(void); -@@ -181,7 +181,7 @@ void moduleFreeContext(ValkeyModuleCtx *ctx); +@@ -186,7 +186,7 @@ void moduleFreeContext(ValkeyModuleCtx * void moduleInitModulesSystem(void); void moduleInitModulesSystemLast(void); void modulesCron(void); -int moduleLoad(const char *path, void **argv, int argc, int is_loadex); +int moduleLoad(const char *path, void **argv, int argc, int is_loadex, int from_include); + int moduleLoadStatic(const char *path, void **argv, int argc, int is_loadex); int moduleUnload(sds name, const char **errmsg); void moduleUnloadAllModules(void); - void moduleLoadFromQueue(void); -diff --git a/src/server.c b/src/server.c -index 881d83bad..a21d3ca9e 100644 ---- a/src/server.c -+++ b/src/server.c -@@ -7630,7 +7630,7 @@ __attribute__((weak)) int main(int argc, char **argv) { - #ifdef LUA_ENABLED - #define LUA_LIB_STR STRINGIFY(LUA_LIB) - if (scriptingEngineManagerFind("lua") == NULL) { -- if (moduleLoad(LUA_LIB_STR, NULL, 0, 0) != C_OK) { -+ if (moduleLoad(LUA_LIB_STR, NULL, 0, 0, 1) != C_OK) { - serverPanic("Lua engine initialization failed, check the server logs."); - } - } --- -2.53.0 - +diff -up ./src/server.c.loadmod ./src/server.c diff --git a/valkey-lua.patch b/valkey-lua.patch deleted file mode 100644 index 7e6d8f2..0000000 --- a/valkey-lua.patch +++ /dev/null @@ -1,54 +0,0 @@ -diff -up ./src/Makefile.old ./src/Makefile ---- ./src/Makefile.old 2026-03-17 16:49:22.086043863 +0100 -+++ ./src/Makefile 2026-03-17 17:02:31.748498351 +0100 -@@ -63,7 +63,7 @@ endif - - PREFIX?=/usr/local - INSTALL_BIN=$(PREFIX)/bin --INSTALL_LIB=$(PREFIX)/lib -+INSTALL_LIB=$(PREFIX)/lib64 - INSTALL=install - PKG_CONFIG?=pkg-config - -@@ -263,12 +263,10 @@ else - LUA_MODULE_INSTALL=install-lua-module - - current_dir = $(shell pwd) -- FINAL_CFLAGS+=-DLUA_ENABLED -DLUA_LIB=libvalkeylua.so -+ FINAL_CFLAGS+=-DLUA_ENABLED -DLUA_LIB=libvalkeylua.so -DLUA_LIB_PATH=/usr/lib64/valkey/modules/lua.so - ifeq ($(uname_S),Darwin) - FINAL_LDFLAGS+= -Wl,-rpath,$(PREFIX)/lib - FINAL_LDFLAGS+= -Wl,-rpath,$(current_dir)/modules/lua --else -- FINAL_LDFLAGS+= -Wl,-rpath,$(PREFIX)/lib:$(current_dir)/modules/lua -Wl,--disable-new-dtags - endif - endif - -@@ -836,8 +834,8 @@ install: all $(LUA_MODULE_INSTALL) - $(call MAYBE_INSTALL_REDIS_SYMLINK,$(ENGINE_SENTINEL_NAME),$(INSTALL_BIN)) - - install-lua-module: $(LUA_MODULE) -- @mkdir -p $(INSTALL_LIB) -- $(call MAKE_INSTALL,$(LUA_MODULE),$(INSTALL_LIB)) -+ @mkdir -p $(INSTALL_LIB)/valkey/modules -+ $(call MAKE_INSTALL,$(LUA_MODULE),$(INSTALL_LIB)/valkey/modules/lua.so) - - uninstall: - @rm -f $(INSTALL_BIN)/{$(SERVER_NAME),$(ENGINE_BENCHMARK_NAME),$(ENGINE_CLI_NAME),$(ENGINE_CHECK_RDB_NAME),$(ENGINE_CHECK_AOF_NAME),$(ENGINE_SENTINEL_NAME)} -diff -up ./src/server.c.old ./src/server.c ---- ./src/server.c.old 2026-03-17 16:50:55.410170510 +0100 -+++ ./src/server.c 2026-03-17 16:58:39.140382232 +0100 -@@ -7628,9 +7628,12 @@ __attribute__((weak)) int main(int argc, - - /* Initialize the LUA scripting engine. */ - #ifdef LUA_ENABLED -+/* LUA_LIB_PATH ini installation dir, LUA_LIB_STR in sources dir */ -+#define LUA_LIB_PATH_STR STRINGIFY(LUA_LIB_PATH) - #define LUA_LIB_STR STRINGIFY(LUA_LIB) - if (scriptingEngineManagerFind("lua") == NULL) { -- if (moduleLoad(LUA_LIB_STR, NULL, 0, 0, 1) != C_OK) { -+ if (moduleLoad(LUA_LIB_PATH_STR, NULL, 0, 0, 1) != C_OK && -+ moduleLoad(LUA_LIB_STR, NULL, 0, 0, 1) != C_OK) { - serverPanic("Lua engine initialization failed, check the server logs."); - } - } diff --git a/valkey-rdma.patch b/valkey-rdma.patch deleted file mode 100644 index edfd6ee..0000000 --- a/valkey-rdma.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/deps/Makefile b/deps/Makefile -index 94d938552..0e3466e68 100644 ---- a/deps/Makefile -+++ b/deps/Makefile -@@ -54,7 +54,7 @@ endif - ifneq (,$(filter $(BUILD_RDMA),yes module)) - LIBVALKEY_MAKE_FLAGS += USE_RDMA=1 - ifneq (,$(filter $(BUILD_RDMA),module)) -- LIBVALKEY_MAKE_FLAGS += USE_DLOPEN_RDMA=1 -+ LIBVALKEY_MAKE_FLAGS += USE_DLOPEN_RDMA=0 - endif - endif - -diff --git a/src/Makefile b/src/Makefile -index 73815ac2b..db2938ed4 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -373,7 +373,7 @@ RDMA_MODULE_NAME:=valkey-rdma$(PROG_SUFFIX).so - RDMA_MODULE_CFLAGS:=$(FINAL_CFLAGS) - ifeq ($(BUILD_RDMA),module) - FINAL_CFLAGS+=-DUSE_RDMA=$(BUILD_MODULE) -- RDMA_CLIENT_LIBS = ../deps/libvalkey/lib/libvalkey_rdma.a -+ RDMA_CLIENT_LIBS = ../deps/libvalkey/lib/libvalkey_rdma.a $(RDMA_LIBS) - RDMA_MODULE=$(RDMA_MODULE_NAME) - RDMA_MODULE_CFLAGS+=-DUSE_RDMA=$(BUILD_MODULE) -DBUILD_RDMA_MODULE=$(BUILD_MODULE) $(RDMA_LIBS) - endif diff --git a/valkey.spec b/valkey.spec index 9b67f07..f1f6262 100644 --- a/valkey.spec +++ b/valkey.spec @@ -8,7 +8,7 @@ %global doc_version 9.0.2 %global upstream_version 9.1.0 -%global upstream_prever rc1 +%global upstream_prever rc2 Name: valkey Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} @@ -33,11 +33,6 @@ Source50: https://github.com/valkey-io/%{name}-doc/archive/%{doc_versio Patch0: %{name}-conf.patch # Workaround to https://github.com/valkey-io/valkey/issues/2678 Patch1: %{name}-loadmod.patch -# clean rpath and set lua module path -Patch2: %{name}-lua.patch -# don't dlopen librdmacm libibverbs -# for proper package dependencies -Patch3: %{name}-rdma.patch ExcludeArch: %{ix86} @@ -154,8 +149,6 @@ See https://valkey.io/topics/RDMA/ %setup -qn %{name}-%{upstream_version}%{?upstream_prever:-%{upstream_prever}} -a50 %patch -P0 -p1 -b .rpm %patch -P1 -p1 -b .loadmod -%patch -P2 -p1 -b .lua -%patch -P3 -p1 -b .rdma mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc @@ -183,7 +176,7 @@ fi # Generates macro file cat << 'EOF' | tee macros.%{name} -%%valkey_version %version +%%valkey_version %upstream_version %%valkey_modules_abi %valkey_modules_abi %%valkey_modules_dir %valkey_modules_dir %%valkey_modules_cfg %valkey_modules_cfg @@ -276,10 +269,6 @@ install -pm640 rdma.conf %{buildroot}%{valkey_modules_cfg}/rdma.conf %if %{with tests} %check -# Search path for libvalkeylua.so -LD_LIBRARY_PATH=src/modules/lua -export LD_LIBRARY_PATH - # https://github.com/redis/redis/issues/1417 (for "taskset -c 1") taskset -c 1 ./runtest --clients 50 --skiptest "Active defrag - AOF loading" @@ -322,7 +311,6 @@ exit 0 %attr(0640, valkey, root) %config(noreplace) %{_sysconfdir}/%{name}/sentinel.conf %dir %{_libdir}/%{name} %dir %{valkey_modules_dir} -%{valkey_modules_dir}/lua.so %dir %attr(0750, valkey, valkey) %{_sharedstatedir}/%{name} %dir %attr(0750, valkey, valkey) %{_localstatedir}/log/%{name} %{_bindir}/%{name}-* @@ -355,6 +343,11 @@ exit 0 %changelog +* Wed Apr 29 2026 Remi Collet <remi@remirepo.net> - 9.1.0~rc2 +- Valkey 9.1.0-rc2 +- drop rdma patch, keep upstream feature to dlopen librdmacm and libibverbs +- Drop lua module (built statically) + * Tue Mar 17 2026 Remi Collet <remi@remirepo.net> - 9.1.0~rc1 - Valkey 9.1.0-rc1 - Lua scripting engine moved into a Valkey module |
