<p dir="auto">If I try to configure the lastest master branch (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/db45268db0203fcdb0e48e3e558b01244424c0a6/hovercard" href="https://github.com/tensorflow/tensorflow/commit/db45268db0203fcdb0e48e3e558b01244424c0a6"><tt>db45268</tt></a>) using Bazel 0.3.0, I get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: [...]/tensorflow/tensorflow/tensorflow.bzl:568:26: Traceback (most recent call last):
        File &quot;[...]/tensorflow/tensorflow/tensorflow.bzl&quot;, line 562
                rule(attrs = {&quot;srcs&quot;: attr.label_list...&quot;), &lt;3 more arguments&gt;)}, &lt;2 more arguments&gt;)
        File &quot;[...]/tensorflow/tensorflow/tensorflow.bzl&quot;, line 568, in rule
                attr.label_list(cfg = &quot;data&quot;, allow_files = True)
expected ConfigurationTransition or NoneType for 'cfg' while calling label_list but got string instead: data.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'tensorflow/tensorflow.bzl' has errors."><pre class="notranslate"><code class="notranslate">ERROR: [...]/tensorflow/tensorflow/tensorflow.bzl:568:26: Traceback (most recent call last):
        File "[...]/tensorflow/tensorflow/tensorflow.bzl", line 562
                rule(attrs = {"srcs": attr.label_list..."), &lt;3 more arguments&gt;)}, &lt;2 more arguments&gt;)
        File "[...]/tensorflow/tensorflow/tensorflow.bzl", line 568, in rule
                attr.label_list(cfg = "data", allow_files = True)
expected ConfigurationTransition or NoneType for 'cfg' while calling label_list but got string instead: data.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'tensorflow/tensorflow.bzl' has errors.
</code></pre></div>
<p dir="auto">Using 0.3.1 avoids this and reverting the offending commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/7bcdcbbf60fc08346fd8016270a0563f4b51362b/hovercard" href="https://github.com/tensorflow/tensorflow/commit/7bcdcbbf60fc08346fd8016270a0563f4b51362b"><tt>7bcdcbb</tt></a> also fixes it.</p>
<h3 dir="auto">Environment info</h3>
<p dir="auto">Setup: CentOS, Bazel 0.3.0, CUDA 7.5, CuDNN 5.1, Tensorflow master (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/db45268db0203fcdb0e48e3e558b01244424c0a6/hovercard" href="https://github.com/tensorflow/tensorflow/commit/db45268db0203fcdb0e48e3e558b01244424c0a6"><tt>db45268</tt></a>)</p>
<p dir="auto">I run <code class="notranslate">configure</code> and set it up for GPU support. I see the error above if I use bazel 0.3.0.</p>
<h3 dir="auto">Fix</h3>
<p dir="auto">Upgrade to 0.3.1, obviously. However, since 0.3.0 is still officially supported, I thought this deserves to be an issue.</p>
<p dir="auto">Another fix is to revert the commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/tensorflow/tensorflow/commit/7bcdcbbf60fc08346fd8016270a0563f4b51362b/hovercard" href="https://github.com/tensorflow/tensorflow/commit/7bcdcbbf60fc08346fd8016270a0563f4b51362b"><tt>7bcdcbb</tt></a>. Note, I didn't have to revert to its parent; undoing that commit alone is enough:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git show -R 7bcdcbbf | git apply"><pre class="notranslate"><code class="notranslate">git show -R 7bcdcbbf | git apply
</code></pre></div>
<p dir="auto">I am trying to build and install tensorflow from source. However when building with bazel it returns an error stating Extension file 'tensorflow/tensorflow.bzl' has errors.</p>
<p dir="auto">Here are the commands that I ran and the logs are included.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
mkvirtualenv tensorflow_dev
brew install bazel swig
workon tensorflow_dev
pip install six numpy wheel ipython
export TF_DIR=/Users/shashank/Documents/repositories/tensorflow
cd /Users/shashank/Documents/repositories/
git clone git@github.com:tensorflow/tensorflow.git
cd $TF_DIR &amp;&amp; ./configure

~/Documents/repositories/tensorflow ~/Documents/repositories/tensorflow
Please specify the location of python. [Default is /Users/shashank/.virtualenvs/tensorflow_dev/bin/python]:
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N]
No Google Cloud Platform support will be enabled for TensorFlow
Found possible Python library paths:
  /Users/shashank/Documents/py_config/
  /Users/shashank/.virtualenvs/tensorflow_dev/lib/python2.7/site-packages
Please input the desired Python library path to use.  Default is [/Users/shashank/Documents/py_config/]

/Users/shashank/Documents/py_config/
Do you wish to build TensorFlow with GPU support? [y/N]
No GPU support will be enabled for TensorFlow
Configuration finished

cd $TF_DIR &amp;&amp; bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: /Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl:568:26: Traceback (most recent call last):
        File &quot;/Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl&quot;, line 562
            rule(attrs = {&quot;srcs&quot;: attr.label_list...&quot;), &lt;3 more arguments&gt;)}, &lt;2 more arguments&gt;)
        File &quot;/Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl&quot;, line 568, in rule
            attr.label_list(cfg = &quot;data&quot;, allow_files = True)
expected ConfigurationTransition or NoneType for 'cfg' while calling label_list but got string instead: data.
ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'tensorflow/tensorflow.bzl' has errors.
INFO: Elapsed time: 0.063s"><pre class="notranslate">mkvirtualenv tensorflow_dev
brew install bazel swig
workon tensorflow_dev
pip install six numpy wheel ipython
<span class="pl-k">export</span> TF_DIR=/Users/shashank/Documents/repositories/tensorflow
<span class="pl-c1">cd</span> /Users/shashank/Documents/repositories/
git clone git@github.com:tensorflow/tensorflow.git
<span class="pl-c1">cd</span> <span class="pl-smi">$TF_DIR</span> <span class="pl-k">&amp;&amp;</span> ./configure

<span class="pl-k">~</span>/Documents/repositories/tensorflow <span class="pl-k">~</span>/Documents/repositories/tensorflow
Please specify the location of python. [Default is /Users/shashank/.virtualenvs/tensorflow_dev/bin/python]:
Do you wish to build TensorFlow with Google Cloud Platform support<span class="pl-k">?</span> [y/N]
No Google Cloud Platform support will be enabled <span class="pl-k">for</span> TensorFlow
Found possible Python library paths:
  /Users/shashank/Documents/py_config/
  /Users/shashank/.virtualenvs/tensorflow_dev/lib/python2.7/site-packages
Please input the desired Python library path to use.  Default is [/Users/shashank/Documents/py_config/]

/Users/shashank/Documents/py_config/
Do you wish to build TensorFlow with GPU support<span class="pl-k">?</span> [y/N]
No GPU support will be enabled <span class="pl-k">for</span> TensorFlow
Configuration finished

<span class="pl-c1">cd</span> <span class="pl-smi">$TF_DIR</span> <span class="pl-k">&amp;&amp;</span> bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
ERROR: /Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl:568:26: Traceback (most recent call last):
        File <span class="pl-s"><span class="pl-pds">"</span>/Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl<span class="pl-pds">"</span></span>, line 562
            rule(attrs = {<span class="pl-s"><span class="pl-pds">"</span>srcs<span class="pl-pds">"</span></span>: attr.label_list...<span class="pl-s"><span class="pl-pds">"</span>), &lt;3 more arguments&gt;)}, &lt;2 more arguments&gt;)</span>
<span class="pl-s">        File <span class="pl-pds">"</span></span>/Users/shashank/Documents/repositories/tensorflow/tensorflow/tensorflow.bzl<span class="pl-s"><span class="pl-pds">"</span>, line 568, in rule</span>
<span class="pl-s">            attr.label_list(cfg = <span class="pl-pds">"</span></span>data<span class="pl-s"><span class="pl-pds">"</span>, allow_files = True)</span>
<span class="pl-s">expected ConfigurationTransition or NoneType for 'cfg' while calling label_list but got string instead: data.</span>
<span class="pl-s">ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'tensorflow/tensorflow.bzl' has errors.</span>
<span class="pl-s">INFO: Elapsed time: 0.063s</span></pre></div>
<p dir="auto">Thanks for your help</p>