.travis.yml 10.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: 1
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.
J
Josh Stone 已提交
15
    - env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
K
kennytm 已提交
16 17 18 19
      if: type = pull_request OR branch = auto

    - env: IMAGE=dist-x86_64-linux DEPLOY=1
      if: branch = try OR branch = auto
K
kennytm 已提交
20 21 22 23 24 25

    # "alternate" deployments, these are "nightlies" but don't have assertions
    # turned on, they're deployed to a different location primarily for projects
    # which are stuck on nightly and don't want llvm assertions in the artifacts
    # that they use.
    - env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
K
kennytm 已提交
26 27
      if: branch = auto

K
kennytm 已提交
28 29 30 31 32 33 34 35
    - env: >
        RUST_CHECK_TARGET=dist
        RUST_CONFIGURE_ARGS="--enable-extended --enable-profiler"
        SRC=.
        DEPLOY_ALT=1
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
        SCCACHE_ERROR_LOG=/tmp/sccache.log
        MACOSX_DEPLOYMENT_TARGET=10.7
36
        NO_LLVM_ASSERTIONS=1
37
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
38
      os: osx
A
Alex Crichton 已提交
39
      osx_image: xcode7.3
K
kennytm 已提交
40
      if: branch = auto
K
kennytm 已提交
41 42 43

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

45 46 47 48
    # 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.
49 50
    - env: >
        RUST_CHECK_TARGET=check
51
        RUST_CONFIGURE_ARGS="--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler"
52
        SRC=.
53
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
54
        SCCACHE_ERROR_LOG=/tmp/sccache.log
P
Peter Wagenet 已提交
55 56
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
57
        NO_LLVM_ASSERTIONS=1
58
        NO_DEBUG_ASSERTIONS=1
59
      os: osx
A
Alex Crichton 已提交
60
      osx_image: xcode8.3
K
kennytm 已提交
61 62
      if: branch = auto

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

77 78 79 80 81 82
    # 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.
83
    - env: >
84
        RUST_CHECK_TARGET=dist
85
        RUST_CONFIGURE_ARGS="--build=i686-apple-darwin --enable-extended --enable-profiler"
86
        SRC=.
87
        DEPLOY=1
88
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
89
        SCCACHE_ERROR_LOG=/tmp/sccache.log
90
        MACOSX_DEPLOYMENT_TARGET=10.7
91
        NO_LLVM_ASSERTIONS=1
92
        NO_DEBUG_ASSERTIONS=1
93
      os: osx
A
Alex Crichton 已提交
94
      osx_image: xcode7.3
K
kennytm 已提交
95 96
      if: branch = auto

97
    - env: >
98
        RUST_CHECK_TARGET=dist
99
        RUST_CONFIGURE_ARGS="--target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-extended --enable-sanitizers --enable-profiler"
100
        SRC=.
101
        DEPLOY=1
102
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
103
        SCCACHE_ERROR_LOG=/tmp/sccache.log
104
        MACOSX_DEPLOYMENT_TARGET=10.7
105
        NO_LLVM_ASSERTIONS=1
106
        NO_DEBUG_ASSERTIONS=1
107
      os: osx
A
Alex Crichton 已提交
108
      osx_image: xcode7.3
K
kennytm 已提交
109
      if: branch = auto
A
Alex Crichton 已提交
110

K
kennytm 已提交
111 112
    # Linux builders, remaining docker images
    - env: IMAGE=arm-android
K
kennytm 已提交
113
      if: branch = auto
K
kennytm 已提交
114
    - env: IMAGE=armhf-gnu
K
kennytm 已提交
115
      if: branch = auto
K
kennytm 已提交
116
    - env: IMAGE=cross DEPLOY=1
K
kennytm 已提交
117
      if: branch = auto
B
bgermann 已提交
118
    - env: IMAGE=cross2 DEPLOY=1
119
      if: branch = auto
K
kennytm 已提交
120
    - env: IMAGE=dist-aarch64-linux DEPLOY=1
K
kennytm 已提交
121
      if: branch = auto
K
kennytm 已提交
122
    - env: IMAGE=dist-android DEPLOY=1
K
kennytm 已提交
123
      if: branch = auto
K
kennytm 已提交
124
    - env: IMAGE=dist-arm-linux DEPLOY=1
K
kennytm 已提交
125
      if: branch = auto
K
kennytm 已提交
126
    - env: IMAGE=dist-armhf-linux DEPLOY=1
K
kennytm 已提交
127
      if: branch = auto
K
kennytm 已提交
128
    - env: IMAGE=dist-armv7-linux DEPLOY=1
K
kennytm 已提交
129
      if: branch = auto
K
kennytm 已提交
130
    - env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
K
kennytm 已提交
131
      if: branch = auto
K
kennytm 已提交
132
    - env: IMAGE=dist-i686-freebsd DEPLOY=1
K
kennytm 已提交
133
      if: branch = auto
K
kennytm 已提交
134
    - env: IMAGE=dist-i686-linux DEPLOY=1
K
kennytm 已提交
135
      if: branch = auto
K
kennytm 已提交
136
    - env: IMAGE=dist-mips-linux DEPLOY=1
K
kennytm 已提交
137
      if: branch = auto
K
kennytm 已提交
138
    - env: IMAGE=dist-mips64-linux DEPLOY=1
K
kennytm 已提交
139
      if: branch = auto
K
kennytm 已提交
140
    - env: IMAGE=dist-mips64el-linux DEPLOY=1
K
kennytm 已提交
141
      if: branch = auto
K
kennytm 已提交
142
    - env: IMAGE=dist-mipsel-linux DEPLOY=1
K
kennytm 已提交
143
      if: branch = auto
K
kennytm 已提交
144
    - env: IMAGE=dist-powerpc-linux DEPLOY=1
K
kennytm 已提交
145
      if: branch = auto
K
kennytm 已提交
146
    - env: IMAGE=dist-powerpc64-linux DEPLOY=1
K
kennytm 已提交
147
      if: branch = auto
K
kennytm 已提交
148
    - env: IMAGE=dist-powerpc64le-linux DEPLOY=1
K
kennytm 已提交
149
      if: branch = auto
K
kennytm 已提交
150
    - env: IMAGE=dist-s390x-linux DEPLOY=1
K
kennytm 已提交
151
      if: branch = auto
K
kennytm 已提交
152
    - env: IMAGE=dist-x86_64-freebsd DEPLOY=1
K
kennytm 已提交
153
      if: branch = auto
K
kennytm 已提交
154
    - env: IMAGE=dist-x86_64-musl DEPLOY=1
K
kennytm 已提交
155
      if: branch = auto
K
kennytm 已提交
156
    - env: IMAGE=dist-x86_64-netbsd DEPLOY=1
K
kennytm 已提交
157
      if: branch = auto
K
kennytm 已提交
158
    - env: IMAGE=asmjs
K
kennytm 已提交
159
      if: branch = auto
K
kennytm 已提交
160
    - env: IMAGE=i686-gnu
K
kennytm 已提交
161
      if: branch = auto
K
kennytm 已提交
162
    - env: IMAGE=i686-gnu-nopt
K
kennytm 已提交
163
      if: branch = auto
K
kennytm 已提交
164
    # - env: IMAGE=wasm32 issue 42646
K
kennytm 已提交
165
    #   if: branch = auto
K
kennytm 已提交
166
    - env: IMAGE=x86_64-gnu
K
kennytm 已提交
167
      if: branch = auto
K
kennytm 已提交
168
    - env: IMAGE=x86_64-gnu-full-bootstrap
K
kennytm 已提交
169
      if: branch = auto
K
kennytm 已提交
170
    - env: IMAGE=x86_64-gnu-aux
K
kennytm 已提交
171
      if: branch = auto
172 173
    - env: IMAGE=x86_64-gnu-cargotest
      if: branch = auto
K
kennytm 已提交
174
    - env: IMAGE=x86_64-gnu-debug
K
kennytm 已提交
175
      if: branch = auto
K
kennytm 已提交
176
    - env: IMAGE=x86_64-gnu-nopt
K
kennytm 已提交
177
      if: branch = auto
K
kennytm 已提交
178
    - env: IMAGE=x86_64-gnu-distcheck
K
kennytm 已提交
179
      if: branch = auto
K
kennytm 已提交
180
    - env: IMAGE=x86_64-gnu-incremental
K
kennytm 已提交
181
      if: branch = auto
182

A
Alex Crichton 已提交
183 184
env:
  global:
185 186
    - SCCACHE_BUCKET=rust-lang-ci-sccache2
    - SCCACHE_REGION=us-west-1
A
Alex Crichton 已提交
187
    - AWS_ACCESS_KEY_ID=AKIAJAMV3QAMMA6AXHFQ
A
Alex Crichton 已提交
188
    # AWS_SECRET_ACCESS_KEY=...
A
Alex Crichton 已提交
189
    - secure: "j96XxTVOSUf4s4r4htIxn/fvIa5DWbMgLqWl7r8z2QfgUwscmkMXAwXuFNc7s7bGTpV/+CgDiMFFM6BAFLGKutytIF6oA02s9b+usQYnM0th7YQ2AIgm9GtMTJCJp4AoyfFmh8F2faUICBZlfVLUJ34udHEe35vOklix+0k4WDo="
A
arcnmx 已提交
190

K
kennytm 已提交
191
before_install:
K
kennytm 已提交
192
  - zcat $HOME/docker/rust-ci.tar.gz | docker load || true
K
kennytm 已提交
193 194 195
  - mkdir -p $HOME/rustsrc

install:
K
kennytm 已提交
196
  - case "$TRAVIS_OS_NAME" in
K
kennytm 已提交
197
        linux)
198
          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 已提交
199 200 201 202 203 204 205 206
            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 &&
207
          travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-05-12-sccache-x86_64-apple-darwin &&
K
kennytm 已提交
208
            chmod +x /usr/local/bin/sccache &&
209
          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 &&
K
kennytm 已提交
210 211
            chmod +x /usr/local/bin/stamp
          ;;
K
kennytm 已提交
212
    esac
213

214 215 216 217 218
before_script:
  - >
      echo "#### Disk usage before running script:";
      df -h;
      du . | sort -nr | head -n100
219
  - >
K
kennytm 已提交
220 221 222
      RUN_SCRIPT="src/ci/init_repo.sh . $HOME/rustsrc";
      if [ "$TRAVIS_OS_NAME" = "osx" ]; then
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
223
      else
K
kennytm 已提交
224
          export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
225
      fi
226

227 228
# 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.
229
script:
230
  - >
231
      date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
232
  - stamp sh -x -c "$RUN_SCRIPT"
233
  - >
234
      date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
235

236 237 238 239 240 241 242 243 244 245 246
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
247 248 249 250

  # One of these is the linux sccache log, one is the OSX sccache log. Instead
  # of worrying about what system we are just cat both. One of these commands
  # will fail but that's ok, they'll both get executed.
251
  - cat obj/tmp/sccache.log
252
  - cat /tmp/sccache.log
253

254 255 256 257
  # Random attempt at debugging currently. Just poking around in here to see if
  # anything shows up.
  - ls $HOME/Library/Logs/DiagnosticReports/

258 259 260 261
  # attempt to debug anything killed by the oom killer on linux, just to see if
  # it happened
  - dmesg | grep -i kill

262
# Save tagged docker images we created and load them if they're available
263
# Travis saves caches whether the build failed or not, nuke rustsrc if
A
acdenisSK 已提交
264
# the failure was while updating it (as it may be in a bad state)
265
# https://github.com/travis-ci/travis-ci/issues/4472
266 267 268 269
before_cache:
  - docker history -q rust-ci |
    grep -v missing |
    xargs docker save |
A
Alex Crichton 已提交
270
    gzip > $HOME/docker/rust-ci.tar.gz
M
Matthew Astley 已提交
271

272 273 274
notifications:
  email: false

275 276 277
cache:
  directories:
    - $HOME/docker
278 279 280 281 282

before_deploy:
  - mkdir -p deploy/$TRAVIS_COMMIT
  - >
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
283
          rm -rf build/dist/doc &&
A
Alex Crichton 已提交
284
          cp -r build/dist/* deploy/$TRAVIS_COMMIT;
285
      else
286
          rm -rf obj/build/dist/doc &&
A
Alex Crichton 已提交
287
          cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
288 289 290 291
      fi

deploy:
  - provider: s3
292
    bucket: rust-lang-ci2
293 294 295 296
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds
    acl: public_read
297
    region: us-west-1
A
Alex Crichton 已提交
298
    access_key_id: AKIAJVBODR3IA4O72THQ
299
    secret_access_key:
A
Alex Crichton 已提交
300
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
301 302 303
    on:
      branch: auto
      condition: $DEPLOY = 1
304

305
  - provider: s3
306
    bucket: rust-lang-ci2
307 308 309 310
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds-try
    acl: public_read
311
    region: us-west-1
A
Alex Crichton 已提交
312
    access_key_id: AKIAJVBODR3IA4O72THQ
313
    secret_access_key:
A
Alex Crichton 已提交
314
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
315 316
    on:
      branch: try
K
kennytm 已提交
317
      condition: $DEPLOY = 1
318

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