.travis.yml 12.9 KB
Newer Older
1
language: shell
A
Alex Crichton 已提交
2
sudo: required
3
dist: trusty
S
Seo Sanghyeon 已提交
4 5
services:
  - docker
6

A
Alex Crichton 已提交
7
git:
8
  depth: 2
9
  submodules: false
10

11
matrix:
A
Alex Crichton 已提交
12
  fast_finish: true
13
  include:
K
kennytm 已提交
14
    # Images used in testing PR and try-build should be run first.
G
gnzlbg 已提交
15
    - env: IMAGE=x86_64-gnu-llvm-5.0 RUST_BACKTRACE=1
K
kennytm 已提交
16 17 18
      if: type = pull_request OR branch = auto

    - env: IMAGE=dist-x86_64-linux DEPLOY=1
19
      if: branch = try OR branch = auto
K
kennytm 已提交
20

21 22 23
    # "alternate" deployments, these are "nightlies" but have LLVM assertions
    # turned on, they're deployed to a different location primarily for
    # additional testing.
K
kennytm 已提交
24
    - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1 CI_JOB_NAME=dist-x86_64-linux-alt
25
      if: branch = try OR branch = auto
K
kennytm 已提交
26

K
kennytm 已提交
27 28 29 30 31 32 33
    - env: >
        RUST_CHECK_TARGET=dist
        RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
        SRC=.
        DEPLOY_ALT=1
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
        MACOSX_DEPLOYMENT_TARGET=10.7
34
        NO_LLVM_ASSERTIONS=1
35
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
36
        CI_JOB_NAME=dist-x86_64-apple-alt
K
kennytm 已提交
37
      os: osx
38
      osx_image: xcode9.3-moar
39
      if: branch = auto
K
kennytm 已提交
40 41 42

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

44 45 46 47
    # OSX builders running tests, these run the full test suite.
    #
    # 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.
48 49
    - env: >
        RUST_CHECK_TARGET=check
50
        RUST_CONFIGURE_ARGS="--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler"
51
        SRC=.
52
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
P
Peter Wagenet 已提交
53 54
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
55
        NO_LLVM_ASSERTIONS=1
56
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
57
        CI_JOB_NAME=x86_64-apple
58
      os: osx
A
Alex Crichton 已提交
59
      osx_image: xcode9.3-moar
K
kennytm 已提交
60 61
      if: branch = auto

62 63 64 65
    - env: >
        RUST_CHECK_TARGET=check
        RUST_CONFIGURE_ARGS=--build=i686-apple-darwin
        SRC=.
66
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
P
Peter Wagenet 已提交
67 68
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
69
        NO_LLVM_ASSERTIONS=1
70
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
71
        CI_JOB_NAME=i686-apple
72
      os: osx
A
Alex Crichton 已提交
73
      osx_image: xcode9.3-moar
K
kennytm 已提交
74
      if: branch = auto
75

76 77 78 79 80 81
    # 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.
82
    - env: >
83
        RUST_CHECK_TARGET=dist
84
        RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-full-tools --enable-profiler"
85
        SRC=.
86
        DEPLOY=1
87
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
88
        MACOSX_DEPLOYMENT_TARGET=10.7
89
        NO_LLVM_ASSERTIONS=1
90
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
91
        CI_JOB_NAME=dist-i686-apple
92
      os: osx
93
      osx_image: xcode9.3-moar
94
      if: branch = auto
K
kennytm 已提交
95

96
    - env: >
97
        RUST_CHECK_TARGET=dist
98
        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"
99
        SRC=.
100
        DEPLOY=1
101
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
102
        MACOSX_DEPLOYMENT_TARGET=10.7
103
        NO_LLVM_ASSERTIONS=1
104
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
105
        CI_JOB_NAME=dist-x86_64-apple
106
      os: osx
107
      osx_image: xcode9.3-moar
108
      if: branch = auto
A
Alex Crichton 已提交
109

K
kennytm 已提交
110 111
    # Linux builders, remaining docker images
    - env: IMAGE=arm-android
K
kennytm 已提交
112
      if: branch = auto
K
kennytm 已提交
113
    - env: IMAGE=armhf-gnu
K
kennytm 已提交
114
      if: branch = auto
115
    - env: IMAGE=dist-various-1 DEPLOY=1
K
kennytm 已提交
116
      if: branch = auto
117
    - env: IMAGE=dist-various-2 DEPLOY=1
118
      if: branch = auto
K
kennytm 已提交
119
    - env: IMAGE=dist-aarch64-linux DEPLOY=1
K
kennytm 已提交
120
      if: branch = auto
K
kennytm 已提交
121
    - env: IMAGE=dist-android DEPLOY=1
K
kennytm 已提交
122
      if: branch = auto
K
kennytm 已提交
123
    - env: IMAGE=dist-arm-linux DEPLOY=1
K
kennytm 已提交
124
      if: branch = auto
K
kennytm 已提交
125
    - env: IMAGE=dist-armhf-linux DEPLOY=1
K
kennytm 已提交
126
      if: branch = auto
K
kennytm 已提交
127
    - env: IMAGE=dist-armv7-linux DEPLOY=1
K
kennytm 已提交
128
      if: branch = auto
129
    - env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
K
kennytm 已提交
130
      if: branch = auto
K
kennytm 已提交
131
    - env: IMAGE=dist-i686-freebsd DEPLOY=1
K
kennytm 已提交
132
      if: branch = auto
K
kennytm 已提交
133
    - env: IMAGE=dist-i686-linux DEPLOY=1
K
kennytm 已提交
134
      if: branch = auto
K
kennytm 已提交
135
    - env: IMAGE=dist-mips-linux DEPLOY=1
K
kennytm 已提交
136
      if: branch = auto
K
kennytm 已提交
137
    - env: IMAGE=dist-mips64-linux DEPLOY=1
K
kennytm 已提交
138
      if: branch = auto
K
kennytm 已提交
139
    - env: IMAGE=dist-mips64el-linux DEPLOY=1
K
kennytm 已提交
140
      if: branch = auto
K
kennytm 已提交
141
    - env: IMAGE=dist-mipsel-linux DEPLOY=1
K
kennytm 已提交
142
      if: branch = auto
K
kennytm 已提交
143
    - env: IMAGE=dist-powerpc-linux DEPLOY=1
K
kennytm 已提交
144
      if: branch = auto
K
kennytm 已提交
145
    - env: IMAGE=dist-powerpc64-linux DEPLOY=1
K
kennytm 已提交
146
      if: branch = auto
K
kennytm 已提交
147
    - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
K
kennytm 已提交
148
      if: branch = auto
K
kennytm 已提交
149
    - env: IMAGE=dist-s390x-linux DEPLOY=1
K
kennytm 已提交
150
      if: branch = auto
K
kennytm 已提交
151
    - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
K
kennytm 已提交
152
      if: branch = auto
K
kennytm 已提交
153
    - env: IMAGE=dist-x86_64-musl DEPLOY=1
K
kennytm 已提交
154
      if: branch = auto
K
kennytm 已提交
155
    - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
K
kennytm 已提交
156
      if: branch = auto
K
kennytm 已提交
157
    - env: IMAGE=asmjs
G
gnzlbg 已提交
158
      if: branch = auto
K
kennytm 已提交
159
    - env: IMAGE=i686-gnu
K
kennytm 已提交
160
      if: branch = auto
K
kennytm 已提交
161
    - env: IMAGE=i686-gnu-nopt
K
kennytm 已提交
162
      if: branch = auto
163
    - env: IMAGE=wasm32-unknown
G
gnzlbg 已提交
164
      if: branch = auto
K
kennytm 已提交
165
    - env: IMAGE=x86_64-gnu
K
kennytm 已提交
166
      if: branch = auto
K
kennytm 已提交
167
    - env: IMAGE=x86_64-gnu-full-bootstrap
K
kennytm 已提交
168
      if: branch = auto
K
kennytm 已提交
169
    - env: IMAGE=x86_64-gnu-aux
K
kennytm 已提交
170
      if: branch = auto
171
    - env: IMAGE=x86_64-gnu-tools
172
      if: branch = auto OR (type = pull_request AND commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri)\b)/)
K
kennytm 已提交
173
    - env: IMAGE=x86_64-gnu-debug
K
kennytm 已提交
174
      if: branch = auto
K
kennytm 已提交
175
    - env: IMAGE=x86_64-gnu-nopt
K
kennytm 已提交
176
      if: branch = auto
K
kennytm 已提交
177
    - env: IMAGE=x86_64-gnu-distcheck
K
kennytm 已提交
178
      if: branch = auto
179 180
    - env: IMAGE=mingw-check
      if: type = pull_request OR branch = auto
181

182 183 184 185 186 187 188 189
    - 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;
190
        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";
191

A
Alex Crichton 已提交
192 193
env:
  global:
194 195
    - SCCACHE_BUCKET=rust-lang-ci-sccache2
    - SCCACHE_REGION=us-west-1
A
Alex Crichton 已提交
196
    - AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
A
Alex Crichton 已提交
197
    # AWS_SECRET_ACCESS_KEY=...
A
Alex Crichton 已提交
198
    - secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
199
    # TOOLSTATE_REPO_ACCESS_TOKEN=...
200
    - secure: "ESfcXqv4N2VMhqi2iIyw6da9VrsA78I4iR1asouCaq4hzTTrkB4WNRrfURy6xg72gQ4nMhtRJbB0/2jmc9Cu1+g2CzXtyiL223aJ5CKrXdcvbitopQSDfp07dMWm+UED+hNFEanpErKAeU/6FM3A+J+60PMk8MCF1h9tqNRISJw="
A
arcnmx 已提交
201

K
kennytm 已提交
202
before_install:
203 204 205 206 207 208
  # We'll use the AWS cli to download/upload cached docker layers, so install
  # that here.
  - if [ "$TRAVIS_OS_NAME" = linux ]; then
      pip install --user awscli;
      export PATH=$PATH:$HOME/.local/bin;
    fi
K
kennytm 已提交
209
  - mkdir -p $HOME/rustsrc
210 211 212 213
  # 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
K
kennytm 已提交
214
      echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json;
215 216
      sudo service docker restart;
    fi
K
kennytm 已提交
217 218

install:
K
kennytm 已提交
219
  - case "$TRAVIS_OS_NAME" in
K
kennytm 已提交
220
        linux)
221
          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 &&
K
kennytm 已提交
222 223 224 225 226 227 228 229
            chmod +x $HOME/stamp &&
            export PATH=$PATH:$HOME
          ;;
        osx)
          if [[ "$RUST_CHECK_TARGET" == dist ]]; then
            travis_retry brew update &&
            travis_retry brew install xz;
          fi &&
230
          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 &&
K
kennytm 已提交
231
            chmod +x /usr/local/bin/sccache &&
232
          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 &&
233 234 235 236 237
            chmod +x /usr/local/bin/stamp &&
          travis_retry curl -f http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
            export CC=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang &&
            export CXX=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++ &&
            export AR=ar
K
kennytm 已提交
238
          ;;
K
kennytm 已提交
239
    esac
240

241 242 243 244 245
before_script:
  - >
      echo "#### Disk usage before running script:";
      df -h;
      du . | sort -nr | head -n100
246
  - >
K
kennytm 已提交
247 248 249
      RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
      if [ "$TRAVIS_OS_NAME" = "osx" ]; then
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
250
      else
K
kennytm 已提交
251
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
252
      fi
253

254 255
# 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.
256
script:
257
  - >
258
      date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
259
  - stamp sh -x -c "$RUN_SCRIPT"
260
  - >
261
      date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
262

263 264 265 266 267 268 269 270 271 272 273
after_success:
  - >
      echo "#### Build successful; Disk usage after running script:";
      df -h;
      du . | sort -nr | head -n100

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

  # Random attempt at debugging currently. Just poking around in here to see if
  # anything shows up.
277
  - ls -lat $HOME/Library/Logs/DiagnosticReports/
278 279
  - find $HOME/Library/Logs/DiagnosticReports
      -type f
280
      -name '*.crash'
281 282 283
      -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" {} \;
284
      -exec head -750 {} \;
285
      -exec echo travis_fold":"end:crashlog \; || true
286

287 288 289
  # see #50887
  - head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true

290 291 292 293
  # attempt to debug anything killed by the oom killer on linux, just to see if
  # it happened
  - dmesg | grep -i kill

294 295 296
notifications:
  email: false

297 298 299 300
before_deploy:
  - mkdir -p deploy/$TRAVIS_COMMIT
  - >
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
301
          rm -rf build/dist/doc &&
A
Alex Crichton 已提交
302
          cp -r build/dist/* deploy/$TRAVIS_COMMIT;
303
      else
304
          rm -rf obj/build/dist/doc &&
A
Alex Crichton 已提交
305
          cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
306
      fi
307
  - ls -la deploy/$TRAVIS_COMMIT
308 309 310

deploy:
  - provider: s3
311
    bucket: rust-lang-ci2
312 313 314 315
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds
    acl: public_read
316
    region: us-west-1
A
Alex Crichton 已提交
317
    access_key_id: AKIAJVBODR3IA4O72THQ
318
    secret_access_key:
A
Alex Crichton 已提交
319
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
320 321 322
    on:
      branch: auto
      condition: $DEPLOY = 1
323

324 325
  # this is the same as the above deployment provider except that it uploads to
  # a slightly different directory and has a different trigger
326
  - provider: s3
327
    bucket: rust-lang-ci2
328 329
    skip_cleanup: true
    local_dir: deploy
330
    upload_dir: rustc-builds-alt
331
    acl: public_read
332
    region: us-west-1
A
Alex Crichton 已提交
333
    access_key_id: AKIAJVBODR3IA4O72THQ
334
    secret_access_key:
A
Alex Crichton 已提交
335
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
336
    on:
337
      branch: auto
338
      condition: $DEPLOY_ALT = 1
339

340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
  # These two providers are the same as the two above, except deploy on the
  # try branch. Travis does not appear to provide a way to use "or" in these
  # conditions.
  - provider: s3
    bucket: rust-lang-ci2
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds
    acl: public_read
    region: us-west-1
    access_key_id: AKIAJVBODR3IA4O72THQ
    secret_access_key:
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
    on:
      branch: try
      condition: $DEPLOY = 1

357
  - provider: s3
358
    bucket: rust-lang-ci2
359 360 361 362
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds-alt
    acl: public_read
363
    region: us-west-1
A
Alex Crichton 已提交
364
    access_key_id: AKIAJVBODR3IA4O72THQ
365
    secret_access_key:
A
Alex Crichton 已提交
366
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
367
    on:
368
      branch: try
369
      condition: $DEPLOY_ALT = 1