Skip to content

Commit

Permalink
Remove obsolete anyinvocable flag
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 695452070
  • Loading branch information
rstz authored and copybara-github committed Nov 11, 2024
1 parent dadbc50 commit 427425a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ build:wasm --cxxopt=-std=c++17
build:wasm --host_cxxopt=-std=c++17
build:wasm --host_cxxopt="-fno-exceptions"

# Use absl::anyInvocable. This breaks builds with TF <= 2.12 but is required
# for builds with TF >= 2.13.
build:use_absl_anyinvocable --define=use_absl_anyinvocable=1

# Optional. Just to make it compatible with dynamic linking and TensorFlow.
# build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
# build --host_cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
6 changes: 0 additions & 6 deletions yggdrasil_decision_forests/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ selects.config_setting_group(
],
)

# TF-nightly uses absl::anyinvocable, while stable TF uses an Abseil version that does not use it.
config_setting(
name = "use_absl_anyinvocable",
values = {"define": "use_absl_anyinvocable=1"},
)

# TensorFlow is used for reading TFRecord dataset, and serializing models (if
# TFRecord is selected as the format container). If
# tensorflow_with_header_lib=1, TensorFlow is linked with "head only"
Expand Down
32 changes: 8 additions & 24 deletions yggdrasil_decision_forests/dataset/tensorflow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@ cc_library_ydf(
"//yggdrasil_decision_forests/utils:sharded_io",
"//yggdrasil_decision_forests/utils:status_macros",
"@com_google_absl//absl/container:node_hash_map",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/log",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
] + select({
"//yggdrasil_decision_forests:use_absl_anyinvocable": [
"@com_google_absl//absl/functional:any_invocable",
],
"//conditions:default": [],
}),
],
)

cc_library_ydf(
Expand All @@ -71,16 +67,12 @@ cc_library_ydf(
"//yggdrasil_decision_forests/serving:tf_example",
"//yggdrasil_decision_forests/utils:compatibility",
"//yggdrasil_decision_forests/utils:status_macros",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/strings:str_format",
] + select({
"//yggdrasil_decision_forests:use_absl_anyinvocable": [
"@com_google_absl//absl/functional:any_invocable",
],
"//conditions:default": [],
}),
],
)

cc_library_ydf(
Expand All @@ -99,16 +91,12 @@ cc_library_ydf(
"//yggdrasil_decision_forests/dataset/tensorflow_no_dep:tf_example",
"//yggdrasil_decision_forests/utils:compatibility",
"//yggdrasil_decision_forests/utils:sharded_io_tfrecord",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
] + select({
"//yggdrasil_decision_forests:use_absl_anyinvocable": [
"@com_google_absl//absl/functional:any_invocable",
],
"//conditions:default": [],
}),
],
alwayslink = 1,
)

Expand All @@ -134,15 +122,11 @@ cc_test(
"//yggdrasil_decision_forests/utils:filesystem",
"//yggdrasil_decision_forests/utils:sharded_io",
"//yggdrasil_decision_forests/utils:test",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest_main",
] + select({
"//yggdrasil_decision_forests:use_absl_anyinvocable": [
"@com_google_absl//absl/functional:any_invocable",
],
"//conditions:default": [],
}),
],
)

cc_test(
Expand Down
6 changes: 1 addition & 5 deletions yggdrasil_decision_forests/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ cc_library_ydf(
":compatibility",
":logging",
":status_macros",
"@com_google_absl//absl/functional:any_invocable",
"@com_google_absl//absl/log",
"@com_google_absl//absl/log:check",
"@com_google_absl//absl/memory",
Expand All @@ -154,11 +155,6 @@ cc_library_ydf(
"@org_tensorflow//tensorflow/core:lib",
"@org_tensorflow//tensorflow/core/platform:path",
],
}) + select({
"//yggdrasil_decision_forests:use_absl_anyinvocable": [
"@com_google_absl//absl/functional:any_invocable",
],
"//conditions:default": [],
}),
)

Expand Down

0 comments on commit 427425a

Please sign in to comment.