.travis.yml 11.8 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
      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
25
      if: branch = try OR branch = auto
K
kennytm 已提交
26

K
kennytm 已提交
27 28 29 30 31 32 33 34
    - 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
35
        NO_LLVM_ASSERTIONS=1
36
        NO_DEBUG_ASSERTIONS=1
K
kennytm 已提交
37
      os: osx
A
Alex Crichton 已提交
38
      osx_image: xcode7.3
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
53
        SCCACHE_ERROR_LOG=/tmp/sccache.log
P
Peter Wagenet 已提交
54 55
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
56
        NO_LLVM_ASSERTIONS=1
57
        NO_DEBUG_ASSERTIONS=1
58
      os: osx
A
Alex Crichton 已提交
59
      osx_image: xcode8.3
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
67
        SCCACHE_ERROR_LOG=/tmp/sccache.log
P
Peter Wagenet 已提交
68 69
        MACOSX_DEPLOYMENT_TARGET=10.8
        MACOSX_STD_DEPLOYMENT_TARGET=10.7
70
        NO_LLVM_ASSERTIONS=1
71
        NO_DEBUG_ASSERTIONS=1
72
      os: osx
A
Alex Crichton 已提交
73
      osx_image: xcode8.3
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-extended --enable-profiler"
85
        SRC=.
86
        DEPLOY=1
87
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
88
        SCCACHE_ERROR_LOG=/tmp/sccache.log
89
        MACOSX_DEPLOYMENT_TARGET=10.7
90
        NO_LLVM_ASSERTIONS=1
91
        NO_DEBUG_ASSERTIONS=1
92
      os: osx
A
Alex Crichton 已提交
93
      osx_image: xcode7.3
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-extended --enable-sanitizers --enable-profiler"
99
        SRC=.
100
        DEPLOY=1
101
        RUSTC_RETRY_LINKER_ON_SEGFAULT=1
102
        SCCACHE_ERROR_LOG=/tmp/sccache.log
103
        MACOSX_DEPLOYMENT_TARGET=10.7
104
        NO_LLVM_ASSERTIONS=1
105
        NO_DEBUG_ASSERTIONS=1
106
      os: osx
A
Alex Crichton 已提交
107
      osx_image: xcode7.3
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
K
kennytm 已提交
129
    - env: IMAGE=dist-i586-gnu-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
K
kennytm 已提交
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 164
    - env: IMAGE=wasm32-unknown
      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
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
K
kennytm 已提交
179
    - env: IMAGE=x86_64-gnu-incremental
K
kennytm 已提交
180
      if: branch = auto
181

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

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

install:
K
kennytm 已提交
195
  - case "$TRAVIS_OS_NAME" in
K
kennytm 已提交
196
        linux)
197
          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 已提交
198 199 200 201 202 203 204 205
            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 &&
206
          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 已提交
207
            chmod +x /usr/local/bin/sccache &&
208
          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 已提交
209 210
            chmod +x /usr/local/bin/stamp
          ;;
K
kennytm 已提交
211
    esac
212

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

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

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

  # 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.
250
  - cat obj/tmp/sccache.log
251
  - cat /tmp/sccache.log
252

253 254
  # Random attempt at debugging currently. Just poking around in here to see if
  # anything shows up.
255
  - ls -lat $HOME/Library/Logs/DiagnosticReports/
256 257 258 259 260
  - find $HOME/Library/Logs/DiagnosticReports
      -type f
      -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" {} \;
261 262
      -exec head -750 {} \;
      -exec echo travis_fold":"end:crashlog \;
263

264 265 266 267
  # attempt to debug anything killed by the oom killer on linux, just to see if
  # it happened
  - dmesg | grep -i kill

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

278 279 280
notifications:
  email: false

281 282 283
cache:
  directories:
    - $HOME/docker
284 285 286 287 288

before_deploy:
  - mkdir -p deploy/$TRAVIS_COMMIT
  - >
      if [ "$TRAVIS_OS_NAME" == "osx" ]; then
289
          rm -rf build/dist/doc &&
A
Alex Crichton 已提交
290
          cp -r build/dist/* deploy/$TRAVIS_COMMIT;
291
      else
292
          rm -rf obj/build/dist/doc &&
A
Alex Crichton 已提交
293
          cp -r obj/build/dist/* deploy/$TRAVIS_COMMIT;
294
      fi
295
  - travis_retry gem update --system
296
  - ls -la deploy/$TRAVIS_COMMIT
297 298 299

deploy:
  - provider: s3
300
    bucket: rust-lang-ci2
301 302 303 304
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds
    acl: public_read
305
    region: us-west-1
A
Alex Crichton 已提交
306
    access_key_id: AKIAJVBODR3IA4O72THQ
307
    secret_access_key:
A
Alex Crichton 已提交
308
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
309 310 311
    on:
      branch: auto
      condition: $DEPLOY = 1
312

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

329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
  # 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

346
  - provider: s3
347
    bucket: rust-lang-ci2
348 349 350 351
    skip_cleanup: true
    local_dir: deploy
    upload_dir: rustc-builds-alt
    acl: public_read
352
    region: us-west-1
A
Alex Crichton 已提交
353
    access_key_id: AKIAJVBODR3IA4O72THQ
354
    secret_access_key:
A
Alex Crichton 已提交
355
      secure: "kUGd3t7JcVWFESgIlzvsM8viZgCA9Encs3creW0xLJaLSeI1iVjlJK4h/2/nO6y224AFrh/GUfsNr4/4AlxPuYb8OU5oC5Lv+Ff2JiRDYtuNpyQSKAQp+bRYytWMtrmhja91h118Mbm90cUfcLPwkdiINgJNTXhPKg5Cqu3VYn0="
356
    on:
357
      branch: try
358
      condition: $DEPLOY_ALT = 1