Repository navigation
Description
When building from source with TensorFlow and switch to another branch, error returned even if I rerun ./configure:
ubuntu@ubuntu:~/tensorflow$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
..........
ubuntu@ubuntu:~/tensorflow$ git checkout -b test
ubuntu@ubuntu:~/tensorflow$ ./configure
..........
ubuntu@ubuntu:~/tensorflow$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
..........
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (252 packages loaded).
INFO: Found 1 target...
ERROR: /home/ubuntu/tensorflow/tensorflow/core/BUILD:1671:1: Executing genrule //tensorflow/core:version_info_gen failed (Exit 1)
Traceback (most recent call last):
File "tensorflow/tools/git/gen_git_source.py", line 284, in <module>
generate(args.generate)
File "tensorflow/tools/git/gen_git_source.py", line 229, in generate
(old_branch, new_branch))
RuntimeError: Run ./configure again, branch was 'refs/heads/master' but is now 'refs/heads/test'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 9.025s, Critical Path: 0.30s
FAILED: Build did NOT complete successfully
I think the issue is that spec.json is not updated when running ./configure
ubuntu@ubuntu:~/tensorflow$ cat /home/ubuntu/.cache/bazel/_bazel_ubuntu/ad1e09741bb4109fbc70ef8216b59ee2/external/local_config_git/gen/spec.json
{
"path": "/home/ubuntu/.cache/bazel/_bazel_ubuntu/ad1e09741bb4109fbc70ef8216b59ee2/external/org_tensorflow/",
"git": true,
"branch": "refs/heads/master"
}
ubuntu@ubuntu:~/tensorflow$
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04
- TensorFlow installed from (source or binary): source
- TensorFlow version (use command below): master
- Python version: 2.7.12
- Bazel version (if compiling from source): 0.9.0
- GCC/Compiler version (if compiling from source): gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
- CUDA/cuDNN version: N/A
- GPU model and memory: N/A
- Exact command to reproduce:
git checkout -b test
./configure
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_packageYou can collect some of this information using our environment capture script:
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
Describe the problem
Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.
Source code / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.
Activity
shivaniag commentedon Jan 11, 2018
@jart could you take a look at this?
jart commentedon Jan 11, 2018
@case540 This is a bug with git autoconf. I've reproduced it.
The quick fix would probably be to say
export TF_CONFIG_TIME="$(date)"in configure.py and add it to theenvironlist in git_configure.bzl.The best fix might be to not call
repository_ctx.execute()insidegit_configure. Instead, consider having it only create symlinks (e.g. branch_ref, head) and then generate a BUILD file with a genrule that cats them into spec.json.yongtang commentedon Jan 17, 2018
@jart @case540 I added a PR #16196 to take a quick fix as suggested. Please take a look.