aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/lib_package
diff options
context:
space:
mode:
authorGravatar Jason Zaman <jason@perfinion.com>2018-08-01 23:48:24 +0800
committerGravatar Jason Zaman <jason@perfinion.com>2018-08-07 13:41:39 +0800
commitcb685b69f5b6e19ab6ffdccc9e3a693add1536b2 (patch)
tree08a5b04e57f7caf7287e4b9521fe6f595d9dc495 /tensorflow/tools/lib_package
parentf9acd38eb687208dcee8622510b9a611e51d21a4 (diff)
lib / pip_package: only include licenses if option is enabled
The license files were included unconditionally so the whole dependency needs to be downloaded even if disabled and not used. This puts them behind in a select() so they are only included when the feature is enabled for the build and significantly reduces the dependencies when configured without all the cloud options. Signed-off-by: Jason Zaman <jason@perfinion.com>
Diffstat (limited to 'tensorflow/tools/lib_package')
-rw-r--r--tensorflow/tools/lib_package/BUILD78
1 files changed, 62 insertions, 16 deletions
diff --git a/tensorflow/tools/lib_package/BUILD b/tensorflow/tools/lib_package/BUILD
index 44d8a37a8f..b450bc42c5 100644
--- a/tensorflow/tools/lib_package/BUILD
+++ b/tensorflow/tools/lib_package/BUILD
@@ -4,7 +4,9 @@
package(default_visibility = ["//visibility:private"])
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
+load("@local_config_syslibs//:build_defs.bzl", "if_not_system_lib")
load("//tensorflow:tensorflow.bzl", "tf_binary_additional_srcs")
+load("//tensorflow:tensorflow.bzl", "if_cuda")
load("//third_party/mkl:build_defs.bzl", "if_mkl")
genrule(
@@ -113,11 +115,8 @@ genrule(
"//third_party/hadoop:LICENSE.txt",
"//third_party/eigen3:LICENSE",
"//third_party/fft2d:LICENSE",
- "@aws//:LICENSE",
"@boringssl//:LICENSE",
- "@com_github_googlecloudplatform_google_cloud_cpp//:LICENSE",
"@com_googlesource_code_re2//:LICENSE",
- "@cub_archive//:LICENSE.TXT",
"@curl//:COPYING",
"@double_conversion//:LICENSE",
"@eigen_archive//:COPYING.MPL2",
@@ -125,13 +124,8 @@ genrule(
"@fft2d//:fft/readme.txt",
"@gemmlowp//:LICENSE",
"@gif_archive//:COPYING",
- "@grpc//:LICENSE",
- "@grpc//third_party/address_sorting:LICENSE",
- "@grpc//third_party/nanopb:LICENSE.txt",
"@highwayhash//:LICENSE",
- "@jemalloc//:COPYING",
"@jpeg//:LICENSE.md",
- "@libxsmm_archive//:LICENSE.md",
"@llvm//:LICENSE.TXT",
"@lmdb//:LICENSE",
"@local_config_sycl//sycl:LICENSE.text",
@@ -141,10 +135,42 @@ genrule(
"@protobuf_archive//:LICENSE",
"@snappy//:COPYING",
"@zlib_archive//:zlib.h",
- ] + if_mkl([
+ ] + select({
+ "//tensorflow:with_aws_support": [
+ "@aws//:LICENSE",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow:with_gcp_support": [
+ "@com_github_googlecloudplatform_google_cloud_cpp//:LICENSE",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow:with_jemalloc_linux_x86_64": [
+ "@jemalloc//:COPYING",
+ ],
+ "//tensorflow:with_jemalloc_linux_ppc64le": [
+ "@jemalloc//:COPYING",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow/core/kernels:xsmm": [
+ "@libxsmm_archive//:LICENSE.md",
+ ],
+ "//conditions:default": [],
+ }) + if_cuda([
+ "@cub_archive//:LICENSE.TXT",
+ ]) + if_mkl([
"//third_party/mkl:LICENSE",
"//third_party/mkl_dnn:LICENSE",
- ]),
+ ]) + if_not_system_lib(
+ "grpc",
+ [
+ "@grpc//:LICENSE",
+ "@grpc//third_party/nanopb:LICENSE.txt",
+ "@grpc//third_party/address_sorting:LICENSE",
+ ],
+ ),
outs = ["include/tensorflow/c/LICENSE"],
cmd = "$(location :concat_licenses.sh) $(SRCS) >$@",
tools = [":concat_licenses.sh"],
@@ -156,11 +182,8 @@ genrule(
"//third_party/hadoop:LICENSE.txt",
"//third_party/eigen3:LICENSE",
"//third_party/fft2d:LICENSE",
- "@aws//:LICENSE",
"@boringssl//:LICENSE",
- "@com_github_googlecloudplatform_google_cloud_cpp//:LICENSE",
"@com_googlesource_code_re2//:LICENSE",
- "@cub_archive//:LICENSE.TXT",
"@curl//:COPYING",
"@double_conversion//:LICENSE",
"@eigen_archive//:COPYING.MPL2",
@@ -169,9 +192,7 @@ genrule(
"@gemmlowp//:LICENSE",
"@gif_archive//:COPYING",
"@highwayhash//:LICENSE",
- "@jemalloc//:COPYING",
"@jpeg//:LICENSE.md",
- "@libxsmm_archive//:LICENSE.md",
"@llvm//:LICENSE.TXT",
"@lmdb//:LICENSE",
"@local_config_sycl//sycl:LICENSE.text",
@@ -181,7 +202,32 @@ genrule(
"@protobuf_archive//:LICENSE",
"@snappy//:COPYING",
"@zlib_archive//:zlib.h",
- ] + if_mkl([
+ ] + select({
+ "//tensorflow:with_aws_support": [
+ "@aws//:LICENSE",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow:with_gcp_support": [
+ "@com_github_googlecloudplatform_google_cloud_cpp//:LICENSE",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow:with_jemalloc_linux_x86_64": [
+ "@jemalloc//:COPYING",
+ ],
+ "//tensorflow:with_jemalloc_linux_ppc64le": [
+ "@jemalloc//:COPYING",
+ ],
+ "//conditions:default": [],
+ }) + select({
+ "//tensorflow/core/kernels:xsmm": [
+ "@libxsmm_archive//:LICENSE.md",
+ ],
+ "//conditions:default": [],
+ }) + if_cuda([
+ "@cub_archive//:LICENSE.TXT",
+ ]) + if_mkl([
"//third_party/mkl:LICENSE",
"//third_party/mkl_dnn:LICENSE",
]),