Skip to content

Commit 2c49927

Browse files
committed
Rollup merge of #27028 - Gankro:travis, r=alexcrichton
This has travis build LLVM and rustc up to stage1, but not run any tests. It seems wasteful to have the ultimate might of travis running on every PR just to check for whitespace errors. This is a pure subset of the bootstrap, so it shouldn't ever spuriously break. `make tidy` still runs first, so we still get \"fast errors\" on bad style. However once make tidy passes, the build will simply keep running to try to make rustc. `tidy` takes ~3 mins to complete, so if your build runs longer you can be confident we've gone on to build LLVM/rustc. In principle this is configured to use ccache (it shows up in the build logs as uploaded/downloaded), but I found no actual performance changes in using it. Maybe someone at @travis-ci knows what's up with that. For reference, here is a successful build with ccache enabled: https://travis-ci.org/Gankro/rust/builds/70821237 and one without: https://travis-ci.org/Gankro/rust/builds/70812814 Builds seem to take about 41mins regardless. r? @alexcrichton
2 parents a4060d0 + e8a0328 commit 2c49927

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
@@ -1031,15 +1031,12 @@ fi
10311031

10321032
if [ ! -z "$CFG_ENABLE_CCACHE" ]
10331033
then
1034-
if [ -z "$CC" ]
1034+
if [ -z "$CFG_CCACHE" ]
10351035
then
1036-
if [ -z "$CFG_CCACHE" ]
1037-
then
1038-
err "ccache requested but not found"
1039-
fi
1040-
1041-
CFG_CC="ccache $CFG_CC"
1036+
err "ccache requested but not found"
10421037
fi
1038+
1039+
CFG_CC="ccache $CFG_CC"
10431040
fi
10441041

10451042
if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
@@ -1528,11 +1525,26 @@ do
15281525

15291526
(*)
15301527
msg "inferring LLVM_CXX/CC from CXX/CC = $CXX/$CC"
1531-
LLVM_CXX_32="$CXX"
1532-
LLVM_CC_32="$CC"
1528+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
1529+
then
1530+
if [ -z "$CFG_CCACHE" ]
1531+
then
1532+
err "ccache requested but not found"
1533+
fi
1534+
1535+
LLVM_CXX_32="ccache $CXX"
1536+
LLVM_CC_32="ccache $CC"
1537+
1538+
LLVM_CXX_64="ccache $CXX"
1539+
LLVM_CC_64="ccache $CC"
1540+
else
1541+
LLVM_CXX_32="$CXX"
1542+
LLVM_CC_32="$CC"
1543+
1544+
LLVM_CXX_64="$CXX"
1545+
LLVM_CC_64="$CC"
1546+
fi
15331547

1534-
LLVM_CXX_64="$CXX"
1535-
LLVM_CC_64="$CC"
15361548
;;
15371549
esac
15381550

0 commit comments

Comments
 (0)