forked from mongodb/mongo-cxx-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mci.yml
249 lines (221 loc) · 9.54 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
#######################################
# CXX Driver Config for MCI #
#######################################
#######################################
# Variables #
#######################################
variables:
## source variables
source:
ubuntu_source: &ubuntu_source https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-latest.tgz
osx_source: &osx_source https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-latest.tgz
## cmake path variables
cmake_path:
ubuntu_cmake_path: &ubuntu_cmake_path /opt/cmake/bin/cmake
osx_cmake_path: &osx_cmake_path /Applications/Cmake.app/Contents/bin/cmake
## tar options variables
tar_options:
ubuntu_tar_options: &ubuntu_tar_options --wildcards --no-anchored
## concurrency for make
compile_concurrency:
linux_compile_concurrency: &linux_compile_concurrency -j$(grep -c ^processor /proc/cpuinfo)
osx_compile_concurrency: &osx_compile_concurrency -j$(sysctl -n hw.logicalcpu)
## cdriver configure flags
cdriver_configure_flags:
linux_cdriver_configure_flags: &linux_cdriver_configure_flags --enable-ssl --enable-sasl
osx_cdriver_configure_flags: &osx_cdriver_configure_flags --enable-ssl --enable-sasl
## cmake flag variables
cmake_flags:
ubuntu_cmake_flags: &ubuntu_cmake_flags -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers"
osx_cmake_flags: &osx_cmake_flags -DCMAKE_CXX_FLAGS="-stdlib=libc++ -Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers" -DBSONCXX_POLY_USE_BOOST=ON
asan_cmake_flags: &asan_cmake_flags -DCMAKE_CXX_FLAGS="-fsanitize=address -O1 -fno-omit-frame-pointer -Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers -Wno-error=maybe-uninitialized"
ubsan_cmake_flags: &ubsan_cmake_flags -DCMAKE_CXX_COMPILER="/usr/bin/clang++" -DCMAKE_CXX_FLAGS="-fsanitize=undefined -g -fno-omit-frame-pointer -fsanitize-blacklist=$(pwd)/../etc/ubsan.blacklist -fno-sanitize-recover -Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers"
## test parameters
test_params:
asan_test_params: &asan_test_params ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-3.5 ASAN_OPTIONS="detect_leaks=1"
ubsan_test_params: &ubsan_test_params UBSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer 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:
"fetch_source":
command: git.get_project
params:
directory: "mongo-cxx-driver"
"start_mongod":
command: shell.exec
params:
working_dir: "."
script: |
set -o errexit
set -o verbose
curl -o mongodb.tgz ${source}
tar --extract --file mongodb.tgz --strip-components=2 ${tar_options} "*/bin/mongod"
mkdir -p /data/tmp/db
./mongod --fork --logpath=/data/tmp/log --dbpath=/data/tmp/db --pidfilepath=/data/tmp/pid
"install_c_driver":
command: shell.exec
params:
working_dir: "."
## Use --disable-extra-align when configuring the C driver to avoid misalignment errors in UBSAN
script: |
set -o errexit
set -o verbose
git clone https://github.com/mongodb/mongo-c-driver.git
cd mongo-c-driver
git checkout 1.3.4
rm -rf /data/tmp/c-driver-install
./autogen.sh --prefix="/data/tmp/c-driver-install" --enable-tests=no --enable-examples=no --with-libbson=bundled --disable-extra-align ${cdriver_configure_flags}
make ${compile_concurrency}
make install
"stop_mongod":
command: shell.exec
params:
working_dir: "."
script:
kill -TERM $(cat /data/tmp/pid)
#######################################
# Pre Task #
#######################################
pre:
- command: expansions.fetch
params:
keys:
- local_key: "aws_key"
remote_key: "project_aws_key"
- local_key: "aws_secret"
remote_key: "project_aws_secret"
- command: shell.exec
params:
script: |
rm -rf "mongo-cxx-driver"
rm -fr "mongo-c-driver"
rm -fr mongod
#######################################
# Tasks #
#######################################
tasks:
- name: compile_and_test
commands:
- func: "fetch_source"
- command: git.apply_patch
params:
directory: "mongo-cxx-driver"
- func: "install_c_driver"
- func: "start_mongod"
- command: shell.exec
params:
working_dir: "mongo-cxx-driver/build"
script: |
set -o errexit
set -o verbose
PKG_CONFIG_PATH="/data/tmp/c-driver-install/lib/pkgconfig" ${cmake_path} ${cmake_flags} -DCMAKE_BUILD_TYPE=${build_type} -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_C_FLAGS="-Wall -Wextra -Wno-attributes -Werror -Wno-error=missing-field-initializers" ..
if [ `uname` != 'Darwin' ]; then
# Evergreen OS X 10.6 does not have tar that can untar tar.bz2 files
make format-lint
fi
make ${compile_concurrency} all
make install
make ${compile_concurrency} examples
${test_params} ./src/bsoncxx/test/test_bson
${test_params} ./src/mongocxx/test/test_driver
${test_params} ./src/mongocxx/test/test_instance
# The break -1 is a hack to cause us to have a bad
# exit status if any test exits with a bad exit
# status.
for test in $(find examples -type f -perm /u+x | sort) ; do ${test_params} $test || break -1 ; done
- func: "stop_mongod"
#######################################
# Buildvariants #
#######################################
buildvariants:
#######################################
# Linux Buildvariants #
#######################################
- name: ubuntu1404-release
display_name: "Ubuntu 14.04 Release"
expansions:
build_type: "Release"
source: *ubuntu_source
tar_options: *ubuntu_tar_options
compile_concurrency: *linux_compile_concurrency
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_cmake_path
cmake_flags: *ubuntu_cmake_flags
run_on:
- ubuntu1404-test
tasks:
- name: compile_and_test
- name: ubuntu1404-debug
display_name: "Ubuntu 14.04 Debug"
expansions:
build_type: "Debug"
source: *ubuntu_source
tar_options: *ubuntu_tar_options
compile_concurrency: *linux_compile_concurrency
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_cmake_path
cmake_flags: *ubuntu_cmake_flags
run_on:
- ubuntu1404-test
tasks:
- name: compile_and_test
- name: osx-1010
display_name: "OS X 10.10 Release"
expansions:
build_type: "Release"
source: *osx_source
compile_concurrency: *osx_compile_concurrency
cdriver_configure_flags: *osx_cdriver_configure_flags
cmake_path: *osx_cmake_path
cmake_flags: *osx_cmake_flags
run_on:
- osx-1010
tasks:
- name: compile_and_test
- name: ubuntu1410-debug-valgrind
display_name: "Valgrind Ubuntu 14.10 Debug"
expansions:
build_type: "Debug"
source: *ubuntu_source
tar_options: *ubuntu_tar_options
compile_concurrency: *linux_compile_concurrency
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_cmake_path
cmake_flags: *ubuntu_cmake_flags
test_params: *valgrind_test_params
run_on:
- ubuntu1410-build
tasks:
- name: compile_and_test
- name: ubuntu1410-debug-asan
display_name: "ASAN Ubuntu 14.10 Debug"
expansions:
build_type: "Debug"
source: *ubuntu_source
tar_options: *ubuntu_tar_options
compile_concurrency: *linux_compile_concurrency
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_cmake_path
cmake_flags: *asan_cmake_flags
test_params: *asan_test_params
run_on:
- ubuntu1410-build
tasks:
- name: compile_and_test
- name: ubuntu1410-debug-ubsan
display_name: "UBSAN Ubuntu 14.10 Debug"
expansions:
build_type: "Debug"
source: *ubuntu_source
tar_options: *ubuntu_tar_options
compile_concurrency: *linux_compile_concurrency
cdriver_configure_flags: *linux_cdriver_configure_flags
cmake_path: *ubuntu_cmake_path
cmake_flags: *ubsan_cmake_flags
test_params: *ubsan_test_params
run_on:
- ubuntu1410-build
tasks:
- name: compile_and_test