forked from mongodb/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mci.yml
483 lines (440 loc) · 20 KB
/
.mci.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
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
#######################################
# CXX Driver Config for MCI #
#######################################
#######################################
# Variables #
#######################################
variables:
mongodb_version:
version_latest: &version_latest latest
version_32: &version_32 3.2
## Use newer compiler path variables
compiler_path:
rhel55_cc_path: &rhel55_cc_path /opt/mongodbtoolchain/v2/bin/gcc
rhel55_cxx_path: &rhel55_cxx_path /opt/mongodbtoolchain/v2/bin/g++
## cmake path variables
cmake_path:
linux_cmake_path: &linux_cmake_path /opt/cmake/bin/cmake
ubuntu_zap_cmake_path: &ubuntu_zap_cmake_path /usr/bin/cmake
osx_cmake_path: &osx_cmake_path /Applications/Cmake.app/Contents/bin/cmake
windows_cmake_path: &windows_cmake_path /cygdrive/c/cmake/bin/cmake
## tar options variables
tar_options:
linux_tar_options: &linux_tar_options --wildcards --no-anchored
build_tool_path:
unix_build_tool_path: &unix_build_tool_path make
windows_build_tool_path: &windows_build_tool_path "/cygdrive/c/Program Files (x86)/MSBuild/14.0/Bin/MSBuild.exe"
## cdriver configure flags
cdriver_configure_flags:
linux_cdriver_configure_flags: &linux_cdriver_configure_flags --enable-ssl --enable-sasl --with-gnu-ld CFLAGS=-fno-omit-frame-pointer
osx_cdriver_configure_flags: &osx_cdriver_configure_flags --enable-ssl --enable-sasl
## cmake flag variables
cmake_flags:
# TODO CXX-1056: remove "-Wno-error=deprecated-declarations" from CMAKE_C_FLAGS and
# CMAKE_CXX_FLAGS.
linux_cmake_flags: &linux_cmake_flags -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations"
rhel55_cmake_flags: &rhel55_cmake_flags -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror -Wno-error=deprecated-declarations"
osx_cmake_flags: &osx_cmake_flags -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations" -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Wall -Wextra -Werror -Wno-error=deprecated-declarations"
asan_cmake_flags: &asan_cmake_flags -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fsanitize=address -O1 -g -fno-omit-frame-pointer -Wall -Wextra -Werror -Wno-error=deprecated-declarations"
ubsan_cmake_flags: &ubsan_cmake_flags -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations" -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_CXX_FLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -fsanitize=undefined -fsanitize-blacklist=$(pwd)/etc/ubsan.blacklist -fno-sanitize-recover=undefined -O1 -g -fno-omit-frame-pointer -Wall -Wextra -Werror -Wno-error=deprecated-declarations"
windows_cmake_flags: &windows_cmake_flags -G "Visual Studio 14 2015 Win64" -DBOOST_ROOT=c:/local/boost_1_60_0 -DLIBBSON_DIR=$(cygpath -m "$(pwd)/../mongoc") -DLIBMONGOC_DIR=$(cygpath -m "$(pwd)/../mongoc")
poly_flags:
poly_boost_flags: &poly_boost_flags -DBSONCXX_POLY_USE_BOOST=ON
poly_std_experimental_flags: &poly_std_experimental_flags -DBSONCXX_POLY_USE_STD_EXPERIMENTAL=ON -DCMAKE_CXX_STANDARD=14
poly_mnmlstc: &poly_mnmlstc -DBSONCXX_POLY_USE_MNMLSTC=ON
## test parameters
test_params:
asan_test_params: &asan_test_params PATH="/usr/lib/llvm-3.8/bin" ASAN_OPTIONS="detect_leaks=1"
ubsan_test_params: &ubsan_test_params PATH="usr/lib/llvm-3.8/bin" UBSAN_OPTIONS="print_stacktrace=1"
valgrind_test_params: &valgrind_test_params valgrind --leak-check=full --track-origins=yes --num-callers=50 --error-exitcode=1 --error-limit=no --read-var-info=yes --suppressions=../etc/memcheck.suppressions
#######################################
# Functions #
#######################################
functions:
"setup":
- command: shell.exec
params:
script: |
rm -rf "mongo-cxx-driver"
rm -fr "mongo-c-driver"
rm -fr mongod
- command: git.get_project
params:
directory: "mongo-cxx-driver"
- command: shell.exec
params:
working_dir: "."
script: |
set -o xtrace
cc --version || true
c++ --version || true
gcc --version || true
g++ --version || true
clang --version || true
cmake --version || true
"start_mongod":
command: shell.exec
params:
working_dir: "."
script: |
set -o errexit
set -o xtrace
git clone [email protected]:mongodb-labs/drivers-evergreen-tools.git
cd drivers-evergreen-tools
# Convert shell script line endings. TODO: Remove this when
# <https://github.com/mongodb-labs/drivers-evergreen-tools/pull/6> is merged.
for i in .evergreen/*.sh; do dos2unix "$i" || true; done
export DRIVERS_TOOLS=$(pwd)
if [ "Windows_NT" == "$OS" ]; then
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
fi
export MONGODB_BINARIES=$DRIVERS_TOOLS/mongodb/bin
export MONGO_ORCHESTRATION_HOME=$DRIVERS_TOOLS/.evergreen/orchestration
export MONGODB_VERSION=${mongodb_version}
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config
sh .evergreen/run-orchestration.sh
"stop_mongod":
command: shell.exec
params:
working_dir: "."
script: |
set -o errexit
set -o xtrace
cd drivers-evergreen-tools/.evergreen/orchestration
if [ -f venv/bin/activate ]; then
. venv/bin/activate
elif [ -f venv/Scripts/activate ]; then
. venv/Scripts/activate
fi
mongo-orchestration stop
"install_c_driver":
command: shell.exec
params:
working_dir: "mongo-cxx-driver"
script: |
export PREFIX=$(pwd)/../mongoc/
sh .evergreen/install.sh ${MONGOC_VERSION|master}
"lint":
- command: shell.exec
params:
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o xtrace
python etc/clang_format.py lint
"compile":
- command: shell.exec
params:
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o xtrace
if [ "${cxx_path|default}" != "default" ]; then
export CXX="${cxx_path}"
fi
if [ "${cc_path|default}" != "default" ]; then
export CC="${cc_path}"
fi
export PATH_TO_CMAKE="${cmake_path}"
export PATH_TO_BUILD_TOOL="${build_tool_path}"
export PKG_CONFIG_PATH="$(pwd)/../mongoc/lib/pkgconfig"
export BUILD_TYPE=${build_type}
sh .evergreen/compile.sh ${cmake_flags} ${poly_flags} -DCMAKE_INSTALL_PREFIX=install
"test":
- command: shell.exec
params:
working_dir: "mongo-cxx-driver"
script: |
set -o errexit
set -o xtrace
cd build
export PREFIX=$(pwd)/../../mongoc
# Use PATH / LD_LIBRARY_PATH / DYLD_LIBRARY_PATH to inform the tests where to find
# mongoc library dependencies on Linux / Mac OS / Windows, respectively.
# Additionally, on Windows, we also need to inform the tests where to find
# mongocxx library dependencies.
export LD_LIBRARY_PATH=.:$PREFIX/lib/
export DYLD_LIBRARY_PATH=.:$PREFIX/lib/
export PATH=$PREFIX/bin:$(pwd)/install/bin:$PATH
# CRUD_TESTS_PATH and GRIDFS_TESTS_PATH are required to be set by the
# `test_crud_specs` and `test_gridfs_specs` test binaries, respectively.
export CRUD_TESTS_PATH="$(pwd)/../data/crud"
export GRIDFS_TESTS_PATH="$(pwd)/../data/gridfs"
if [ "Windows_NT" == "$OS" ]; then
CRUD_TESTS_PATH=$(cygpath -m $CRUD_TESTS_PATH)
CTEST_OUTPUT_ON_FAILURE=1 "${build_tool_path}" /p:Configuration=${build_type} RUN_TESTS.vcxproj
CTEST_OUTPUT_ON_FAILURE=1 "${build_tool_path}" /p:Configuration=${build_type} examples/run-examples.vcxproj
else
# Running the tests and examples here one-by-one here with "test_params" is
# necessary due to the fact that we don't yet have explicit CMake integration
# with valgrind. When CXX-1083 is resolved, we can replace the below with
# `make test && make run-examples` (or the valgrind equivalents, if we make
# separate build targets for valgrind).
${test_params} ./src/bsoncxx/test/test_bson
${test_params} ./src/mongocxx/test/test_driver
${test_params} ./src/mongocxx/test/test_crud_specs
${test_params} ./src/mongocxx/test/test_gridfs_specs
${test_params} ./src/mongocxx/test/test_instance
for test in $(find examples -type f -perm +0100 | sort); do ${test_params} $test; done
fi
#######################################
# Pre Task #
#######################################
post:
- func: "stop_mongod"
#######################################
# Tasks #
#######################################
tasks:
- name: lint
commands:
- func: "setup"
- func: "lint"
- name: compile_and_test_with_mongoc_current
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
vars:
MONGOC_VERSION: 1.5.0
- func: "compile"
- func: "test"
- name: compile_and_test_with_mongoc_stable_branch
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
vars:
MONGOC_VERSION: r1.6
- func: "compile"
- func: "test"
- name: compile_and_test_with_mongoc_master_branch
commands:
- func: "setup"
- func: "start_mongod"
- func: "install_c_driver"
vars:
MONGOC_VERSION: master
- func: "compile"
- func: "test"
#######################################
# Buildvariants #
#######################################
buildvariants:
#######################################
# Linux Buildvariants #
#######################################
- name: ubuntu1404-release
display_name: "Ubuntu 14.04 Release"
expansions:
build_type: "Release"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *linux_cmake_flags
mongodb_version: *version_latest
run_on:
- ubuntu1404-test
tasks:
- name: lint
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1404-debug
display_name: "Ubuntu 14.04 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *linux_cmake_flags
mongodb_version: *version_latest
run_on:
- ubuntu1404-test
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: rhel55-debug
display_name: "RHEL 5.5 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *rhel55_cmake_flags
cc_path: *rhel55_cc_path
cxx_path: *rhel55_cxx_path
# Versions 3.4+ of the server no longer run RHEL 5.5, so we pin to 3.2 instead.
mongodb_version: *version_32
run_on:
- rhel55-test
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: osx-1010
display_name: "OS X 10.10 Release (Boost)"
expansions:
build_type: "Release"
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *osx_cdriver_configure_flags
cmake_path: *osx_cmake_path
cmake_flags: *osx_cmake_flags
poly_flags: *poly_boost_flags
mongodb_version: *version_latest
run_on:
- osx-1010
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1604-debug-std-experimental
display_name: "Ubuntu 16.04 Debug (std::experimental)"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *linux_cmake_flags
poly_flags: *poly_std_experimental_flags
mongodb_version: *version_latest
run_on:
- ubuntu1604-build
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1604-debug-valgrind
display_name: "Valgrind Ubuntu 16.04 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *linux_cmake_flags
test_params: *valgrind_test_params
mongodb_version: *version_latest
run_on:
- ubuntu1604-build
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1604-debug-asan
display_name: "ASAN Ubuntu 16.04 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *asan_cmake_flags
test_params: *asan_test_params
mongodb_version: *version_latest
run_on:
- ubuntu1604-build
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1604-debug-ubsan
display_name: "UBSAN Ubuntu 16.04 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *linux_cmake_path
cmake_flags: *ubsan_cmake_flags
test_params: *ubsan_test_params
mongodb_version: *version_latest
run_on:
- ubuntu1604-build
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: ubuntu1604-zseries
display_name: "s390x Ubuntu 16.04"
batchtime: 1440 # 1 day
expansions:
build_type: "Release"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_zap_cmake_path
mongodb_version: *version_latest
run_on:
- ubuntu1604-zseries-small
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: power8-ubuntu1604
display_name: "ppc64le Ubuntu 16.04"
batchtime: 1440 # 1 day
expansions:
build_type: "Release"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_zap_cmake_path
mongodb_version: *version_latest
run_on:
- ubuntu1604-power8-build
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: arm-ubuntu1604
display_name: "arm64 Ubuntu 16.04"
batchtime: 1440 # 1 day
expansions:
build_type: "Release"
tar_options: *linux_tar_options
build_tool_path: *unix_build_tool_path
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_zap_cmake_path
mongodb_version: *version_latest
run_on:
- ubuntu1604-arm64-small
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: windows-2k8-release
display_name: "Windows 2008R2 Release"
expansions:
build_type: "Release"
tar_options: *linux_tar_options
build_tool_path: *windows_build_tool_path
cmake_path: *windows_cmake_path
cmake_flags: *windows_cmake_flags
mongodb_version: *version_latest
run_on:
- windows-64-vs2015-compile
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch
- name: windows-2k8-debug
display_name: "Windows 2008R2 Debug"
expansions:
build_type: "Debug"
tar_options: *linux_tar_options
build_tool_path: *windows_build_tool_path
cmake_path: *windows_cmake_path
cmake_flags: *windows_cmake_flags
mongodb_version: *version_latest
run_on:
- windows-64-vs2015-compile
tasks:
- name: compile_and_test_with_mongoc_current
- name: compile_and_test_with_mongoc_stable_branch
- name: compile_and_test_with_mongoc_master_branch