Skip to content

Commit e8a0328

Browse files
committed
Ratchet up travis to build stage1 and our own LLVM.
Tidy is still run first for failing fast on the easy stuff. To accomplish this we have travis actually persist ccache across builds. This has LLVM built within 6 minutes, and all of stage1 built within 18. Caching should work on fresh PRs (cache acquired from the master branch). Because all we persist is ccache, there is minimal danger of persisting corrupt build state. I had to mangle `configure` a bit to make --enable-ccache work when custom compilers are provide via CC and CXX.
1 parent 67256df commit e8a0328

File tree

2 files changed

+47
-17
lines changed

2 files changed

+47
-17
lines changed

.travis.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
# Use something that's not 'ruby' so we don't set up things like
2-
# RVM/bundler/ruby and whatnot. Right now 'rust' as a language actually
3-
# downloads a rust/cargo snapshot, which we don't really want for building rust.
1+
# ccache support is disabled unless your language is a C-derivative. However
2+
# `language: C` unconditionally sets `CC=compiler`. If we just set it in our
3+
# `env` it will be overwritten by the default (gcc 4.6).
44
language: c
5+
compiler: /usr/bin/gcc-4.7
6+
cache: ccache
57
sudo: false
68

79
# The test suite is in general way too stressful for travis, especially in
810
# terms of time limit and reliability. In the past we've tried to scale things
911
# back to only build the stage1 compiler and run a subset of tests, but this
1012
# didn't end up panning out very well.
1113
#
12-
# As a result, we're just using travis to run `make tidy` now. It'll help
13-
# everyone find out about their trailing spaces early on!
14+
# As a result, we're just using travis to run `make tidy` and *only* build
15+
# stage1 but *not* test it for now (a strict subset of the bootstrap). This will
16+
# catch "obvious" errors like style or not even compiling.
17+
#
18+
# We need gcc4.7 or higher to build LLVM, and travis (well, Ubuntu 12.04)
19+
# currently ships with 4.6. Gotta download our own.
1420
before_script:
15-
- ./configure --llvm-root=path/to/nowhere
21+
- ./configure --enable-ccache
1622
script:
1723
- make tidy
24+
- make rustc-stage1 -j4
25+
26+
env:
27+
- CXX=/usr/bin/g++-4.7
28+
29+
addons:
30+
apt:
31+
sources:
32+
- ubuntu-toolchain-r-test
33+
packages:
34+
- gcc-4.7
35+
- g++-4.7
1836

1937
# Real testing happens on http://buildbot.rust-lang.org/
2038
#

configure

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,15 +1016,12 @@ fi
10161016

10171017
if [ ! -z "$CFG_ENABLE_CCACHE" ]
10181018
then
1019-
if [ -z "$CC" ]
1019+
if [ -z "$CFG_CCACHE" ]
10201020
then
1021-
if [ -z "$CFG_CCACHE" ]
1022-
then
1023-
err "ccache requested but not found"
1024-
fi
1025-
1026-
CFG_CC="ccache $CFG_CC"
1021+
err "ccache requested but not found"
10271022
fi
1023+
1024+
CFG_CC="ccache $CFG_CC"
10281025
fi
10291026

10301027
if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
@@ -1513,11 +1510,26 @@ do
15131510

15141511
(*)
15151512
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1516-
LLVM_CXX_32="$CXX"
1517-
LLVM_CC_32="$CC"
1513+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1514+
then
1515+
if [ -z "$CFG_CCACHE" ]
1516+
then
1517+
err "ccache requested but not found"
1518+
fi
1519+
1520+
LLVM_CXX_32="ccache $CXX"
1521+
LLVM_CC_32="ccache $CC"
1522+
1523+
LLVM_CXX_64="ccache $CXX"
1524+
LLVM_CC_64="ccache $CC"
1525+
else
1526+
LLVM_CXX_32="$CXX"
1527+
LLVM_CC_32="$CC"
1528+
1529+
LLVM_CXX_64="$CXX"
1530+
LLVM_CC_64="$CC"
1531+
fi
15181532

1519-
LLVM_CXX_64="$CXX"
1520-
LLVM_CC_64="$CC"
15211533
;;
15221534
esac
15231535

0 commit comments

Comments
 (0)