Skip to content

Commit 660be26

Browse files
authored
Merge branch 'main' into main
2 parents 77e6dcb + 1322133 commit 660be26

139 files changed

Lines changed: 4499 additions & 370 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2026-present Alibaba Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Setup ccache
16+
description: Install, configure and cache ccache for CI builds
17+
18+
inputs:
19+
cache-key-prefix:
20+
description: Prefix for the cache key (e.g., ccache-gcc-test)
21+
required: true
22+
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Install ccache
27+
shell: bash
28+
run: sudo apt-get update && sudo apt-get install -y ccache
29+
30+
- name: Restore ccache
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.ccache
34+
key: ${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
35+
restore-keys: |
36+
${{ inputs.cache-key-prefix }}-${{ runner.os }}-${{ github.ref_name }}-
37+
${{ inputs.cache-key-prefix }}-${{ runner.os }}-
38+
39+
- name: Configure ccache
40+
shell: bash
41+
run: ci/scripts/setup_ccache.sh

.github/workflows/build_release.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,19 @@ jobs:
4040
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
with:
4242
lfs: true
43+
- name: Setup ccache
44+
uses: ./.github/actions/setup-ccache
45+
with:
46+
cache-key-prefix: ccache-clang-release
4347
- name: Build Paimon
4448
shell: bash
4549
env:
4650
CC: clang
4751
CXX: clang++
4852
run: ci/scripts/build_paimon.sh $(pwd) false false Release
53+
- name: Show ccache statistics
54+
if: always()
55+
run: ccache -s
4956
gcc-release:
5057
runs-on: ubuntu-24.04
5158
timeout-minutes: 120
@@ -56,9 +63,16 @@ jobs:
5663
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5764
with:
5865
lfs: true
66+
- name: Setup ccache
67+
uses: ./.github/actions/setup-ccache
68+
with:
69+
cache-key-prefix: ccache-gcc-release
5970
- name: Build Paimon
6071
shell: bash
6172
env:
6273
CC: gcc-14
6374
CXX: g++-14
6475
run: ci/scripts/build_paimon.sh $(pwd) false false Release
76+
- name: Show ccache statistics
77+
if: always()
78+
run: ccache -s

.github/workflows/clang_test.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ jobs:
4141
with:
4242
lfs: true
4343
fetch-depth: 0 # fetch all history for git diff in clang-tidy
44+
- name: Setup ccache
45+
uses: ./.github/actions/setup-ccache
46+
with:
47+
cache-key-prefix: ccache-clang-test
4448
- name: Build Paimon
4549
shell: bash
4650
env:
4751
CC: clang
4852
CXX: clang++
4953
run: ci/scripts/build_paimon.sh $(pwd) false true
54+
- name: Show ccache statistics
55+
if: always()
56+
run: ccache -s

.github/workflows/gcc8_test.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Install dependencies
4343
run: |
4444
apt-get update
45-
DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-8 g++-8 ninja-build git git-lfs tar curl tzdata zip unzip pkg-config build-essential python3-dev gdb
45+
DEBIAN_FRONTEND=noninteractive apt-get install -y gcc-8 g++-8 ninja-build git git-lfs tar curl tzdata zip unzip pkg-config build-essential python3-dev gdb sudo
4646
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz
4747
tar -zxvf cmake-3.28.3-linux-x86_64.tar.gz -C /usr/local --strip-components=1
4848
rm cmake-3.28.3-linux-x86_64.tar.gz
@@ -59,9 +59,16 @@ jobs:
5959
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
6060
with:
6161
lfs: true
62+
- name: Setup ccache
63+
uses: ./.github/actions/setup-ccache
64+
with:
65+
cache-key-prefix: ccache-gcc8-test
6266
- name: Build Paimon
6367
shell: bash
6468
env:
6569
CC: gcc-8
6670
CXX: g++-8
6771
run: ci/scripts/build_paimon.sh $(pwd)
72+
- name: Show ccache statistics
73+
if: always()
74+
run: ccache -s

.github/workflows/gcc_test.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ jobs:
4040
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
with:
4242
lfs: true
43+
- name: Setup ccache
44+
uses: ./.github/actions/setup-ccache
45+
with:
46+
cache-key-prefix: ccache-gcc-test
4347
- name: Build Paimon
4448
shell: bash
4549
env:
4650
CC: gcc-14
4751
CXX: g++-14
4852
run: ci/scripts/build_paimon.sh $(pwd)
53+
- name: Show ccache statistics
54+
if: always()
55+
run: ccache -s

.github/workflows/test_with_sanitizer.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ jobs:
4040
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4141
with:
4242
lfs: true
43+
- name: Setup ccache
44+
uses: ./.github/actions/setup-ccache
45+
with:
46+
cache-key-prefix: ccache-sanitizer
4347
- name: Build Paimon
4448
shell: bash
4549
env:
4650
CC: clang
4751
CXX: clang++
4852
run: ci/scripts/build_paimon.sh $(pwd) true
53+
- name: Show ccache statistics
54+
if: always()
55+
run: ccache -s

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,21 @@ if(UNIX)
187187
all)
188188
endif(UNIX)
189189
190+
# Setup ccache to accelerate compilation if available
191+
if(PAIMON_USE_CCACHE
192+
AND NOT CMAKE_C_COMPILER_LAUNCHER
193+
AND NOT CMAKE_CXX_COMPILER_LAUNCHER)
194+
195+
find_program(CCACHE_PROGRAM ccache)
196+
if(CCACHE_PROGRAM)
197+
message(STATUS "Found ccache: ${CCACHE_PROGRAM}")
198+
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
199+
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
200+
else()
201+
message(STATUS "ccache not found, compiling without cache acceleration")
202+
endif()
203+
endif()
204+
190205
include(SetupCxxFlags)
191206
192207
# set compile output directory

ci/scripts/build_paimon.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ check_clang_tidy=${3:-false}
2222
build_type=${4:-Debug}
2323
build_dir=${1}/build
2424

25+
# Display ccache status if available
26+
if command -v ccache &> /dev/null; then
27+
echo "=== ccache found: $(ccache --version | head -1) ==="
28+
ccache -p | grep -E "cache_dir|max_size|compression" || true
29+
ccache -z # Reset statistics for this build
30+
else
31+
echo "=== ccache not found, compiling without cache acceleration ==="
32+
fi
33+
2534
mkdir ${build_dir}
2635
pushd ${build_dir}
2736

@@ -61,6 +70,12 @@ if [[ "${check_clang_tidy}" == "true" ]]; then
6170
cmake --build . --target check-clang-tidy
6271
fi
6372

73+
# Print ccache statistics after build
74+
if command -v ccache &> /dev/null; then
75+
echo "=== ccache statistics after build ==="
76+
ccache -s
77+
fi
78+
6479
popd
6580

6681
rm -rf ${build_dir}

ci/scripts/setup_ccache.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2026-present Alibaba Inc.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
echo "PAIMON_USE_CCACHE=ON" >> $GITHUB_ENV
18+
19+
echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
20+
echo "CCACHE_DIR=${HOME}/.ccache" >> $GITHUB_ENV
21+
echo "CCACHE_MAXSIZE=1500M" >> $GITHUB_ENV
22+
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
23+
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
24+
25+
mkdir -p "${HOME}/.ccache"

cmake_modules/DefineOptions.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
9595
define_option(PAIMON_BUILD_STATIC "Build static libraries" ON)
9696

9797
define_option(PAIMON_BUILD_SHARED "Build shared libraries" ON)
98+
99+
define_option(PAIMON_USE_CCACHE "Use ccache when compiling (if available)" ON)
100+
98101
#----------------------------------------------------------------------
99102
set_option_category("Test")
100103

0 commit comments

Comments
 (0)