Skip to content

Commit fb9e9ec

Browse files
authored
Revert "Simplify offline build (valkey-io#73)" (valkey-io#93)
This reverts commit ac5a0e4. Signed-off-by: Roshan Khatri <rvkhatri@amazon.com>
1 parent ac5a0e4 commit fb9e9ec

File tree

4 files changed

+37
-76
lines changed

4 files changed

+37
-76
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,20 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
server_version: ["unstable", "8.0", "8.1", "9.0"]
11+
server_version: ['unstable', '8.0', '8.1', '9.0']
1212
steps:
13-
- name: Checkout valkey
14-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
15-
with:
16-
repository: valkey-io/valkey
17-
ref: ${{ matrix.server_version }}
18-
path: valkey
19-
20-
- name: Set VALKEY_INCLUDE_DIR
21-
working-directory: valkey
22-
run: echo "VALKEY_INCLUDE_DIR=$(pwd)/src" >> $GITHUB_ENV
23-
24-
- name: Checkout valkey-json
25-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
26-
with:
27-
path: valkey-json
28-
13+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
2914
- name: Set the server version
3015
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV
31-
3216
- name: Build release
33-
working-directory: valkey-json
3417
run: ./build.sh
3518

3619
unit-tests:
3720
runs-on: ubuntu-latest
3821
strategy:
3922
fail-fast: false
4023
matrix:
41-
server_version: ["unstable", "8.0", "8.1", "9.0"]
24+
server_version: ['unstable', '8.0', '8.1', '9.0']
4225
steps:
4326
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4427
- name: Set the server version
@@ -51,15 +34,15 @@ jobs:
5134
strategy:
5235
fail-fast: false
5336
matrix:
54-
server_version: ["unstable", "8.0", "8.1", "9.0"]
37+
server_version: ['unstable', '8.0', '8.1', '9.0']
5538
steps:
5639
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5740
- name: Set the server version
5841
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV
5942
- name: Set up Python
6043
uses: actions/setup-python@3542bca2639a428e1796aaa6a2ffef0c0f575566 # v3.1.4
6144
with:
62-
python-version: "3.9"
45+
python-version: '3.9'
6346
- name: Install dependencies
6447
run: |
6548
python -m pip install --upgrade pip
@@ -72,15 +55,15 @@ jobs:
7255
strategy:
7356
fail-fast: false
7457
matrix:
75-
server_version: ["unstable", "8.0", "8.1", "9.0"]
58+
server_version: ['unstable', '8.0', '8.1', '9.0']
7659
steps:
7760
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
7861
- name: Set the server version
7962
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV
8063
- name: Set up Python
8164
uses: actions/setup-python@3542bca2639a428e1796aaa6a2ffef0c0f575566 # v3.1.4
8265
with:
83-
python-version: "3.9"
66+
python-version: '3.9'
8467
- name: Install dependencies
8568
run: |
8669
python -m pip install --upgrade pip

CMakeLists.txt

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -100,39 +100,31 @@ else()
100100
endif()
101101
endif()
102102

103-
if(VALKEY_INCLUDE_DIR)
104-
if(ENABLE_UNIT_TESTS OR ENABLE_INTEGRATION_TESTS)
105-
message(FATAL_ERROR "Incompatible option VALKEY_INCLUDE_DIR with ENABLE_UNIT_TESTS or ENABLE_INTEGRATION_TESTS")
106-
endif()
107-
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
108-
file(COPY_FILE "${VALKEY_INCLUDE_DIR}/valkeymodule.h" "${CMAKE_CURRENT_SOURCE_DIR}/src/include/valkeymodule.h")
109-
else()
110-
ExternalProject_Add(
111-
valkey
112-
GIT_REPOSITORY https://github.com/valkey-io/valkey.git
113-
GIT_TAG ${VALKEY_VERSION}
114-
PREFIX ${VALKEY_DOWNLOAD_DIR}
115-
CONFIGURE_COMMAND ""
116-
BUILD_COMMAND ${VALKEY_BUILD_CMD}
117-
INSTALL_COMMAND ""
118-
BUILD_IN_SOURCE 1
119-
)
120-
121-
# Define the paths for the copied files
122-
set(VALKEY_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
123-
set(VALKEY_BINARY_DEST "${CMAKE_CURRENT_SOURCE_DIR}/tst/integration/.build/binaries/${VALKEY_VERSION}")
103+
ExternalProject_Add(
104+
valkey
105+
GIT_REPOSITORY https://github.com/valkey-io/valkey.git
106+
GIT_TAG ${VALKEY_VERSION}
107+
PREFIX ${VALKEY_DOWNLOAD_DIR}
108+
CONFIGURE_COMMAND ""
109+
BUILD_COMMAND ${VALKEY_BUILD_CMD}
110+
INSTALL_COMMAND ""
111+
BUILD_IN_SOURCE 1
112+
)
124113

125-
ExternalProject_Add_Step(
126-
valkey
127-
copy_header_files
128-
COMMENT "Copying header files to include/ directory"
129-
DEPENDEES download
130-
DEPENDERS configure
131-
COMMAND ${CMAKE_COMMAND} -E make_directory ${VALKEY_INCLUDE_DIR}
132-
COMMAND ${CMAKE_COMMAND} -E copy ${VALKEY_DOWNLOAD_DIR}/src/valkey/src/valkeymodule.h ${VALKEY_INCLUDE_DIR}/valkeymodule.h
133-
ALWAYS 1
134-
)
135-
endif()
114+
# Define the paths for the copied files
115+
set(VALKEY_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
116+
set(VALKEY_BINARY_DEST "${CMAKE_CURRENT_SOURCE_DIR}/tst/integration/.build/binaries/${VALKEY_VERSION}")
117+
118+
ExternalProject_Add_Step(
119+
valkey
120+
copy_header_files
121+
COMMENT "Copying header files to include/ directory"
122+
DEPENDEES download
123+
DEPENDERS configure
124+
COMMAND ${CMAKE_COMMAND} -E make_directory ${VALKEY_INCLUDE_DIR}
125+
COMMAND ${CMAKE_COMMAND} -E copy ${VALKEY_DOWNLOAD_DIR}/src/valkey/src/valkeymodule.h ${VALKEY_INCLUDE_DIR}/valkeymodule.h
126+
ALWAYS 1
127+
)
136128

137129
# Integration tests require the valkey-test-framework which is only needed when
138130
# building Valkey from source.
@@ -210,18 +202,11 @@ message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
210202
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
211203

212204
# Fetch RapidJSON
213-
if(RAPIDJSON_SOURCE_DIR)
214-
FetchContent_Declare(
215-
rapidjson
216-
SOURCE_DIR "${RAPIDJSON_SOURCE_DIR}"
217-
)
218-
else()
219-
FetchContent_Declare(
220-
rapidjson
221-
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
222-
GIT_TAG ebd87cb468fb4cb060b37e579718c4a4125416c1
223-
)
224-
endif()
205+
FetchContent_Declare(
206+
rapidjson
207+
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
208+
GIT_TAG ebd87cb468fb4cb060b37e579718c4a4125416c1
209+
)
225210

226211
# Disable RapidJSON tests and examples
227212
set(RAPIDJSON_BUILD_TESTS OFF CACHE BOOL "Build rapidjson tests" FORCE)

build.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ fi
109109

110110
CMAKE_FLAGS="$CMAKE_FLAGS -DENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS} -DENABLE_INTEGRATION_TESTS=${ENABLE_INTEGRATION_TESTS} -DBUILD_RELEASE=${ENABLE_BUILD_RELEASE}"
111111

112-
if [ -n "${VALKEY_INCLUDE_DIR}" ]; then
113-
CMAKE_FLAGS="$CMAKE_FLAGS -DVALKEY_INCLUDE_DIR=${VALKEY_INCLUDE_DIR}"
114-
fi
115-
116112
if [ -z "${CFLAGS}" ]; then
117113
cmake .. -DVALKEY_VERSION=${SERVER_VERSION} ${CMAKE_FLAGS}
118114
else

src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,4 @@ target_sources(${OBJECT_TARGET}
4040
)
4141

4242
add_library(${JSON_MODULE_LIB} SHARED $<TARGET_OBJECTS:${OBJECT_TARGET}>)
43-
44-
if(ENABLE_UNIT_TESTS OR ENABLE_INTEGRATION_TESTS)
45-
add_dependencies(${OBJECT_TARGET} valkey)
46-
endif()
43+
add_dependencies(${OBJECT_TARGET} valkey)

0 commit comments

Comments
 (0)