Fails to build tf-opt with llvm-project repository override
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/59946">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/59946">No</a>

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

Build/Install

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

Yes

### Source

source

### Tensorflow Version

2.9

### Custom Code

Yes

### OS Platform and Distribution

mac(M2)

### Mobile device

_No response_

### Python version

3.9.16

### Bazel version

5.3.0

### GCC/Compiler version

15.0.5 (llvm version)

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

```shell
I want to build the tf-opt and tf-mlir-translate

I followed the steps given in the [readme](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/compiler/mlir), and roll back the version of llvm-project to [corresponding version](https://github.com/tensorflow/tensorflow/tree/master/third_party/llvm).

I got Error output below:

when build tf-opt:
cannot load '@llvm-project//:vars.bzl': no such file and referenced by '@llvm-project//mlir:Transforms'

when build tf-mlir-translate:
 cannot load '@llvm-project//:vars.bzl': no such file and referenced by '//tensorflow/compiler/mlir:tf-mlir-translate'
```


### Standalone code to reproduce the issue

```shell
LLVM_SRC=/Volumes/back/mlir_project/llvm-project
LLVM_BAZEL_OVERLAY=${LLVM_SRC}/bazel # Note: this can be anywhere
mkdir -p ${LLVM_BAZEL_OVERLAY}
# This will symlink your LLVM sources with the BUILD files to be usable by Bazel.
python ${LLVM_SRC}/utils/bazel/overlay_directories.py \
    --src ${LLVM_SRC} \
    --overlay ${LLVM_SRC}/utils/bazel/llvm-project-overlay/ \
    --target ${LLVM_BAZEL_OVERLAY}
touch ${LLVM_BAZEL_OVERLAY}/BUILD.bazel ${LLVM_BAZEL_OVERLAY}/WORKSPACE
echo 'llvm_targets = ["X86","NVPTX","AMDGPU","AArch64","ARM"]' > ${LLVM_BAZEL_OVERLAY}/llvm/targets.bzl
```


### Relevant log output

```shell
ERROR: /private/var/tmp/_bazel_isolateya/af219aaee912b96bcf0876417404d886/external/llvm-project/mlir/BUILD.bazel:5904:11: error loading package '@llvm-project//llvm': at /private/var/tmp/_bazel_isolateya/af219aaee912b96bcf0876417404d886/external/llvm-project/llvm/config.bzl:8:5: cannot load '@llvm-project//:vars.bzl': no such file and referenced by '@llvm-project//mlir:Transforms'
ERROR: Analysis of target '//tensorflow/compiler/mlir:tf-opt' failed; build aborted: 
INFO: Elapsed time: 38.684s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (122 packages loaded, 463 targets \
configured)
    currently loading: @com_google_protobuf// ... (4 packages)
    Fetching https://storage.googleapis.com/.../nsync/archive/1.25.0.tar.gz
    Fetching https://storage.googleapis.com/.../archive/v2.0.6.tar.gz
    Fetching https://storage.googleapis.com/...65082ee350509af1d113344d.tar.gz

```shell
ERROR: /Volumes/back/mlir_project/tensorflow/tensorflow/compiler/mlir/BUILD:219:13: error loading package '@llvm-project//llvm': at /private/var/tmp/_bazel_isolateya/af219aaee912b96bcf0876417404d886/external/llvm-project/llvm/config.bzl:8:5: cannot load '@llvm-project//:vars.bzl': no such file and referenced by '//tensorflow/compiler/mlir:tf-mlir-translate'
ERROR: Analysis of target '//tensorflow/compiler/mlir:tf-mlir-translate' failed; build aborted: Analysis failed
INFO: Elapsed time: 27.395s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (54 packages loaded, 247 targets configured)
    currently loading: @llvm-project//llvm
    Fetching @local_config_cc; Building xcode-locator
    Fetching https://storage.googleapis.com/.../abseil-cpp/archive/273292d1cfc0a94a65082ee350509af1d113344d.tar.gz
```
```
</details>