Skip to content

Commit 80c9088

Browse files
committed
MDEV-13585: RocksDB plugin fails to build on macOS because of unknown type timer_t etc.
Rdb_io_watchdog can not be built on OS X. Disable it.
1 parent 4ae200a commit 80c9088

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

storage/rocksdb/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ ADD_CONVENIENCE_LIBRARY(rocksdb_aux_lib
146146
ADD_DEPENDENCIES(rocksdb_aux_lib GenError)
147147

148148
# MARIAROCKS-TODO: how to properly depend on -lrt ?
149-
TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY} -lrt)
149+
TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
150+
if (UNIX AND NOT APPLE)
151+
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
152+
endif()
150153

151154
TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib)
152155

@@ -182,7 +185,9 @@ ENDIF()
182185
# ADD_SUBDIRECTORY(unittest)
183186
#ENDIF()
184187

185-
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
188+
if (UNIX AND NOT APPLE)
189+
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
190+
endif()
186191

187192
ADD_LIBRARY(rocksdb_tools STATIC
188193
rocksdb/tools/ldb_tool.cc

storage/rocksdb/ha_rocksdb.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Rdb_ddl_manager ddl_manager;
173173
const char *m_mysql_gtid;
174174
Rdb_binlog_manager binlog_manager;
175175

176-
#ifndef _WIN32
176+
#if !defined(_WIN32) && !defined(__APPLE__)
177177
Rdb_io_watchdog *io_watchdog = nullptr;
178178
#endif
179179
/**
@@ -554,7 +554,7 @@ static void rocksdb_set_io_write_timeout(
554554
void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
555555
DBUG_ASSERT(save != nullptr);
556556
DBUG_ASSERT(rdb != nullptr);
557-
#ifndef _WIN32
557+
#if !defined(_WIN32) && !defined(__APPLE__)
558558
DBUG_ASSERT(io_watchdog != nullptr);
559559
#endif
560560

@@ -563,7 +563,7 @@ static void rocksdb_set_io_write_timeout(
563563
const uint32_t new_val = *static_cast<const uint32_t *>(save);
564564

565565
rocksdb_io_write_timeout_secs = new_val;
566-
#ifndef _WIN32
566+
#if !defined(_WIN32) && !defined(__APPLE__)
567567
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
568568
#endif
569569
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
@@ -3984,7 +3984,7 @@ static int rocksdb_init_func(void *const p) {
39843984
directories.push_back(myrocks::rocksdb_wal_dir);
39853985
}
39863986

3987-
#ifndef _WIN32
3987+
#if !defined(_WIN32) && !defined(__APPLE__)
39883988
io_watchdog = new Rdb_io_watchdog(directories);
39893989
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
39903990
#endif
@@ -4076,7 +4076,7 @@ static int rocksdb_done_func(void *const p) {
40764076
delete commit_latency_stats;
40774077
commit_latency_stats = nullptr;
40784078

4079-
#ifndef _WIN32
4079+
#if !defined(_WIN32) && !defined(__APPLE__)
40804080
delete io_watchdog;
40814081
io_watchdog = nullptr;
40824082
#endif

storage/rocksdb/rdb_io_watchdog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <vector>
2323

2424
/* Rdb_io_watchdog doesn't work on Windows [yet] */
25-
#ifndef _WIN32
25+
#if !defined(_WIN32) && !defined(__APPLE__)
2626

2727
namespace myrocks {
2828

storage/rocksdb/rdb_io_watchdog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
namespace myrocks {
3636

3737
// Rdb_io_watchdog does not support Windows ATM.
38-
#ifndef _WIN32
38+
#if !defined(_WIN32) && !defined(__APPLE__)
3939

4040
class Rdb_io_watchdog {
4141
const int RDB_IO_WRITE_BUFFER_SIZE = 4096;

0 commit comments

Comments
 (0)