diff --git a/.bazelrc b/.bazelrc index 1908f956f517b16e0808d23909fc3bfe1a206f07..83dcc15bcf144e758b8630f4a4c9057c1de0d05a 100644 --- a/.bazelrc +++ b/.bazelrc @@ -98,7 +98,7 @@ # nothing in a bazelrc will default to a monolithic build. The following line # opts in to modular op registration support by default. build --define framework_shared_object=true -build --define tsl_link_protobuf=false +build --define tsl_protobuf_header_only=true build --define=use_fast_cpp_protos=true build --define=allow_oversize_protos=true @@ -210,7 +210,7 @@ build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64 # By default, TensorFlow will build with a dependence on # //tensorflow:libtensorflow_framework.so. build:monolithic --define framework_shared_object=false -build:monolithic --define tsl_link_protobuf=true +build:monolithic --define tsl_protobuf_header_only=false build:monolithic --experimental_link_static_libraries_once=false # b/229868128 # Please note that MKL on MacOS or windows is still not supported. diff --git a/tensorflow/tsl/BUILD b/tensorflow/tsl/BUILD index 3e854579375daac46a61e3d940dfb429d096bbee..c1a33873a18624325e27aeaf219be295e645cfca 100644 --- a/tensorflow/tsl/BUILD +++ b/tensorflow/tsl/BUILD @@ -48,8 +48,8 @@ config_setting( # This should be removed after Tensorflow moves to cc_shared_library config_setting( - name = "tsl_link_protobuf", - define_values = {"tsl_link_protobuf": "true"}, + name = "tsl_protobuf_header_only", + define_values = {"tsl_protobuf_header_only": "true"}, visibility = ["//visibility:public"], ) diff --git a/tensorflow/tsl/platform/default/build_config.bzl b/tensorflow/tsl/platform/default/build_config.bzl index 7ecca9f99ad05c3d7f723152d024eecd07185cc9..7b2074f6fd39d47fc51de2e64e396cd1c65110b3 100644 --- a/tensorflow/tsl/platform/default/build_config.bzl +++ b/tensorflow/tsl/platform/default/build_config.bzl @@ -807,7 +807,7 @@ def tf_protobuf_deps(): def tsl_protobuf_deps(): return if_tsl_link_protobuf([clean_dep("@com_google_protobuf//:protobuf")], [clean_dep("@com_google_protobuf//:protobuf_headers")]) -# When tsl_link_protobuf is false, we need to add the protobuf library +# When tsl_protobuf_header_only is true, we need to add the protobuf library # back into our binaries explicitly. def tsl_cc_test( name, diff --git a/tensorflow/tsl/tsl.bzl b/tensorflow/tsl/tsl.bzl index 198a31b4e5fd69697ae1ccaf4ff75c8a419f6219..ad5e098f914ef4bb111ad52d85af421bf39a2656 100644 --- a/tensorflow/tsl/tsl.bzl +++ b/tensorflow/tsl/tsl.bzl @@ -57,8 +57,8 @@ def if_google(google_value, oss_value = []): def if_tsl_link_protobuf(if_true, if_false = []): return select({ - clean_dep("//tensorflow/tsl:tsl_link_protobuf"): if_true, - "//conditions:default": if_false, + "//conditions:default": if_true, + clean_dep("//tensorflow/tsl:tsl_protobuf_header_only"): if_false, }) def if_libtpu(if_true, if_false = []):