Require a dependency tree that fully resolves, through all select statements.

This should help prevent cases where things are committed to the codebase with
dangling references to things that don't exist.

PiperOrigin-RevId: 281200606
Change-Id: Ic298a1e051687099d9aa696cacb0dc2de062b600
This commit is contained in:
Brian Atkinson 2019-11-18 18:32:58 -08:00 committed by TensorFlower Gardener
parent 22b4651ae0
commit b39b1ed24b
8 changed files with 25 additions and 42 deletions

View File

@ -111,27 +111,6 @@ config_setting(
visibility = ["//visibility:public"],
)
config_setting(
name = "chromiumos_x86_64",
flag_values = {"//tools/cpp:cc_target_os": "chromiumos"},
values = {"cpu": "k8"},
visibility = ["//visibility:public"],
)
config_setting(
name = "chromiumos_arm64",
flag_values = {"//tools/cpp:cc_target_os": "chromiumos"},
values = {"cpu": "arm"},
visibility = ["//visibility:public"],
)
config_setting(
name = "chromiumos_armv7",
flag_values = {"//tools/cpp:cc_target_os": "chromiumos"},
values = {"cpu": "armeabi-v7a"},
visibility = ["//visibility:public"],
)
config_setting(
name = "emscripten",
values = {"crosstool_top": "//external:android/emscripten"},

View File

@ -41,21 +41,12 @@ cc_library(
name = "reader",
srcs = ["reader.cc"],
hdrs = ["reader.h"],
deps = [
":constants",
] + if_not_mobile([
deps = [":constants"] + if_not_mobile([
# TODO(b/111634734): :lib and :protos_all contain dependencies that
# cannot be built on mobile platforms. Instead, include the appropriate
# tf_lib depending on the build platform.
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
]) + if_mobile([
# Mobile-friendly SavedModel proto. See go/portable-proto for more info.
"//tensorflow/core:saved_model_portable_proto",
]) + if_android([
"//tensorflow/core:android_tensorflow_lib",
]) + if_ios([
"//tensorflow/core:ios_tensorflow_lib",
]),
)
@ -103,7 +94,6 @@ cc_library(
"//tensorflow/core:core_cpu",
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
# mobile not supported yet
]),
)
@ -121,7 +111,6 @@ cc_library(
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/util/tensor_bundle:naming",
# mobile not supported yet
]),
alwayslink = 1,
)

View File

@ -377,7 +377,7 @@ tf_cc_test(
":test_graph_tfmatmulandadd_with_profiling_mlir_bridge",
"//tensorflow/compiler/xla:shape_util",
"//tensorflow/compiler/xla:test",
"//tensorflow/compiler/xla:xla_data_proto",
"//tensorflow/compiler/xla:xla_data_proto_cc",
"//tensorflow/compiler/xla/service:hlo_profile_printer",
"//tensorflow/core:lib",
"//tensorflow/core:regexp_internal",

View File

@ -282,9 +282,9 @@ def tf_library(
] + (need_xla_data_proto and [
# If we're generating the program shape, we must depend on the
# proto.
"//tensorflow/compiler/xla:xla_data_proto",
"//tensorflow/compiler/xla:xla_data_proto_cc",
] or []) + (enable_xla_hlo_profiling and [
"//tensorflow/compiler/xla/service:hlo_profile_printer_data",
"//tensorflow/compiler/xla/service:hlo_profile_printer_data_cc",
] or []) + (include_standard_runtime_deps and [
# TODO(cwhipkey): only depend on kernel code that the model actually
# needed.

View File

@ -26,7 +26,7 @@ py_test(
],
deps = [
"//tensorflow:tensorflow_py",
"//third_party/py/absl:app",
"//third_party/py/absl/flags",
"@absl_py//absl:app",
"@absl_py//absl/flags",
],
)

View File

@ -458,6 +458,22 @@ do_bazel_nobuild() {
"This is due to invalid BUILD files."
}
do_bazel_deps_query() {
local BUILD_TARGET='//tensorflow/...'
# Android targets tend to depend on an Android runtime being available.
# Exclude until the sanity test has such a runtime available.
#
# TODO(mikecase): Remove TF Lite exclusion from this list. Exclusion is
# necessary since the @androidsdk WORKSPACE dependency is commented out by
# default in TF WORKSPACE file.
local BUILD_TARGET="${BUILD_TARGET}"' - kind("android_*", //tensorflow/...)'
bazel query ${BAZEL_FLAGS} -- "deps($BUILD_TARGET)" > /dev/null
cmd_status \
"This is due to invalid BUILD files."
}
do_pip_smoke_test() {
cd "$ROOT_DIR/tensorflow/tools/pip_package"
python pip_smoke_test.py
@ -615,8 +631,8 @@ do_configure_test() {
}
# Supply all sanity step commands and descriptions
SANITY_STEPS=("do_configure_test" "do_pylint PYTHON2" "do_pylint PYTHON3" "do_check_futures_test" "do_buildifier" "do_bazel_nobuild" "do_pip_package_licenses_check" "do_lib_package_licenses_check" "do_java_package_licenses_check" "do_pip_smoke_test" "do_check_load_py_test" "do_code_link_check" "do_check_file_name_test" "do_pip_no_cuda_deps_check_ubuntu" "do_pip_no_cuda_deps_check_windows")
SANITY_STEPS_DESC=("Run ./configure" "Python 2 pylint" "Python 3 pylint" "Check that python files have certain __future__ imports" "buildifier check" "bazel nobuild" "pip: license check for external dependencies" "C library: license check for external dependencies" "Java Native Library: license check for external dependencies" "Pip Smoke Test: Checking py_test dependencies exist in pip package" "Check load py_test: Check that BUILD files with py_test target properly load py_test" "Code Link Check: Check there are no broken links" "Check file names for cases" "Check Ubuntu gpu pip package does not depend on cuda shared libraries" "Check Windows gpu pip package does not depend on cuda shared libraries")
SANITY_STEPS=("do_configure_test" "do_pylint PYTHON2" "do_pylint PYTHON3" "do_check_futures_test" "do_buildifier" "do_bazel_nobuild" "do_bazel_deps_query" "do_pip_package_licenses_check" "do_lib_package_licenses_check" "do_java_package_licenses_check" "do_pip_smoke_test" "do_check_load_py_test" "do_code_link_check" "do_check_file_name_test" "do_pip_no_cuda_deps_check_ubuntu" "do_pip_no_cuda_deps_check_windows")
SANITY_STEPS_DESC=("Run ./configure" "Python 2 pylint" "Python 3 pylint" "Check that python files have certain __future__ imports" "buildifier check" "bazel nobuild" "bazel query" "pip: license check for external dependencies" "C library: license check for external dependencies" "Java Native Library: license check for external dependencies" "Pip Smoke Test: Checking py_test dependencies exist in pip package" "Check load py_test: Check that BUILD files with py_test target properly load py_test" "Code Link Check: Check there are no broken links" "Check file names for cases" "Check Ubuntu gpu pip package does not depend on cuda shared libraries" "Check Windows gpu pip package does not depend on cuda shared libraries")
INCREMENTAL_FLAG=""
DEFAULT_BAZEL_CONFIGS=""

View File

@ -112,5 +112,5 @@ tf_py_logged_benchmark(
tf_py_logged_benchmark(
name = "sparse_csr_matrix_ops_benchmark",
target = "//tensorflow/python/kernel_tests:sparse_csr_matrix_ops_test_py",
target = "//tensorflow/python/kernel_tests/linalg/sparse:csr_sparse_matrix_ops_test",
)

View File

@ -61,7 +61,6 @@ cc_library(
"@ngraph//:ngraph_core",
"@org_tensorflow//tensorflow/core:core_cpu_headers_lib",
"@org_tensorflow//tensorflow/core:framework_headers_lib",
"@org_tensorflow//tensorflow/core:protos_all_proto_text",
],
alwayslink = 1,
)