-
Notifications
You must be signed in to change notification settings - Fork 102
365 lines (331 loc) · 13 KB
/
Copy pathcpp-dependency-source.yml
File metadata and controls
365 lines (331 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Cpp-Dependency-Source
on:
push:
branches:
- develop
- iotdb
- rc/*
paths:
- '.github/workflows/cpp-dependency-source.yml'
- 'cpp/**'
- 'pom.xml'
pull_request:
branches:
- develop
- dev/*
- iotdb
- rc/*
paths:
- '.github/workflows/cpp-dependency-source.yml'
- 'cpp/**'
- 'pom.xml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
TSFILE_BUILD_DIR: cpp/target/dependency-source-build
TSFILE_DEPENDENCY_CACHE: cpp/target/dependency-source-cache
jobs:
legacy-cmake:
name: Legacy core build with CMake 3.11
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
CMAKE_3_11_VERSION: 3.11.4
CMAKE_3_11_SHA256: 6dab016a6b82082b8bcd0f4d1e53418d6372015dd983d29367b9153f1a376435
XZ_VERSION: 5.8.3
XZ_SHA256: 3d3a1b973af218114f4f889bbaa2f4c037deaae0c8e815eec381c3d546b974a0
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install verified CMake 3.11
shell: bash
run: |
curl --fail --location --retry 3 \
"https://cmake.org/files/v3.11/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64.tar.gz" \
--output cmake-3.11.tar.gz
echo "${CMAKE_3_11_SHA256} cmake-3.11.tar.gz" | sha256sum --check
tar -xzf cmake-3.11.tar.gz
- name: Configure the legacy core with default LZMA2 setting
shell: bash
run: |
mkdir -p "$TSFILE_BUILD_DIR"
cd "$TSFILE_BUILD_DIR"
"$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
"$GITHUB_WORKSPACE/cpp" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_ANTLR4=OFF \
-DENABLE_SNAPPY=OFF \
-DENABLE_LZ4=OFF \
-DENABLE_LZOKAY=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_SIMD=OFF
grep -Fx "ENABLE_LZMA2:BOOL=OFF" CMakeCache.txt
! grep -q '^TSFILE_LIBLZMA' CMakeCache.txt
- name: Build TsFile with CMake 3.11
shell: bash
run: |
cd "$TSFILE_BUILD_DIR"
"$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
--build . --target tsfile -- -j2
- name: Install an external liblzma for the legacy SYSTEM build
shell: bash
run: |
curl --fail --location --retry 3 \
"https://github.com/tukaani-project/xz/releases/download/v${XZ_VERSION}/xz-${XZ_VERSION}.tar.gz" \
--output xz.tar.gz
echo "${XZ_SHA256} xz.tar.gz" | sha256sum --check
tar -xzf xz.tar.gz
cd "xz-${XZ_VERSION}"
./configure \
--prefix="$GITHUB_WORKSPACE/system-liblzma" \
--disable-static \
--disable-xz \
--disable-xzdec \
--disable-lzmadec \
--disable-lzmainfo \
--disable-lzma-links \
--disable-scripts \
--disable-doc \
--disable-nls
make -j2
make install
- name: Build LZMA2 against SYSTEM liblzma with CMake 3.11
shell: bash
run: |
mkdir -p "${TSFILE_BUILD_DIR}-lzma2-system"
cd "${TSFILE_BUILD_DIR}-lzma2-system"
"$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
"$GITHUB_WORKSPACE/cpp" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/system-liblzma" \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_ANTLR4=OFF \
-DENABLE_SNAPPY=OFF \
-DENABLE_LZ4=OFF \
-DENABLE_LZOKAY=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_LZMA2=ON \
-DENABLE_SIMD=OFF \
-DTSFILE_DEPENDENCY_SOURCE=SYSTEM \
2>&1 | tee configure.log
grep -F "TsFile dependency liblzma: SYSTEM" configure.log
"$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
--build . --target tsfile -- -j2
- name: Reject bundled LZMA2 with CMake 3.11 clearly
shell: bash
run: |
mkdir -p "${TSFILE_BUILD_DIR}-lzma2-bundled-rejected"
cd "${TSFILE_BUILD_DIR}-lzma2-bundled-rejected"
if "$GITHUB_WORKSPACE/cmake-${CMAKE_3_11_VERSION}-Linux-x86_64/bin/cmake" \
"$GITHUB_WORKSPACE/cpp" \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_ANTLR4=OFF \
-DENABLE_SNAPPY=OFF \
-DENABLE_LZ4=OFF \
-DENABLE_LZOKAY=OFF \
-DENABLE_ZLIB=OFF \
-DENABLE_ZSTD=OFF \
-DENABLE_LZMA2=ON \
-DENABLE_SIMD=OFF \
-DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
> configure.log 2>&1; then
echo "Bundled LZMA2 unexpectedly configured with CMake 3.11."
exit 1
fi
cat configure.log
# CMake wraps long FATAL_ERROR messages, so match short fragments
# instead of assuming the complete sentence remains on one line.
grep -F "XZ Utils 5.8.3" configure.log
grep -F "CMake 3.20 or newer" configure.log
bundled:
name: BUNDLED from a fresh archive cache
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install bundled build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y uuid-dev
- name: Configure all dependencies from verified archives
shell: bash
run: |
cmake -S cpp -B "$TSFILE_BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_LZMA2=ON \
-DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
-DTSFILE_DEPENDENCY_CACHE="$GITHUB_WORKSPACE/$TSFILE_DEPENDENCY_CACHE" \
2>&1 | tee bundled-configure.log
for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
grep -F "TsFile dependency ${dependency}: BUNDLED" bundled-configure.log
done
- name: Build TsFile with bundled dependencies
run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2
- name: Upload verified dependency archives
uses: actions/upload-artifact@v7
with:
name: tsfile-cpp-dependency-archives
path: ${{ env.TSFILE_DEPENDENCY_CACHE }}/
if-no-files-found: error
retention-days: 1
offline:
name: BUNDLED from cache with network downloads disabled
needs: bundled
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Download verified dependency archives
uses: actions/download-artifact@v8
with:
name: tsfile-cpp-dependency-archives
path: ${{ env.TSFILE_DEPENDENCY_CACHE }}
- name: Install offline build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y uuid-dev
- name: Configure all dependencies offline
shell: bash
run: |
cmake -S cpp -B "$TSFILE_BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_LZMA2=ON \
-DTSFILE_DEPENDENCY_SOURCE=BUNDLED \
-DTSFILE_DEPENDENCY_OFFLINE=ON \
-DTSFILE_DEPENDENCY_CACHE="$GITHUB_WORKSPACE/$TSFILE_DEPENDENCY_CACHE" \
2>&1 | tee offline-configure.log
for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
grep -F "TsFile dependency ${dependency}: BUNDLED" offline-configure.log
done
- name: Build TsFile offline
run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2
system:
name: SYSTEM from an external package prefix
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
VCPKG_COMMIT: a2b75031b909a2d6b051725c3909230c72d4bd4a
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/.vcpkg-binary-cache
ANTLR4_VERSION: 4.9.3
ANTLR4_SHA256: efe4057d75ab48145d4683100fec7f77d7f87fa258707330cadd1f8e6f7eecae
SIMDE_VERSION: 0.8.4-rc3
SIMDE_SHA256: a5407985439fef1435ac1f091a4d2e6c71981faed213e1be156aca575ce7052c
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Checkout pinned vcpkg registry
uses: actions/checkout@v7
with:
repository: microsoft/vcpkg
ref: ${{ env.VCPKG_COMMIT }}
path: vcpkg
- name: Cache vcpkg binary packages
uses: actions/cache@v6
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_COMMIT }}-tsfile-system-v2
- name: Install external build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y cmake libutfcpp-dev pkg-config uuid-dev
- name: Install external vcpkg dependencies
shell: bash
run: |
mkdir -p "$VCPKG_DEFAULT_BINARY_CACHE"
./vcpkg/bootstrap-vcpkg.sh -disableMetrics
./vcpkg/vcpkg install \
snappy:x64-linux \
lz4:x64-linux \
lzokay:x64-linux \
zlib:x64-linux \
zstd:x64-linux \
liblzma:x64-linux \
--clean-after-build
# ANTLR4 4.10 and later require C++17, while TsFile currently targets
# C++11. Build the compatible 4.9.3 runtime into the external prefix with
# Ubuntu's distro CMake; CMake 4 no longer accepts its legacy policies.
- name: Install external ANTLR4 runtime
shell: bash
run: |
mkdir -p system-prefix
curl --fail --location --retry 3 \
"https://github.com/antlr/antlr4/archive/refs/tags/${ANTLR4_VERSION}.tar.gz" \
--output antlr4.tar.gz
echo "${ANTLR4_SHA256} antlr4.tar.gz" | sha256sum --check
tar -xzf antlr4.tar.gz
/usr/bin/cmake \
-S "antlr4-${ANTLR4_VERSION}/runtime/Cpp" \
-B antlr4-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/system-prefix" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DANTLR4_INSTALL=ON \
-DWITH_DEMO=OFF
/usr/bin/cmake --build antlr4-build \
--target install --parallel 2
# vcpkg currently provides SIMDe 0.8.2, which is below TsFile's 0.8.4
# minimum. Install the verified upstream headers into a separate external
# prefix so SYSTEM mode still validates SIMD support.
- name: Install external SIMDe headers
shell: bash
run: |
mkdir -p system-prefix/include
curl --fail --location --retry 3 \
"https://github.com/simd-everywhere/simde/archive/refs/tags/v${SIMDE_VERSION}.tar.gz" \
--output simde.tar.gz
echo "${SIMDE_SHA256} simde.tar.gz" | sha256sum --check
tar -xzf simde.tar.gz
cmake -E copy_directory \
"simde-${SIMDE_VERSION}/simde" \
system-prefix/include/simde
- name: Configure all dependencies from the system prefix
shell: bash
run: |
cmake -S cpp -B "$TSFILE_BUILD_DIR" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake" \
-DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/system-prefix" \
-Dantlr4-runtime_DIR="$GITHUB_WORKSPACE/system-prefix/lib/cmake/antlr4-runtime" \
-DSIMDE_ROOT="$GITHUB_WORKSPACE/system-prefix" \
-DBUILD_TEST=OFF \
-DBUILD_TOOLS=OFF \
-DENABLE_LZMA2=ON \
-DTSFILE_DEPENDENCY_SOURCE=SYSTEM \
2>&1 | tee system-configure.log
for dependency in ANTLR4 Snappy LZ4 lzokay zlib Zstandard liblzma SIMDe; do
grep -F "TsFile dependency ${dependency}: SYSTEM" system-configure.log
done
- name: Build TsFile with system dependencies
run: cmake --build "$TSFILE_BUILD_DIR" --target tsfile --parallel 2