forked from vgvassilev/cling
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
362 lines (321 loc) · 9.91 KB
/
.travis.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
sudo: false
language: cpp
addons: &addons
apt:
packages: timeout
sources: &sources
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.5
- llvm-toolchain-precise-3.6
- llvm-toolchain-precise-3.7
- llvm-toolchain-precise-3.8
- llvm-toolchain-precise
cache:
apt: true
ccache: true
directories:
- $HOME/.ccache
- $CLING_BUILD_DEPS
env:
global:
- USE_CCACHE=1
- CCACHE_COMPRESS=1
- CCACHE_MAXSIZE=500M
- CCACHE_CPP2=1
- TIMEOUT=0
- secure: "MWXnhg939UrLRP7Jg5xLFxxquIgale0crNyP9Y2L2Pg+zINTgSExyykP/+s4uV1mj44uYLr4oEU7Ue72w3yGptanau90BUO+ZN5clC7QEUWsfJUDBc/ytilp+xhNRNLA+MJvaYLNOyXJOf9JKf/IzgRAR0m0PGAl9pMRG2vP5Sg="
# Do not build our sync branch.
branches:
except:
- /^__internal.*$/
only:
- master
- cling-nightlies
matrix:
# Abort all builds on a single failing matrix entry.
fast_finish: true
exclude:
# Note: Workaround travis-ci/travis-ci#4681
# Exclude default job which lacks our included environment variables.
- os: osx
- os: linux
include:
# There seems to be a hard limit to how many machines a Travis build will
# across all platforms. By interleaving OS X, the hope is to get in the
# queue faster while not blocking Linux builds from occuring.
- os: linux
env: DIST=pangolin COMPILER=g++-4.8 CCOMPILER=gcc-4.8 NIGHTLY_CRON_SYNC=1
addons:
apt:
sources: *sources
packages: g++-4.8
compiler: gcc-4.8
- os: linux
env: DIST=pangolin COMPILER=g++-4.9 CCOMPILER=gcc-4.9
addons:
apt:
sources: *sources
packages: g++-4.9
compiler: gcc-4.9
- os: osx
env: COMPILER=clang++ CCOMPILER=clang
osx_image: xcode6.4
compiler: clang
- os: linux
env: DIST=pangolin COMPILER=g++-5 CCOMPILER=gcc-5
addons:
apt:
sources: *sources
packages: g++-5
compiler: gcc-5
- os: linux
env: DIST=pangolin COMPILER=g++-6 CCOMPILER=gcc-6
addons:
apt:
sources: *sources
packages: g++-6
compiler: gcc-6
- os: osx
env: COMPILER=clang++ CCOMPILER=clang
osx_image: xcode7.3
compiler: clang
- os: linux
env: DIST=trusty COMPILER=g++-4.8 CCOMPILER=gcc-4.8
sudo: required
dist: trusty
addons:
apt:
sources: *sources
packages: g++-4.8
compiler: gcc-4.8
- os: linux
env: DIST=trusty COMPILER=g++-4.9 CCOMPILER=gcc-4.9
sudo: required
dist: trusty
addons:
apt:
sources: *sources
packages: g++-4.9
compiler: gcc-4.9
- os: osx
env: COMPILER=g++-6 CCOMPILER=gcc-6
osx_image: xcode7.3
compiler: gcc-6
- os: linux
env: DIST=trusty COMPILER=g++-5 CCOMPILER=gcc-5
sudo: required
dist: trusty
addons:
apt:
sources: *sources
packages: g++-5
compiler: gcc-5
- os: linux
env: DIST=trusty COMPILER=g++-6 CCOMPILER=gcc-6
sudo: required
dist: trusty
addons:
apt:
sources: *sources
packages: g++-6
compiler: gcc-6
- os: osx
env: COMPILER=clang++ CCOMPILER=clang
osx_image: xcode8.3
compiler: clang
- os: linux
env: DIST=trusty COMPILER=g++-7 CCOMPILER=gcc-7
sudo: required
dist: trusty
addons:
apt:
sources: *sources
packages: g++-7
compiler: gcc-7
- os: linux
env: CXXLIB=libstdc++ COMPILER=clang++-3.7 CCOMPILER=clang-3.7
addons:
apt:
sources: *sources
packages: ['clang-3.7', 'libstdc++-5-dev']
compiler: clang-3.7
- os: osx
env: COMPILER=g++-7 CCOMPILER=gcc-7
osx_image: xcode8.3
compiler: gcc-7
- os: linux
env: CXXLIB=libstdc++ COMPILER=clang++-3.8 CCOMPILER=clang-3.8
addons:
apt:
sources: *sources
packages: ['clang-3.8', 'libstdc++-6-dev']
compiler: clang-3.8
allow_failures:
# clang-3.5 crashes compiling clang-3.9 with libc++-3.9
- env: CXXLIB=libc++ COMPILER=clang++-3.5 CCOMPILER=clang-3.5
install:
# If cmake is not in the cache, download it.
- |
CLING_USER_ROOT=`dirname $TRAVIS_BUILD_DIR`
export CLING_BUILD_DEPS="$CLING_USER_ROOT/deps"
export CLING_LOCAL_BIN="$CLING_USER_ROOT/bin"
if [ $TRAVIS_OS_NAME == 'osx' ]; then
brew install ccache python coreutils
if [[ "$COMPILER" == g++-* ]]; then
brew install "gcc@${COMPILER##*++-}"
brew link --overwrite "gcc@${COMPILER##*++-}"
if [[ "$COMPILER" == "g++-6" ]]; then
export CXXFLAGS="-D__builtin_unreachable=__builtin_trap"
export CFLAGS="-D__builtin_unreachable=__builtin_trap"
fi
fi
PATH="/usr/local/opt/ccache/libexec:$PATH"
# This is where timeout is hiding now, is the above still neccessary?
PATH="$PATH:/usr/local/opt/coreutils/libexec/gnubin"
fi
if [ "$COMPILER" == "g++-6" ]; then
export CLING_BUILD_FLAGS="-DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON"
CMAKEREQ="3.8"
else
CMAKEREQ="3.6"
fi
# Containers need to timeout before the buildscript exits
TIMEOUT='37m' # Any more and Travis might cancel
# If we timeout, objects can be corrupted in the cache, causing link errors
# Turn this on to get the mapping to the cache.o to delete
# export CCACHE_LOGFILE="$CLING_USER_ROOT/ccache.log"
# Get installed CMake version and make sure its at least CMAKEREQ
CMKV=( `cmake --version` )
CMKV=${CMKV[2]}
if [ "${CMKV:0:1}" -lt "${CMAKEREQ:0:1}" ] || [ "${CMKV:2:1}" -lt "${CMAKEREQ:2:1}" ]; then
if [ $TRAVIS_OS_NAME == 'linux' ]; then
CMAKE_URL="https://cmake.org/files/v${CMAKEREQ}/cmake-${CMAKEREQ}.0-Linux-x86_64.tar.gz"
export CMAKE=$CLING_BUILD_DEPS/cmake/bin/cmake
else
CMAKE_URL="https://cmake.org/files/v${CMAKEREQ}/cmake-${CMAKEREQ}.0-Darwin-x86_64.tar.gz"
export CMAKE=$CLING_BUILD_DEPS/cmake/CMake.app/Contents/bin/cmake
fi
if [ ! -f $CMAKE ]; then
mkdir -pv $CLING_BUILD_DEPS/cmake
travis_retry curl -k $CMAKE_URL | tar --strip-components=1 -xz -C $CLING_BUILD_DEPS/cmake
fi
else
export CMAKE="cmake"
fi
before_script:
- $CMAKE --version
- export CXX="ccache $COMPILER"
- export CC="ccache $CCOMPILER"
- |
# If we are running our nightly cron job, sync.
if [ -n "$NIGHTLY_CRON_SYNC" ] && [ "$TRAVIS_EVENT_TYPE" = "cron" ] \
&& [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] \
&& [ "$TRAVIS_REPO_SLUG" == "vgvassilev/cling" ] ; then
echo "Syncing repository."
git remote add alt http://root.cern.ch/git/cling.git
git pull alt master
git remote remove origin
git remote add origin https://[email protected]/${TRAVIS_REPO_SLUG}
git push --verbose origin master
# Move the tag to newest master
git tag --force cling-nightlies HEAD
git push --verbose --force origin cling-nightlies
fi
script:
- |
if [ -z $TRAVIS_TAG ]; then
timeout -s SIGTERM $TIMEOUT tools/packaging/cpt.py \
--current-dev=tar \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
--with-clang-url=http://root.cern.ch/git/clang.git \
--with-llvm-url=http://root.cern.ch/git/llvm.git \
--with-cmake-flags="$CLING_BUILD_FLAGS" \
--skip-cleanup
else
tools/packaging/cpt.py \
--tarball-tag=$TRAVIS_TAG \
--with-cling-url=https://github.com/$TRAVIS_REPO_SLUG \
--with-clang-url=http://root.cern.ch/git/clang.git \
--with-llvm-url=http://root.cern.ch/git/llvm.git \
--with-cmake-flags="$CLING_BUILD_FLAGS"
fi
RESULT="$?"
echo "Build Result: $RESULT"
ccache -s
if [ $RESULT -ne 124 ]; then
return $RESULT
fi
# Timout occured, pass that on to after_failure so as not to dump logs
export CLING_BUILD_TIMEOUT=1
TRAVIS_TEST_RESULT=124
return $TRAVIS_TEST_RESULT
notifications:
email:
recipients:
on_success: change
on_failure: always
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{message}"
- "Build details: %{build_url}"
- "Change view : %{compare_url}"
before_deploy:
- |
export RELEASE_TARBALL=$(ls $HOME/ci/build/cling*.tar.bz2)
if [[ $TRAVIS_TAG -eq "cling-nightlies" ]]; then
NIGHTLY="`dirname $RELEASE_TARBALL`/`date "+%Y-%b-%d-"``basename $RELEASE_TARBALL`"
echo "Renaming $RELEASE_TARBALL to $NIGHTLY"
mv $RELEASE_TARBALL $NIGHTLY
export RELEASE_TARBALL=$NIGHTLY
fi
echo "Deploying $RELEASE_TARBALL to GitHub releases"
deploy:
provider: releases
skip_cleanup: true
api_key: $OAUTH_TOKEN
file: '${RELEASE_TARBALL}'
on:
tags: true
all_branches: true
repo: $TRAVIS_REPO_SLUG
after_failure:
- |
if [ -n "$CCACHE_LOGFILE" ]; then
echo "ccache log stored to:"
cat "$CCACHE_LOGFILE" | curl -sT - chunk.io
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "Dumping env."
find $CLING_LOCAL_BIN -type f -print0 -exec cat {} \;
$CMAKE --version
$CC --version
$CXX --version
ls -al `which ld` && ld -v
export
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "Dumping CMakeOutput.log"
cat /home/travis/ci/build/builddir/CMakeFiles/CMakeOutput.log
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "Dumping CMakeError.log"
cat /home/travis/ci/build/builddir/CMakeFiles/CMakeError.log
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "Dumping cling-compiledata.h..."
COMPILE_DATA_H=$HOME/ci/build/builddir/tools/cling/lib/Interpreter/cling-compiledata.h
cat $COMPILE_DATA_H
echo "Running cling-compiledata compiler..."
COMPDATA_CXX=$(cat $COMPILE_DATA_H | cut -c 18- | sed "s,\",,g")
eval echo | LC_ALL=C $COMPDATA_CXX -xc++ -E -v -
fi
- |
if [ "$CLING_BUILD_TIMEOUT" != "1" ]; then
echo "Dumping `which ccache`"
ccache -s
ls -la /usr/lib/ccache/ || ls -la /usr/local/opt/ccache/libexec
fi