Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If vendor RocksDb files have changed the trigger a clean rebuild. #49

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions scripts/build_static_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnetheduck This should fix the problem you encountered. If we have already built RocksDb then it won't be rebuilt unless you switch the code then it will check if a rebuild is needed, and will clean the build artifacts just before completing the full rebuild.

By the way I couldn't find a good way to clean up the build artifacts as you suggested without triggering RocksDb to rebuild and we don't want to rebuild RocksDb every time, that would be too slow. This is because the make file targets are all linked together and if any files are changed or deleted then it will trigger a rebuild up the path of what was changed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright! nice bonus with the echo, without it looks like the build has frozen..


export DISABLE_WARNING_AS_ERROR=1

export ROCKSDB_DISABLE_SNAPPY=1
Expand Down
6 changes: 4 additions & 2 deletions scripts/clean_build_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading