]> git.lizzy.rs Git - rust.git/blob - .travis.yml
Don't warn about parentheses on `match (return)`
[rust.git] / .travis.yml
1 language: shell
2 sudo: required
3 dist: trusty
4 services:
5   - docker
6 addons:
7   apt:
8     packages:
9       - gdb
10
11 git:
12   depth: 2
13   submodules: false
14
15 matrix:
16   fast_finish: true
17   include:
18     # Images used in testing PR and try-build should be run first.
19     - env: IMAGE=x86_64-gnu-llvm-5.0 RUST_BACKTRACE=1
20       if: type = pull_request OR branch = auto
21
22     - env: IMAGE=dist-x86_64-linux DEPLOY=1
23       if: branch = try OR branch = auto
24
25     # "alternate" deployments, these are "nightlies" but have LLVM assertions
26     # turned on, they're deployed to a different location primarily for
27     # additional testing.
28     - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1 CI_JOB_NAME=dist-x86_64-linux-alt
29       if: branch = try OR branch = auto
30
31     - env: >
32         RUST_CHECK_TARGET=dist
33         RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --enable-lldb"
34         SRC=.
35         DEPLOY_ALT=1
36         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
37         MACOSX_DEPLOYMENT_TARGET=10.7
38         NO_LLVM_ASSERTIONS=1
39         NO_DEBUG_ASSERTIONS=1
40         CI_JOB_NAME=dist-x86_64-apple-alt
41       os: osx
42       osx_image: xcode9.3-moar
43       if: branch = auto
44
45     # macOS builders. These are placed near the beginning because they are very
46     # slow to run.
47
48     # OSX builders running tests, these run the full test suite.
49     # NO_DEBUG_ASSERTIONS=1 to make them go faster, but also do have some
50     # runners that run `//ignore-debug` tests.
51     #
52     # Note that the compiler is compiled to target 10.8 here because the Xcode
53     # version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
54     - env: >
55         RUST_CHECK_TARGET=check
56         RUST_CONFIGURE_ARGS="--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler"
57         SRC=.
58         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
59         MACOSX_DEPLOYMENT_TARGET=10.8
60         MACOSX_STD_DEPLOYMENT_TARGET=10.7
61         NO_LLVM_ASSERTIONS=1
62         NO_DEBUG_ASSERTIONS=1
63         CI_JOB_NAME=x86_64-apple
64       os: osx
65       osx_image: xcode9.3-moar
66       if: branch = auto
67
68     - env: >
69         RUST_CHECK_TARGET=check
70         RUST_CONFIGURE_ARGS=--build=i686-apple-darwin
71         SRC=.
72         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
73         MACOSX_DEPLOYMENT_TARGET=10.8
74         MACOSX_STD_DEPLOYMENT_TARGET=10.7
75         NO_LLVM_ASSERTIONS=1
76         NO_DEBUG_ASSERTIONS=1
77         CI_JOB_NAME=i686-apple
78       os: osx
79       osx_image: xcode9.3-moar
80       if: branch = auto
81
82     # OSX builders producing releases. These do not run the full test suite and
83     # just produce a bunch of artifacts.
84     #
85     # Note that these are running in the `xcode7` image instead of the
86     # `xcode8.2` image as above. That's because we want to build releases for
87     # OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7.
88     - env: >
89         RUST_CHECK_TARGET=dist
90         RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-full-tools --enable-profiler --enable-lldb"
91         SRC=.
92         DEPLOY=1
93         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
94         MACOSX_DEPLOYMENT_TARGET=10.7
95         NO_LLVM_ASSERTIONS=1
96         NO_DEBUG_ASSERTIONS=1
97         DIST_REQUIRE_ALL_TOOLS=1
98         CI_JOB_NAME=dist-i686-apple
99       os: osx
100       osx_image: xcode9.3-moar
101       if: branch = auto
102
103     - env: >
104         RUST_CHECK_TARGET=dist
105         RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --enable-lldb"
106         SRC=.
107         DEPLOY=1
108         RUSTC_RETRY_LINKER_ON_SEGFAULT=1
109         MACOSX_DEPLOYMENT_TARGET=10.7
110         NO_LLVM_ASSERTIONS=1
111         NO_DEBUG_ASSERTIONS=1
112         DIST_REQUIRE_ALL_TOOLS=1
113         CI_JOB_NAME=dist-x86_64-apple
114       os: osx
115       osx_image: xcode9.3-moar
116       if: branch = auto
117
118     # Linux builders, remaining docker images
119     - env: IMAGE=arm-android
120       if: branch = auto
121     - env: IMAGE=armhf-gnu
122       if: branch = auto
123     - env: IMAGE=dist-various-1 DEPLOY=1
124       if: branch = auto
125     - env: IMAGE=dist-various-2 DEPLOY=1
126       if: branch = auto
127     - env: IMAGE=dist-aarch64-linux DEPLOY=1
128       if: branch = auto
129     - env: IMAGE=dist-android DEPLOY=1
130       if: branch = auto
131     - env: IMAGE=dist-arm-linux DEPLOY=1
132       if: branch = auto
133     - env: IMAGE=dist-armhf-linux DEPLOY=1
134       if: branch = auto
135     - env: IMAGE=dist-armv7-linux DEPLOY=1
136       if: branch = auto
137     - env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
138       if: branch = auto
139     - env: IMAGE=dist-i686-freebsd DEPLOY=1
140       if: branch = auto
141     - env: IMAGE=dist-i686-linux DEPLOY=1
142       if: branch = auto
143     - env: IMAGE=dist-mips-linux DEPLOY=1
144       if: branch = auto
145     - env: IMAGE=dist-mips64-linux DEPLOY=1
146       if: branch = auto
147     - env: IMAGE=dist-mips64el-linux DEPLOY=1
148       if: branch = auto
149     - env: IMAGE=dist-mipsel-linux DEPLOY=1
150       if: branch = auto
151     - env: IMAGE=dist-powerpc-linux DEPLOY=1
152       if: branch = auto
153     - env: IMAGE=dist-powerpc64-linux DEPLOY=1
154       if: branch = auto
155     - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
156       if: branch = auto
157     - env: IMAGE=dist-s390x-linux DEPLOY=1
158       if: branch = auto
159     - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
160       if: branch = auto
161     - env: IMAGE=dist-x86_64-musl DEPLOY=1
162       if: branch = auto
163     - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
164       if: branch = auto
165     - env: IMAGE=asmjs
166       if: branch = auto
167     - env: IMAGE=i686-gnu
168       if: branch = auto
169     - env: IMAGE=i686-gnu-nopt
170       if: branch = auto
171     - env: IMAGE=wasm32-unknown
172       if: branch = auto
173     - env: IMAGE=x86_64-gnu
174       if: branch = auto
175     - env: IMAGE=x86_64-gnu-full-bootstrap
176       if: branch = auto
177     - env: IMAGE=x86_64-gnu-aux
178       if: branch = auto
179     - env: IMAGE=x86_64-gnu-tools
180       if: branch = auto OR (type = pull_request AND commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri)\b)/)
181     - env: IMAGE=x86_64-gnu-debug
182       if: branch = auto
183     - env: IMAGE=x86_64-gnu-nopt
184       if: branch = auto
185     - env: IMAGE=x86_64-gnu-distcheck
186       if: branch = auto
187     - env: IMAGE=mingw-check
188       if: type = pull_request OR branch = auto
189
190     - stage: publish toolstate
191       if: branch = master AND type = push
192       before_install: []
193       install: []
194       sudo: false
195       script:
196         MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
197         . src/ci/docker/x86_64-gnu-tools/repo.sh;
198         commit_toolstate_change "$MESSAGE_FILE" "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "$MESSAGE_FILE" "$TOOLSTATE_REPO_ACCESS_TOKEN";
199
200 env:
201   global:
202     - SCCACHE_BUCKET=rust-lang-ci-sccache2
203     - SCCACHE_REGION=us-west-1
204     - AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
205     # AWS_SECRET_ACCESS_KEY=...
206     - secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
207     # TOOLSTATE_REPO_ACCESS_TOKEN=...
208     - secure: "ESfcXqv4N2VMhqi2iIyw6da9VrsA78I4iR1asouCaq4hzTTrkB4WNRrfURy6xg72gQ4nMhtRJbB0/2jmc9Cu1+g2CzXtyiL223aJ5CKrXdcvbitopQSDfp07dMWm+UED+hNFEanpErKAeU/6FM3A+J+60PMk8MCF1h9tqNRISJw="
209
210 before_install:
211   # We'll use the AWS cli to download/upload cached docker layers, so install
212   # that here.
213   - if [ "$TRAVIS_OS_NAME" = linux ]; then
214       pip install --user awscli;
215       export PATH=$PATH:$HOME/.local/bin;
216     fi
217   - mkdir -p $HOME/rustsrc
218   # FIXME(#46924): these two commands are required to enable IPv6,
219   # they shouldn't exist, please revert once more official solutions appeared.
220   # see https://github.com/travis-ci/travis-ci/issues/8891#issuecomment-353403729
221   - if [ "$TRAVIS_OS_NAME" = linux ]; then
222       echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json;
223       sudo service docker restart;
224     fi
225
226 install:
227   - case "$TRAVIS_OS_NAME" in
228         linux)
229           travis_retry curl -fo $HOME/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl &&
230             chmod +x $HOME/stamp &&
231             export PATH=$PATH:$HOME
232           ;;
233         osx)
234           if [[ "$RUST_CHECK_TARGET" == dist ]]; then
235             travis_retry brew update &&
236             travis_retry brew install xz &&
237             travis_retry brew install swig;
238           fi &&
239           travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin &&
240             chmod +x /usr/local/bin/sccache &&
241           travis_retry curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
242             chmod +x /usr/local/bin/stamp &&
243           travis_retry curl -f http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
244             export CC=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang &&
245             export CXX=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++ &&
246             export AR=ar
247           ;;
248     esac
249
250 before_script:
251   - >
252       echo "#### Disk usage before running script:";
253       df -h;
254       du . | sort -nr | head -n100
255   - >
256       RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
257       if [ "$TRAVIS_OS_NAME" = "osx" ]; then
258           export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
259       else
260           export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
261           # Enable core dump on Linux.
262           sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern';
263       fi
264
265 # Log time information from this machine and an external machine for insight into possible
266 # clock drift. Timezones don't matter since relative deltas give all the necessary info.
267 script:
268   - >
269       date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
270   - stamp sh -x -c "$RUN_SCRIPT"
271   - >
272       date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
273
274 after_success:
275   - >
276       echo "#### Build successful; Disk usage after running script:";
277       df -h;
278       du . | sort -nr | head -n100
279
280 after_failure:
281   - >
282       echo "#### Build failed; Disk usage after running script:";
283       df -h;
284       du . | sort -nr | head -n100
285
286   # Random attempt at debugging currently. Just poking around in here to see if
287   # anything shows up.
288
289   # Dump backtrace for macOS
290   - ls -lat $HOME/Library/Logs/DiagnosticReports/
291   - find $HOME/Library/Logs/DiagnosticReports
292       -type f
293       -name '*.crash'
294       -not -name '*.stage2-*.crash'
295       -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash'
296       -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \;
297       -exec head -750 {} \;
298       -exec echo travis_fold":"end:crashlog \; || true
299
300   # Dump backtrace for Linux
301   - ln -s . checkout &&
302     for CORE in obj/cores/core.*; do
303       EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|');
304       if [ -f "$EXE" ]; then
305         printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE";
306         gdb --batch -q -c "$CORE" "$EXE"
307           -iex 'set auto-load off'
308           -iex 'dir src/'
309           -iex 'set sysroot .'
310           -ex bt
311           -ex q;
312         echo travis_fold":"end:crashlog;
313       fi;
314     done || true
315
316   # see #50887
317   - cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
318
319   # attempt to debug anything killed by the oom killer on linux, just to see if
320   # it happened
321   - dmesg | grep -i kill
322
323 notifications:
324   email: false
325
326 before_deploy:
327   - mkdir -p deploy/$TRAVIS_COMMIT
328   - >
329       if [ "$TRAVIS_OS_NAME" == "osx" ]; then
330           rm -rf build/dist/doc &&
331           cp -r build/dist/* deploy/$TRAVIS_COMMIT;
332       else
333           rm -rf obj/build/dist/doc &&
334           cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
335       fi
336   - ls -la deploy/$TRAVIS_COMMIT
337
338 deploy:
339   - provider: s3
340     bucket: rust-lang-ci2
341     skip_cleanup: true
342     local_dir: deploy
343     upload_dir: rustc-builds
344     acl: public_read
345     region: us-west-1
346     access_key_id: AKIAJVBODR3IA4O72THQ
347     secret_access_key:
348       secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
349     on:
350       branch: auto
351       condition: $DEPLOY = 1
352
353   # this is the same as the above deployment provider except that it uploads to
354   # a slightly different directory and has a different trigger
355   - provider: s3
356     bucket: rust-lang-ci2
357     skip_cleanup: true
358     local_dir: deploy
359     upload_dir: rustc-builds-alt
360     acl: public_read
361     region: us-west-1
362     access_key_id: AKIAJVBODR3IA4O72THQ
363     secret_access_key:
364       secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
365     on:
366       branch: auto
367       condition: $DEPLOY_ALT = 1
368
369   # These two providers are the same as the two above, except deploy on the
370   # try branch. Travis does not appear to provide a way to use "or" in these
371   # conditions.
372   - provider: s3
373     bucket: rust-lang-ci2
374     skip_cleanup: true
375     local_dir: deploy
376     upload_dir: rustc-builds
377     acl: public_read
378     region: us-west-1
379     access_key_id: AKIAJVBODR3IA4O72THQ
380     secret_access_key:
381       secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
382     on:
383       branch: try
384       condition: $DEPLOY = 1
385
386   - provider: s3
387     bucket: rust-lang-ci2
388     skip_cleanup: true
389     local_dir: deploy
390     upload_dir: rustc-builds-alt
391     acl: public_read
392     region: us-west-1
393     access_key_id: AKIAJVBODR3IA4O72THQ
394     secret_access_key:
395       secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
396     on:
397       branch: try
398       condition: $DEPLOY_ALT = 1