Commit f3057406 authored by Jason Madden's avatar Jason Madden

Merge branch 'configure-caching'

parents 9610e1a1 19fe5066
...@@ -45,6 +45,7 @@ docs/__pycache__ ...@@ -45,6 +45,7 @@ docs/__pycache__
# Artifacts of configuring in place # Artifacts of configuring in place
deps/c-ares/config.log deps/c-ares/config.log
deps/c-ares/config.status deps/c-ares/config.status
deps/c-ares/config.cache
deps/c-ares/stamp-h1 deps/c-ares/stamp-h1
deps/c-ares/stamp-h2 deps/c-ares/stamp-h2
deps/c-ares/ares_build.h.orig deps/c-ares/ares_build.h.orig
...@@ -73,6 +74,7 @@ deps/libev/Makefile ...@@ -73,6 +74,7 @@ deps/libev/Makefile
deps/libev/config.log deps/libev/config.log
deps/libev/config.h deps/libev/config.h
deps/libev/config.status deps/libev/config.status
deps/libev/config.cache
deps/libev/configure-output.txt deps/libev/configure-output.txt
deps/libev/libtool deps/libev/libtool
deps/libev/stamp-h1 deps/libev/stamp-h1
...@@ -86,6 +88,7 @@ deps/libuv/Makefile ...@@ -86,6 +88,7 @@ deps/libuv/Makefile
deps/libuv/config.log deps/libuv/config.log
deps/libuv/config.h deps/libuv/config.h
deps/libuv/config.status deps/libuv/config.status
deps/libev/config.cache
deps/libduv/libtool deps/libduv/libtool
deps/libuv/stamp-h1 deps/libuv/stamp-h1
deps/libuv/.libs deps/libuv/.libs
......
...@@ -18,7 +18,9 @@ env: ...@@ -18,7 +18,9 @@ env:
- CCACHE_SLOPPINESS=file_macro,time_macros,include_file_ctime,include_file_mtime - CCACHE_SLOPPINESS=file_macro,time_macros,include_file_ctime,include_file_mtime
- CCACHE_NOHASHDIR=true - CCACHE_NOHASHDIR=true
- BUILD_LIBS=$HOME/.libs - BUILD_LIBS=$HOME/.libs
- CFLAGS="-g -pipe" # Disable some warnings produced by libev especially and also some Cython generated code.
# Note that changing the value of these variables invalidates configure caches
- CFLAGS="-g -pipe -Wno-strict-aliasing -Wno-comment"
- CPPFLAGS="-I$BUILD_LIBS/include -DEV_VERIFY=3" - CPPFLAGS="-I$BUILD_LIBS/include -DEV_VERIFY=3"
- LDFLAGS="-L$BUILD_LIBS/lib" - LDFLAGS="-L$BUILD_LIBS/lib"
- LD_LIBRARY_PATH="$BUILD_LIBS/lib" - LD_LIBRARY_PATH="$BUILD_LIBS/lib"
...@@ -51,6 +53,10 @@ matrix: ...@@ -51,6 +53,10 @@ matrix:
before_install: before_install:
- export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH - export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH
- export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/ - export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/
# Restore the configure caches
- if [ -f $BUILD_LIBS/config.cache.ares ]; then cp $BUILD_LIBS/config.cache.ares deps/c-ares/config.cache ; fi
- if [ -f $BUILD_LIBS/config.cache.libev ]; then cp $BUILD_LIBS/config.cache.libev deps/libev/config.cache ; fi
- if [ -f $BUILD_LIBS/config.cache.libuv ]; then cp $BUILD_LIBS/config.cache.libuv deps/libuv/config.cache ; fi
before_script: before_script:
# Show some details of interest # Show some details of interest
...@@ -62,6 +68,25 @@ before_script: ...@@ -62,6 +68,25 @@ before_script:
- > - >
python -c "import gevent.ares; print(gevent.ares)" python -c "import gevent.ares; print(gevent.ares)"
cache:
pip: true
directories:
- $HOME/.venv
- $HOME/.runtimes
- $HOME/.wheelhouse
- $HOME/.ccache
- $HOME/.libs
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
# Store the configure caches. Having a cache can speed up c-ares
# configure from 2-3 minutes to 20 seconds.
- mkdir -p $BUILD_LIBS
- cp deps/c-ares/config.cache $BUILD_LIBS/config.cache.ares
- cp deps/libev/config.cache $BUILD_LIBS/config.cache.libev
- cp deps/libuv/config.cache $BUILD_LIBS/config.cache.libuv
# Installing is taken care of by the first stage. # Installing is taken care of by the first stage.
install: install:
- ls -l $BUILD_RUNTIMES/snakepit/ - ls -l $BUILD_RUNTIMES/snakepit/
...@@ -111,7 +136,11 @@ jobs: ...@@ -111,7 +136,11 @@ jobs:
# so that we don't have to use build isolation and can better use the cache; # so that we don't have to use build isolation and can better use the cache;
# Note that we can't use -U for cffi and greenlet on PyPy. # Note that we can't use -U for cffi and greenlet on PyPy.
- &build-gevent-deps pip install -U setuptools wheel && pip install cffi cython greenlet - &build-gevent-deps pip install -U setuptools wheel && pip install cffi cython greenlet
- pip install --no-build-isolation .[test] # Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
# output (pip install uses a random temporary directory, making this difficult)
- python setup.py bdist_wheel
- pip uninstall -y gevent
- pip install `ls dist/*whl`[test]
script: ccache -s script: ccache -s
before_script: true before_script: true
after_success: true after_success: true
...@@ -131,23 +160,27 @@ jobs: ...@@ -131,23 +160,27 @@ jobs:
# Install the Python runtime # Install the Python runtime
- *build-gevent-python - *build-gevent-python
- *build-gevent-deps - *build-gevent-deps
- ls -l $G_SITE
# Install the C dependencies to a known location. This is used # Install the C dependencies to a known location. This is used
# to test 'no embed' cases. It might seem like it would prime # to test 'no embed' cases. It might seem like it would prime
# the CCache for when we *do* embed if we did it as part of the generic build stage, # the CCache for when we *do* embed if we did it as part of
# but overall it just seems to slow things down. The Travis caching and CCache is not working as # the generic build stage, but overall it just seems to slow
# well as we would hope. # things down. The Travis caching and CCache is not working as
- pushd deps/libev && ./configure --prefix=$BUILD_LIBS && make install && popd # well as we would hope. (XXX: Probably because in the past we
- pushd deps/c-ares && ./configure --prefix=$BUILD_LIBS && make -j4 install && popd # used pip install which used temporary directories.)
- pushd deps/libuv && ./autogen.sh && ./configure --disable-static --prefix=$BUILD_LIBS && make -j4 install && popd - pushd deps/libev && ./configure -C --prefix=$BUILD_LIBS && make install && popd
- pushd deps/c-ares && ./configure -C --prefix=$BUILD_LIBS && make -j4 install && popd
- pushd deps/libuv && ./autogen.sh && ./configure -C --disable-static --prefix=$BUILD_LIBS && make -j4 install && popd
# libev builds a manpage each time, and it includes today's date, so it frequently changes. # libev builds a manpage each time, and it includes today's date, so it frequently changes.
# delete to avoid repacking the archive # delete to avoid repacking the archive
- rm -rf $BUILD_LIBS/share/man/ - rm -rf $BUILD_LIBS/share/man/
- ls -l $BUILD_LIBS $BUILD_LIBS/lib $BUILD_LIBS/include - ls -l $BUILD_LIBS $BUILD_LIBS/lib $BUILD_LIBS/include
- pip install --no-build-isolation .[test] - python setup.py bdist_wheel
- pip uninstall -y gevent
- pip install `ls dist/*whl`[test]
# Test that we're actually linking # Test that we're actually linking
# to the .so file. # to the .so file.
- objdump -p $G_SITE/gevent/libev/_corecffi*so | grep "NEEDED.*libev.so" - objdump -p $G_SITE/gevent/libev/_corecffi*so | grep "NEEDED.*libev.so"
- objdump -p $G_SITE/gevent/libev/corecext*so | grep "NEEDED.*libev.so"
- objdump -p $G_SITE/gevent/libuv/_corecffi*so | grep "NEEDED.*libuv.so" - objdump -p $G_SITE/gevent/libuv/_corecffi*so | grep "NEEDED.*libuv.so"
script: script:
# Verify that we got non-embedded builds # Verify that we got non-embedded builds
...@@ -279,16 +312,3 @@ jobs: ...@@ -279,16 +312,3 @@ jobs:
notifications: notifications:
email: false email: false
cache:
pip: true
directories:
- $HOME/.venv
- $HOME/.runtimes
- $HOME/.wheelhouse
- $HOME/.ccache
- $HOME/.libs
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
...@@ -43,7 +43,7 @@ else: ...@@ -43,7 +43,7 @@ else:
ares_configure_command = ' '.join([ ares_configure_command = ' '.join([
"(cd ", quoted_dep_abspath('c-ares'), "(cd ", quoted_dep_abspath('c-ares'),
" && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ", " && if [ -r ares_build.h ]; then cp ares_build.h ares_build.h.orig; fi ",
" && sh ./configure --disable-dependency-tracking " + _m32 + "CONFIG_COMMANDS= ", " && sh ./configure --disable-dependency-tracking -C " + _m32 + "CONFIG_COMMANDS= ",
" && cp ares_config.h ares_build.h \"$OLDPWD\" ", " && cp ares_config.h ares_build.h \"$OLDPWD\" ",
" && cat ares_build.h ", " && cat ares_build.h ",
" && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)", " && if [ -r ares_build.h.orig ]; then mv ares_build.h.orig ares_build.h; fi)",
......
...@@ -30,7 +30,7 @@ LIBEV_EMBED = should_embed('libev') ...@@ -30,7 +30,7 @@ LIBEV_EMBED = should_embed('libev')
# Configure libev in place # Configure libev in place
libev_configure_command = ' '.join([ libev_configure_command = ' '.join([
"(cd ", quoted_dep_abspath('libev'), "(cd ", quoted_dep_abspath('libev'),
" && sh ./configure > configure-output.txt", " && sh ./configure -C > configure-output.txt",
")", ")",
]) ])
......
...@@ -391,6 +391,7 @@ class GeventClean(clean): ...@@ -391,6 +391,7 @@ class GeventClean(clean):
'config.h', 'config.h',
'config.log', 'config.log',
'config.status', 'config.status',
'config.cache',
'configure-output.txt', 'configure-output.txt',
'.libs' '.libs'
): ):
......
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