bazel query "deps(//external:local_config_python)" shows error like this:
ERROR: /home/mingzhao/g/tensorflow/WORKSPACE:19:14: every rule of type python_configure implicitly depends upon the target '@com_github_grpc_grpc//third_party/py:BUILD.tpl', but this target could not be found because of: no such target '@com_github_grpc_grpc//third_party/py:BUILD.tpl': target 'BUILD.tpl' not declared in package 'third_party/py'; however, a source file of this name exists. (Perhaps add 'exports_files(["BUILD.tpl"])' to third_party/py/BUILD?) defined by /home/mingzhao/.cache/bazel/_bazel_mingzhao/b8418b6d51a5e225bcc1359ca8cb25de/external/com_github_grpc_grpc/third_party/py/BUILD
ERROR: /home/mingzhao/g/tensorflow/WORKSPACE:19:14: every rule of type python_configure implicitly depends upon the target '@com_github_grpc_grpc//third_party/py:variety.tpl', but this target could not be found because of: no such target '@com_github_grpc_grpc//third_party/py:variety.tpl': target 'variety.tpl' not declared in package 'third_party/py'; however, a source file of this name exists. (Perhaps add 'exports_files(["variety.tpl"])' to third_party/py/BUILD?) defined by /home/mingzhao/.cache/bazel/_bazel_mingzhao/b8418b6d51a5e225bcc1359ca8cb25de/external/com_github_grpc_grpc/third_party/py/BUILD
ERROR: Evaluation of query "deps(//external:local_config_python)" failed: errors were encountered while computing transitive closure
After this fix:
bazel query "deps(//external:local_config_python)"
//external:local_config_python
@com_github_grpc_grpc//third_party/py:variety.tpl
@com_github_grpc_grpc//third_party/py:BUILD.tpl
Building gRPC Python with Bazel has been one of the long requested
additions to gRPC (#8079). Doing so had been made complex by the fact
that Bazel itself is still in active development.
There has been extensive work on building Cython code at tensorflow,
which can be reused for gRPC's purposes as well.
Major included changes required for building grpcio with Bazel are:
- Include Cython as a third party Bazel package, to compile the Cython
parts of gRPC Python.
- Include rules for Python autoconfiguration so Python headers can be
detected by cygrpc.