Skip to content

Commit

Permalink
Update to Redis 6.0.4
Browse files Browse the repository at this point in the history
https://raw.githubusercontent.com/antirez/redis/6.0/00-RELEASENOTES

Thanks to cwen for helping me figure out what was going on with
64-bit atomics on powerpc and gkoehler for fixing this in clang.

ok danj sthen
  • Loading branch information
botovq committed Jun 8, 2020
1 parent 1dbc784 commit e967071
Show file tree
Hide file tree
Showing 15 changed files with 161 additions and 83 deletions.
20 changes: 16 additions & 4 deletions databases/redis/Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
# $OpenBSD: Makefile,v 1.111 2020/04/18 17:42:54 sthen Exp $
# $OpenBSD: Makefile,v 1.112 2020/06/08 07:32:47 tb Exp $

COMMENT = persistent key-value database
DISTNAME = redis-5.0.9
DISTNAME = redis-6.0.4
CATEGORIES = databases
HOMEPAGE = https://redis.io/

# BSD
PERMIT_PACKAGE = Yes

WANTLIB += c ${MODLUA_WANTLIB} m pthread
WANTLIB += c crypto ssl ${MODLUA_WANTLIB} m pthread

MASTER_SITES = http://download.redis.io/releases/

DEBUG_PACKAGES = ${BUILD_PACKAGES}

# C11
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c

MODULES = lang/lua \
lang/tcl

MAKE_FLAGS = CC="${CC}" \
MAKE_FLAGS = BUILD_TLS=yes \
CC="${CC}" \
DEBUG="${DEBUG}" \
DEBUG_FLAGS="${DEBUG}" \
USE_JEMALLOC=no \
OPT="" \
OPTIMIZATION="" \
V=1

# Fix "undefined reference to `__atomic_store_8'"
.if ${MACHINE_ARCH:Mhppa}
WANTLIB += atomic
LIB_DEPENDS += lang/gcc/${MODGCC4_VERSION},-libs
MAKE_FLAGS += LDFLAGS="${LDFLAGS} -latomic"
.endif

FAKE_FLAGS = INSTALL="${INSTALL_PROGRAM}" \
INSTALL_DIR="${INSTALL_DATA_DIR}" \
INSTALL_TOP="${WRKINST}${PREFIX}"
Expand Down
4 changes: 2 additions & 2 deletions databases/redis/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (redis-5.0.9.tar.gz) = U9CuFkzTNTbD1LcgrpoSjqYWbr8E/xrdO4XxJCCQy4U=
SIZE (redis-5.0.9.tar.gz) = 1986574
SHA256 (redis-6.0.4.tar.gz) = MzcAWh4MOqKTyHwxNGfqisEZhJIfqwiAeZi6dlyZQ94=
SIZE (redis-6.0.4.tar.gz) = 2217173
8 changes: 5 additions & 3 deletions databases/redis/patches/patch-deps_Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$OpenBSD: patch-deps_Makefile,v 1.11 2020/02/11 08:11:13 tb Exp $
$OpenBSD: patch-deps_Makefile,v 1.12 2020/06/08 07:32:47 tb Exp $
Index: deps/Makefile
--- deps/Makefile.orig
+++ deps/Makefile
@@ -35,49 +35,16 @@ endif
@@ -35,8 +35,6 @@ endif
distclean:
-(cd hiredis && $(MAKE) clean) > /dev/null || true
-(cd linenoise && $(MAKE) clean) > /dev/null || true
Expand All @@ -11,10 +11,12 @@ Index: deps/Makefile
-(rm -f .make-*)

.PHONY: distclean
@@ -46,42 +44,11 @@ ifeq ($(BUILD_TLS),yes)
endif

hiredis: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd hiredis && $(MAKE) static
cd hiredis && $(MAKE) static $(HIREDIS_MAKE_FLAGS)

.PHONY: hiredis

Expand Down
23 changes: 16 additions & 7 deletions databases/redis/patches/patch-deps_hiredis_Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
$OpenBSD: patch-deps_hiredis_Makefile,v 1.8 2018/04/24 14:35:29 kn Exp $
$OpenBSD: patch-deps_hiredis_Makefile,v 1.9 2020/06/08 07:32:47 tb Exp $
Index: deps/hiredis/Makefile
--- deps/hiredis/Makefile.orig
+++ deps/hiredis/Makefile
@@ -181,7 +181,7 @@ $(PKGCONFNAME): hiredis.h
@echo Cflags: -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@
@@ -71,7 +71,7 @@ ifeq ($(USE_SSL),1)
CFLAGS+=-DHIREDIS_TEST_SSL
endif

-ifeq ($(uname_S),Linux)
+ifneq (,filter Linux OpenBSD,$(uname_S))
SSL_LDFLAGS=-lssl -lcrypto
else
OPENSSL_PREFIX?=/usr/local/opt/openssl
@@ -236,7 +236,7 @@ $(SSL_PKGCONFNAME): hiredis.h
@echo Libs.private: -lssl -lcrypto >> $@

install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME)
- mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
+ $(INSTALL_DIR) $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
$(INSTALL) hiredis.h async.h read.h sds.h adapters $(INSTALL_INCLUDE_PATH)
- mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
+ $(INSTALL_DIR) $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
$(INSTALL) hiredis.h async.h read.h sds.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME)
6 changes: 3 additions & 3 deletions databases/redis/patches/patch-deps_hiredis_net_c
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$OpenBSD: patch-deps_hiredis_net_c,v 1.2 2017/08/09 09:16:09 dcoppa Exp $
$OpenBSD: patch-deps_hiredis_net_c,v 1.3 2020/06/08 07:32:47 tb Exp $
Index: deps/hiredis/net.c
--- deps/hiredis/net.c.orig
+++ deps/hiredis/net.c
@@ -141,7 +141,7 @@ int redisKeepAlive(redisContext *c, int interval) {
@@ -179,7 +179,7 @@ int redisKeepAlive(redisContext *c, int interval) {
return REDIS_ERR;
}
#else
-#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__)
+#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__)
val = interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
return REDIS_ERR;
7 changes: 5 additions & 2 deletions databases/redis/patches/patch-deps_linenoise_linenoise_c
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
$OpenBSD: patch-deps_linenoise_linenoise_c,v 1.1 2020/02/11 08:11:13 tb Exp $
$OpenBSD: patch-deps_linenoise_linenoise_c,v 1.2 2020/06/08 07:32:47 tb Exp $

Fix an occurrence where char is considered signed on all platforms,
it's not the case on powerpc and arm.

https://github.com/antirez/redis/pull/7132
https://github.com/antirez/linenoise/pull/188

Index: deps/linenoise/linenoise.c
--- deps/linenoise/linenoise.c.orig
+++ deps/linenoise/linenoise.c
@@ -793,7 +793,7 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd,
@@ -819,7 +819,7 @@ static int linenoiseEdit(int stdin_fd, int stdout_fd,

if (write(l.ofd,prompt,l.plen) == -1) return -1;
while(1) {
Expand Down
56 changes: 46 additions & 10 deletions databases/redis/patches/patch-redis_conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
$OpenBSD: patch-redis_conf,v 1.21 2020/02/11 08:11:13 tb Exp $
$OpenBSD: patch-redis_conf,v 1.22 2020/06/08 07:32:47 tb Exp $

Redis TLSv1.3 support is conditional on TLS1_3_VERSION being public.
This is not currently the case and the ciphersuites config is a no-op.

Main changes in this file:

* Redis socket and pid files were moved to /var/run/redis
* Suggest using the system-wide root certificates /etc/ssl/certs.pem
* Using TLSv1.3 will currently trigger a log warning
* redis will daemonize and use syslog

Index: redis.conf
--- redis.conf.orig
+++ redis.conf
Expand All @@ -13,7 +24,32 @@ Index: redis.conf

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
@@ -132,8 +132,9 @@ tcp-keepalive 300
@@ -154,6 +154,7 @@ tcp-keepalive 300
# of these, and will not implicitly use the system wide configuration.
#
# tls-ca-cert-file ca.crt
+# tls-ca-cert-file /etc/ssl/cert.pem
# tls-ca-cert-dir /etc/ssl/certs

# By default, clients (including replica servers) on a TLS port are required
@@ -181,14 +182,14 @@ tcp-keepalive 300
#
# tls-protocols "TLSv1.2 TLSv1.3"

-# Configure allowed ciphers. See the ciphers(1ssl) manpage for more information
+# Configure allowed ciphers. See SSL_set_cipher_list(3) for more information
# about the syntax of this string.
#
# Note: this configuration applies only to <= TLSv1.2.
#
# tls-ciphers DEFAULT:!MEDIUM

-# Configure allowed TLSv1.3 ciphersuites. See the ciphers(1ssl) manpage for more
+# Configure allowed TLSv1.3 ciphersuites. See SSL_set_cipher_list(3) for more
# information about the syntax of this string, and specifically for TLSv1.3
# ciphersuites.
#
@@ -202,8 +203,9 @@ tcp-keepalive 300
################################# GENERAL #####################################

# By default Redis does not run as a daemon. Use 'yes' if you need it.
Expand All @@ -25,7 +61,7 @@ Index: redis.conf

# If you run Redis from upstart or systemd, Redis can interact with your
# supervision tree. Options:
@@ -151,11 +152,11 @@ supervised no
@@ -221,11 +223,11 @@ supervised no
#
# When the server runs non daemonized, no pid file is created if none is
# specified in the configuration. When the server is daemonized, the pid file
Expand All @@ -39,7 +75,7 @@ Index: redis.conf

# Specify the server verbosity level.
# This can be one of:
@@ -168,17 +169,18 @@ loglevel notice
@@ -238,17 +240,18 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
Expand All @@ -63,7 +99,7 @@ Index: redis.conf

# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
@@ -260,7 +262,7 @@ dbfilename dump.rdb
@@ -343,7 +346,7 @@ rdb-del-sync-files no
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
Expand All @@ -72,16 +108,16 @@ Index: redis.conf

################################# REPLICATION #################################

@@ -504,7 +506,7 @@ replica-priority 100
# 150k passwords per second against a good box. This means that you should
# use a very strong password otherwise it will be very easy to break.
@@ -768,7 +771,7 @@ acllog-max-len 128
# AUTH <password> as usually, or more explicitly with AUTH default <password>
# if they follow the new protocol: both will work.
#
-# requirepass foobared
+# requirepass very-strong-password

# Command renaming.
# Command renaming (DEPRECATED).
#
@@ -537,6 +539,7 @@ replica-priority 100
@@ -807,6 +810,7 @@ acllog-max-len 128
# an error 'max number of clients reached'.
#
# maxclients 10000
Expand Down
6 changes: 3 additions & 3 deletions databases/redis/patches/patch-sentinel_conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$OpenBSD: patch-sentinel_conf,v 1.7 2020/02/11 08:11:13 tb Exp $
$OpenBSD: patch-sentinel_conf,v 1.8 2020/06/08 07:32:47 tb Exp $
Index: sentinel.conf
--- sentinel.conf.orig
+++ sentinel.conf
Expand All @@ -20,7 +20,7 @@ Index: sentinel.conf

# Specify the log file name. Also the empty string can be used to force
# Sentinel to log on the standard output. Note that if you use standard
@@ -182,7 +182,7 @@ sentinel failover-timeout mymaster 180000
@@ -202,7 +202,7 @@ sentinel failover-timeout mymaster 180000
#
# Example:
#
Expand All @@ -29,7 +29,7 @@ Index: sentinel.conf

# CLIENTS RECONFIGURATION SCRIPT
#
@@ -207,7 +207,7 @@ sentinel failover-timeout mymaster 180000
@@ -227,7 +227,7 @@ sentinel failover-timeout mymaster 180000
#
# Example:
#
Expand Down
36 changes: 19 additions & 17 deletions databases/redis/patches/patch-src_Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
$OpenBSD: patch-src_Makefile,v 1.31 2020/03/17 04:51:28 tb Exp $
$OpenBSD: patch-src_Makefile,v 1.32 2020/06/08 07:32:47 tb Exp $

Index: src/Makefile
--- src/Makefile.orig
+++ src/Makefile
Expand All @@ -17,9 +18,9 @@ Index: src/Makefile
INSTALL_BIN=$(PREFIX)/bin
+INSTALL_SBIN=$(PREFIX)/sbin
INSTALL=install
PKG_CONFIG?=pkg-config

# Default allocator defaults to Jemalloc if it's not an ARM
@@ -48,7 +49,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
@@ -49,7 +50,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
CFLAGS+=-funwind-tables
else
ifneq (,$(findstring armv,$(uname_M)))
Expand All @@ -28,7 +29,7 @@ Index: src/Makefile
endif
endif

@@ -82,7 +83,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
@@ -83,7 +84,7 @@ ifneq (,$(filter aarch64 armv,$(uname_M)))
FINAL_LIBS+=-latomic
else
ifneq (,$(findstring armv,$(uname_M)))
Expand All @@ -37,24 +38,25 @@ Index: src/Makefile
endif
endif

@@ -136,7 +137,7 @@ endif
@@ -149,7 +150,7 @@ endif
endif
endif
# Include paths to dependencies
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I${MODLUA_INCL_DIR}

ifeq ($(MALLOC),tcmalloc)
FINAL_CFLAGS+= -DUSE_TCMALLOC
@@ -174,6 +175,7 @@ endif
REDIS_SERVER_NAME=redis-server
REDIS_SENTINEL_NAME=redis-sentinel
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o
# Determine systemd support and/or build preference (defaulting to auto-detection)
BUILD_WITH_SYSTEMD=no
@@ -224,6 +225,8 @@ REDIS_BENCHMARK_OBJ=ae.o anet.o redis-benchmark.o adli
REDIS_CHECK_RDB_NAME=redis-check-rdb
REDIS_CHECK_AOF_NAME=redis-check-aof

+REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
REDIS_CLI_NAME=redis-cli
REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o siphash.o crc16.o
REDIS_BENCHMARK_NAME=redis-benchmark
@@ -225,7 +227,7 @@ endif
+
all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME)
@echo ""
@echo "Hint: It's a good idea to run 'make test' ;)"
@@ -268,7 +271,7 @@ endif

# redis-server
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
Expand All @@ -63,7 +65,7 @@ Index: src/Makefile

# redis-sentinel
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
@@ -268,7 +270,7 @@ distclean: clean
@@ -315,7 +318,7 @@ distclean: clean
.PHONY: distclean

test: $(REDIS_SERVER_NAME) $(REDIS_CHECK_AOF_NAME)
Expand All @@ -72,7 +74,7 @@ Index: src/Makefile

test-sentinel: $(REDIS_SENTINEL_NAME)
@(cd ..; ./runtest-sentinel)
@@ -312,13 +314,14 @@ src/help.h:
@@ -359,13 +362,14 @@ src/help.h:
@../utils/generate-command-help.rb > help.h

install: all
Expand Down
11 changes: 1 addition & 10 deletions databases/redis/patches/patch-src_config_c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$OpenBSD: patch-src_config_c,v 1.7 2017/08/09 09:16:09 dcoppa Exp $
$OpenBSD: patch-src_config_c,v 1.8 2020/06/08 07:32:47 tb Exp $

Recognize LOG_DAEMON as a valid facility

Expand All @@ -13,12 +13,3 @@ Index: src/config.c
{"user", LOG_USER},
{"local0", LOG_LOCAL0},
{"local1", LOG_LOCAL1},
@@ -298,7 +299,7 @@ void loadServerConfigFromString(char *config) {
server.syslog_facility =
configEnumGetValue(syslog_facility_enum,argv[1]);
if (server.syslog_facility == INT_MIN) {
- err = "Invalid log facility. Must be one of USER or between LOCAL0-LOCAL7";
+ err = "Invalid log facility. Must be one of DAEMON, USER or between LOCAL0-LOCAL7";
goto loaderr;
}
} else if (!strcasecmp(argv[0],"databases") && argc == 2) {
6 changes: 4 additions & 2 deletions databases/redis/patches/patch-src_networking_c
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
$OpenBSD: patch-src_networking_c,v 1.1 2020/03/17 04:51:28 tb Exp $
$OpenBSD: patch-src_networking_c,v 1.2 2020/06/08 07:32:47 tb Exp $

time_t is long long, so use llabs to avoid truncation

Index: src/networking.c
--- src/networking.c.orig
+++ src/networking.c
@@ -1939,7 +1939,7 @@ void securityWarningCommand(client *c) {
@@ -2554,7 +2554,7 @@ void securityWarningCommand(client *c) {
static time_t logged_time;
time_t now = time(NULL);

Expand Down
Loading

0 comments on commit e967071

Please sign in to comment.