Skip to content

Commit 832b67c

Browse files
author
y-p
committed
BLD: travis, reuse cython files if unchanged in last 5 master commits
1 parent 52350a7 commit 832b67c

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

ci/prep_ccache.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ "$IRON_TOKEN" ]; then
88

99
python ci/ironcache/get.py
1010
ccache -C
11-
ccache -M 60M
11+
ccache -M 120M
1212

1313
if [ -f ~/ccache.7z ]; then
1414
echo "Cache retrieved"
@@ -21,6 +21,17 @@ if [ "$IRON_TOKEN" ]; then
2121
rm -rf $HOME/ccache
2222

2323
fi
24+
25+
# did the last commit change cython files?
26+
git show --pretty="format:" --name-only HEAD~5.. --first-parent | grep -P "pyx|pxd"
27+
28+
if [ "$?" != "0" ]; then
29+
# nope, reuse cython files
30+
echo "Will reuse cached cython file"
31+
touch "$TRAVIS_BUILD_DIR"/pandas/*.c
32+
touch "$TRAVIS_BUILD_DIR"/pandas/src/*.c
33+
touch "$TRAVIS_BUILD_DIR"/pandas/*.cpp
34+
fi
2435
fi
2536

2637
exit 0

ci/submit_ccache.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,10 @@ if [ "$IRON_TOKEN" ]; then
1414
rm -rf ~/ccache.7z
1515

1616
tar cf - $HOME/.ccache \
17-
| 7za a -si ~/ccache.7z
18-
19-
# Caching the cython files could be be made to work.
20-
# There's a timestamp issue to be handled (http://stackoverflow.com/questions/1964470)
21-
# but you could get the build to reuse them.
22-
# However, there's a race condition between travis cythonizing
23-
# and a new commit being made on a GH server somewhere.
24-
# and there's convenient causal link between the two we can
25-
# take advantage of.
26-
# Let's just wait another 60 seconds.
27-
# "$TRAVIS_BUILD_DIR"/pandas/{index,algos,lib,tslib,parser,hashtable}.c \
28-
# "$TRAVIS_BUILD_DIR"/pandas/src/{sparse,testing}.c \
29-
# "$TRAVIS_BUILD_DIR"/pandas/msgpack.cpp \
30-
# | 7za a -si ~/ccache.7z
17+
"$TRAVIS_BUILD_DIR"/pandas/{index,algos,lib,tslib,parser,hashtable}.c \
18+
"$TRAVIS_BUILD_DIR"/pandas/src/{sparse,testing}.c \
19+
"$TRAVIS_BUILD_DIR"/pandas/msgpack.cpp \
20+
| 7za a -si ~/ccache.7z
3121

3222
split -b 500000 -d ~/ccache.7z ~/ccache.
3323

0 commit comments

Comments
 (0)