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