From f99aebca5d0b916106d9e17b0c1ee7898d14abc9 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 12 Feb 2020 14:07:48 -0800 Subject: [PATCH] Migrate --incompatible_remap_main_repo for bazel 2.0 Bazel 2.0 flipped --incompatible_remap_main_repo. The gist of it is that when referring to a target in the main repository from inside an external repository the target needs to be prefixed by the main repository name. In this case "@org_tensorflow". Else, it's assumed that one is referring to a target inside the external repo. PiperOrigin-RevId: 294752795 Change-Id: Ic23d08f457b966e9a039152c5f8a550ba5a1978e --- .bazelrc | 2 -- tensorflow/opensource_only.files | 1 + third_party/llvm/BUILD | 2 -- third_party/mkl/build_defs.bzl | 22 +++++++++++----------- third_party/mkl_dnn/build_defs.bzl | 4 ++-- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.bazelrc b/.bazelrc index 5a300304794..071b4013380 100644 --- a/.bazelrc +++ b/.bazelrc @@ -225,8 +225,6 @@ build --noincompatible_remove_legacy_whole_archive # These are bazel 2.0's incompatible flags. Tensorflow needs to use bazel 2.0.0 # to use cc_shared_library, as part of the Tensorflow Build Improvements RFC: # https://github.com/tensorflow/community/pull/179 -build --noincompatible_remap_main_repo -query --noincompatible_remap_main_repo build --noincompatible_prohibit_aapt1 # Modular TF build options diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files index 988b3c9bb04..5df80351a55 100644 --- a/tensorflow/opensource_only.files +++ b/tensorflow/opensource_only.files @@ -116,6 +116,7 @@ tensorflow/third_party/mkl/MKL_LICENSE tensorflow/third_party/mkl/build_defs.bzl tensorflow/third_party/mkl/mkl.BUILD tensorflow/third_party/mkl_dnn/LICENSE +tensorflow/third_party/mkl_dnn/build_defs.bzl tensorflow/third_party/mkl_dnn/mkldnn.BUILD tensorflow/third_party/mpi/.gitignore tensorflow/third_party/nanopb.BUILD diff --git a/third_party/llvm/BUILD b/third_party/llvm/BUILD index 563f394b276..1a5634a6285 100644 --- a/third_party/llvm/BUILD +++ b/third_party/llvm/BUILD @@ -1,5 +1,3 @@ -licenses(["notice"]) - py_binary( name = "expand_cmake_vars", srcs = ["expand_cmake_vars.py"], diff --git a/third_party/mkl/build_defs.bzl b/third_party/mkl/build_defs.bzl index 6f3e7c0b52d..4b8fb83eb09 100644 --- a/third_party/mkl/build_defs.bzl +++ b/third_party/mkl/build_defs.bzl @@ -25,7 +25,7 @@ def if_mkl(if_true, if_false = []): a select evaluating to either if_true or if_false as appropriate. """ return select({ - str(Label("//third_party/mkl:build_with_mkl")): if_true, + "@org_tensorflow//third_party/mkl:build_with_mkl": if_true, "//conditions:default": if_false, }) @@ -41,8 +41,8 @@ def if_mkl_ml(if_true, if_false = []): a select evaluating to either if_true or if_false as appropriate. """ return select({ - str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): if_false, - str(Label("//third_party/mkl:build_with_mkl")): if_true, + "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": if_false, + "@org_tensorflow//third_party/mkl:build_with_mkl": if_true, "//conditions:default": if_false, }) @@ -57,7 +57,7 @@ def if_mkl_ml_only(if_true, if_false = []): a select evaluating to either if_true or if_false as appropriate. """ return select({ - str(Label("//third_party/mkl:build_with_mkl_ml_only")): if_true, + "@org_tensorflow//third_party/mkl:build_with_mkl_ml_only": if_true, "//conditions:default": if_false, }) @@ -74,7 +74,7 @@ def if_mkl_lnx_x64(if_true, if_false = []): a select evaluating to either if_true or if_false as appropriate. """ return select({ - str(Label("//third_party/mkl:build_with_mkl_lnx_x64")): if_true, + "@org_tensorflow//third_party/mkl:build_with_mkl_lnx_x64": if_true, "//conditions:default": if_false, }) @@ -91,7 +91,7 @@ def if_enable_mkl(if_true, if_false = []): A select evaluating to either if_true or if_false as appropriate. """ return select({ - str(Label("//third_party/mkl:enable_mkl")): if_true, + "@org_tensorflow//third_party/mkl:enable_mkl": if_true, "//conditions:default": if_false, }) @@ -105,11 +105,11 @@ def mkl_deps(): inclusion in the deps attribute of rules. """ return select({ - str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): ["@mkl_dnn"], - str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_v1_only")): ["@mkl_dnn_v1//:mkl_dnn"], - str(Label("//third_party/mkl:build_with_mkl_ml_only")): ["//third_party/mkl:intel_binary_blob"], - str(Label("//third_party/mkl:build_with_mkl")): [ - "//third_party/mkl:intel_binary_blob", + "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": ["@mkl_dnn"], + "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_v1_only": ["@mkl_dnn_v1//:mkl_dnn"], + "@org_tensorflow//third_party/mkl:build_with_mkl_ml_only": ["@org_tensorflow//third_party/mkl:intel_binary_blob"], + "@org_tensorflow//third_party/mkl:build_with_mkl": [ + "@org_tensorflow//third_party/mkl:intel_binary_blob", "@mkl_dnn", ], "//conditions:default": [], diff --git a/third_party/mkl_dnn/build_defs.bzl b/third_party/mkl_dnn/build_defs.bzl index 384b528c273..af05333c947 100644 --- a/third_party/mkl_dnn/build_defs.bzl +++ b/third_party/mkl_dnn/build_defs.bzl @@ -10,7 +10,7 @@ def if_mkl_open_source_only(if_true, if_false = []): """ return select({ - str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): if_true, + "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": if_true, "//conditions:default": if_false, }) @@ -26,6 +26,6 @@ def if_mkl_v1_open_source_only(if_true, if_false = []): """ return select({ - str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_v1_only")): if_true, + "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_v1_only": if_true, "//conditions:default": if_false, })