Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/clang_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ permissions:
contents: read

jobs:
clang-test:
clang-test-ubuntu-x86-64:
name: Ubuntu 24.04 x86_64
runs-on: ubuntu-24.04
timeout-minutes: 120
strategy:
Expand All @@ -47,3 +48,26 @@ jobs:
CC: clang
CXX: clang++
run: ci/scripts/build_paimon.sh $(pwd) false true
clang-test-macos-x86_64:
name: macOS 26 x86_64
runs-on: macos-26
timeout-minutes: 120
strategy:
fail-fast: false
steps:
- name: Checkout paimon-cpp
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
lfs: true
fetch-depth: 0 # fetch all history for git diff in clang-tidy
- name: Build Paimon
shell: bash
run: |
brew uninstall cmake
brew uninstall --ignore-dependencies brotli
wget https://cmake.org/files/v3.31/cmake-3.31.0-macos-universal.tar.gz
tar -xzf cmake-3.31.0-macos-universal.tar.gz
mv cmake-3.31.0-macos-universal/CMake.app /Applications/
echo 'export PATH="/Applications/CMake.app/Contents/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
ci/scripts/build_paimon.sh $(pwd) false true
113 changes: 80 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ option(PAIMON_ENABLE_AVRO "Whether to enable avro file format" ON)
option(PAIMON_ENABLE_ORC "Whether to enable orc file format" ON)
option(PAIMON_ENABLE_LANCE "Whether to enable lance file format" OFF)
option(PAIMON_ENABLE_JINDO "Whether to enable jindo file system" OFF)
option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" ON)
option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" ON)
option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" OFF)
option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" OFF)
option(PAIMON_ENABLE_MACOS "Whether to enable experimental macOS support" OFF)

if(APPLE)
if(NOT PAIMON_ENABLE_MACOS)
message(FATAL_ERROR,"macOS support is currently experimental.")
endif()
endif()

if(PAIMON_ENABLE_ORC)
add_definitions(-DPAIMON_ENABLE_ORC)
Expand Down Expand Up @@ -334,8 +341,13 @@ add_compile_definitions("GLOG_USE_GLOG_EXPORT")

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(PAIMON_VERSION_SCRIPT_FLAGS
"-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/paimon/symbols.map")
if(APPLE)
set(PAIMON_VERSION_SCRIPT_FLAGS
"-Wl,-exported_symbols_list,${CMAKE_SOURCE_DIR}/src/paimon/symbols.list")
else()
set(PAIMON_VERSION_SCRIPT_FLAGS
"-Wl,--version-script=${CMAKE_SOURCE_DIR}/src/paimon/symbols.map")
endif()

set(ENV{PAIMON_TEST_DATA} "${CMAKE_SOURCE_DIR}/test/test_data")

Expand Down Expand Up @@ -363,47 +375,82 @@ if(PAIMON_BUILD_TESTS)
include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
include_directories("${CMAKE_SOURCE_DIR}/test/")

set(TEST_STATIC_LINK_LIBS
"-Wl,--whole-archive"
paimon_file_index_static
paimon_global_index_static
paimon_local_file_system_static
paimon_mock_file_format_static
"-Wl,--no-whole-archive"
"-Wl,--no-as-needed"
paimon_parquet_file_format_shared
paimon_blob_file_format_shared
"-Wl,--as-needed")
if(APPLE)
set(TEST_STATIC_LINK_LIBS
"-Wl,-force_load"
paimon_file_index_static
paimon_global_index_static
paimon_local_file_system_static
paimon_mock_file_format_static
paimon_parquet_file_format_shared
paimon_blob_file_format_shared)
else()
set(TEST_STATIC_LINK_LIBS
"-Wl,--whole-archive"
paimon_file_index_static
paimon_global_index_static
paimon_local_file_system_static
paimon_mock_file_format_static
"-Wl,--no-whole-archive"
"-Wl,--no-as-needed"
paimon_parquet_file_format_shared
paimon_blob_file_format_shared
"-Wl,--as-needed")
endif()

if(PAIMON_ENABLE_LANCE)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lance_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
if(PAIMON_ENABLE_ORC)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_orc_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
if(PAIMON_ENABLE_AVRO)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_avro_file_format_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
if(PAIMON_ENABLE_JINDO)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_jindo_file_system_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
if(PAIMON_ENABLE_LUMINA)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lumina_index_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
if(PAIMON_ENABLE_LUCENE)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
if(APPLE)
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
else()
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--no-as-needed")
list(APPEND TEST_STATIC_LINK_LIBS paimon_lucene_index_shared)
list(APPEND TEST_STATIC_LINK_LIBS "-Wl,--as-needed")
endif()
endif()
endif()

Expand Down
42 changes: 31 additions & 11 deletions ci/scripts/build_paimon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,31 @@ build_dir=${1}/build
mkdir ${build_dir}
pushd ${build_dir}

CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_BUILD_TYPE=${build_type}"
"-DPAIMON_BUILD_TESTS=ON"
"-DPAIMON_ENABLE_LANCE=ON"
"-DPAIMON_ENABLE_JINDO=ON"
)
is_macos() {
[[ "${OSTYPE}" == "darwin"* ]]
}

if is_macos; then
CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_BUILD_TYPE=${build_type}"
"-DPAIMON_BUILD_TESTS=ON"
"-DPAIMON_ENABLE_MACOS=ON"
"-DPAIMON_ENABLE_JINDO=ON"
)
NPROCS=$(sysctl -n hw.ncpu)
else
CMAKE_ARGS=(
"-G Ninja"
"-DCMAKE_BUILD_TYPE=${build_type}"
"-DPAIMON_BUILD_TESTS=ON"
"-DPAIMON_ENABLE_LANCE=ON"
"-DPAIMON_ENABLE_JINDO=ON"
"-DPAIMON_ENABLE_LUMINA=ON"
"-DPAIMON_ENABLE_LUCENE=ON"
)
NPROCS=$(nproc)
fi

if [[ "${enable_sanitizer}" == "true" ]]; then
CMAKE_ARGS+=(
Expand All @@ -41,11 +59,13 @@ if [[ "${enable_sanitizer}" == "true" ]]; then
fi

cmake "${CMAKE_ARGS[@]}" ${source_dir}
cmake --build . -- -j$(nproc)
ctest --output-on-failure -j $(nproc)
cmake --build . -- -j${NPROCS}
if ! is_macos; then
ctest --output-on-failure -j ${NPROCS}

if [[ "${check_clang_tidy}" == "true" ]]; then
cmake --build . --target check-clang-tidy
if [[ "${check_clang_tidy}" == "true" ]]; then
cmake --build . --target check-clang-tidy
fi
fi

popd
Expand Down
16 changes: 10 additions & 6 deletions cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,16 @@ function(add_paimon_lib LIB_NAME)
target_link_libraries(${LIB_NAME}_shared
PUBLIC "$<BUILD_INTERFACE:paimon_sanitizer_flags>")

target_link_options(${LIB_NAME}_shared
PRIVATE
-Wl,--exclude-libs,ALL
-Wl,-Bsymbolic
-Wl,-z,defs
-Wl,--gc-sections)
if(APPLE)
target_link_options(${LIB_NAME}_shared PRIVATE -Wl,-dead_strip)
else()
target_link_options(${LIB_NAME}_shared
PRIVATE
-Wl,--exclude-libs,ALL
-Wl,-Bsymbolic
-Wl,-z,defs
-Wl,--gc-sections)
endif()

install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
Expand Down
6 changes: 5 additions & 1 deletion cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ if("${BUILD_WARNING_LEVEL}" STREQUAL "CHECKIN")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wextra")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wdocumentation")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wglobal-constructors")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-missing-braces")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-constant-logical-operand")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated-declarations")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-deprecated-builtins")
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-global-constructors")
else()
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wglobal-constructors")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-conversion")
Expand Down
Loading
Loading