Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take a whack at using ccache to speed up builds on CI. #1099

Merged
merged 1 commit into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ python:
env:
global:
- BUILD_RUNTIMES=$HOME/.runtimes
- CC="ccache gcc"
- CCACHE_NOCPP2=true
- CCACHE_SLOPPINESS=file_macro,time_macros,include_file_ctime,include_file_mtime
- CCACHE_NOHASHDIR=true
- CFLAGS="-Ofast -pipe -fomit-frame-pointer -march=native -flto"

matrix:
# These are ordered to get as much diversity in the
Expand Down Expand Up @@ -37,6 +42,7 @@ cache:
- $HOME/.venv
- $HOME/.runtimes
- $HOME/.wheelhouse
- $HOME/.ccache

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ develop:
# First install a newer pip so that it can use the wheel cache
# (only needed until travis upgrades pip to 7.x; note that the 3.5
# environment uses pip 7.1 by default)
python -m pip install -U pip setuptools
${PYTHON} -m pip install -U pip setuptools
# Then start installing our deps so they can be cached. Note that use of --build-options / --global-options / --install-options
# disables the cache.
# We need wheel>=0.26 on Python 3.5. See previous revisions.
GEVENTSETUP_EV_VERIFY=3 ${PYTHON} -m pip install -U -r dev-requirements.txt
${PYTHON} -m pip install -U -r ci-requirements.txt
GEVENTSETUP_EV_VERIFY=3 time ${PYTHON} -m pip install -U -e .
ccache -s
@${PYTHON} scripts/travis.py fold_end install

test-py27: $(PY27)
Expand Down
5 changes: 5 additions & 0 deletions _setuputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,13 @@ def make_universal_header(filename, *defines):

def _system(cmd, cwd=None, env=None, **kwargs):
sys.stdout.write('Running %r in %s\n' % (cmd, cwd or os.getcwd()))
sys.stdout.flush()
if 'shell' not in kwargs:
kwargs['shell'] = True
env = env or os.environ.copy()
if env.get('CC', '').startswith('ccache '):
# Running configure scripts under ccache just adds overhead.
env['CC'] = env['CC'][7:]
return check_call(cmd, cwd=cwd, env=env, **kwargs)


Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ install:

cache:
- "%TMP%\\py\\"
- '%LOCALAPPDATA%\pip\Cache'

build_script:
# Build the compiled extension
Expand Down
25 changes: 25 additions & 0 deletions ci-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
setuptools
wheel
cython>=0.27.3 ; python_version < '3.7'
# Thread state changes, especially in Pythran seem to need this,
# which in turn requires CPython 3.7.0a3 or above
git+https://github.com/cython/cython#egg=cython ; python_version >= '3.7'
greenlet>=0.4.10 ; python_version < '3.7'
# Thread state changes again; requires 0.4.13, as yet unreleased
git+https://github.com/python-greenlet/greenlet#egg=greenlet ; python_version >= '3.7'
pylint>=1.8.0
# pyyaml is included here and doesn't install on travis with 3.7a3
prospector[with_pyroma] ; python_version < '3.7'
coverage>=4.0
coveralls>=1.0
# See version requirements in setup.py
cffi
futures
dnspython
idna
# Makes tests faster
psutil
# For viewing README.rst (restview --long-description),
# CONTRIBUTING.rst, etc.
# https://github.com/mgedmin/restview
restview
26 changes: 1 addition & 25 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,2 @@
setuptools
wheel
cython>=0.27.3 ; python_version < '3.7'
# Thread state changes, especially in Pythran seem to need this,
# which in turn requires CPython 3.7.0a3 or above
git+https://github.com/cython/cython#egg=cython ; python_version >= '3.7'
greenlet>=0.4.10 ; python_version < '3.7'
# Thread state changes again; requires 0.4.13, as yet unreleased
git+https://github.com/python-greenlet/greenlet#egg=greenlet ; python_version >= '3.7'
pylint>=1.8.0
# pyyaml is included here and doesn't install on travis with 3.7a3
prospector[with_pyroma] ; python_version < '3.7'
coverage>=4.0
coveralls>=1.0
# See version requirements in setup.py
cffi
futures
dnspython
idna
# Makes tests faster
psutil
# For viewing README.rst (restview --long-description),
# CONTRIBUTING.rst, etc.
# https://github.com/mgedmin/restview
restview
-r ci-requirements.txt
-e .