forked from percona/percona-xtradb-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
444 lines (383 loc) · 13.3 KB
/
azure-pipelines.yml
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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
jobs:
- job: BiDiScan
pool:
vmImage: 'ubuntu-18.04'
steps:
- checkout: self
fetchDepth: 32
- script: |
git fetch origin 8.0
CHANGED_FILES=$(git diff --name-only --relative --diff-filter AMR origin/8.0 -- . | tr '\n' ' ')
if [ -z "${CHANGED_FILES}" ]; then
echo --- No changed files
else
python $(Build.SourcesDirectory)/scripts/find_unicode_control.py -p bidi -v ${CHANGED_FILES}
fi
- job:
timeoutInMinutes: 240
pool:
vmImage: $(imageName)
variables:
UBUNTU_CODE_NAME: focal
BOOST_VERSION: boost_1_73_0
BOOST_DIR: $(Pipeline.Workspace)/boost
USE_CCACHE: 1
CCACHE_DIR: $(Pipeline.Workspace)/ccache
CCACHE_COMPRESS: 1
CCACHE_COMPRESSLEVEL: 9
CCACHE_CPP2: 1
CCACHE_MAXSIZE: 2G
OS_NAME: $(Agent.OS)
strategy:
matrix:
macOS 12 Release:
imageName: 'macOS-12'
Compiler: clang
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
macOS 12 Debug:
imageName: 'macOS-12'
Compiler: clang
BuildType: Debug
# clang-6 and newer compilers
Ubuntu Focal clang-14 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 14
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-14 Release INVERTED=ON:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 14
BuildType: RelWithDebInfo
Inverted: ON
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-14 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 14
BuildType: Debug
Ubuntu Focal clang-14 Debug INVERTED=ON:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 14
BuildType: Debug
Inverted: ON
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-13 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 13
BuildType: RelWithDebInfo
Ubuntu Focal clang-13 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 13
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-12 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 12
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-12 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 12
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-11 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 11
BuildType: RelWithDebInfo
Ubuntu Focal clang-11 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 11
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-10 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 10
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-10 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 10
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-9 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 9
BuildType: RelWithDebInfo
Ubuntu Focal clang-9 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 9
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-8 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 8
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-8 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 8
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-7 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 7
BuildType: RelWithDebInfo
Ubuntu Focal clang-7 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 7
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-6 Release:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 6.0
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal clang-6 Debug:
imageName: 'ubuntu-20.04'
Compiler: clang
CompilerVer: 6.0
BuildType: Debug
# gcc-7 and newer compilers
Ubuntu Focal gcc-11 Release:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 11
BuildType: RelWithDebInfo
Ubuntu Focal gcc-11 Debug:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 11
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-10 Release:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 10
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-10 Debug:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 10
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-9 Release:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 9
BuildType: RelWithDebInfo
Ubuntu Focal gcc-9 Debug:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 9
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-8 Release:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 8
BuildType: RelWithDebInfo
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-8 Debug:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 8
BuildType: Debug
${{ if ne(variables['Build.Reason'], 'IndividualCI') }}:
Ubuntu Focal gcc-7 Release:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 7
BuildType: RelWithDebInfo
Ubuntu Focal gcc-7 Debug:
imageName: 'ubuntu-20.04'
Compiler: gcc
CompilerVer: 7
BuildType: Debug
steps:
- script: |
uname -r
df -Th
ls -l ..
pwd
ls -l
if [[ "$OS_NAME" == "Linux" ]]; then
CC=$(Compiler)-$(CompilerVer)
if [[ "$(Compiler)" == "clang" ]]; then
CXX=clang++-$(CompilerVer)
PACKAGES="$CC $PACKAGES"
else
CXX=g++-$(CompilerVer)
PACKAGES="$CXX $PACKAGES"
fi
fi
echo CC=$CC CXX=$CXX BuildType=$(BuildType) Ubuntu=$UBUNTU_CODE_NAME OS_NAME=$OS_NAME
echo --- Configure required LLVM and Ubuntu Toolchain repositories
if [[ "$OS_NAME" == "Linux" ]] && [[ "$CC" == "clang"* ]]; then
PACKAGES="llvm-$(CompilerVer)-dev $PACKAGES"
curl -sSL "http://apt.llvm.org/llvm-snapshot.gpg.key" | sudo -E apt-key add -
echo "deb http://apt.llvm.org/$UBUNTU_CODE_NAME/ llvm-toolchain-$UBUNTU_CODE_NAME-$(CompilerVer) main" | sudo tee -a /etc/apt/sources.list > /dev/null
fi
echo --- Update list of packages and download dependencies
if [[ "$OS_NAME" == "Linux" ]]; then
sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
sudo -E apt-get -yq update >> ~/apt-get-update.log 2>&1
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES cmake cmake-curses-gui ccache bison libncurses5-dev libaio-dev libmecab-dev libnuma-dev liblzma-dev libssl-dev libreadline-dev libpam-dev libcurl4-openssl-dev libldap2-dev libkrb5-dev libsasl2-dev libsasl2-modules-gssapi-mit || exit 1;
if [[ "$(Inverted)" != "ON" ]]; then
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install libevent-dev libeditline-dev liblz4-dev libre2-dev protobuf-compiler libprotobuf-dev libprotoc-dev libicu-dev || exit 1;
fi
else
brew update
brew install ccache protobuf lz4 re2 rapidjson [email protected]
fi
UPDATE_TIME=$SECONDS
echo --- Packages updated in $UPDATE_TIME seconds.
$CC -v
$CXX -v
CCACHE_BIN=$(which ccache)
echo ccache=$CCACHE_BIN
ccache --version
ccache -p
ccache --zero-stats
df -Th
COMPILER_VER=$(CompilerVer)
echo '##vso[task.setvariable variable=CompilerMajorVer]'${COMPILER_VER%.*}
echo '##vso[task.setvariable variable=CC]'$CC
echo '##vso[task.setvariable variable=CXX]'$CXX
echo '##vso[task.setvariable variable=CCACHE_BIN]'$CCACHE_BIN
echo '##vso[task.setvariable variable=UPDATE_TIME]'$UPDATE_TIME
echo '##vso[task.prependpath]/usr/lib/ccache'
displayName: '*** Install Build Dependencies'
- task: Cache@2
continueOnError: true
inputs:
key: ccache | $(Agent.OS)-$(Compiler)-$(CompilerMajorVer)-$(BuildType) | $(Build.SourceVersion)
restoreKeys: ccache | $(Agent.OS)-$(Compiler)-$(CompilerMajorVer)-$(BuildType)
path: $(CCACHE_DIR)
displayName: '*** Download/upload ccached files'
- task: Cache@2
continueOnError: true
inputs:
key: $(BOOST_VERSION)
restoreKeys: $(BOOST_VERSION)
path: $(BOOST_DIR)
displayName: '*** Download/upload $(BOOST_VERSION) libraries'
- checkout: self
fetchDepth: 32
- script: |
df -Th
git submodule sync
git submodule update --init --force --depth=256
displayName: '*** Update git submodules'
- script: |
df -Th
echo --- Set cmake parameters
COMPILE_OPT+=(
-DCMAKE_C_FLAGS_DEBUG=-g1
-DCMAKE_CXX_FLAGS_DEBUG=-g1
'-DCMAKE_C_FLAGS_RELWITHDEBINFO=-O2 -g1 -DNDEBUG'
'-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=-O2 -g1 -DNDEBUG'
)
CMAKE_OPT="
-DCMAKE_BUILD_TYPE=$(BuildType)
-DBUILD_CONFIG=mysql_release
-DENABLE_DOWNLOADS=1
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=$(BOOST_DIR)
-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_BIN
-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_BIN
-DWITH_ROCKSDB=ON
-DWITH_KEYRING_VAULT=ON
-DWITH_KEYRING_VAULT_TEST=ON
-DWITH_PAM=ON
"
if [[ ( "$(Compiler)" == "gcc" ) && ( $(bc <<< "$(CompilerVer) < 8.1") -eq 1 ) ]]; then
CMAKE_OPT+="
-DWITH_ROUTER=OFF
"
fi
if [[ "$OS_NAME" == "Darwin" ]]; then
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=OFF
-DWITH_TOKUDB=OFF
-DWITH_PROTOBUF=system
-DWITH_SYSTEM_LIBS=ON
-DWITH_ICU=/usr/local/opt/icu4c
-DWITH_SSL=/usr/local/opt/[email protected]
-DWITH_FIDO=bundled
-DWITH_ZLIB=bundled
-DWITH_PERCONA_AUTHENTICATION_LDAP=OFF
"
else
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=ON
-DWITH_TOKUDB=ON
-DWITH_CURL=system
-DWITH_MECAB=system
-DWITH_RAPIDJSON=bundled
-DWITH_SSL=system
-DWITH_LIBEVENT=bundled
-DWITH_PROTOBUF=bundled
-DWITH_ZLIB=bundled
"
if [[ "$(Inverted)" != "ON" ]]; then
CMAKE_OPT+="
-DWITH_READLINE=system
-DWITH_ICU=system
-DWITH_LZ4=bundled
-DWITH_NUMA=ON
"
else
CMAKE_OPT+="
-DWITH_EDITLINE=bundled
-DWITH_ICU=bundled
-DWITH_LZ4=bundled
-DWITH_NUMA=OFF
-DWITH_ARCHIVE_STORAGE_ENGINE=OFF
-DWITH_BLACKHOLE_STORAGE_ENGINE=OFF
-DWITH_EXAMPLE_STORAGE_ENGINE=ON
-DWITH_FEDERATED_STORAGE_ENGINE=OFF
-DWITHOUT_PERFSCHEMA_STORAGE_ENGINE=ON
-DWITH_INNODB_MEMCACHED=ON
"
fi
fi
echo --- CMAKE_OPT=\"$CMAKE_OPT\"
echo --- COMPILE_OPT=\"${COMPILE_OPT[@]}\"
mkdir bin; cd bin
CC=$CC CXX=$CXX cmake .. $CMAKE_OPT "${COMPILE_OPT[@]}" || exit 1
rm -f $(BOOST_DIR)/$(BOOST_VERSION).tar.gz
CMAKE_TIME=$SECONDS
echo --- CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds.
echo '##vso[task.setvariable variable=CMAKE_TIME]'$CMAKE_TIME
displayName: '*** CC=$(Compiler)-$(CompilerVer) cmake .. -DCMAKE_BUILD_TYPE=$(BuildType)'
- script: |
df -Th
cd bin
make -j2 || exit 1
ccache --show-stats
BUILD_TIME=$SECONDS
echo --- Total time $(($BUILD_TIME + $UPDATE_TIME + $CMAKE_TIME)) seconds. Build time $BUILD_TIME seconds. CMake took $CMAKE_TIME seconds. Packages updated in $UPDATE_TIME seconds.
df -Th
rm -rf *
df -Th
displayName: '*** Compile'