File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -209,19 +209,8 @@ build --announce_rc
209
209
# Other build flags.
210
210
build --define=grpc_no_ares=true
211
211
212
- # See https://github.com/bazelbuild/bazel/issues/7362 for information on what
213
- # --incompatible_remove_legacy_whole_archive flag does.
214
- # This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate
215
- # Tensorflow to the default, however test coverage wasn't enough to catch the
216
- # errors.
217
- # There is ongoing work on Bazel team's side to provide support for transitive
218
- # shared libraries. As part of migrating to transitive shared libraries, we
219
- # hope to provide a better mechanism for control over symbol exporting, and
220
- # then tackle this issue again.
221
- #
222
- # TODO: Remove this line once TF doesn't depend on Bazel wrapping all library
223
- # archives in -whole_archive -no_whole_archive.
224
- build --noincompatible_remove_legacy_whole_archive
212
+ # Prevent regression of https://github.com/bazelbuild/bazel/issues/7362
213
+ build --incompatible_remove_legacy_whole_archive
225
214
226
215
# Modular TF build options
227
216
build:dynamic_kernels --define=dynamic_loaded_kernels=true
Original file line number Diff line number Diff line change @@ -587,6 +587,18 @@ tf_cc_shared_object(
587
587
] + tf_additional_binary_deps (),
588
588
)
589
589
590
+ # This is intended to be the same as tf_binary_additional_srcs:
591
+ # https://github.com/tensorflow/tensorflow/blob/cd67f4f3723f9165aabedd0171aaadc6290636e5/tensorflow/tensorflow.bzl#L396-L425
592
+ # And is usable in the "deps" attribute instead of the "srcs" attribute
593
+ # as a workaround for https://github.com/tensorflow/tensorflow/issues/34117
594
+ cc_import (
595
+ name = "libtensorflow_framework_import_lib" ,
596
+ shared_library = select ({
597
+ "//tensorflow:macos" : ":libtensorflow_framework.dylib" ,
598
+ "//conditions:default" : ":libtensorflow_framework.so" ,
599
+ }),
600
+ )
601
+
590
602
# -------------------------------------------
591
603
# New rules should be added above this target.
592
604
# -------------------------------------------
Original file line number Diff line number Diff line change @@ -626,6 +626,11 @@ def tf_cc_binary(
626
626
[
627
627
clean_dep ("//third_party/mkl:intel_binary_blob" ),
628
628
],
629
+ ) + if_static (
630
+ extra_deps = [],
631
+ otherwise = [
632
+ clean_dep ("//tensorflow:libtensorflow_framework_import_lib" ),
633
+ ],
629
634
),
630
635
data = depset (data + added_data_deps ),
631
636
linkopts = linkopts + _rpath_linkopts (name_os ),
You can’t perform that action at this time.
0 commit comments