Skip to content

Commit d2c8f32

Browse files
xingbowangNavi
andcommitted
Fix nightly CI regressions from #14478
Fix two build failures introduced by the accelerate-build PR (#14478): 1. **Release build (NDEBUG) compile error**: The SyncPoint cleanup listener in testharness.cc referenced SyncPoint::GetInstance() which is only declared in debug builds. Guard the listener with #ifndef NDEBUG since it's only needed for debug test sharding anyway. 2. **Folly-lite link error**: The USE_FOLLY_LITE cmake path unconditionally linked -lglog, but glog may not be installed as a system library. Use find_library() to only link glog when available. Co-authored-by: Navi <navi@navibot.dev>
1 parent f8ff77d commit d2c8f32

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,10 @@ if(USE_FOLLY_LITE)
11371137
include_directories(${FMT_INCLUDE_DIR})
11381138

11391139
add_definitions(-DUSE_FOLLY -DFOLLY_NO_CONFIG)
1140-
list(APPEND THIRDPARTY_LIBS glog)
1140+
find_library(GLOG_LIBRARY glog)
1141+
if(GLOG_LIBRARY)
1142+
list(APPEND THIRDPARTY_LIBS glog)
1143+
endif()
11411144
endif()
11421145

11431146
set(ROCKSDB_STATIC_LIB rocksdb${ARTIFACT_SUFFIX})

test_util/testharness.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
#include <string>
1414
#include <thread>
1515

16+
#ifndef NDEBUG
1617
#include "test_util/sync_point.h"
18+
#endif
1719

1820
namespace {
21+
#ifndef NDEBUG
1922
// Global gtest event listener that cleans up SyncPoint state after every
2023
// test. Many tests set SyncPoint callbacks with captured local variables
2124
// but forget to disable/clear them. Under sharded execution (multiple
@@ -45,6 +48,7 @@ static int RegisterSyncPointCleanup() noexcept {
4548
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
4649
[[maybe_unused]] static int sync_point_cleanup_registered_ =
4750
RegisterSyncPointCleanup();
51+
#endif // !NDEBUG
4852
} // namespace
4953

5054
namespace ROCKSDB_NAMESPACE::test {

0 commit comments

Comments
 (0)