-
Notifications
You must be signed in to change notification settings - Fork 521
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
676 lines (584 loc) · 22.8 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
676 lines (584 loc) · 22.8 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
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
# Queue-time parameter. Resolved when the run is created, so it is one of the
# few things a ${{ }} expression can see -- which is what makes it usable as the
# full-CI gate (see the matrix below).
#
# GitHub Actions queues a run with:
#
# POST https://dev.azure.com/it0639/percona-server/_apis/pipelines/<id>/runs?api-version=7.1
# {
# "resources": { "repositories": { "self": { "refName": "refs/pull/<n>/merge" } } },
# "templateParameters": { "fullCI": true }
# }
#
# Omit templateParameters (or pass false) for the five default configs; pass
# true for all 42. It also appears as a checkbox in the Run pipeline dialog.
parameters:
- name: fullCI
displayName: 'Build all configs, not just the default five'
type: boolean
default: false
schedules:
- cron: "0 1 * * *"
displayName: Daily 1:00 AM UTC build
branches:
include:
- 8.0
trigger: none
pr:
drafts: false
branches:
include:
- '*'
paths:
exclude:
- doc
- build-ps
- man
- mysql-test
- packaging
- policy
- scripts
- support-files
jobs:
- job: BiDiScan
pool:
vmImage: 'ubuntu-22.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: 360
pool:
vmImage: $(imageName)
variables:
UBUNTU_CODE_NAME: jammy
BOOST_VERSION: boost_1_77_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: 4G
OS_NAME: $(Agent.OS)
PARENT_BRANCH: 8.0
BUILD_PARAMS_TYPE: normal
# Two tiers of coverage:
#
# default the five configs listed first -- built on every pull request.
# extended the remaining 37, each guarded so they are built only when the
# fullCI parameter is set (how GitHub Actions asks for a full run)
# or on the nightly schedule.
#
# The guards are compile-time insertions, so on a default run the extra legs
# are never generated: no agents, and no skipped entries in the run summary.
#
# The gate keys on the parameter rather than on Build.Reason because a run
# created through the REST API reports Build.Reason=Manual -- so testing
# "not a pull request" would make every GitHub-Actions-queued run build all 42.
# Schedule is kept so the nightly still covers everything.
#
# It cannot key on the branch, which is what an earlier attempt did. Measured
# on a pull request from branch PS-11473-8.4-fullci, the compile-time values
# are Build.SourceBranch='refs/pull/<n>/merge', Build.SourceBranchName='merge'
# and System.PullRequest.SourceBranch='' (its runtime value is the branch, but
# expansion happens before that is set). A runtime condition cannot substitute:
# job conditions are evaluated before matrix variables are in scope, so a
# per-leg condition lets every leg through.
strategy:
matrix:
clang-22 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 22
BuildType: RelWithDebInfo
clang-22 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 22
BuildType: Debug
gcc-16 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
Compiler: gcc
CompilerVer: 16
BuildType: RelWithDebInfo
gcc-16 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
Compiler: gcc
CompilerVer: 16
BuildType: Debug
gcc-16 Debug INVERTED [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
Compiler: gcc
CompilerVer: 16
BuildType: Debug
BUILD_PARAMS_TYPE: inverted
# Extended coverage below: built only with fullCI, or on the nightly.
# macOS 14
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
macOS 14 RelWithDebInfo:
imageName: 'macOS-14'
Compiler: clang
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
macOS 14 Debug:
imageName: 'macOS-14'
Compiler: clang
BuildType: Debug
# clang-12 and newer compilers
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-22 RelWithDebInfo INVERTED [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 22
BuildType: RelWithDebInfo
BUILD_PARAMS_TYPE: inverted
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-21 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 21
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-21 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 21
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-20 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 20
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-20 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 20
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-19 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 19
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-19 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 19
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-18 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 18
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-18 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
UBUNTU_CODE_NAME: noble
Compiler: clang
CompilerVer: 18
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-17 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 17
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-17 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 17
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-16 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 16
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-16 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 16
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-15 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 15
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-15 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 15
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-14 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 14
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-14 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 14
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-13 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 13
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-13 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 13
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-12 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 12
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
clang-12 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: clang
CompilerVer: 12
BuildType: Debug
# gcc-9 and newer compilers
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-15 RelWithDebInfo [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
Compiler: gcc
CompilerVer: 15
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-15 Debug [Ubuntu 24.04 Noble]:
imageName: 'ubuntu-24.04'
Compiler: gcc
CompilerVer: 15
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-14 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 14
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-14 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 14
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-13 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 13
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-13 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 13
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-12 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 12
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-12 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 12
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-11 RelWithDebInfo Ubuntu 22.04 Jammy:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 11
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-11 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 11
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-10 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 10
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-10 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 10
BuildType: Debug
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-9 RelWithDebInfo [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 9
BuildType: RelWithDebInfo
${{ if or(parameters.fullCI, eq(variables['Build.Reason'], 'Schedule')) }}:
gcc-9 Debug [Ubuntu 22.04 Jammy]:
imageName: 'ubuntu-22.04'
Compiler: gcc
CompilerVer: 9
BuildType: Debug
steps:
- script: |
# Logic for Ubuntu 22.04 or 24.04
if [[ "$(imageName)" =~ ubuntu-(22|24).04 ]]; then
df -Th
echo "--- Performing Deep Clean for $(imageName) ---"
echo "1. Remove .NET (~4.0 GB)"
sudo rm -rf /usr/share/dotnet
echo "2. Remove Swift (~3.2 GB)"
sudo rm -rf /usr/share/swift
echo "3. Remove Tool Cache (CodeQL, Go, Ruby) (~3.0 GB)"
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo rm -rf /opt/hostedtoolcache/go
sudo rm -rf /opt/hostedtoolcache/Ruby
echo "4. Remove Julia (~1.0 GB)"
sudo rm -rf /usr/local/julia*
echo "5. Remove Android SDK (~9-12 GB)"
sudo rm -rf /usr/local/lib/android
echo "6. Clean up Docker images and volumes"
docker system prune -af --volumes
echo "--- Disk space after cleanup ---"
df -Th
fi
displayName: 'Clean Disk Space'
- script: |
uname -r
df -Th
ls -l ..
pwd
ls -l
if [[ "$OS_NAME" == "Linux" ]]; then
SELECTED_CC=$(Compiler)-$(CompilerVer)
if [[ "$(Compiler)" == "clang" ]]; then
SELECTED_CXX=clang++-$(CompilerVer)
PACKAGES="$SELECTED_CC $PACKAGES"
else
SELECTED_CXX=g++-$(CompilerVer)
PACKAGES="$SELECTED_CXX $PACKAGES"
fi
else
REAL_COMPILER_VER=`$(Compiler) --version | grep -o "clang version.*" | awk '{print $3}'`
SELECTED_CC=$(Compiler)
SELECTED_CXX=clang++
fi
echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX BuildType=$(BuildType) BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE) imageName=$(imageName) OS_NAME=$OS_NAME
echo --- Configure required LLVM and Ubuntu Toolchain repositories
if [[ "$OS_NAME" == "Linux" ]] && [[ "$SELECTED_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 libtirpc-dev libudev-dev libaio-dev libmecab-dev libnuma-dev libssl-dev libreadline-dev libedit-dev libpam-dev libcurl4-openssl-dev libldap2-dev libkrb5-dev libsasl2-dev libsasl2-modules-gssapi-mit || exit 1;
`# SYSTEM_LIBRARIES = CURL EDITLINE ICU LIBEVENT LZ4 PROTOBUF SSL ZSTD FIDO (Ubuntu 21.04+)`
if [[ "$(BUILD_PARAMS_TYPE)" != "inverted" ]]; then
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install libicu-dev libevent-dev liblz4-dev zlib1g-dev protobuf-compiler libprotobuf-dev libprotoc-dev libzstd-dev libfido2-dev || exit 1;
else
sudo -E apt-get -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install libgflags-dev || exit 1;
fi
if [[ "$(Compiler)" == "clang" ]]; then
REAL_COMPILER_VER=`$SELECTED_CC --version | grep -o "clang version.*" | awk '{print $3}'`
else
REAL_COMPILER_VER=`$SELECTED_CC --version | head -1 | awk '{print $4}'`
fi
else
brew update
brew install ccache protobuf@21 lz4 openssl@3 bison
brew link --force protobuf@21
fi
UPDATE_TIME=$SECONDS
echo --- Packages updated in $UPDATE_TIME seconds.
echo "##vso[task.setvariable variable=REAL_COMPILER_VER]${REAL_COMPILER_VER%%-*}"
echo "##vso[task.setvariable variable=SELECTED_CC]$SELECTED_CC"
echo "##vso[task.setvariable variable=SELECTED_CXX]$SELECTED_CXX"
echo "##vso[task.setvariable variable=UPDATE_TIME]$UPDATE_TIME"
displayName: '*** Install Build Dependencies'
- task: Cache@2
continueOnError: true
inputs:
key: '"ccache"| "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE)" | "$(Build.SourceVersion)"'
restoreKeys: '"ccache" | "$(PARENT_BRANCH)" | "$(imageName)-$(Compiler)-$(REAL_COMPILER_VER)-$(BuildType)" | "BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE)"'
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
git submodule
displayName: '*** Update git submodules'
- script: |
echo "SELECTED_CC=$SELECTED_CC (`which $SELECTED_CC`) SELECTED_CXX=$SELECTED_CXX (`which $SELECTED_CXX`) REAL_COMPILER_VER=$REAL_COMPILER_VER BuildType=$(BuildType)"
$SELECTED_CC -v
$SELECTED_CXX -v
ccache --version
ccache -p
ccache --zero-stats
df -Th
if [[ "$OS_NAME" == "Linux" ]]; then
cat /proc/cpuinfo
fi
displayName: '*** System and compiler info'
- script: |
echo SELECTED_CC=$SELECTED_CC SELECTED_CXX=$SELECTED_CXX REAL_COMPILER_VER=$REAL_COMPILER_VER BuildType=$(BuildType) BUILD_PARAMS_TYPE=$(BUILD_PARAMS_TYPE) imageName=$(imageName) OS_NAME=$OS_NAME
echo --- Set cmake parameters
COMPILE_OPT+=(
-DCMAKE_C_FLAGS_DEBUG=-g1
-DCMAKE_CXX_FLAGS_DEBUG=-g1
)
CMAKE_OPT="
-DCMAKE_BUILD_TYPE=$(BuildType)
-DBUILD_CONFIG=mysql_release
-DWITH_PACKAGE_FLAGS=OFF
-DDOWNLOAD_BOOST=1
-DWITH_BOOST=$(BOOST_DIR)
-DCMAKE_C_COMPILER=$SELECTED_CC
-DCMAKE_CXX_COMPILER=$SELECTED_CXX
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DWITH_ROCKSDB=ON
-DWITH_COREDUMPER=ON
-DWITH_KEYRING_VAULT=ON
-DWITH_KEYRING_VAULT_TEST=ON
-DWITH_PAM=ON
"
function get_ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); }
if [[ ( "$(Compiler)" == "gcc" ) && ( 10#$(get_ver $REAL_COMPILER_VER) -lt 10#$(get_ver 8.1.0) ) ]]; then
CMAKE_OPT+="
-DWITH_ROUTER=OFF
-DWITH_PERCONA_AUDIT_LOG_FILTER=OFF
"
fi
if [[ ( "$(Compiler)" == "clang" ) && ( 10#$(get_ver $REAL_COMPILER_VER) -lt 10#$(get_ver 7.0.0) ) ]]; then
CMAKE_OPT+="
-DWITH_PERCONA_AUDIT_LOG_FILTER=OFF
"
fi
if [[ "$OS_NAME" == "Darwin" ]]; then
OPENSSL_PREFIX=$(brew --prefix openssl@3)
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=OFF
-DWITH_PROTOBUF=system
-DWITH_SYSTEM_LIBS=ON
-DWITH_ICU=bundled
-DWITH_SSL=$OPENSSL_PREFIX
-DWITH_FIDO=bundled
-DWITH_ZLIB=bundled
-DWITH_LIBEVENT=bundled
-DWITH_PERCONA_AUTHENTICATION_LDAP=OFF
"
else
CMAKE_OPT+="
-DMYSQL_MAINTAINER_MODE=ON
"
if [[ "$(BUILD_PARAMS_TYPE)" != "inverted" ]]; then
CMAKE_OPT+="
-DWITH_MECAB=system
-DWITH_NUMA=ON
-DWITH_READLINE=system
-DWITH_SYSTEM_LIBS=ON
"
`# Required liblz4 1.9.3 and installed version is 1.9.2`
if [[ "$(imageName)" == "ubuntu-20.04" ]]; then
CMAKE_OPT+="-DWITH_LZ4=bundled"
fi
else
CMAKE_OPT+="
-DWITH_NDB=ON
-DWITH_NDBCLUSTER=ON
-DWITH_NDB_JAVA=OFF
-DWITH_ROUTER=OFF
-DWITH_UNIT_TESTS=OFF
-DWITH_NUMA=OFF
-DWITH_EDITLINE=bundled
-DWITH_FIDO=bundled
-DWITH_ICU=bundled
-DWITH_LIBEVENT=bundled
-DWITH_LZ4=bundled
-DWITH_PROTOBUF=bundled
-DWITH_RAPIDJSON=bundled
-DWITH_ZLIB=bundled
-DWITH_ZSTD=bundled
-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
-DROCKSDB_PLUGINS=zenfs
-DWITH_ZENFS_UTILITY=ON
"
fi
fi
echo --- CMAKE_OPT=\"$CMAKE_OPT\"
echo --- COMPILE_OPT=\"${COMPILE_OPT[@]}\"
mkdir bin; cd bin
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.
cmake -L .
echo '##vso[task.setvariable variable=CMAKE_TIME]'$CMAKE_TIME
displayName: '*** 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'