diff --git a/.circleci/config.yml b/.circleci/config.yml index fcced9f54..780afa48c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,8 @@ commands: - run: name: Install JDK 8 on macos command: | - brew install --cask adoptopenjdk/openjdk/adoptopenjdk8 + HOMEBREW_NO_AUTO_UPDATE=1 brew tap bell-sw/liberica + HOMEBREW_NO_AUTO_UPDATE=1 brew install --cask liberica-jdk8 increase-max-open-files-on-macos: steps: @@ -172,8 +173,8 @@ executors: jobs: build-macos: macos: - xcode: 12.5.1 - resource_class: large + xcode: 13.4.1 + resource_class: m2pro.medium environment: ROCKSDB_DISABLE_JEMALLOC: 1 # jemalloc cause env_test hang, disable it for now steps: @@ -185,8 +186,8 @@ jobs: build-macos-cmake: macos: - xcode: 12.5.1 - resource_class: large + xcode: 13.4.1 + resource_class: m2pro.medium parameters: run_even_tests: description: run even or odd tests, used to split tests to 2 groups @@ -417,7 +418,10 @@ jobs: steps: - checkout # check out the code in the project directory - run: apt-get update -y && apt-get install -y libgflags-dev - - run: make V=1 -j8 unity_test + - run: + name: "Unity build" + command: make V=1 -j8 unity_test + no_output_timeout: 20m - run: make V=1 -j8 -k check-headers # could be moved to a different build - post-steps @@ -621,10 +625,10 @@ jobs: build-macos-java: macos: - xcode: 12.5.1 - resource_class: large + xcode: 13.4.1 + resource_class: m2pro.medium environment: - JAVA_HOME: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home + JAVA_HOME: /Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home ROCKSDB_DISABLE_JEMALLOC: 1 # jemalloc causes java 8 crash steps: - increase-max-open-files-on-macos @@ -645,10 +649,10 @@ jobs: build-macos-java-static: macos: - xcode: 12.5.1 - resource_class: large + xcode: 13.4.1 + resource_class: m2pro.medium environment: - JAVA_HOME: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home + JAVA_HOME: /Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home steps: - increase-max-open-files-on-macos - install-gflags-on-macos @@ -669,10 +673,10 @@ jobs: build-macos-java-static-universal: macos: - xcode: 12.5.1 - resource_class: large + xcode: 13.4.1 + resource_class: m2pro.medium environment: - JAVA_HOME: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home + JAVA_HOME: /Library/Java/JavaVirtualMachines/liberica-jdk-8.jdk/Contents/Home steps: - increase-max-open-files-on-macos - install-gflags-on-macos @@ -863,20 +867,7 @@ workflows: jobs-linux-other-checks: jobs: - build-linux-clang10-clang-analyze - - build-linux-unity-and-headers - build-linux-mini-crashtest - jobs-windows: - jobs: - - build-windows: - name: "build-windows-vs2019" - - build-windows: - name: "build-windows-vs2019-cxx20" - extra_cmake_opt: -DCMAKE_CXX_STANDARD=20 - - build-windows: - name: "build-windows-vs2017" - vs_year: "2017" - cmake_generator: "Visual Studio 15 Win64" - - build-cmake-mingw jobs-java: jobs: - build-linux-java @@ -887,10 +878,6 @@ workflows: jobs-macos: jobs: - build-macos - - build-macos-cmake: - run_even_tests: true - - build-macos-cmake: - run_even_tests: false jobs-linux-arm: jobs: - build-linux-arm diff --git a/cache/fast_lru_cache.cc b/cache/fast_lru_cache.cc index 10ae7367f..2813c04fb 100644 --- a/cache/fast_lru_cache.cc +++ b/cache/fast_lru_cache.cc @@ -92,7 +92,7 @@ void LRUHandleTable::Resize() { std::unique_ptr new_list { new LRUHandle* [size_t{1} << new_length_bits] {} }; - uint32_t count = 0; + [[maybe_unused]] uint32_t count = 0; for (uint32_t i = 0; i < old_length; i++) { LRUHandle* h = list_[i]; while (h != nullptr) { diff --git a/cache/lru_cache.cc b/cache/lru_cache.cc index a28c2b515..a9d0f8964 100644 --- a/cache/lru_cache.cc +++ b/cache/lru_cache.cc @@ -91,7 +91,7 @@ void LRUHandleTable::Resize() { std::unique_ptr new_list { new LRUHandle* [size_t{1} << new_length_bits] {} }; - uint32_t count = 0; + [[maybe_unused]] uint32_t count = 0; for (uint32_t i = 0; i < old_length; i++) { LRUHandle* h = list_[i]; while (h != nullptr) { diff --git a/db/db_test.cc b/db/db_test.cc index f3039f187..589c940a5 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -3301,7 +3301,7 @@ static bool CompareIterators(int step, DB* model, DB* db, options.snapshot = db_snap; Iterator* dbiter = db->NewIterator(options); bool ok = true; - int count = 0; + [[maybe_unused]] int count = 0; for (miter->SeekToFirst(), dbiter->SeekToFirst(); ok && miter->Valid() && dbiter->Valid(); miter->Next(), dbiter->Next()) { count++; diff --git a/db/version_edit_handler.cc b/db/version_edit_handler.cc index f3e24016b..709a666dd 100644 --- a/db/version_edit_handler.cc +++ b/db/version_edit_handler.cc @@ -26,7 +26,7 @@ void VersionEditHandlerBase::Iterate(log::Reader& reader, assert(log_read_status); assert(log_read_status->ok()); - size_t recovered_edits = 0; + [[maybe_unused]] size_t recovered_edits = 0; Status s = Initialize(); while (reader.LastRecordEnd() < max_manifest_read_size_ && s.ok() && reader.ReadRecord(&record, &scratch) && log_read_status->ok()) { diff --git a/db/version_set.cc b/db/version_set.cc index 223bdba6a..e965eebf4 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -3113,7 +3113,7 @@ void VersionStorageInfo::SetFinalized() { assert(MaxBytesForLevel(level) >= max_bytes_prev_level); max_bytes_prev_level = MaxBytesForLevel(level); } - int num_empty_non_l0_level = 0; + [[maybe_unused]] int num_empty_non_l0_level = 0; for (int level = 0; level < num_levels(); level++) { assert(LevelFiles(level).size() == 0 || LevelFiles(level).size() == LevelFilesBrief(level).num_files); diff --git a/file/prefetch_test.cc b/file/prefetch_test.cc index de896a99e..fa3c2138d 100644 --- a/file/prefetch_test.cc +++ b/file/prefetch_test.cc @@ -168,7 +168,7 @@ TEST_P(PrefetchTest, Basic) { // count the keys { auto iter = std::unique_ptr(db_->NewIterator(ReadOptions())); - int num_keys = 0; + [[maybe_unused]] int num_keys = 0; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { num_keys++; } diff --git a/memtable/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc index 4523aa770..2261136fa 100644 --- a/memtable/inlineskiplist_test.cc +++ b/memtable/inlineskiplist_test.cc @@ -570,7 +570,7 @@ class TestState { static void ConcurrentReader(void* arg) { TestState* state = reinterpret_cast(arg); Random rnd(state->seed_); - int64_t reads = 0; + [[maybe_unused]] int64_t reads = 0; state->Change(TestState::RUNNING); while (!state->quit_flag_.load(std::memory_order_acquire)) { state->t_.ReadStep(&rnd); diff --git a/memtable/skiplist_test.cc b/memtable/skiplist_test.cc index d35bc856d..b74e26cb2 100644 --- a/memtable/skiplist_test.cc +++ b/memtable/skiplist_test.cc @@ -344,7 +344,7 @@ class TestState { static void ConcurrentReader(void* arg) { TestState* state = reinterpret_cast(arg); Random rnd(state->seed_); - int64_t reads = 0; + [[maybe_unused]] int64_t reads = 0; state->Change(TestState::RUNNING); while (!state->quit_flag_.load(std::memory_order_acquire)) { state->t_.ReadStep(&rnd); diff --git a/table/block_based/block_based_table_reader_test.cc b/table/block_based/block_based_table_reader_test.cc index 4c2844f53..d176aed71 100644 --- a/table/block_based/block_based_table_reader_test.cc +++ b/table/block_based/block_based_table_reader_test.cc @@ -50,7 +50,7 @@ class BlockBasedTableReaderBaseTest : public testing::Test { // Internal key is constructed directly from this key, // and internal key size is required to be >= 8 bytes, // so use %08u as the format string. - sprintf(k, "%08u", key); + snprintf(k, sizeof(k), "%08u", key); std::string v; if (mixed_with_human_readable_string_value) { v = (block % 2) ? rnd.HumanReadableString(256) diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index ef4203fbf..7209a56bf 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -6807,8 +6807,8 @@ class Benchmark { fprintf(stderr, "num reads to do %" PRIu64 "\n", reads_); Duration duration(FLAGS_duration, reads_); - uint64_t num_seek_to_first = 0; - uint64_t num_next = 0; + [[maybe_unused]] uint64_t num_seek_to_first = 0; + [[maybe_unused]] uint64_t num_next = 0; while (!duration.Done(1)) { if (!iter->Valid()) { iter->SeekToFirst(); diff --git a/util/cleanable.cc b/util/cleanable.cc index 1aad0ed50..89a7ab9be 100644 --- a/util/cleanable.cc +++ b/util/cleanable.cc @@ -11,6 +11,7 @@ #include #include +#include namespace ROCKSDB_NAMESPACE {