Skip to content

Commit

Permalink
More travis run speedups
Browse files Browse the repository at this point in the history
- Using clang instead of gcc; compiles faster and with less memory,
meaning we can build in parallel.
- Caching more stuff so startup is faster. In particular, the Rust
toolchain.
- Using the ninja build tool which tends to be faster than Make.
  • Loading branch information
Valloric committed Feb 2, 2016
1 parent f3d01e1 commit a8244ed
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
29 changes: 22 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ env:
global:
- MONO_THREADS_PER_CPU=2000
- MONO_MANAGED_WATCHER=disabled
# Travis can run out of RAM when compiling if we don't prevent parallelization.
- YCM_CORES=1
# Travis can run out of RAM, so we need to be careful here.
- YCM_CORES=3
matrix:
# Don't forget to take the below matrix exclusions into account.
- USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7
Expand All @@ -36,18 +36,33 @@ matrix:
- os: linux
env: USE_CLANG_COMPLETER=true YCMD_PYTHON_VERSION=2.7
addons:
# If this doesn't make much sense to you, see the travis docs:
# https://docs.travis-ci.com/user/migrating-from-legacy/
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
# The Travis apt source whitelist can be found here:
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
- ubuntu-toolchain-r-test # for new libstdc++
- llvm-toolchain-precise-3.7 # for clang
- deadsnakes # for various versions of python
- kalakris-cmake # for a more recent version of cmake (needed for ninja-build)
packages:
- g++-4.8
- cmake
- clang-3.7
- ninja-build
- python2.6
- python2.6-dev
- python2.7
- python2.7-dev
- python-virtualenv
cache:
directories:
- $HOME/.cache/pip
- $HOME/.dnx/packages
- $HOME/.cache/pip # Python packages from pip
- $HOME/.dnx/packages # .Net packages?
- $HOME/.multirust # what multirust downloads
- $HOME/.cargo # cargo package deps
- $HOME/clang_archives # clang downloads
# dependency compilation output
- $TRAVIS_BUILD_DIR/third_party/racerd/target
- $TRAVIS_BUILD_DIR/third_party/gocode
- $TRAVIS_BUILD_DIR/third_party/OmniSharpServer/OmniSharp/bin/Release
3 changes: 2 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ def GetGenerator( args ):
if ( not args.arch and platform.architecture()[ 0 ] == '64bit'
or args.arch == 64 ):
generator = generator + ' Win64'

return generator

if PathToFirstExistingExecutable( ['ninja'] ):
return 'Ninja'
return 'Unix Makefiles'


Expand Down
14 changes: 10 additions & 4 deletions ci/travis/travis_install.linux.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Linux-specific installation

# We can't use sudo, so we have to approximate the behaviour of the following:
# $ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90
# $ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-3.7 100

mkdir ${HOME}/bin

ln -s /usr/bin/g++-4.8 ${HOME}/bin/g++
ln -s /usr/bin/gcc-4.8 ${HOME}/bin/gcc
ln -s ${HOME}/bin/g++ ${HOME}/bin/c++
ln -s /usr/bin/clang++-3.7 ${HOME}/bin/clang++
ln -s /usr/bin/clang-3.7 ${HOME}/bin/clang

ln -s /usr/bin/clang++-3.7 ${HOME}/bin/c++
ln -s /usr/bin/clang-3.7 ${HOME}/bin/cc

# These shouldn't be necessary, but just in case.
ln -s /usr/bin/clang++-3.7 ${HOME}/bin/g++
ln -s /usr/bin/clang-3.7 ${HOME}/bin/gcc

export PATH=${HOME}/bin:${PATH}

Expand Down
1 change: 1 addition & 0 deletions ci/travis/travis_install.osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
brew update || brew update
brew install node.js || brew outdated node.js || brew upgrade node.js
brew install go || brew outdated go || brew upgrade go
brew install ninja

# OS X comes with 2 versions of python by default, and a neat system
# (versioner) to switch between them:
Expand Down

0 comments on commit a8244ed

Please sign in to comment.