Unverified Commit eeabc12e authored by xoviat's avatar xoviat Committed by GitHub
Browse files

Ccache: fixes (#61)

* [osx] don't update homebrew

* [docker] move activate_ccache until after utils are loaded

* [manylinux_utils] create cccache directory

* [manylinux_utils] fix case

* [osx/ccache] disable maxsize

* [osx_utils] move  code and add comment
parent 70a73bf2
......@@ -7,10 +7,6 @@
# BUILD_DEPENDS (may be used by config.sh, can be empty)
set -e
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
# Unicode width, default 32
UNICODE_WIDTH=${UNICODE_WIDTH:-32}
......@@ -23,6 +19,10 @@ MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MULTIBUILD_DIR/manylinux_utils.sh
source $MULTIBUILD_DIR/library_builders.sh
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
# Set PATH for chosen Python, Unicode width
export PATH="$(cpython_path $PYTHON_VERSION $UNICODE_WIDTH)/bin:$PATH"
......
......@@ -52,6 +52,7 @@ function repair_wheelhouse {
function activate_ccache {
# Link up the correct location for ccache
mkdir -p /parent-home/.ccache
ln -s /parent-home/.ccache $HOME/.ccache
# Now install ccache
......@@ -62,11 +63,11 @@ function activate_ccache {
# 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
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,9 +267,6 @@ function set_py_vars {
}
function get_macpython_environment {
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
# Set up MacPython environment
# Parameters:
# $version : [implementation-]major[.minor[.patch]]
......@@ -285,10 +282,19 @@ function get_macpython_environment {
# Puts directory of $PYTHON_EXE on $PATH
local version=$1
local venv_dir=$2
# We MUST set this before calling homebrew or it could potentially fail
# See travis-ci issue #8552 for more details
export HOMEBREW_NO_AUTO_UPDATE=1
if [ "$USE_CCACHE" == "1" ]; then
activate_ccache
fi
remove_travis_ve_pip
install_macpython $version
install_pip
export HOMEBREW_NO_AUTO_UPDATE=1
if [ -n "$venv_dir" ]; then
install_virtualenv
make_workon_venv $venv_dir
......@@ -338,10 +344,9 @@ function 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
......
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