Skip to content

Commit

Permalink
Reverts "Migrates _pywrap_py_exception_registry to cc_shared_library."
Browse files Browse the repository at this point in the history
Migrates the implementation of _pywrap_py_exception_registry from cc_shared_library back to the cc_binary version. Removes the extra shared object that the cc_shared_library implementation adds to the runfiles directory which caused the pip package size increase.

PiperOrigin-RevId: 450567030
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed May 24, 2022
1 parent 61dfa8c commit 4c23813
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tensorflow/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ":platform" - Low-level and platform-specific Python code.

load("//tensorflow:tensorflow.bzl", "py_strict_library")
load("//tensorflow:tensorflow.bzl", "cc_header_only_library", "if_mlir", "if_windows", "if_xla_available", "py_test", "tf_enable_mlir_bridge", "tf_python_pybind_static_deps")
load("//tensorflow:tensorflow.bzl", "cc_header_only_library", "if_mlir", "if_windows", "if_xla_available", "py_test", "tf_enable_mlir_bridge")

# buildifier: disable=same-origin-load
load("//tensorflow:tensorflow.bzl", "get_compatible_with_portable")
Expand Down Expand Up @@ -383,7 +383,8 @@ tf_python_pybind_extension(
"//tensorflow/c/eager:headers",
"//tensorflow/python/lib/core:py_exception_registry_hdr",
],
static_deps = tf_python_pybind_static_deps(),
# TODO(rostam): Why does enabling cc_shared_library bloat the pip package?
# static_deps = tf_python_pybind_static_deps(),
deps = [
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/platform:status",
Expand Down
4 changes: 0 additions & 4 deletions tensorflow/tools/pip_package/build_pip_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ function prepare_src() {
cp -LR \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
"${TMPDIR}"
# Prevents pip package bloat. See b/228948031#comment17.
rm -f "${TMPDIR}/tensorflow/python/lib_pywrap_tensorflow_internal.*"
cp_external \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/external \
"${EXTERNAL_INCLUDES}"
Expand All @@ -185,8 +183,6 @@ function prepare_src() {
cp -LR \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles/org_tensorflow/tensorflow \
"${TMPDIR}"
# Prevents pip package bloat. See b/228948031#comment17.
rm -f "${TMPDIR}/tensorflow/python/lib_pywrap_tensorflow_internal.*"
cp_external \
bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles \
"${EXTERNAL_INCLUDES}"
Expand Down

0 comments on commit 4c23813

Please sign in to comment.