From 4eb3945d4337430a0e1cd25e23192b4a9134ee47 Mon Sep 17 00:00:00 2001 From: web3-developer <51288821+web3-developer@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:24:29 +0800 Subject: [PATCH] If vendor RocksDb files have changed the trigger a clean rebuild. --- scripts/build_static_deps.sh | 8 ++++++++ scripts/clean_build_artifacts.sh | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/build_static_deps.sh b/scripts/build_static_deps.sh index a61c52e..736e6ba 100755 --- a/scripts/build_static_deps.sh +++ b/scripts/build_static_deps.sh @@ -23,6 +23,14 @@ BUILD_DEST="${REPO_DIR}/build/lib" git submodule update --init +if ${MAKE} -C "${ROCKSDB_LIB_DIR}" --dry-run static_lib | grep -q 'Nothing to be done'; then + echo "RocksDb static libraries already built. Skipping build." + exit 0 +else + ${REPO_DIR}/scripts/clean_build_artifacts.sh + echo "Building RocksDb static libraries." +fi + export DISABLE_WARNING_AS_ERROR=1 export ROCKSDB_DISABLE_SNAPPY=1 diff --git a/scripts/clean_build_artifacts.sh b/scripts/clean_build_artifacts.sh index 52f6d24..5fcf68a 100755 --- a/scripts/clean_build_artifacts.sh +++ b/scripts/clean_build_artifacts.sh @@ -13,7 +13,9 @@ set -e cd "$(dirname "${BASH_SOURCE[0]}")"/.. +echo "Cleaning up RocksDb build artifacts." + rm -rf build -make -C vendor/rocksdb clean +make -C vendor/rocksdb clean --no-print-directory > /dev/null -git submodule foreach --recursive git clean -fdx +git submodule foreach --recursive git clean -fdx > /dev/null