diff --git a/ci/prep_ccache.sh b/ci/prep_ccache.sh index 9c7267ee21623..775aec555a824 100755 --- a/ci/prep_ccache.sh +++ b/ci/prep_ccache.sh @@ -6,6 +6,7 @@ if [ "$IRON_TOKEN" ]; then pip install -I --allow-external --allow-insecure git+https://github.com/iron-io/iron_cache_python.git@8a451c7d7e4d16e0c3bedffd0f280d5d9bd4fe59#egg=iron_cache + curdir=$(pwd) python ci/ironcache/get.py ccache -C @@ -22,14 +23,23 @@ if [ "$IRON_TOKEN" ]; then fi # did the last commit change cython files? - git diff HEAD~5 | grep diff | grep -P "pyx|pxd" + cd $curdir - if [ "$?" != "0" ]; then + echo "diff from HEAD~5" + git diff HEAD~5 --numstat + + retval=$(git diff HEAD~5 --numstat | grep -P "pyx|pxd"|wc -l) + echo "number of cython files changed: $retval" + + if [ $retval -eq 0 ] + then # nope, reuse cython files echo "Will reuse cached cython file" touch "$TRAVIS_BUILD_DIR"/pandas/*.c touch "$TRAVIS_BUILD_DIR"/pandas/src/*.c touch "$TRAVIS_BUILD_DIR"/pandas/*.cpp + else + echo "Rebuilding cythonized files" fi fi