Error "Genrules without outputs don't make sense" when building the package builder for building TF from source
@berrylizzard,
Tensorflow v2.12 is compatible with the python 3.8-3.1, GCC -9.3.1, Bazel - 5.3.0, cuDNN 8.6, CUDA 11.8 which are mentioned on the official tensorflow document. 
https://www.tensorflow.org/install/source#gpu

Could you please try with the tested build configurations and let us know if the installation was completed. Thank you!


 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60588">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60588">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Build/Install

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

r2.12

### Custom Code

No

### OS Platform and Distribution

Linux Ubuntu 22.04

### Mobile device

_No response_

### Python version

3.9

### Bazel version

5.3.0

### GCC/Compiler version

11.3.0

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

FYI this looks similar to https://github.com/tensorflow/tensorflow/issues/12008, but that issue has been abandoned in 2018 hence I am creating a new one.

When following this [guide](https://www.tensorflow.org/install/source#setup_for_linux_and_macos) on building TensorFlow from source, I first encountered error like in https://github.com/tensorflow/tensorflow/issues/57761 and the solution described there (adding the `--define=no_tensorflow_py_deps=true`) helped get past it. 


Now I am encountering error "Genrules without outputs don't make sense" when trying to build the package builder with bazel. Included below are commands I run (just like in the guide) and their output.

What actions can I take to resolve this error? I have tried to `bazel clean --expunge`, `rm -rf tensorflow`, and start again with steps provided in the guide with no success. Any pointers are appreciated. Thanks.

### Standalone code to reproduce the issue

```shell
(N/A since I'm not running any special code, just trying to build/install TF)
```


### Relevant log output

```shell
(py3.9_openvino_env) user@userPC:~/Downloads$ git clone https://github.com/tensorflow/tensorflow.git
Cloning into 'tensorflow'...
remote: Enumerating objects: 1575336, done.
remote: Counting objects: 100% (1575336/1575336), done.
remote: Compressing objects: 100% (282486/282486), done.
remote: Total 1575336 (delta 1278490), reused 1575252 (delta 1278412), pack-reused 0
Receiving objects: 100% (1575336/1575336), 961.31 MiB | 13.81 MiB/s, done.
Resolving deltas: 100% (1278490/1278490), done.
Updating files: 100% (29704/29704), done.
(py3.9_openvino_env) user@userPC:~/Downloads$ cd tensorflow/
(py3.9_openvino_env) user@userPC:~/Downloads/tensorflow$ git checkout r2.12
Updating files: 100% (6855/6855), done.
Branch 'r2.12' set up to track remote branch 'r2.12' from 'origin'.
Switched to a new branch 'r2.12'
(py3.9_openvino_env) user@userPC:~/Downloads/tensorflow$ ./configure
You have bazel 5.3.0 installed.
Please specify the location of python. [Default is /home/user/py3.9_openvino_env/bin/python3]:


Found possible Python library paths:
  /home/user/py3.9_openvino_env/lib/python3.9/site-packages
Please input the desired Python library path to use.  Default is [/home/user/py3.9_openvino_env/lib/python3.9/site-packages]

Do you wish to build TensorFlow with ROCm support? [y/N]: n
No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: n
No CUDA support will be enabled for TensorFlow.

Do you wish to download a fresh release of clang? (Experimental) [y/N]: n
Clang will not be downloaded.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]:


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl            # Build with MKL support.
        --config=mkl_aarch64    # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
        --config=monolithic     # Config for mostly static monolithic build.
        --config=numa           # Build with NUMA support.
        --config=dynamic_kernels        # (Experimental) Build kernels into separate shared objects.
        --config=v1             # Build with TensorFlow 1 API instead of TF 2 API.
Preconfigured Bazel build configs to DISABLE default on features:
        --config=nogcp          # Disable GCP support.
        --config=nonccl         # Disable NVIDIA NCCL support.
Configuration finished
(py3.9_openvino_env) user@userPC:~/Downloads/tensorflow$ bazel build --define=no_tensorflow_py_deps=true //tensorflow/tools/pip_package:build_pip_package
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=176
INFO: Reading rc options for 'build' from /home/user/Downloads/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /home/user/Downloads/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /home/user/Downloads/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/home/user/py3.9_openvino_env/bin/python3 --action_env PYTHON_LIB_PATH=/home/user/py3.9_openvino_env/lib/python3.9/site-packages --python_path=/home/user/py3.9_openvino_env/bin/python3
INFO: Reading rc options for 'build' from /home/user/Downloads/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /home/user/Downloads/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /home/user/Downloads/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:linux in file /home/user/Downloads/tensorflow/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --config=dynamic_kernels --distinct_host_configuration=false --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /home/user/Downloads/tensorflow/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
ERROR: /home/user/.cache/bazel/_bazel_user/4f29e91194527f9a06235ff817954d09/external/local_config_python/BUILD:78:8: in outs attribute of genrule rule @local_config_python//:python_include: Genrules without outputs don't make sense
ERROR: /home/user/.cache/bazel/_bazel_user/4f29e91194527f9a06235ff817954d09/external/local_config_python/BUILD:78:8: Analysis of target '@local_config_python//:python_include' failed
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted:
INFO: Elapsed time: 52.246s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (371 packages loaded, 5088 targets configured)
(py3.9_openvino_env) user@userPC:~/Downloads/tensorflow$
```
</details>