Skip to content

Commit b1651fb

Browse files
committed
Use Docker for Travis
1 parent 433d70c commit b1651fb

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
language: generic
22
sudo: required
3-
dist: trusty
3+
services:
4+
- docker
45

56
# LLVM takes awhile to check out and otherwise we'll manage the submodules in
67
# our configure script, so disable auto submodule management.
78
git:
89
submodules: false
910

1011
before_install:
11-
- echo 0 | sudo tee /proc/sys/net/ipv6/conf/lo/disable_ipv6
12-
- echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list
13-
- echo 'deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list
14-
- sudo apt-get update
15-
- sudo apt-get --force-yes install curl make g++ python2.7 git zlib1g-dev libedit-dev llvm-3.7-tools
12+
- docker build -t rust -f src/etc/Dockerfile src/etc
1613

1714
script:
18-
- ./configure --llvm-root=/usr/lib/llvm-3.7
19-
- make tidy && make check-notidy -j4
15+
- docker run -v `pwd`:/build rust
16+
sh -c "
17+
./configure --llvm-root=/usr/lib/llvm-3.7 &&
18+
make tidy &&
19+
make check-notidy -j4
20+
"
2021
2122
# Real testing happens on http://buildbot.rust-lang.org/
2223
#

src/etc/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:xenial
2+
3+
# curl
4+
# Download stage0, see src/bootstrap/bootstrap.py
5+
# g++
6+
# Compile LLVM binding in src/rustllvm
7+
# git
8+
# Get commit hash and commit date in version string
9+
# make
10+
# Run build scripts in mk
11+
# libedit-dev zlib1g-dev
12+
# LLVM dependencies as packaged in Ubuntu
13+
# (They are optional, but Ubuntu package enables them)
14+
# llvm-3.7-dev (installed by llvm-3.7-tools)
15+
# LLVM
16+
# llvm-3.7-tools
17+
# FileCheck is used to run tests in src/test/codegen
18+
19+
RUN apt-get update && apt-get -y install \
20+
curl g++ git make \
21+
libedit-dev zlib1g-dev \
22+
llvm-3.7-tools
23+
24+
RUN mkdir /build
25+
WORKDIR /build

0 commit comments

Comments
 (0)