From daec6e0af0dfe39aada697275a76570da7f04608 Mon Sep 17 00:00:00 2001 From: Brian Zhao Date: Wed, 12 Feb 2020 13:07:54 -0800 Subject: [PATCH] Upgrading bazel version to 2.0.0 This is necessary to start using bazel's experimental cc_shared_library support. This change is part of the refactoring described in https://github.com/tensorflow/community/pull/179 PiperOrigin-RevId: 294736824 Change-Id: I8d13c71545cf2f2edd47818b40fa413e3e9c3254 --- .bazelrc | 7 +++++++ .bazelversion | 2 +- configure.py | 2 +- tensorflow/tools/ci_build/install/install_bazel.sh | 2 +- .../tools/ci_build/install/install_bazel_from_source.sh | 2 +- tensorflow/tools/ci_build/release/common.sh | 2 +- tensorflow/tools/ci_build/release/common_win.bat | 2 +- .../dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile | 2 +- .../tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile | 2 +- .../dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile | 2 +- .../tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile | 2 +- .../dockerfiles/partials/ubuntu/bazel.partial.Dockerfile | 2 +- 12 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.bazelrc b/.bazelrc index a29897226e8..5a300304794 100644 --- a/.bazelrc +++ b/.bazelrc @@ -222,6 +222,13 @@ build --define=grpc_no_ares=true # archives in -whole_archive -no_whole_archive. 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 build:dynamic_kernels --define=dynamic_loaded_kernels=true build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS diff --git a/.bazelversion b/.bazelversion index 6085e946503..227cea21564 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -1.2.1 +2.0.0 diff --git a/configure.py b/configure.py index 4cb68924db4..64956049c34 100644 --- a/configure.py +++ b/configure.py @@ -50,7 +50,7 @@ _TF_WORKSPACE_ROOT = '' _TF_BAZELRC = '' _TF_CURRENT_BAZEL_VERSION = None _TF_MIN_BAZEL_VERSION = '1.2.1' -_TF_MAX_BAZEL_VERSION = '1.2.1' +_TF_MAX_BAZEL_VERSION = '2.0.0' NCCL_LIB_PATHS = [ 'lib64/', 'lib/powerpc64le-linux-gnu/', 'lib/x86_64-linux-gnu/', '' diff --git a/tensorflow/tools/ci_build/install/install_bazel.sh b/tensorflow/tools/ci_build/install/install_bazel.sh index ede4ddaebd4..7da01266ebb 100755 --- a/tensorflow/tools/ci_build/install/install_bazel.sh +++ b/tensorflow/tools/ci_build/install/install_bazel.sh @@ -15,7 +15,7 @@ # ============================================================================== # Select bazel version. -BAZEL_VERSION="1.2.1" +BAZEL_VERSION="2.0.0" set +e local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}') diff --git a/tensorflow/tools/ci_build/install/install_bazel_from_source.sh b/tensorflow/tools/ci_build/install/install_bazel_from_source.sh index df210c2352f..c4942fba942 100755 --- a/tensorflow/tools/ci_build/install/install_bazel_from_source.sh +++ b/tensorflow/tools/ci_build/install/install_bazel_from_source.sh @@ -18,7 +18,7 @@ # It will compile bazel from source and install it in /usr/local/bin # Select bazel version. -BAZEL_VERSION="1.2.1" +BAZEL_VERSION="2.0.0" set +e local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}') diff --git a/tensorflow/tools/ci_build/release/common.sh b/tensorflow/tools/ci_build/release/common.sh index e87bcab5842..e328a2f94a6 100644 --- a/tensorflow/tools/ci_build/release/common.sh +++ b/tensorflow/tools/ci_build/release/common.sh @@ -17,7 +17,7 @@ # Keep in sync with tensorflow_estimator and configure.py. # LINT.IfChange -LATEST_BAZEL_VERSION=1.2.1 +LATEST_BAZEL_VERSION=2.0.0 # LINT.ThenChange( # //tensorflow/opensource_only/configure.py, # //tensorflow_estimator/google/kokoro/common.sh, diff --git a/tensorflow/tools/ci_build/release/common_win.bat b/tensorflow/tools/ci_build/release/common_win.bat index 1a83e044adb..85f22c1e4cb 100644 --- a/tensorflow/tools/ci_build/release/common_win.bat +++ b/tensorflow/tools/ci_build/release/common_win.bat @@ -73,7 +73,7 @@ SET PATH=%CUDNN_INSTALL_PATH%\bin;%PATH% @REM Setup Bazel @REM :: Download Bazel from github and make sure its found in PATH. -SET BAZEL_VERSION=1.2.1 +SET BAZEL_VERSION=2.0.0 md C:\tools\bazel\ wget -q https://github.com/bazelbuild/bazel/releases/download/%BAZEL_VERSION%/bazel-%BAZEL_VERSION%-windows-x86_64.exe -O C:/tools/bazel/bazel.exe SET PATH=C:\tools\bazel;%PATH% diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile index bdaf0116f1f..7a07bd5b45d 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu-jupyter.Dockerfile @@ -100,7 +100,7 @@ RUN ${PIP} --no-cache-dir install \ enum34 # Install bazel -ARG BAZEL_VERSION=1.2.1 +ARG BAZEL_VERSION=2.0.0 RUN mkdir /bazel && \ wget -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile index 5984dd6e8fd..6c731f24b8d 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile @@ -100,7 +100,7 @@ RUN ${PIP} --no-cache-dir install \ enum34 # Install bazel -ARG BAZEL_VERSION=1.2.1 +ARG BAZEL_VERSION=2.0.0 RUN mkdir /bazel && \ wget -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile index 96274dbbdab..d344654ece6 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile @@ -142,7 +142,7 @@ RUN ${PIP} --no-cache-dir install \ enum34 # Install bazel -ARG BAZEL_VERSION=1.2.1 +ARG BAZEL_VERSION=2.0.0 RUN mkdir /bazel && \ wget -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \ diff --git a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile index a0cc1ad9259..eb75d905462 100644 --- a/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile +++ b/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile @@ -142,7 +142,7 @@ RUN ${PIP} --no-cache-dir install \ enum34 # Install bazel -ARG BAZEL_VERSION=1.2.1 +ARG BAZEL_VERSION=2.0.0 RUN mkdir /bazel && \ wget -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \ diff --git a/tensorflow/tools/dockerfiles/partials/ubuntu/bazel.partial.Dockerfile b/tensorflow/tools/dockerfiles/partials/ubuntu/bazel.partial.Dockerfile index 5e7c2eb52ce..bcd4d882c92 100644 --- a/tensorflow/tools/dockerfiles/partials/ubuntu/bazel.partial.Dockerfile +++ b/tensorflow/tools/dockerfiles/partials/ubuntu/bazel.partial.Dockerfile @@ -24,7 +24,7 @@ RUN ${PIP} --no-cache-dir install \ enum34 # Install bazel -ARG BAZEL_VERSION=1.2.1 +ARG BAZEL_VERSION=2.0.0 RUN mkdir /bazel && \ wget -O /bazel/installer.sh "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh" && \ wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \