Target 'build_pip_package' no longer existing?
This has been removed with recent refactoring. I think @georgiyekkert can help here with the new way to build The new target (at HEAD) is ` //tensorflow/tools/pip_package:wheel`. It's a somewhat more efficient way of building the wheel  
At 2.16, it's `//tensorflow/tools/pip_package/v2:wheel`


The build command might now look something like
```
bazel build --repo_env=TF_PYTHON_VERSION=3.11 --config release_cpu_linux  //tensorflow/tools/pip_package/v2:wheel --repo_env=WHEEL_NAME=tf_nightly
```
See https://github.com/tensorflow/tensorflow/commit/d52ee229e5e87233e6c5352db8ff4b271cbc0d4c for more relevant details

 @vladbelit , i cant seem to find v2 inside pip_package while building. I tried after pulling from master and r2.15

ERROR: no such package 'tensorflow/tools/pip_package/v2': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /home/administrator/tensorinstall/tensorflow/tensorflow/tensorflow/tools/pip_package/v2 Indeed, same error as sumanth1989:

`ERROR: no such package 'tensorflow/tools/pip_package/v2': BUILD file not found in any of the following directories. `
 @waarmond  i could clear this error but it fails while building the pip package. If you want to clear this error do the following :

"/home/administrator/tensorinstall/tensorflow/tensorflow/tools/pip_package/BUILD" file.
i changed the following lines after which the package built succesfully
# changed the name from "build_pip_package_py" to "build_pip_package"
py_binary(
name = "build_pip_package", 
srcs = ["build_pip_package.py"],
main = "build_pip_package.py", If you are building the nightly CPU wheel from master HEAD, please run:

`bazel build --repo_env=TF_PYTHON_VERSION=3.11  //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tf_nightly`

I have updated instructions but it takes time for them to propagate. I will post here once https://www.tensorflow.org/install/source is updated.  @georgiyekkert  it still doesnt work for me, i have tried with bazel 6.1.0 ,6.5.0 ,7.0.2. I get different errors depending on the bazel version. Btw i am trying to build for GPU

Can you tell me which version you are using ?
Im doing bazel 7.0.2 , cuda 12.2 , cudnn 8.9, python3.10 @sumanth1989 You should always use the version from https://github.com/tensorflow/tensorflow/blob/master/.bazelversion Using the correct bazel version mentioned in .bazelversion (6.5.0) it still didnt work

Error while using clang 17 below 
```
INFO: Analyzed target //tensorflow/tools/pip_package:wheel (718 packages loaded, 51809 targets configured).
INFO: Found 1 target...
ERROR: /home/administrator/.cache/bazel/_bazel_administrator/38c227b95c25a75c2f31c75458f8f9be/external/com_google_absl/absl/log/internal/BUILD.bazel:227:11: Compiling absl/log/internal/nullguard.cc failed: (Exit 1): clang failed: error executing command (from target @com_google_absl//absl/log/internal:nullguard) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt/bin/external/com_google_absl/absl/log/internal/_objs/nullguard/nullguard.pic.d ... (remaining 78 arguments skipped)
clang: warning: argument unused during compilation: '--cuda-path=/usr/local/cuda-12.2' [-Wunused-command-line-argument]
In file included from external/com_google_absl/absl/log/internal/nullguard.cc:15:
external/com_google_absl/absl/log/internal/nullguard.h:27:10: fatal error: 'array' file not found
   27 | #include <array>
      |          ^~~~~~~
1 error generated.
ERROR: /home/administrator/.cache/bazel/_bazel_administrator/38c227b95c25a75c2f31c75458f8f9be/external/llvm-project/llvm/BUILD.bazel:191:11: Compiling llvm/lib/Demangle/MicrosoftDemangleNodes.cpp failed: (Exit 1): clang failed: error executing command (from target @llvm-project//llvm:Demangle) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt/bin/external/llvm-project/llvm/_objs/Demangle/MicrosoftDemangleNodes.pic.d ... (remaining 86 arguments skipped)
clang: warning: argument unused during compilation: '--cuda-path=/usr/local/cuda-12.2' [-Wunused-command-line-argument]
In file included from external/llvm-project/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp:13:
external/llvm-project/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h:16:10: fatal error: 'array' file not found
   16 | #include <array>
      |          ^~~~~~~
1 error generated.
ERROR: /home/administrator/.cache/bazel/_bazel_administrator/38c227b95c25a75c2f31c75458f8f9be/external/llvm-project/llvm/BUILD.bazel:191:11: Compiling llvm/lib/Demangle/RustDemangle.cpp [for tool] failed: (Exit 1): clang failed: error executing command (from target @llvm-project//llvm:Demangle) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt-exec-50AE0418/bin/external/llvm-project/llvm/_objs/Demangle/RustDemangle.d ... (remaining 76 arguments skipped)
In file included from external/llvm-project/llvm/lib/Demangle/RustDemangle.cpp:14:
external/llvm-project/llvm/include/llvm/Demangle/Demangle.h:12:10: fatal error: 'cstddef' file not found
   12 | #include <cstddef>
      |          ^~~~~~~~~
1 error generated.
ERROR: /home/administrator/.cache/bazel/_bazel_administrator/38c227b95c25a75c2f31c75458f8f9be/external/highwayhash/BUILD.bazel:40:11: Compiling highwayhash/arch_specific.cc failed: (Exit 1): clang failed: error executing command (from target @highwayhash//:arch_specific) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt/bin/external/highwayhash/_objs/arch_specific/arch_specific.pic.d ... (remaining 43 arguments skipped)
clang: warning: argument unused during compilation: '--cuda-path=/usr/local/cuda-12.2' [-Wunused-command-line-argument]
external/highwayhash/highwayhash/arch_specific.cc:35:10: fatal error: 'string' file not found
   35 | #include <string>
      |          ^~~~~~~~
1 error generated.
ERROR: /home/administrator/.cache/bazel/_bazel_administrator/38c227b95c25a75c2f31c75458f8f9be/external/com_google_absl/absl/base/BUILD.bazel:77:11: Compiling absl/base/internal/raw_logging.cc failed: (Exit 1): clang failed: error executing command (from target @com_google_absl//absl/base:raw_logging_internal) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt/bin/external/com_google_absl/absl/base/_objs/raw_logging_internal/raw_logging.pic.d ... (remaining 78 arguments skipped)
clang: warning: argument unused during compilation: '--cuda-path=/usr/local/cuda-12.2' [-Wunused-command-line-argument]
In file included from external/com_google_absl/absl/base/internal/raw_logging.cc:15:
external/com_google_absl/absl/base/internal/raw_logging.h:22:10: fatal error: 'string' file not found
   22 | #include <string>
      |          ^~~~~~~~
1 error generated.
ERROR: /home/administrator/tensorinstall/tensorflow/tensorflow/lite/kernels/internal/BUILD:545:11: Compiling tensorflow/lite/kernels/internal/quantization_util.cc failed: (Exit 1): clang failed: error executing command (from target //tensorflow/lite/kernels/internal:quantization_util) /usr/lib/llvm-17/bin/clang -MD -MF bazel-out/k8-opt/bin/tensorflow/lite/kernels/internal/_objs/quantization_util/quantization_util.pic.d ... (remaining 48 arguments skipped)
clang: warning: argument unused during compilation: '--cuda-path=/usr/local/cuda-12.2' [-Wunused-command-line-argument]
In file included from tensorflow/lite/kernels/internal/quantization_util.cc:16:
./tensorflow/lite/kernels/internal/quantization_util.h:18:10: fatal error: 'cmath' file not found
   18 | #include <cmath>
      |          ^~~~~~~
1 error generated.
Target //tensorflow/tools/pip_package:wheel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 16.935s, Critical Path: 1.31s
INFO: 393 processes: 354 internal, 39 local.
FAILED: Build did NOT complete successfully

Error while using GCC

ERROR: /home/administrator/tensorinstall/tensorflow/tensorflow/compiler/mlir/quantization/stablehlo/BUILD:46:11: Compiling tensorflow/compiler/mlir/quantization/stablehlo/passes/nchw_convolution_to_nhwc.cc failed: (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command (from target //tensorflow/compiler/mlir/quantization/stablehlo:passes) external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF ... (remaining 633 arguments skipped)
tensorflow/compiler/mlir/quantization/stablehlo/passes/nchw_convolution_to_nhwc.cc: In member function ‘llvm::SmallVector<long int> mlir::quant::stablehlo::{anonymous}::RewriteNchwConvolutionToNhwc::PermuteShape(llvm::ArrayRef<long int>, llvm::ArrayRef<long int>) const’:
tensorflow/compiler/mlir/quantization/stablehlo/passes/nchw_convolution_to_nhwc.cc:199: error: could not convert ‘after_shape’ from ‘SmallVector<[...],4>’ to ‘SmallVector<[...],6>’
  199 |     return after_shape;
      | 
Target //tensorflow/tools/pip_package:wheel failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/administrator/tensorinstall/tensorflow/tensorflow/tools/pip_package/BUILD:265:9 Action tensorflow/tools/pip_package/wheel_house failed: (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command (from target //tensorflow/compiler/mlir/quantization/stablehlo:passes) external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF ... (remaining 633 arguments skipped)
INFO: Elapsed time: 630.573s, Critical Path: 362.42s
INFO: 34839 processes: 9006 internal, 25833 local.
FAILED: Build did NOT complete successfully
``` The new installation guide of @georgiyekkert worked for me  @waarmond Kindly double-check the target name you're using. The error message suggests "build_pip_package.py" might exist. Could you ensure you're using the correct target name with a colon (":") separating the package and the target: `//tensorflow/tools/pip_package:build_pip_package.`
Please follow the official TensorFlow installation guide for building from source: https://www.tensorflow.org/install/source.
Thank you! > @waarmond Kindly double-check the target name you're using. The error message suggests "build_pip_package.py" might exist. Could you ensure you're using the correct target name with a colon (":") separating the package and the target: `//tensorflow/tools/pip_package:build_pip_package.` Please follow the official TensorFlow installation guide for building from source: https://www.tensorflow.org/install/source. Thank you!

The `build_pip_package` target no longer exists. Following the newly updated doc is a good idea, however - https://www.tensorflow.org/install/source 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. The new build from source guide seems to be correct, but I can't finish a successful build with onednn 3.x: https://github.com/tensorflow/tensorflow/issues/64518 @waarmond Thank you for your response!
Could you please confirm if we can close this issue as the build from the source guide looks good to you. So that we will track the new ticket?
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/63298">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/63298">No</a>

### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

git > 2.16.1

### Custom code

No

### OS platform and distribution

ArchLinux

### Mobile device

_No response_

### Python version

3.10

### Bazel version

7.0.2 (also tried 5.3.2)

### GCC/compiler version

13.2.1

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

`build_pip_package  ERROR: no such target '//tensorflow/tools/pip_package:build_pip_package': target 'build_pip_package' not declared in package 'tensorflow/tools/pip_package' defined by ./tensorflow/src/tensorflow/tensorflow/tools/pip_package/BUILD (did you mean 'build_pip_package.py'? Tip: use `query "//tensorflow/tools/pip_package:*"` to see all the targets in that package)`

### Standalone code to reproduce the issue

I've tried to compile current git of TensorFlow (near to 2.16.1) with the same PKGBUILD from ArchLinux which is still at 2.15.0 :
https://gitlab.archlinux.org/archlinux/packaging/packages/tensorflow/-/blob/main/PKGBUILD?ref_type=heads
```shell
[..]
  ./configure
  bazel \
    build ${BAZEL_ARGS[@]} \
      //tensorflow:libtensorflow.so \
      //tensorflow:libtensorflow_cc.so \
      //tensorflow:install_headers \
      //tensorflow/tools/pip_package:build_pip_package
  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmp
```


### Relevant log output

_No response_