about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-03 00:13:38 -0700
committerbors <bors@rust-lang.org>2016-06-03 00:13:38 -0700
commit95206f438f1573e95601f06b315a151de010e92f (patch)
tree0603575412c4fc29c9e54b6aa65f833246f71389
parent0646e8ae6ee2d6697b828a6512357c135f834633 (diff)
parentb1651fb4d2c0349ccca108b8d24210d688507936 (diff)
Auto merge of #34016 - sanxiyn:travis-docker, r=brson
Use Docker for Travis

The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.

Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

Fix #34009.
-rw-r--r--.travis.yml17
-rw-r--r--src/etc/Dockerfile25
2 files changed, 34 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index cc93b1127c3..87197a37f1d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
 language: generic
 sudo: required
-dist: trusty
+services:
+  - docker
 
 # LLVM takes awhile to check out and otherwise we'll manage the submodules in
 # our configure script, so disable auto submodule management.
@@ -8,15 +9,15 @@ git:
   submodules: false
 
 before_install:
-  - echo 0 | sudo tee /proc/sys/net/ipv6/conf/lo/disable_ipv6
-  - echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list
-  - echo 'deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list
-  - sudo apt-get update
-  - sudo apt-get --force-yes install curl make g++ python2.7 git zlib1g-dev libedit-dev llvm-3.7-tools
+  - docker build -t rust -f src/etc/Dockerfile src/etc
 
 script:
-  - ./configure --llvm-root=/usr/lib/llvm-3.7
-  - make tidy && make check-notidy -j4
+  - docker run -v `pwd`:/build rust
+    sh -c "
+      ./configure --llvm-root=/usr/lib/llvm-3.7 &&
+      make tidy &&
+      make check-notidy -j4
+    "
 
 # Real testing happens on http://buildbot.rust-lang.org/
 #
diff --git a/src/etc/Dockerfile b/src/etc/Dockerfile
new file mode 100644
index 00000000000..58fa1474444
--- /dev/null
+++ b/src/etc/Dockerfile
@@ -0,0 +1,25 @@
+FROM ubuntu:xenial
+
+# curl
+#   Download stage0, see src/bootstrap/bootstrap.py
+# g++
+#   Compile LLVM binding in src/rustllvm
+# git
+#   Get commit hash and commit date in version string
+# make
+#   Run build scripts in mk
+# libedit-dev zlib1g-dev
+#   LLVM dependencies as packaged in Ubuntu
+#   (They are optional, but Ubuntu package enables them)
+# llvm-3.7-dev (installed by llvm-3.7-tools)
+#   LLVM
+# llvm-3.7-tools
+#   FileCheck is used to run tests in src/test/codegen
+
+RUN apt-get update && apt-get -y install \
+    curl g++ git make \
+    libedit-dev zlib1g-dev \
+    llvm-3.7-tools
+
+RUN mkdir /build
+WORKDIR /build