diff options
| -rw-r--r-- | valkey-conf.patch | 8 | ||||
| -rw-r--r-- | valkey-loadmod.patch | 68 | ||||
| -rw-r--r-- | valkey.spec | 30 |
3 files changed, 64 insertions, 42 deletions
diff --git a/valkey-conf.patch b/valkey-conf.patch index 8e20288..93696f4 100644 --- a/valkey-conf.patch +++ b/valkey-conf.patch @@ -32,7 +32,7 @@ diff -up ./valkey.conf.rpm ./valkey.conf ################################## MODULES ##################################### -@@ -153,7 +156,7 @@ tcp-backlog 511 +@@ -163,7 +166,7 @@ tcp-backlog 511 # incoming connections. There is no default, so the server will not listen # on a unix socket when not specified. # @@ -41,7 +41,7 @@ diff -up ./valkey.conf.rpm ./valkey.conf # unixsocketgroup wheel # unixsocketperm 700 -@@ -385,7 +388,7 @@ daemonize no +@@ -409,7 +412,7 @@ daemonize no # # Note that on modern Linux systems "/run/valkey.pid" is more conforming # and should be used instead. @@ -50,7 +50,7 @@ diff -up ./valkey.conf.rpm ./valkey.conf # Specify the server verbosity level. # This can be one of: -@@ -416,7 +419,7 @@ loglevel notice +@@ -440,7 +443,7 @@ loglevel notice # Specify the log file name. Also the empty string can be used to force # the server to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null @@ -59,7 +59,7 @@ diff -up ./valkey.conf.rpm ./valkey.conf # To enable logging to the system logger, just set 'syslog-enabled' to yes, # and optionally update the other syslog parameters to suit your needs. -@@ -606,7 +609,7 @@ rdb-del-sync-files no +@@ -631,7 +634,7 @@ rdb-del-sync-files no # Note that modifying 'dir' during runtime may have unexpected behavior, # for example when a child process is running, related file operations may # have unexpected effects. diff --git a/valkey-loadmod.patch b/valkey-loadmod.patch index 3341863..dad9cb9 100644 --- a/valkey-loadmod.patch +++ b/valkey-loadmod.patch @@ -1,19 +1,31 @@ -Adapted for 8.1.4 from -https://github.com/valkey-io/valkey/pull/2689 +From b40ab88996d0bbe9bdd366af9426f7400b21e19c 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 -diff -up ./src/config.c.loadmod ./src/config.c ---- ./src/config.c.loadmod 2025-10-03 21:17:43.000000000 +0200 -+++ ./src/config.c 2025-10-06 03:06:41.774448336 +0200 -@@ -438,6 +438,8 @@ static int updateClientOutputBufferLimit +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 ++-- + 3 files changed, 20 insertions(+), 9 deletions(-) + +diff --git a/src/config.c b/src/config.c +index d0158b2c4d..ab453056df 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -448,6 +448,8 @@ static int updateClientOutputBufferLimit(sds *args, int arg_len, const char **er * 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; +/* support detecting include vs main config file */ +static int reading_include_file = 0; - void loadServerConfigFromString(char *config) { + void loadServerConfigFromString(sds config) { deprecatedConfig deprecated_configs[] = { -@@ -529,7 +531,9 @@ void loadServerConfigFromString(char *co +@@ -539,7 +541,9 @@ void loadServerConfigFromString(sds config) { /* Execute config directives */ if (!strcasecmp(argv[0], "include") && argc == 2) { @@ -23,7 +35,7 @@ diff -up ./src/config.c.loadmod ./src/config.c } else if (!strcasecmp(argv[0], "rename-command") && argc == 3) { struct serverCommand *cmd = lookupCommandBySds(argv[1]); -@@ -562,7 +566,7 @@ void loadServerConfigFromString(char *co +@@ -572,7 +576,7 @@ void loadServerConfigFromString(sds config) { goto loaderr; } } else if (!strcasecmp(argv[0], "loadmodule") && argc >= 2) { @@ -32,7 +44,7 @@ diff -up ./src/config.c.loadmod ./src/config.c } else if (strchr(argv[0], '.')) { if (argc < 2) { err = "Module config specified without value"; -@@ -1579,7 +1583,7 @@ void rewriteConfigLoadmoduleOption(struc +@@ -1605,7 +1609,7 @@ void rewriteConfigLoadmoduleOption(struct rewriteConfigState *state) { while ((de = dictNext(di)) != NULL) { struct ValkeyModule *module = dictGetVal(de); line = moduleLoadQueueEntryToLoadmoduleOptionStr(module, "loadmodule"); @@ -41,10 +53,11 @@ diff -up ./src/config.c.loadmod ./src/config.c } dictReleaseIterator(di); /* Mark "loadmodule" as processed in case modules is empty. */ -diff -up ./src/module.c.loadmod ./src/module.c ---- ./src/module.c.loadmod 2025-10-03 21:17:43.000000000 +0200 -+++ ./src/module.c 2025-10-06 03:05:36.498290506 +0200 -@@ -83,6 +83,7 @@ +diff --git a/src/module.c b/src/module.c +index e5afa952fa..f18bc3c6bf 100644 +--- a/src/module.c ++++ b/src/module.c +@@ -84,6 +84,7 @@ struct moduleLoadQueueEntry { sds path; @@ -52,7 +65,7 @@ diff -up ./src/module.c.loadmod ./src/module.c int argc; robj **argv; }; -@@ -669,7 +670,7 @@ void freeClientModuleData(client *c) { +@@ -670,7 +671,7 @@ void freeClientModuleData(client *c) { c->module_data = NULL; } @@ -61,7 +74,7 @@ diff -up ./src/module.c.loadmod ./src/module.c int i; struct moduleLoadQueueEntry *loadmod; -@@ -677,6 +678,7 @@ void moduleEnqueueLoadModule(sds path, s +@@ -678,6 +679,7 @@ void moduleEnqueueLoadModule(sds path, sds *argv, int argc) { loadmod->argv = argc ? zmalloc(sizeof(robj *) * argc) : NULL; loadmod->path = sdsnew(path); loadmod->argc = argc; @@ -69,7 +82,7 @@ diff -up ./src/module.c.loadmod ./src/module.c for (i = 0; i < argc; i++) { loadmod->argv[i] = createRawStringObject(argv[i], sdslen(argv[i])); } -@@ -687,6 +689,10 @@ sds moduleLoadQueueEntryToLoadmoduleOpti +@@ -688,6 +690,10 @@ sds moduleLoadQueueEntryToLoadmoduleOptionStr(ValkeyModule *module, const char *config_option_str) { sds line; @@ -80,7 +93,7 @@ diff -up ./src/module.c.loadmod ./src/module.c line = sdsnew(config_option_str); line = sdscatlen(line, " ", 1); line = sdscatsds(line, module->loadmod->path); -@@ -12188,7 +12194,7 @@ void moduleLoadFromQueue(void) { +@@ -12350,7 +12356,7 @@ void moduleLoadFromQueue(void) { listRewind(server.loadmodule_queue, &li); while ((ln = listNext(&li))) { struct moduleLoadQueueEntry *loadmod = ln->value; @@ -89,7 +102,7 @@ diff -up ./src/module.c.loadmod ./src/module.c serverLog(LL_WARNING, "Can't load module from %s: server aborting", loadmod->path); exit(1); } -@@ -12369,7 +12375,7 @@ void moduleUnregisterCleanup(ValkeyModul +@@ -12531,7 +12537,7 @@ void moduleUnregisterCleanup(ValkeyModule *module) { /* Load a module and initialize it. On success C_OK is returned, otherwise * C_ERR is returned. */ @@ -98,7 +111,7 @@ diff -up ./src/module.c.loadmod ./src/module.c int (*onload)(void *, void **, int); void *handle; -@@ -12444,6 +12450,7 @@ int moduleLoad(const char *path, void ** +@@ -12606,6 +12612,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; @@ -106,7 +119,7 @@ diff -up ./src/module.c.loadmod ./src/module.c for (int i = 0; i < module_argc; i++) { ctx.module->loadmod->argv[i] = module_argv[i]; incrRefCount(ctx.module->loadmod->argv[i]); -@@ -13361,7 +13368,7 @@ void moduleCommand(client *c) { +@@ -13529,7 +13536,7 @@ void moduleCommand(client *c) { argv = &c->argv[3]; } @@ -115,7 +128,7 @@ diff -up ./src/module.c.loadmod ./src/module.c addReply(c, shared.ok); else addReplyError(c, "Error loading the extension. Please check the server logs."); -@@ -13376,7 +13383,7 @@ void moduleCommand(client *c) { +@@ -13544,7 +13551,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 && @@ -124,10 +137,11 @@ diff -up ./src/module.c.loadmod ./src/module.c addReply(c, shared.ok); else { dictEmpty(server.module_configs_queue, NULL); -diff -up ./src/module.h.loadmod ./src/module.h ---- ./src/module.h.loadmod 2025-10-03 21:17:43.000000000 +0200 -+++ ./src/module.h 2025-10-06 03:05:36.498698194 +0200 -@@ -169,7 +169,7 @@ static inline void moduleInitDigestConte +diff --git a/src/module.h b/src/module.h +index f6c266b592..1f9e729e56 100644 +--- a/src/module.h ++++ b/src/module.h +@@ -169,7 +169,7 @@ static inline void moduleInitDigestContext(ValkeyModuleDigest *mdvar) { memset(mdvar->x, 0, sizeof(mdvar->x)); } @@ -136,7 +150,7 @@ diff -up ./src/module.h.loadmod ./src/module.h sds moduleLoadQueueEntryToLoadmoduleOptionStr(ValkeyModule *module, const char *config_option_str); ValkeyModuleCtx *moduleAllocateContext(void); -@@ -180,7 +180,7 @@ void moduleFreeContext(ValkeyModuleCtx * +@@ -180,7 +180,7 @@ void moduleFreeContext(ValkeyModuleCtx *ctx); void moduleInitModulesSystem(void); void moduleInitModulesSystemLast(void); void modulesCron(void); diff --git a/valkey.spec b/valkey.spec index 17ccb9c..cc96286 100644 --- a/valkey.spec +++ b/valkey.spec @@ -7,18 +7,21 @@ # See https://github.com/valkey-io/valkey-doc/tags %global doc_version 8.1.1 +%global upstream_version 9.0.0 +%global upstream_prever rc3 + Name: valkey -Version: 8.1.4 -Release: 2%{?dist} +Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} +Release: 1%{?dist} Summary: A persistent key-value database # valkey: BSD-3-Clause -# hiredis: BSD-3-Clause +# libvalkey: BSD-3-Clause # hdrhistogram, jemalloc, lzf, linenoise: BSD-2-Clause # lua: MIT # fpconv: BSL-1.0 License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 URL: https://valkey.io -Source0: https://github.com/valkey-io/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/valkey-io/%{name}/archive/%{upstream_version}%{?upstream_prever:-%{upstream_prever}}/%{name}-%{upstream_version}%{?upstream_prever:-%{upstream_prever}}.tar.gz Source1: %{name}.logrotate Source2: %{name}-sentinel.service Source3: %{name}.service @@ -54,8 +57,8 @@ BuildRequires: python3-pyyaml %endif Requires: logrotate -# from deps/hiredis/hiredis.h -Provides: bundled(hiredis) = 1.0.3 +# from deps/libvalkey/include/valkey/valkey.h +Provides: bundled(hiredis) = 0.2.1 # from deps/jemalloc/VERSION Provides: bundled(jemalloc) = 5.3.0 # from deps/lua/src/lua.h @@ -63,8 +66,9 @@ Provides: bundled(lua-libs) = 5.1.5 # from deps/linenoise/linenoise.h Provides: bundled(linenoise) = 1.0 Provides: bundled(lzf) -# from deps/hdr_histogram/README.md -Provides: bundled(hdr_histogram) = 0.11.0 +# from deps/README.md +# e4448cf6d1cd08fff519812d3b1e58bd5a94ac42 +Provides: bundled(hdr_histogram) = 0.11.9 # no version Provides: bundled(fpconv) @@ -144,13 +148,13 @@ See https://valkey.io/topics/encryption/ %prep # no autosetup due to no support for multiple source extraction -%setup -n %{name}-%{version} -a50 +%setup -qn %{name}-%{upstream_version}%{?upstream_prever:-%{upstream_prever}} -a50 %patch -P0 -p1 -b .rpm %patch -P1 -p1 -b .loadmod mv deps/lua/COPYRIGHT COPYRIGHT-lua mv deps/jemalloc/COPYING COPYING-jemalloc -mv deps/hiredis/COPYING COPYING-hiredis-BSD-3-Clause +mv deps/libvalkey/COPYING COPYING-libvalkey mv deps/hdr_histogram/LICENSE.txt LICENSE-hdrhistogram mv deps/hdr_histogram/COPYING.txt COPYING-hdrhistogram mv deps/fpconv/LICENSE.txt LICENSE-fpconv @@ -311,7 +315,7 @@ exit 0 %license LICENSE-hdrhistogram %license COPYING-hdrhistogram %license LICENSE-fpconv -%license COPYING-hiredis-BSD-3-Clause +%license COPYING-libvalkey %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %attr(0750, valkey, root) %dir %{_sysconfdir}/%{name} %attr(0750, valkey, root) %dir %{valkey_modules_cfg} @@ -355,6 +359,10 @@ exit 0 %changelog +* Fri Oct 17 2025 Remi Collet <remi@fedoraproject.org> - 9.0.0~rc3-1 +- update to 9.0.0-rc3 +- hiredis replaced by libvalkey + * Mon Oct 6 2025 Remi Collet <remi@fedoraproject.org> - 8.1.4-2 - improve the patch for loadmodule directive |
