Build improvements by rafie · Pull Request #2832 · RedisGraph/RedisGraph · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .circleci/config.yml
37 changes: 37 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build on macOS

on:
push:
workflow_dispatch:

jobs:
build-macos:
runs-on: macos-11
defaults:
run:
shell: bash -l -eo pipefail {0}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup
run: |
./sbin/setup
export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}"
./deps/readies/bin/getredis --with-github-token
- name: Build
run: |
make
make pack
- name: Unit tests
run: |
make unit-tests CLEAR_LOGS=0
- name: Flow tests
run: |
make flow-tests CLEAR_LOGS=0
- name: TCK tests
run: |
make tck-tests CLEAR_LOGS=0
- name: Fuzzer tests
run: |
make fuzz
25 changes: 7 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ endif()

project(redisgraph)

file(GLOB_RECURSE SOURCES "src/*.c")
setup_cc_options()

if (NOT APPLE)
add_library(redisgraph SHARED ${SOURCES})
else()
add_library(redisgraph MODULE ${SOURCES})
endif()
file(GLOB_RECURSE SOURCES "src/*.c")

set_property(TARGET redisgraph PROPERTY C_STANDARD 11)
add_library(redisgraph SHARED ${SOURCES})

include_directories(
${root}/src
Expand All @@ -41,17 +37,11 @@ if (DEBUG)
add_compile_definitions(RG_DEBUG)
endif()

add_compile_options(${CMAKE_CC_FLAGS} ${CMAKE_CC_C_FLAGS})
target_compile_options(redisgraph PRIVATE -fPIC ${CMAKE_CC_FLAGS} ${CMAKE_CC_C_FLAGS})
if (MEMCHECK)
add_compile_definitions(MEMCHECK)
endif()

lists_from_env(LIBOMP)
target_link_options(redisgraph PRIVATE ${CMAKE_LD_FLAGS} ${CMAKE_SO_LD_FLAGS} ${LIBOMP})

set_target_properties(redisgraph PROPERTIES PREFIX "")
set_target_properties(redisgraph PROPERTIES SUFFIX ".so")
setup_shared_object_target(redisgraph "")

set_target_properties(redisgraph PROPERTIES LINKER_LANGUAGE CXX)

Expand All @@ -60,17 +50,16 @@ set(REDISGRAPH_OBJECTS $<TARGET_OBJECTS:redisgraph>)
lists_from_env(GRAPHBLAS LIBXXHASH RAX LIBCYPHER_PARSER REDISEARCH_LIBS UTF8PROC)
set(REDISGRAPH_LIBS ${GRAPHBLAS} ${LIBXXHASH} ${RAX} ${LIBCYPHER_PARSER} ${REDISEARCH_LIBS} ${UTF8PROC})

target_link_libraries(redisgraph PRIVATE ${REDISGRAPH_LIBS} c m dl pthread)
target_link_options(redisgraph PRIVATE ${CMAKE_LD_FLAGS_LIST} ${CMAKE_SO_LD_FLAGS_LIST})
target_link_libraries(redisgraph PRIVATE ${REDISGRAPH_LIBS} ${CMAKE_LD_LIBS})

extract_debug_symbols(redisgraph)

if (APPLE)
# add_library(redisgraph_dylib SHARED $<TARGET_OBJECTS:redisgraph>)
# target_link_libraries(redisgraph_dylib PRIVATE ${REDISGRAPH_LIBS} ${LIBOMP} c m dl pthread)

add_library(redisgraph_static STATIC $<TARGET_OBJECTS:redisgraph>)
endif()

if (UNIT_TESTS)
add_subdirectory(${root}/tests/unit tests/unit)
endif()

18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ LIBS=$(RAX) $(LIBXXHASH) $(GRAPHBLAS) $(REDISEARCH_LIBS) $(LIBCYPHER_PARSER) $(U

CC_COMMON_H=$(SRCDIR)/src/common.h

CC_C_STD=gnu11
CC_OPENMP=1

include $(MK)/defs

$(info # Building into $(BINDIR))
Expand Down Expand Up @@ -296,7 +299,7 @@ endif

#----------------------------------------------------------------------------------------------

pack package: $(TARGET)
pack package: #$(TARGET)
@MODULE=$(realpath $(TARGET)) $(ROOT)/sbin/pack.sh

upload-release:
Expand All @@ -321,14 +324,7 @@ ifneq ($(BUILD),0)
TEST_DEPS=$(TARGET)
endif

ifeq ($(VG_DOCKER),1)
test:
@echo Building docker to run valgrind on macOS
$(SHOW)docker build -f tests/Dockerfile -t macos_test_docker .
else
test: $(TEST_DEPS)
$(SHOW)MODULE=$(TARGET) BINROOT=$(BINROOT) PARALLEL=$(_RLTEST_PARALLEL) ./tests/flow/tests.sh
endif
test: unit-tests flow-tests tck-tests

unit-tests:
ifneq ($(BUILD),0)
Expand Down Expand Up @@ -385,7 +381,9 @@ COV_EXCLUDE+=$(foreach D,$(COV_EXCLUDE_DIRS),'$(realpath $(ROOT))/$(D)/*')
coverage:
$(SHOW)$(MAKE) build COV=1
$(SHOW)$(COVERAGE_RESET)
-$(SHOW)$(MAKE) test COV=1
-$(SHOW)$(MAKE) unit-tests COV=1
-$(SHOW)$(MAKE) flow-tests COV=1
-$(SHOW)$(MAKE) tck-tests COV=1
$(SHOW)$(COVERAGE_COLLECT_REPORT)

.PHONY: coverage
Expand Down
2 changes: 1 addition & 1 deletion build/docker/dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ADD . /build
RUN ./deps/readies/bin/getbash
{% endif %}
RUN ./deps/readies/bin/getupdates
RUN ./sbin/setup
RUN VERBOSE=1 ./sbin/setup

RUN make

Expand Down
2 changes: 1 addition & 1 deletion deps/readies
120 changes: 74 additions & 46 deletions sbin/pack.sh
Loading