tensorflow: Target 'build_pip_package' no longer existing?

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

[..]
  ./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

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

@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!

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.

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

@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

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