Skip to content

Commit 13d7bd3

Browse files
authored
Add linkstatic=True to several library Bazel config (#1355)
While checking the content of the tensorflow-io wheel, noticed that there are several redundant .so files included: ``` inflating: tensorflow_io/core/kernels/gsmemcachedfs/libmemcached_file_block_cache.so inflating: tensorflow_io/core/kernels/gsmemcachedfs/libgce_memcached_server_list_provider.so inflating: tensorflow_io/core/kernels/gsmemcachedfs/libmemcached_file_system.so inflating: tensorflow_io/core/kernels/avro/utils/libavro_utils.so ``` The reason was that linkstatic=True was not passed in bazel which caused extra .so being built. This PR removes those unneeded .so (they are compiled as static library instead). Signed-off-by: Yong Tang <[email protected]>
1 parent 8393306 commit 13d7bd3

File tree

2 files changed

+6
-0
lines changed
  • tensorflow_io/core/kernels

2 files changed

+6
-0
lines changed

tensorflow_io/core/kernels/avro/utils/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cc_library(
1919
"prefix_tree.h",
2020
"value_buffer.h",
2121
],
22+
linkstatic = True,
2223
deps = [
2324
"//tensorflow_io/core:dataset_ops",
2425
"@com_googlesource_code_re2//:re2",
@@ -36,6 +37,7 @@ cc_library(
3637
"prefix_tree.cc",
3738
"value_buffer.cc",
3839
],
40+
linkstatic = True,
3941
deps = [
4042
":avro_utils_api",
4143
"@avro",

tensorflow_io/core/kernels/gsmemcachedfs/BUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cc_library(
1111
"memcached_dao_interface.h",
1212
],
1313
copts = tf_io_copts(),
14+
linkstatic = True,
1415
visibility = ["//visibility:public"],
1516
deps = [
1617
"@libmemcached",
@@ -22,6 +23,7 @@ cc_library(
2223
srcs = ["memcached_file_block_cache.cc"],
2324
hdrs = ["memcached_file_block_cache.h"],
2425
copts = tf_io_copts(),
26+
linkstatic = True,
2527
visibility = ["//visibility:public"],
2628
deps = [
2729
":memcached_dao_interfaces",
@@ -41,6 +43,7 @@ cc_library(
4143
"gce_memcached_server_list_provider.h",
4244
],
4345
copts = tf_io_copts(),
46+
linkstatic = True,
4447
visibility = ["//visibility:public"],
4548
deps = [
4649
"@com_google_absl//absl/memory",
@@ -54,6 +57,7 @@ cc_library(
5457
srcs = ["memcached_file_system.cc"],
5558
hdrs = ["memcached_file_system.h"],
5659
copts = tf_io_copts(),
60+
linkstatic = True,
5761
visibility = ["//visibility:public"],
5862
deps = [
5963
":gce_memcached_server_list_provider",

0 commit comments

Comments
 (0)