From: Kefu Chai Date: Wed, 16 May 2018 11:41:52 +0000 (+0800) Subject: install-deps: nuke wheelhouse if it's stale X-Git-Tag: v12.2.13~109^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8831354d1a7d02651f4a357557c28e57fcb5e8c;p=ceph.git install-deps: nuke wheelhouse if it's stale otherwise, if we update *requirements.txt, and the wheelhouse fails to offer the newly added dependency, the setup-virtualenv.sh will fail the build. Signed-off-by: Kefu Chai (cherry picked from commit ed0ca70707439f44779ca7093461182d73db1a77) --- diff --git a/install-deps.sh b/install-deps.sh index 89ea940977e6..865c90f840b4 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -314,6 +314,12 @@ find . -name tox.ini | while read ini ; do ( cd $(dirname $ini) require=$(ls *requirements.txt 2>/dev/null | sed -e 's/^/-r /') + md5=wheelhouse/md5 + if test "$require"; then + if ! test -f $md5 || ! md5sum -c $md5 ; then + rm -rf wheelhouse + fi + fi if test "$require" && ! test -d wheelhouse ; then for interpreter in python2.7 python3 ; do type $interpreter > /dev/null 2>&1 || continue @@ -321,6 +327,7 @@ find . -name tox.ini | while read ini ; do populate_wheelhouse "wheel -w $wip_wheelhouse" $require || exit 1 done mv $wip_wheelhouse wheelhouse + md5sum *requirements.txt > $md5 fi ) done diff --git a/src/tools/setup-virtualenv.sh b/src/tools/setup-virtualenv.sh index d249d49f2a86..2f6f0c983f5d 100755 --- a/src/tools/setup-virtualenv.sh +++ b/src/tools/setup-virtualenv.sh @@ -46,5 +46,8 @@ fi pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --find-links=file://$(pwd)/wheelhouse 'tox >=1.9' if test -f requirements.txt ; then + if ! test -f wheelhouse/md5 || ! md5sum -c wheelhouse/md5 > /dev/null; then + NO_INDEX='' + fi pip $DISABLE_PIP_VERSION_CHECK --log $DIR/log.txt install $NO_INDEX --find-links=file://$(pwd)/wheelhouse -r requirements.txt fi