Skip to content

Commit 95206f4

Browse files
committed
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.
2 parents 0646e8a + b1651fb commit 95206f4

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

.travis.yml

+9-8
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

+25
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)