Skip to content

Commit 2696377

Browse files
authored
feat(build): add gcc8 ci to avoid some test failure (alibaba#194)
1 parent 5cd814d commit 2696377

5 files changed

Lines changed: 90 additions & 5 deletions

File tree

.github/workflows/gcc8_test.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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: Gcc 8 Test
16+
17+
on:
18+
push:
19+
branches:
20+
- '**'
21+
tags:
22+
- '**'
23+
pull_request:
24+
25+
concurrency:
26+
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
27+
cancel-in-progress: true
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
gcc8-test:
34+
runs-on: ubuntu-22.04
35+
container:
36+
image: ubuntu:20.04
37+
options: --privileged
38+
timeout-minutes: 120
39+
strategy:
40+
fail-fast: false
41+
steps:
42+
- name: Install dependencies
43+
run: |
44+
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
46+
curl -L -O https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-linux-x86_64.tar.gz
47+
tar -zxvf cmake-3.28.3-linux-x86_64.tar.gz -C /usr/local --strip-components=1
48+
rm cmake-3.28.3-linux-x86_64.tar.gz
49+
- name: Enable core dumps
50+
run: |
51+
ulimit -c unlimited
52+
sysctl -w kernel.core_pattern=core.%e.%p
53+
- name: Debug core dump settings
54+
run: |
55+
ulimit -c
56+
cat /proc/sys/kernel/core_pattern
57+
ls -la
58+
- name: Checkout paimon-cpp
59+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
60+
with:
61+
lfs: true
62+
- name: Build Paimon
63+
shell: bash
64+
env:
65+
CC: gcc-8
66+
CXX: g++-8
67+
run: ci/scripts/build_paimon.sh $(pwd)

ci/scripts/build_paimon.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,24 @@ build_dir=${1}/build
2525
mkdir ${build_dir}
2626
pushd ${build_dir}
2727

28+
ENABLE_LUMINA="ON"
29+
ENABLE_LANCE="ON"
30+
if [[ "${CC:-}" == *"gcc-8"* ]] || [[ "${CXX:-}" == *"g++-8"* ]]; then
31+
ENABLE_LUMINA="OFF" # Lumina is only supported on GCC 9 or higher.
32+
ENABLE_LANCE="OFF"
33+
# Lance's prebuilt binaries can only be compiled on Ubuntu 22.04 and above
34+
# which requires a higher version of glibc,
35+
# but Ubuntu 22.04 and above no longer ships with gcc-8 by default.
36+
# Consider supporting Lance from source compilation in the future
37+
fi
38+
2839
CMAKE_ARGS=(
2940
"-G Ninja"
3041
"-DCMAKE_BUILD_TYPE=${build_type}"
3142
"-DPAIMON_BUILD_TESTS=ON"
32-
"-DPAIMON_ENABLE_LANCE=ON"
43+
"-DPAIMON_ENABLE_LANCE=${ENABLE_LANCE}"
3344
"-DPAIMON_ENABLE_JINDO=ON"
34-
"-DPAIMON_ENABLE_LUMINA=ON"
45+
"-DPAIMON_ENABLE_LUMINA=${ENABLE_LUMINA}"
3546
"-DPAIMON_ENABLE_LUCENE=ON"
3647
)
3748

cmake_modules/SetupCxxFlags.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
166166
set(CXX_ONLY_FLAGS "${CXX_ONLY_FLAGS} -Wno-subobject-linkage")
167167
endif()
168168

169+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "8.0"
170+
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0")
171+
# When using the C++17 filesystem library (<filesystem>) with GCC 8, you do need to explicitly link stdc++fs.
172+
link_libraries(stdc++fs)
173+
endif()
174+
169175
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL
170176
"Clang")
171177
# Clang options for all builds

cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,8 @@ macro(build_arrow)
11451145
-DZSTD_ROOT=${ARROW_ZSTD_ROOT}
11461146
-DZLIB_ROOT=${ARROW_ZLIB_ROOT}
11471147
-DSnappy_ROOT=${ARROW_SNAPPY_ROOT}
1148-
-DLZ4_ROOT=${ARROW_LZ4_ROOT})
1148+
-DLZ4_ROOT=${ARROW_LZ4_ROOT}
1149+
-DBUILD_WARNING_LEVEL=PRODUCTION) # ignore warnings under gcc8
11491150

11501151
set(ARROW_CONFIGURE SOURCE_SUBDIR "cpp" CMAKE_ARGS ${ARROW_CMAKE_ARGS})
11511152
set(PATCH_FILE "${CMAKE_CURRENT_LIST_DIR}/arrow.diff")

docs/source/building.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ and invoke ``cmake $CMAKE_ARGS ..`` from this directory.
2929

3030
Building requires:
3131

32-
* A C++17-enabled compiler. On Linux, gcc 9 and higher should be
32+
* A C++17-enabled compiler. On Linux, gcc 8 and higher should be
3333
sufficient. Windows and MacOS are not supported for now.
3434
* At least 2GB of RAM for a minimal build, 8GB for a minimal
3535
debug build with tests and 16GB for a full build.
@@ -122,7 +122,7 @@ boolean flags to ``cmake``.
122122
* ``-DPAIMON_ENABLE_LANCE=ON``: Paimon integration with Lance
123123
* ``-DPAIMON_ENABLE_AVRO=ON``: Apache Avro libraries and Paimon integration
124124
* ``-DPAIMON_ENABLE_JINDO=ON``: Support for Alibaba Jindo filesystems
125-
* ``-DPAIMON_ENABLE_LUMINA=ON``: Support for Lumina vector index
125+
* ``-DPAIMON_ENABLE_LUMINA=ON``: Support for Lumina vector index, lumina is only supported on gcc9 or higher.
126126

127127
Optional Targets
128128
~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)