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