title: tensorflow: "trying to mutate a frozen object", bazel
body: <p>MacOS high sierra, MBP 2016, in terminal. </p>
  
  <p>I'm following the directions here:
  <a href="https://github.com/tensorflow/models/tree/master/research/syntaxnet" rel="nofollow noreferrer">https://github.com/tensorflow/models/tree/master/research/syntaxnet</a>
  All options for ./configure chosen as default (and all python directories double-checked.). All steps have completed cleanly until this:</p>
  
  <pre><code>bazel test ...
  # On Mac, run the following:
  bazel test --linkopt=-headerpad_max_install_names \
    dragnn/... syntaxnet/... util/utf8/...
  </code></pre>
  
  <p>I assume I'm supposed to run the latter line ("bazel test --linkopt" etc.).  But I get the same result either way, interestingly.</p>
  
  <p>This throws about 10 errors, each of the same type "trying to mutate a frozen object", and concludes tests not run, error loading package dragnn/protos, and couldn't start build.  </p>
  
  <p>This is the general form of the errors:</p>
  
  <blockquote>
    <p>syntaxnet>> bazel test --linkopt=-headerpad_max_install_names
    dragnn/... syntaxnet/... util/utf8/...</p>
    
    <p>.</p>
    
    <p>ERROR:
    /Users/XXX/Desktop/NLP/syntaxnet/models/research/syntaxnet/dragnn/protos/BUILD:35:1:
    Traceback (most recent call last): File
    "/Users/XXX/Desktop/NLP/syntaxnet/models/research/syntaxnet/dragnn/protos/BUILD",
    line 35 tf_proto_library_py(name = "data_py_pb2", srcs = ["dat..."])
    File
    "/Users/XXX/Desktop/NLP/syntaxnet/models/research/syntaxnet/syntaxnet/syntaxnet.bzl",
    line 53, in tf_proto_library_py py_proto_library(name = name, srcs =
    srcs, srcs_versi...", &lt;5 more arguments>) File
    "/private/var/tmp/_bazel_XXX/f74e5a21c3ad09aeb110d9de15110035/external/protobuf_archive/protobuf.bzl",
    line 374, in py_proto_library py_libs += [default_runtime] trying to
    mutate a frozen object ERROR: package contains errors: dragnn/protos</p>
  </blockquote>
  
  <hr>
  
  <p>... [same error for various 'name = "...pb2"' files] ...</p>
  
  <blockquote>
    <p>INFO: Elapsed time: 0.709s FAILED: Build did NOT complete successfully
    (17 packages loaded) ERROR: Couldn't start the build. Unable to run
    tests</p>
  </blockquote>
  
  <p>Any idea what could be doing this?  Thanks.</p>