diff --git a/.travis.yml b/.travis.yml index 2b406590..9f5fcb89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,10 +47,11 @@ install: # Maybe get and clean and patch source - | if [ ${TRAVIS_EVENT_TYPE} == "cron" ]; then - clean_code $REPO_DIR develop + clean_code_local $REPO_DIR develop else - clean_code $REPO_DIR $OPENBLAS_COMMIT + clean_code_local $REPO_DIR $OPENBLAS_COMMIT fi + echo done install step script: # Build library and collect into libs subdirectory diff --git a/tools/build_steps.sh b/tools/build_steps.sh index 3b9d5091..b7268dab 100644 --- a/tools/build_steps.sh +++ b/tools/build_steps.sh @@ -24,6 +24,34 @@ function before_build { fi } +function clean_code_local { + set -ex + # Copied from common_utils.sh, with added debugging + local repo_dir=${1:-$REPO_DIR} + local build_commit=${2:-$BUILD_COMMIT} + [ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1 + [ -z "$build_commit" ] && echo "build_commit not defined" && exit 1 + # The package $repo_dir may be a submodule. git submodules do not + # have a .git directory. If $repo_dir is copied around, tools like + # Versioneer which require that it be a git repository are unable + # to determine the version. Give submodule proper git directory + # XXX no need to do this + # fill_submodule "$repo_dir" + pushd $repo_dir + echo in $repo_dir + git fetch origin --tags + echo after git fetch origin + git checkout $build_commit + echo after git checkout $build_commit + git clean -fxd + echo after git clean + git reset --hard + echo after git reset + git submodule update --init --recursive + echo after git submodule update + popd +} + function get_plat_tag { # Copied from gfortran-install/gfortran_utils.sh, modified for MB_ML_LIBC diff --git a/tools/local_build.sh b/tools/local_build.sh index ce5ced6c..aa5d9a5e 100644 --- a/tools/local_build.sh +++ b/tools/local_build.sh @@ -37,6 +37,27 @@ function install_virtualenv { pip install virtualenv } +function clean_code_local { + # Copied from common_utils.sh, with added debugging + local repo_dir=${1:-$REPO_DIR} + local build_commit=${2:-$BUILD_COMMIT} + [ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1 + [ -z "$build_commit" ] && echo "build_commit not defined" && exit 1 + # The package $repo_dir may be a submodule. git submodules do not + # have a .git directory. If $repo_dir is copied around, tools like + # Versioneer which require that it be a git repository are unable + # to determine the version. Give submodule proper git directory + # XXX no need to do this + # fill_submodule "$repo_dir" + pushd $repo_dir + git fetch origin --tags + git checkout $build_commit + git clean -fxd + git reset --hard + git submodule update --init --recursive + popd +} + function build_openblas { if [[ -z VIRTUAL_ENV ]]; then echo "must be run in a virtualenv"