This is an automated email from the ASF dual-hosted git repository.
zclll pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 598861d2ad9 [fix](compile) fix compile backend on MacOS failed (#60723)
598861d2ad9 is described below
commit 598861d2ad9684a631b591cabfb8f11971235ea8
Author: 924060929 <[email protected]>
AuthorDate: Sat Feb 14 14:56:15 2026 +0800
[fix](compile) fix compile backend on MacOS failed (#60723)
fix compile backend on MacOS failed
---
be/CMakeLists.txt | 4 ++++
be/src/io/cache/block_file_cache_factory.cpp | 8 ++++++++
2 files changed, 12 insertions(+)
diff --git a/be/CMakeLists.txt b/be/CMakeLists.txt
index bdd3599982b..fb0de111359 100644
--- a/be/CMakeLists.txt
+++ b/be/CMakeLists.txt
@@ -51,6 +51,10 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_definitions(-D OS_MACOSX)
endif ()
+if (OS_MACOSX)
+ add_definitions(-DBOOST_PROCESS_POSIX_NO_SIGTIMEDWAIT
-UBOOST_POSIX_HAS_SIGTIMEDWAIT)
+endif()
+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (COMPILER_GCC 1)
option(ENABLE_PCH "enable pch" OFF)
diff --git a/be/src/io/cache/block_file_cache_factory.cpp
b/be/src/io/cache/block_file_cache_factory.cpp
index ef12ca353de..f7f16c99d60 100644
--- a/be/src/io/cache/block_file_cache_factory.cpp
+++ b/be/src/io/cache/block_file_cache_factory.cpp
@@ -94,7 +94,11 @@ Status FileCacheFactory::create_file_cache(const
std::string& cache_base_path,
LOG_ERROR("").tag("file cache path", cache_base_path).tag("error",
strerror(errno));
return Status::IOError("{} statfs error {}", cache_base_path,
strerror(errno));
}
+#if defined(__APPLE__)
+ const auto block_size = stat.f_bsize;
+#else
const auto block_size = stat.f_frsize ? stat.f_frsize : stat.f_bsize;
+#endif
size_t disk_capacity =
static_cast<size_t>(static_cast<size_t>(stat.f_blocks) *
static_cast<size_t>(block_size));
if (file_cache_settings.capacity == 0 || disk_capacity <
file_cache_settings.capacity) {
@@ -289,7 +293,11 @@ std::string validate_capacity(const std::string& path,
int64_t new_capacity,
valid_capacity = 0; // caller will handle the error
return ret;
}
+#if defined(__APPLE__)
+ const auto block_size = stat.f_bsize;
+#else
const auto block_size = stat.f_frsize ? stat.f_frsize : stat.f_bsize;
+#endif
size_t disk_capacity =
static_cast<size_t>(static_cast<size_t>(stat.f_blocks) *
static_cast<size_t>(block_size));
if (new_capacity == 0 || disk_capacity < new_capacity) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]