From 09045e49d1e2d3322e8ca8cc40f0e5db10f13c58 Mon Sep 17 00:00:00 2001 From: Andrew Selle Date: Tue, 6 Sep 2016 08:19:04 -0800 Subject: Include sha hash in python variable __version__ It is necessary to symlink in files from .git/ in order to make bazel aware of changes to the current head. As it is this is not completely reliable when git repositories are in a dirty index state. First class support for bazel git a reported bug but not a high priority. ./configure sets up the symlinks by calling the gen_git_source.py a bazel genrule calls gen_git_source.py to generate version_info.cc Also changed cmake and make to build this properly. Change: 132328009 --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'configure') diff --git a/configure b/configure index f4b772c55e..ce75bb490a 100755 --- a/configure +++ b/configure @@ -2,6 +2,11 @@ DO_NOT_SUBMIT_WARNING="Unofficial setting. DO NOT SUBMIT!!!" +# Find out the absolute path to where ./configure resides +pushd `dirname $0` #> /dev/null +SOURCE_BASE_DIR=`pwd -P` +popd > /dev/null + ## Set up python-related environment settings while true; do fromuser="" @@ -68,6 +73,12 @@ echo "$SWIG_PATH" > tensorflow/tools/swig/swig_path # Invoke python_config and set up symlinks to python includes (./util/python/python_config.sh --setup "$PYTHON_BIN_PATH";) || exit -1 +# Run the gen_git_source to create links where bazel can track dependencies for +# git hash propagation +GEN_GIT_SOURCE=tensorflow/tools/git/gen_git_source.py +chmod a+x ${GEN_GIT_SOURCE} +${PYTHON_BIN_PATH} ${GEN_GIT_SOURCE} --configure ${SOURCE_BASE_DIR} + ## Set up Cuda-related environment settings while [ "$TF_NEED_CUDA" == "" ]; do -- cgit v1.2.3