Skip to content

Switching branch and run ./configure does not regenerate spec.json #15957

Closed

Description

@yongtang

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_package

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

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

  1. added
    stat:awaiting tensorflower
    type:build/install
    on Jan 11, 2018
  2. shivaniag commented on Jan 11, 2018

    @shivaniag
    Contributor

    @jart could you take a look at this?

  3. assigned and unassigned on Jan 11, 2018
  4. removed
    stat:awaiting tensorflower
    on Jan 11, 2018
  5. jart commented on Jan 11, 2018

    @jart
    Contributor

    @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 the environ list in git_configure.bzl.

    The best fix might be to not call repository_ctx.execute() inside git_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.

  6. yongtang commented on Jan 17, 2018

    @yongtang
    MemberAuthor

    @jart @case540 I added a PR #16196 to take a quick fix as suggested. Please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type:build/install

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions