yx-keith opened a new pull request, #63474:
URL: https://github.com/apache/doris/pull/63474
This commit collects all changes required to compile and run the BE unit
tests on macOS 15+ / Apple Silicon (arm64) with Apple Clang 17.
## Build system (CMake / run-be-ut.sh)
- run-be-ut.sh: auto-detect Apple Clang 17 and Homebrew JDK-17 on macOS
- be/CMakeLists.txt: set DISABLE_ANN compile definition *before*
add_subdirectory(storage/index/ann) so ann_index sees the flag; always build
ann_index (production code links against it regardless of FAISS availability)
- be/src/storage/CMakeLists.txt, be/src/exprs/CMakeLists.txt: always link
ann_index
- be/test/CMakeLists.txt: always exclude ANN test files from the monolithic
doris_be_test target
- be/src/storage/index/ann/CMakeLists.txt: guard OpenMP / faiss link with
if(NOT DISABLE_ANN)
- be/src/storage/index/ann/cmake-protect/CMakeLists.txt: strip ASAN/UBSAN
flags from OpenBLAS sub-build (prevents getarch hang on macOS); disable OpenMP
in OpenBLAS on Apple Silicon; force ARMV8 target
## Source portability fixes
- be/src/common/factory_creator.h: use std::shared_ptr(new T) instead of
std::make_shared on Apple to avoid libc++ compressed_pair bug
- be/src/common/multi_version.h: use atomic_shared_ptr wrapper
- be/src/core/binary_cast.hpp: add missing #include <bit>
- be/src/core/value/vdatetime_value.h: guard non-const copy ctor with
#ifndef __APPLE__ (Apple Clang 17 rejects it for trivially-copyable)
- be/src/exec/common/memory.cpp: disambiguate std::max literal types
- be/src/load/routine_load/kinesis_conf.cpp: explicit int64_t cast for
Aws::Utils::DateTime constructor
- be/src/macos_patches/__ranges/lazy_split_view.h: libc++ patch for
std::ranges::lazy_split_view used in tests
- be/src/storage/index/ann/ann_index_writer.cpp,
be/src/storage/index/ann/ann_index_reader.cpp: guard faiss includes and
FaissVectorIndex usage with #ifndef DISABLE_ANN
- be/src/storage/index/ann/faiss_ann_index.cpp,
be/src/storage/index/ann/faiss_ann_index.h: wrap entire file body with #ifndef
DISABLE_ANN
- be/src/exprs/function/array/function_array_distance.h: provide inline
FAISS stubs under #else DISABLE_ANN so L1/L2/IP distance classes compile
without FAISS headers
- be/src/storage/segment/segment_writer.h: move _is_mow() and
_is_mow_with_cluster_key() inline definitions from the .cpp to the .h; macOS
linker dead-strips out-of-line inline symbols, causing TestSegmentWriter link
failures
- be/src/storage/segment/segment_writer.cpp: remove the now-redundant inline
definitions
## Test portability fixes
- be/test/udf/python/python_env_test.cpp: replace sighandler_t (Linux glibc
extension) with void (*)(int)
- be/test/storage/segment/inverted_index_reader_test.cpp: local copy for
vector<bool> element to avoid proxy-reference UB in template
- be/test/storage/index/ann/*.cpp: guard faiss / HNSW includes with #ifndef
DISABLE_ANN
- Multiple test files: add LL suffix to large integer literals, replace
std::ranges::iota_view loops, add missing #include <thread>, and disambiguate
int64_t literal types to satisfy Apple Clang 17
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]