Skip to content

Commit

Permalink
update rocksdb cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexStocks committed Aug 6, 2024
1 parent d3873b2 commit 8eea991
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/import_braft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build
run: bash etc/script/ci/build.sh
run: bash ./etc/script/ci/build.sh

- name: Check Format
working-directory: ${{ github.workspace }}/build
Expand All @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build --verbose
env:
env:
CPLUS_INCLUDE_PATH: /opt/homebrew/include
run: |
brew install autoconf
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pikiwidb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build
run: bash etc/script/ci/build.sh
run: bash ./etc/script/ci/build.sh

- name: Check Format
working-directory: ${{ github.workspace }}/build
Expand Down Expand Up @@ -67,4 +67,4 @@ jobs:
run: |
cd ../tests
go mod tidy
go test -timeout 15m
go test -timeout 15m
5 changes: 4 additions & 1 deletion cmake/rocksdb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ ExternalProject_Add(
extern_rocksdb
${EXTERNAL_PROJECT_LOG_ARGS}
GIT_REPOSITORY https://github.com/facebook/rocksdb.git
GIT_TAG v8.3.3
GIT_TAG v9.4.0
URL https://github.com/facebook/rocksdb/archive/refs/tags/v9.4.0.tar.gz
URL_HASH MD5=ce19cb3e2b6db927ef88cbf25c42097e
DOWNLOAD_NO_PROGRESS 1
DEPENDS
gflags
snappy
Expand Down
22 changes: 12 additions & 10 deletions etc/script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,25 @@ function build() {
cmake --build ${PREFIX} -- ${MAKE_FLAGS} -j ${CPU_CORE}

if [ $? -eq 0 ]; then
echo -e "pikiwidb compile complete, output file ${C_GREEN} ${BUILD_DIR}/pikiwidb ${C_END}"
# echo -e "pikiwidb compile complete, output file ${C_GREEN} ${PREFIX}/bin/pikiwidb ${C_END}"
echo -e "pikiwidb compile complete, output file ${C_GREEN} ./bin/pikiwidb ${C_END}"
else
echo -e "${C_RED} pikiwidb compile fail ${C_END}"
exit 1
fi
}

# ":?" makes sure the bash var is not empty.
function clear() {
rm -rf ${PROJECT_HOME}/deps-debug
rm -rf ${PROJECT_HOME}/deps-release
rm -rf ${PROJECT_HOME}/cmake-build-debug
rm -rf ${PROJECT_HOME}/cmake-build-release
rm -rf ${PROJECT_HOME}/cmake-build-release-release
rm -rf ${PROJECT_HOME}/build
rm -rf ${PROJECT_HOME}/build-release
rm -rf ${PROJECT_HOME}/build-debug
rm -rf ${PROJECT_HOME}/bin
rm -rf ${PROJECT_HOME:?}/deps-debug
rm -rf ${PROJECT_HOME:?}/deps-release
rm -rf ${PROJECT_HOME:?}/cmake-build-debug
rm -rf ${PROJECT_HOME:?}/cmake-build-release
rm -rf ${PROJECT_HOME:?}/cmake-build-release-release
rm -rf ${PROJECT_HOME:?}/build
rm -rf ${PROJECT_HOME:?}/build-release
rm -rf ${PROJECT_HOME:?}/build-debug
rm -rf ${PROJECT_HOME:?}/bin
exit 0
}

Expand Down
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ IF (CMAKE_BUILD_TYPE STREQUAL "Release")
TARGET_COMPILE_DEFINITIONS(pikiwidb PRIVATE KPIKIWIDB_BUILD_DATE="${BUILD_TIMESTAMP}" KPIKIWIDB_GIT_COMMIT_ID="${GIT_COMMIT_ID}")
ENDIF ()

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/)

TARGET_INCLUDE_DIRECTORIES(pikiwidb
PRIVATE ${PROJECT_SOURCE_DIR}/src
Expand Down
4 changes: 2 additions & 2 deletions tests/util/pikiwidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ func GetConfPath(copy bool, t int64) string {
nPath string
)
if len(rPath) != 0 && copy {
nPath = path.Join(rPath, fmt.Sprintf("pikiwidb_%d.conf", t))
nPath = path.Join(rPath, fmt.Sprintf("etc/conf/pikiwidb_%d.conf", t))
return nPath
}
if len(rPath) != 0 {
cPath = path.Join(rPath, "pikiwidb.conf")
cPath = path.Join(rPath, "etc/conf/pikiwidb.conf")
return cPath
}
return rPath
Expand Down

0 comments on commit 8eea991

Please sign in to comment.