Search code examples
tensorflowbazel

How can I find the build-dest-position of a cc file


For example common_shape_fns_test.cc, I search this string and find it in the BUILD file , then I search tf_cc_tests . At last I can't find any hint.

I want to run it directly and debug it , so I need to find the position.


Solution

  • If you're looking for the location of the binary Bazel built, it will be printed in Bazel's output, e.g.,

    $ bazel build //foo/bar:baz
    ...
    Target //foo/bar:baz up-to-date:
      bazel-bin/foo/bar/baz
    

    bazel-bin/foo/bar/baz is the build output.

    In general, though, you can always find the output file when you know the BUILD file that generated it. If the BUILD file is tensorflow/core/BUILD, then the output will be under bazel-bin/tensorflow/core (or, if it's a genrule, bazel-genfiles/tensorflow/core).