Commit 1b97cd55 authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #45 from xoviat/ccache

MRG: enable use of ccache

Enable use of ccache with environment variable toggle.
parents 8b19d71a 3d512ea7
...@@ -12,6 +12,11 @@ matrix: ...@@ -12,6 +12,11 @@ matrix:
dist: trusty dist: trusty
env: env:
- TEST_BUILDS=1 - TEST_BUILDS=1
- os: linux
dist: trusty
env:
- TEST_BUILDS=1
- USE_CCACHE=1
- os: osx - os: osx
osx_image: xcode6.4 osx_image: xcode6.4
env: env:
...@@ -53,6 +58,11 @@ matrix: ...@@ -53,6 +58,11 @@ matrix:
env: env:
- PYTHON_VERSION=3.6.1 - PYTHON_VERSION=3.6.1
- VENV=venv - VENV=venv
- os: osx
env:
- PYTHON_VERSION=3.6.1
- VENV=venv
- USE_CCACHE=1
- os: osx - os: osx
env: env:
- PYTHON_VERSION=pypy-2.6 - PYTHON_VERSION=pypy-2.6
......
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
# BUILD_DEPENDS (may be used by config.sh, can be empty) # BUILD_DEPENDS (may be used by config.sh, can be empty)
set -e set -e
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
# Unicode width, default 32 # Unicode width, default 32
UNICODE_WIDTH=${UNICODE_WIDTH:-32} UNICODE_WIDTH=${UNICODE_WIDTH:-32}
......
...@@ -49,3 +49,25 @@ function repair_wheelhouse { ...@@ -49,3 +49,25 @@ function repair_wheelhouse {
done done
chmod -R a+rwX $out_dir chmod -R a+rwX $out_dir
} }
function activate_ccache {
# Link up the correct location for ccache
ln -s /parent-home/.ccache $HOME/.ccache
# Now install ccache
yum install -y ccache
# Create fake compilers and prepend them to the PATH
# Note that yum is supposed to create these for us,
# but I had trouble finding them
local ccache_dir=/usr/lib/ccache/compilers
mkdir -p $ccache_dir
ln -s /usr/bin/ccache $CCACHE_DIR/gcc
ln -s /usr/bin/ccache $CCACHE_DIR/g++
ln -s /usr/bin/ccache $CCACHE_DIR/cc
ln -s /usr/bin/ccache $CCACHE_DIR/c++
export PATH=$CCACHE_DIR:$PATH
# Prove to the developer that ccache is activated
which gcc
}
...@@ -267,6 +267,9 @@ function set_py_vars { ...@@ -267,6 +267,9 @@ function set_py_vars {
} }
function get_macpython_environment { function get_macpython_environment {
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
# Set up MacPython environment # Set up MacPython environment
# Parameters: # Parameters:
# $version : [implementation-]major[.minor[.patch]] # $version : [implementation-]major[.minor[.patch]]
...@@ -333,3 +336,14 @@ function install_pkg_config { ...@@ -333,3 +336,14 @@ function install_pkg_config {
# https://github.com/matthew-brett/multibuild/issues/24#issue-221951587 # https://github.com/matthew-brett/multibuild/issues/24#issue-221951587
command -v pkg-config > /dev/null 2>&1 || brew install pkg-config command -v pkg-config > /dev/null 2>&1 || brew install pkg-config
} }
function activate_ccache {
brew update
brew install ccache
export PATH=/usr/local/opt/ccache/libexec:$PATH
export CCACHE_MAXSIZE=200M
export CCACHE_CPP2=1
# Prove to the developer that ccache is activated
which clang
}
...@@ -87,9 +87,11 @@ function build_multilinux { ...@@ -87,9 +87,11 @@ function build_multilinux {
-e WHEEL_SDIR="$WHEEL_SDIR" \ -e WHEEL_SDIR="$WHEEL_SDIR" \
-e MANYLINUX_URL="$MANYLINUX_URL" \ -e MANYLINUX_URL="$MANYLINUX_URL" \
-e BUILD_DEPENDS="$BUILD_DEPENDS" \ -e BUILD_DEPENDS="$BUILD_DEPENDS" \
-e USE_CCACHE="$USE_CCACHE" \
-e REPO_DIR="$repo_dir" \ -e REPO_DIR="$repo_dir" \
-e PLAT="$PLAT" \ -e PLAT="$PLAT" \
-v $PWD:/io \ -v $PWD:/io \
-v $HOME:/parent-home \
$docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh $docker_image /io/$MULTIBUILD_DIR/docker_build_wrap.sh
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment