Skip to content

Commit aff7310

Browse files
committed
Fix warnings "target is both a rule and a file"
Bazel 6.5.0 complains about ``` (04:17:26) WARNING: ..../external/local_config_tf/BUILD:8216:8: target 'libtensorflow_framework.so' is both a rule and a file; please choose another name for the rule (04:17:26) WARNING: ..../external/local_config_tf/BUILD:8226:8: target 'test_log_pb2.py' is both a rule and a file; please choose another name for the rule ``` (Note: I elided the long pathnames in the messages above by replacing them with '....'.) The warnings come from definitions in `third_party/tf/tf_configure.bzl` where the names of a couple of rules are `libtensorflow_framework.so` and `test_log_pb2.py`. Changing the names to `libtensorflow_framework_so` and `test_log_pb2_py` resolves the problem. Other names are possible, of course, but those seem like good choices in order to keep their meanings clear.
1 parent 605d282 commit aff7310

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

third_party/tf/tf_configure.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def _tf_pip_impl(repository_ctx):
195195
repository_ctx,
196196
None,
197197
"",
198-
"libtensorflow_framework.so",
198+
"libtensorflow_framework_so",
199199
[tf_shared_library_path],
200200
["_pywrap_tensorflow_internal.lib" if _is_windows(repository_ctx) else "libtensorflow_framework.so"],
201201
)
@@ -206,7 +206,7 @@ def _tf_pip_impl(repository_ctx):
206206
repository_ctx,
207207
None,
208208
"",
209-
"test_log_pb2.py",
209+
"test_log_pb2_py",
210210
[tf_test_log_proto_path],
211211
["test_log_pb2.py"],
212212
)

0 commit comments

Comments
 (0)