From 51dbc464832599c4d450d078d00e56a011233277 Mon Sep 17 00:00:00 2001 From: Andrew Harp Date: Fri, 27 Jan 2017 14:42:30 -0800 Subject: [PATCH] Delete downloaded BUILD files for makefile dependencies immediately after extracting and also at the beginning of ./configure. This will prevent bazel from erroneously parsing contrib/makefile/downloads during configuration if a makefile build has previously been performed. Change: 145838744 --- configure | 7 +++++++ tensorflow/contrib/makefile/download_dependencies.sh | 3 +++ 2 files changed, 10 insertions(+) diff --git a/configure b/configure index a8e7bb77385..6cd5c2f3dbf 100755 --- a/configure +++ b/configure @@ -44,6 +44,13 @@ function bazel_clean_and_fetch() { bazel fetch "//tensorflow/... -//tensorflow/examples/android/..." } +# Delete any leftover BUILD files from the Makefile build, which would interfere +# with Bazel parsing. +MAKEFILE_DOWNLOAD_DIR=tensorflow/contrib/makefile/downloads +if [ -d "${MAKEFILE_DOWNLOAD_DIR}" ]; then + find ${MAKEFILE_DOWNLOAD_DIR} -type f -name '*BUILD' -delete +fi + ## Set up python-related environment settings while true; do fromuser="" diff --git a/tensorflow/contrib/makefile/download_dependencies.sh b/tensorflow/contrib/makefile/download_dependencies.sh index 7aebe18767b..58d1dc6f0af 100755 --- a/tensorflow/contrib/makefile/download_dependencies.sh +++ b/tensorflow/contrib/makefile/download_dependencies.sh @@ -44,6 +44,9 @@ download_and_extract() { echo "downloading ${url}" >&2 mkdir -p "${dir}" curl -Ls "${url}" | tar -C "${dir}" --strip-components=1 -xz + + # Delete any potential BUILD files, which would interfere with Bazel builds. + find "${dir}" -type f -name '*BUILD' -delete } download_and_extract "${EIGEN_URL}" "${DOWNLOADS_DIR}/eigen"