Skip to content

Commit

Permalink
Redis patch and test results
Browse files Browse the repository at this point in the history
  • Loading branch information
coolyjg committed Aug 2, 2023
1 parent 26fc1a0 commit 4aa872c
Show file tree
Hide file tree
Showing 27 changed files with 630 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:
run: make ARCH=${{ matrix.arch }} A=apps/c/udpserver
- name: Build c/iperf
run: make ARCH=${{ matrix.arch }} A=apps/c/iperf
- name: Build c/redis
run: make ARCH=${{ matrix.arch }} A=apps/c/redis SMP=4

build-apps-for-std:
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ clean: clean_c
rm -rf $(APP)/*.bin $(APP)/*.elf
cargo clean

clean_c:
clean_c::
rm -rf ulib/axlibc/build_*
rm -rf $(app-objs)

Expand Down
1 change: 1 addition & 0 deletions apps/c/redis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
redis-*
45 changes: 45 additions & 0 deletions apps/c/redis/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Build for linux

ARCH ?= x86_64

CC := $(ARCH)-linux-musl-gcc

CFLAGS :=
LDFLAGS := -static -no-pie

redis-version := 7.0.12
redis-dir := $(CURDIR)/redis-$(redis-version)
redis-objs := $(redis-dir)/src/redis-server.o
redis-bin := redis-server

redis-build-args := \
CC=$(CC) \
CFLAGS="$(CFLAGS)" \
USE_JEMALLOC=no \
-j

ifneq ($(V),)
redis-build-args += V=$(V)
endif

all: build

$(redis-dir):
@echo "Download redis source code"
wget https://github.com/redis/redis/archive/$(redis-version).tar.gz -P $(APP)
tar -zxvf $(APP)/$(redis-version).tar.gz -C $(APP) && rm -f $(APP)/$(redis-version).tar.gz
cd $(redis-dir) && git init && git add .
patch -p1 -N -d $(redis-dir) --no-backup-if-mismatch -r - < $(APP)/redis.patch

build: $(redis-dir)
cd $(redis-dir) && $(MAKE) $(redis-build-args)
$(CC) $(LDFLAGS) -o $(redis-bin) $(redis-objs)

run:
./$(redis-bin)

clean:
$(MAKE) -C $(redis-dir) distclean
rm -f $(redis-bin)

.PHONY: all build clean
Loading

0 comments on commit 4aa872c

Please sign in to comment.