.travis.yml 13 KB
Newer Older
1
language: shell
Alex Crichton's avatar
Alex Crichton committed
2
sudo: required
Alex Crichton's avatar
Alex Crichton committed
3
dist: xenial
Seo Sanghyeon's avatar
Seo Sanghyeon committed
4 5
services:
  - docker
6 7 8 9
addons:
  apt:
    packages:
      - gdb
10

Alex Crichton's avatar
Alex Crichton committed
11
git:
12
  depth: 2
13
  submodules: false
14

Eric Huss's avatar
Eric Huss committed
15 16 17 18
env:
  global:
    - CI_JOB_NAME=$TRAVIS_JOB_NAME

19
matrix:
Alex Crichton's avatar
Alex Crichton committed
20
  fast_finish: true
21
  include:
kennytm's avatar
kennytm committed
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
Eric Huss's avatar
Eric Huss committed
24
      name: x86_64-gnu-llvm-6.0
25 26 27
      if: type = pull_request OR branch = auto

    - env: IMAGE=dist-x86_64-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
28
      name: dist-x86_64-linux
29
      if: branch = try OR branch = auto
kennytm's avatar
kennytm committed
30

31 32 33
    # "alternate" deployments, these are "nightlies" but have LLVM assertions
    # turned on, they're deployed to a different location primarily for
    # additional testing.
Eric Huss's avatar
Eric Huss committed
34 35
    - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
      name: dist-x86_64-linux-alt
36
      if: branch = try OR branch = auto
37

kennytm's avatar
kennytm committed
38 39
    - env: >
        RUST_CHECK_TARGET=dist
Tom Tromey's avatar
Tom Tromey committed
40
        RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler --enable-lldb --set rust.jemalloc"
kennytm's avatar
kennytm committed
41 42 43 44
        SRC=.
        DEPLOY_ALT=1
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
        MACOSX_DEPLOYMENT_TARGET=10.7
45
        NO_LLVM_ASSERTIONS=1
46
        NO_DEBUG_ASSERTIONS=1
kennytm's avatar
kennytm committed
47
      os: osx
48
      osx_image: xcode9.3-moar
Eric Huss's avatar
Eric Huss committed
49
      name: dist-x86_64-apple-alt
50
      if: branch = auto
kennytm's avatar
kennytm committed
51 52 53

    # macOS builders. These are placed near the beginning because they are very
    # slow to run.
54

55
    # OSX builders running tests, these run the full test suite.
56 57
    # NO_DEBUG_ASSERTIONS=1 to make them go faster, but also do have some
    # runners that run `//ignore-debug` tests.
58 59 60
    #
    # Note that the compiler is compiled to target 10.8 here because the Xcode
    # version that we're using, 8.2, cannot compile LLVM for OSX 10.7.
61 62
    - env: >
        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
Peter Wagenet's avatar
Peter Wagenet committed
66 67
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
68
        NO_LLVM_ASSERTIONS=1
69
        NO_DEBUG_ASSERTIONS=1
70
      os: osx
Alex Crichton's avatar
Alex Crichton committed
71
      osx_image: xcode9.3-moar
Eric Huss's avatar
Eric Huss committed
72
      name: x86_64-apple
73 74
      if: branch = auto

75 76
    - env: >
        RUST_CHECK_TARGET=check
77
        RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --set rust.jemalloc"
78
        SRC=.
79
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
Peter Wagenet's avatar
Peter Wagenet committed
80 81
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
82
        NO_LLVM_ASSERTIONS=1
83
        NO_DEBUG_ASSERTIONS=1
84
      os: osx
Alex Crichton's avatar
Alex Crichton committed
85
      osx_image: xcode9.3-moar
Eric Huss's avatar
Eric Huss committed
86
      name: i686-apple
87
      if: branch = auto
88

89 90 91 92 93 94
    # OSX builders producing releases. These do not run the full test suite and
    # just produce a bunch of artifacts.
    #
    # Note that these are running in the `xcode7` image instead of the
    # `xcode8.2` image as above. That's because we want to build releases for
    # OSX 10.7 and `xcode7` is the latest Xcode able to compile LLVM for 10.7.
95
    - env: >
96
        RUST_CHECK_TARGET=dist
Tom Tromey's avatar
Tom Tromey committed
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
Eric Huss's avatar
Eric Huss committed
107
      name: dist-i686-apple
108
      if: branch = auto
109

110
    - env: >
111
        RUST_CHECK_TARGET=dist
Tom Tromey's avatar
Tom Tromey committed
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
Eric Huss's avatar
Eric Huss committed
122
      name: dist-x86_64-apple
123
      if: branch = auto
Alex Crichton's avatar
Alex Crichton committed
124

kennytm's avatar
kennytm committed
125 126
    # Linux builders, remaining docker images
    - env: IMAGE=arm-android
Eric Huss's avatar
Eric Huss committed
127
      name: arm-android
128
      if: branch = auto
kennytm's avatar
kennytm committed
129
    - env: IMAGE=armhf-gnu
Eric Huss's avatar
Eric Huss committed
130
      name: armhf-gnu
131
      if: branch = auto
132
    - env: IMAGE=dist-various-1 DEPLOY=1
Eric Huss's avatar
Eric Huss committed
133
      name: dist-various-1
134
      if: branch = auto
135
    - env: IMAGE=dist-various-2 DEPLOY=1
Eric Huss's avatar
Eric Huss committed
136
      name: dist-various-2
137
      if: branch = auto
kennytm's avatar
kennytm committed
138
    - env: IMAGE=dist-aarch64-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
139
      name: dist-aarch64-linux
140
      if: branch = auto
kennytm's avatar
kennytm committed
141
    - env: IMAGE=dist-android DEPLOY=1
Eric Huss's avatar
Eric Huss committed
142
      name: dist-android
143
      if: branch = auto
kennytm's avatar
kennytm committed
144
    - env: IMAGE=dist-arm-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
145
      name: dist-arm-linux
146
      if: branch = auto
kennytm's avatar
kennytm committed
147
    - env: IMAGE=dist-armhf-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
148
      name: dist-armhf-linux
149
      if: branch = auto
kennytm's avatar
kennytm committed
150
    - env: IMAGE=dist-armv7-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
151
      name: dist-armv7-linux
152
      if: branch = auto
153
    - env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
Eric Huss's avatar
Eric Huss committed
154
      name: dist-i586-gnu-i586-i686-musl
155
      if: branch = auto
kennytm's avatar
kennytm committed
156
    - env: IMAGE=dist-i686-freebsd DEPLOY=1
Eric Huss's avatar
Eric Huss committed
157
      name: dist-i686-freebsd
158
      if: branch = auto
kennytm's avatar
kennytm committed
159
    - env: IMAGE=dist-i686-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
160
      name: dist-i686-linux
161
      if: branch = auto
kennytm's avatar
kennytm committed
162
    - env: IMAGE=dist-mips-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
163
      name: dist-mips-linux
164
      if: branch = auto
kennytm's avatar
kennytm committed
165
    - env: IMAGE=dist-mips64-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
166
      name: dist-mips64-linux
167
      if: branch = auto
kennytm's avatar
kennytm committed
168
    - env: IMAGE=dist-mips64el-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
169
      name: dist-mips64el-linux
170
      if: branch = auto
kennytm's avatar
kennytm committed
171
    - env: IMAGE=dist-mipsel-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
172
      name: dist-mipsel-linux
173
      if: branch = auto
kennytm's avatar
kennytm committed
174
    - env: IMAGE=dist-powerpc-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
175
      name: dist-powerpc-linux
176
      if: branch = auto
kennytm's avatar
kennytm committed
177
    - env: IMAGE=dist-powerpc64-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
178
      name: dist-powerpc64-linux
179
      if: branch = auto
kennytm's avatar
kennytm committed
180
    - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
181
      name: dist-powerpc64le-linux
182
      if: branch = auto
kennytm's avatar
kennytm committed
183
    - env: IMAGE=dist-s390x-linux DEPLOY=1
Eric Huss's avatar
Eric Huss committed
184
      name: dist-s390x-linux
185
      if: branch = auto
kennytm's avatar
kennytm committed
186
    - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
Eric Huss's avatar
Eric Huss committed
187
      name: dist-x86_64-freebsd
188
      if: branch = auto
kennytm's avatar
kennytm committed
189
    - env: IMAGE=dist-x86_64-musl DEPLOY=1
Eric Huss's avatar
Eric Huss committed
190
      name: dist-x86_64-musl
191
      if: branch = auto
kennytm's avatar
kennytm committed
192
    - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
Eric Huss's avatar
Eric Huss committed
193
      name: dist-x86_64-netbsd
194
      if: branch = auto
kennytm's avatar
kennytm committed
195
    - env: IMAGE=asmjs
Eric Huss's avatar
Eric Huss committed
196
      name: asmjs
gnzlbg's avatar
gnzlbg committed
197
      if: branch = auto
kennytm's avatar
kennytm committed
198
    - env: IMAGE=i686-gnu
Eric Huss's avatar
Eric Huss committed
199
      name: i686-gnu
200
      if: branch = auto
kennytm's avatar
kennytm committed
201
    - env: IMAGE=i686-gnu-nopt
Eric Huss's avatar
Eric Huss committed
202
      name: i686-gnu-nopt
203
      if: branch = auto
204
    - env: IMAGE=test-various
Eric Huss's avatar
Eric Huss committed
205
      name: test-various
gnzlbg's avatar
gnzlbg committed
206
      if: branch = auto
kennytm's avatar
kennytm committed
207
    - env: IMAGE=x86_64-gnu
Eric Huss's avatar
Eric Huss committed
208
      name: x86_64-gnu
209
      if: branch = auto
kennytm's avatar
kennytm committed
210
    - env: IMAGE=x86_64-gnu-full-bootstrap
Eric Huss's avatar
Eric Huss committed
211
      name: x86_64-gnu-full-bootstrap
212
      if: branch = auto
kennytm's avatar
kennytm committed
213
    - env: IMAGE=x86_64-gnu-aux
Eric Huss's avatar
Eric Huss committed
214
      name: x86_64-gnu-aux
215
      if: branch = auto
216
    - env: IMAGE=x86_64-gnu-tools
Eric Huss's avatar
Eric Huss committed
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)/)
kennytm's avatar
kennytm committed
219
    - env: IMAGE=x86_64-gnu-debug
Eric Huss's avatar
Eric Huss committed
220
      name: x86_64-gnu-debug
221
      if: branch = auto
kennytm's avatar
kennytm committed
222
    - env: IMAGE=x86_64-gnu-nopt
Eric Huss's avatar
Eric Huss committed
223
      name: x86_64-gnu-nopt
224
      if: branch = auto
kennytm's avatar
kennytm committed
225
    - env: IMAGE=x86_64-gnu-distcheck
Eric Huss's avatar
Eric Huss committed
226
      name: x86_64-gnu-distcheck
227
      if: branch = auto
228
    - env: IMAGE=mingw-check
Eric Huss's avatar
Eric Huss committed
229
      name: mingw-check
230
      if: type = pull_request OR branch = auto
231

232 233 234 235 236 237 238 239
    - stage: publish toolstate
      if: branch = master AND type = push
      before_install: []
      install: []
      sudo: false
      script:
        MESSAGE_FILE=$(mktemp -t msg.XXXXXX);
        . 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

kennytm's avatar
kennytm committed
242
before_install:
243 244
  # We'll use the AWS cli to download/upload cached docker layers as well as
  # push our deployments, so download that here.
245
  - pip install --user awscli; export PATH=$PATH:$HOME/.local/bin:$HOME/Library/Python/2.7/bin/
kennytm's avatar
kennytm committed
246
  - mkdir -p $HOME/rustsrc
247 248 249 250
  # FIXME(#46924): these two commands are required to enable IPv6,
  # they shouldn't exist, please revert once more official solutions appeared.
  # see https://github.com/travis-ci/travis-ci/issues/8891#issuecomment-353403729
  - if [ "$TRAVIS_OS_NAME" = linux ]; then
kennytm's avatar
kennytm committed
251
      echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json;
252 253
      sudo service docker restart;
    fi
kennytm's avatar
kennytm committed
254 255

install:
256
  - case "$TRAVIS_OS_NAME" in
kennytm's avatar
kennytm committed
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 &&
kennytm's avatar
kennytm committed
259 260 261 262 263 264
            chmod +x $HOME/stamp &&
            export PATH=$PATH:$HOME
          ;;
        osx)
          if [[ "$RUST_CHECK_TARGET" == dist ]]; then
            travis_retry brew update &&
Tom Tromey's avatar
Tom Tromey committed
265 266
            travis_retry brew install xz &&
            travis_retry brew install swig;
kennytm's avatar
kennytm committed
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 &&
kennytm's avatar
kennytm committed
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 273 274
          travis_retry curl -f http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
            export CC=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang &&
            export CXX=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++ &&
275
            export AR=ar
kennytm's avatar
kennytm committed
276
          ;;
277
    esac
278

279 280 281 282 283
before_script:
  - >
      echo "#### Disk usage before running script:";
      df -h;
      du . | sort -nr | head -n100
284
  - >
kennytm's avatar
kennytm committed
285 286 287
      RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
      if [ "$TRAVIS_OS_NAME" = "osx" ]; then
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
288
      else
kennytm's avatar
kennytm committed
289
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
290 291
          # Enable core dump on Linux.
          sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern';
292
      fi
293 294 295 296 297 298 299 300 301
  - >
      if [ "$IMAGE" = mingw-check ]; then
        # verify the publish_toolstate script works.
        git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git;
        cd rust-toolstate;
        python2.7 "$TRAVIS_BUILD_DIR/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" "";
        cd ..;
        rm -rf rust-toolstate;
      fi
302

303 304
# Log time information from this machine and an external machine for insight into possible
# 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 313 314 315 316
after_success:
  - >
      echo "#### Build successful; Disk usage after running script:";
      df -h;
      du . | sort -nr | head -n100
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
  - >
      if [ "$DEPLOY$DEPLOY_ALT" == "1" ]; then
        mkdir -p deploy/$TRAVIS_COMMIT;
        if [ "$TRAVIS_OS_NAME" == "osx" ]; then
            rm -rf build/dist/doc &&
            cp -r build/dist/* deploy/$TRAVIS_COMMIT;
        else
            rm -rf obj/build/dist/doc &&
            cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
        fi;
        ls -la deploy/$TRAVIS_COMMIT;
        deploy_dir=rustc-builds;
        if [ "$DEPLOY_ALT" == "1" ]; then
            deploy_dir=rustc-builds-alt;
        fi;
        travis_retry aws s3 cp --no-progress --recursive --acl public-read ./deploy s3://rust-lang-ci2/$deploy_dir
      fi
334 335 336 337 338 339

after_failure:
  - >
      echo "#### Build failed; Disk usage after running script:";
      df -h;
      du . | sort -nr | head -n100
340 341 342

  # Random attempt at debugging currently. Just poking around in here to see if
  # anything shows up.
343 344

  # Dump backtrace for macOS
345
  - ls -lat $HOME/Library/Logs/DiagnosticReports/
346 347
  - find $HOME/Library/Logs/DiagnosticReports
      -type f
348
      -name '*.crash'
349 350 351
      -not -name '*.stage2-*.crash'
      -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash'
      -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 356 357 358 359 360
  # Dump backtrace for Linux
  - ln -s . checkout &&
    for CORE in obj/cores/core.*; do
      EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|');
      if [ -f "$EXE" ]; then
        printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE";
Tom Tromey's avatar
Tom Tromey committed
361
        gdb --batch -q -c "$CORE" "$EXE"
362 363 364 365 366 367 368 369 370
          -iex 'set auto-load off'
          -iex 'dir src/'
          -iex 'set sysroot .'
          -ex bt
          -ex q;
        echo travis_fold":"end:crashlog;
      fi;
    done || true

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 375 376 377
  # attempt to debug anything killed by the oom killer on linux, just to see if
  # it happened
  - dmesg | grep -i kill

378 379
notifications:
  email: false