Revert "Upgrade to bazel 1.0.0"

pull/20611/head
Nicolas Noble 5 years ago committed by GitHub
parent 31853bb797
commit 04d7e0d11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      WORKSPACE
  2. 8
      bazel/grpc_build_system.bzl
  3. 8
      bazel/grpc_deps.bzl
  4. 2
      templates/tools/dockerfile/bazel.include
  5. 6
      test/core/gprpp/BUILD
  6. 6
      test/core/iomgr/BUILD
  7. 6
      test/cpp/qps/BUILD
  8. 80
      third_party/toolchains/BUILD
  9. 2
      tools/bazel
  10. 2
      tools/dockerfile/test/bazel/Dockerfile
  11. 2
      tools/dockerfile/test/sanity/Dockerfile
  12. 2
      tools/internal_ci/windows/bazel_rbe.bat
  13. 2
      tools/remote_build/rbe_common.bazelrc

@ -23,8 +23,6 @@ load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
# Create toolchain configuration for remote execution. # Create toolchain configuration for remote execution.
rbe_autoconfig( rbe_autoconfig(
name = "rbe_default", name = "rbe_default",
# use exec_properties instead of deprecated remote_execution_properties
use_legacy_platform_definition = False,
) )
load("@bazel_toolchains//rules:environments.bzl", "clang_env") load("@bazel_toolchains//rules:environments.bzl", "clang_env")

@ -31,10 +31,6 @@ load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
# The set of pollers to test against if a test exercises polling # The set of pollers to test against if a test exercises polling
POLLERS = ["epollex", "epoll1", "poll"] POLLERS = ["epollex", "epoll1", "poll"]
# set exec_properties = LARGE_MACHINE, to run the test on a large machine
# see //third_party/toolchains/machine_size for details
LARGE_MACHINE = { "gceMachineType" : "n1-standard-8"}
def if_not_windows(a): def if_not_windows(a):
return select({ return select({
"//:windows": [], "//:windows": [],
@ -169,7 +165,7 @@ def ios_cc_test(
deps = ios_test_deps, deps = ios_test_deps,
) )
def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = [], exec_properties = {}): def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data = [], uses_polling = True, language = "C++", size = "medium", timeout = None, tags = [], exec_compatible_with = []):
copts = if_mac(["-DGRPC_CFSTREAM"]) copts = if_mac(["-DGRPC_CFSTREAM"])
if language.upper() == "C": if language.upper() == "C":
copts = copts + if_not_windows(["-std=c99"]) copts = copts + if_not_windows(["-std=c99"])
@ -183,7 +179,6 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
"size": size, "size": size,
"timeout": timeout, "timeout": timeout,
"exec_compatible_with": exec_compatible_with, "exec_compatible_with": exec_compatible_with,
"exec_properties": exec_properties,
} }
if uses_polling: if uses_polling:
# the vanilla version of the test should run on platforms that only # the vanilla version of the test should run on platforms that only
@ -212,7 +207,6 @@ def grpc_cc_test(name, srcs = [], deps = [], external_deps = [], args = [], data
] + args["args"], ] + args["args"],
tags = (tags + ["no_windows", "no_mac"]), tags = (tags + ["no_windows", "no_mac"]),
exec_compatible_with = exec_compatible_with, exec_compatible_with = exec_compatible_with,
exec_properties = exec_properties,
) )
else: else:
# the test behavior doesn't depend on polling, just generate the test # the test behavior doesn't depend on polling, just generate the test

@ -176,11 +176,11 @@ def grpc_deps():
# list of releases is at https://releases.bazel.build/bazel-toolchains.html # list of releases is at https://releases.bazel.build/bazel-toolchains.html
http_archive( http_archive(
name = "bazel_toolchains", name = "bazel_toolchains",
sha256 = "e9bab54199722935f239cb1cd56a80be2ac3c3843e1a6d3492e2bc11f9c21daf", sha256 = "22ca5b8115c8673ecb627a02b606529e813961e447933863fccdf325cc5f999f",
strip_prefix = "bazel-toolchains-1.0.0", strip_prefix = "bazel-toolchains-0.29.5",
urls = [ urls = [
"https://github.com/bazelbuild/bazel-toolchains/releases/download/1.0.0/bazel-toolchains-1.0.0.tar.gz", "https://github.com/bazelbuild/bazel-toolchains/releases/download/0.29.5/bazel-toolchains-0.29.5.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.0.0.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.29.5.tar.gz",
], ],
) )

@ -2,7 +2,7 @@
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel # Must be in sync with tools/bazel
ENV BAZEL_VERSION 1.0.0 ENV BAZEL_VERSION 0.29.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1 ENV DISABLE_BAZEL_WRAPPER 1

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2 licenses(["notice"]) # Apache v2
@ -111,9 +111,9 @@ grpc_cc_test(
grpc_cc_test( grpc_cc_test(
name = "mpscq_test", name = "mpscq_test",
srcs = ["mpscq_test.cc"], srcs = ["mpscq_test.cc"],
exec_properties = LARGE_MACHINE, exec_compatible_with = ["//third_party/toolchains/machine_size:large"],
language = "C++", language = "C++",
tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE tags = ["no_windows"], # machine_size:large is not configured for windows RBE
deps = [ deps = [
"//:gpr", "//:gpr",
"//test/core/util:grpc_test_util", "//test/core/util:grpc_test_util",

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package")
licenses(["notice"]) # Apache v2 licenses(["notice"]) # Apache v2
@ -39,9 +39,9 @@ grpc_cc_library(
grpc_cc_test( grpc_cc_test(
name = "combiner_test", name = "combiner_test",
srcs = ["combiner_test.cc"], srcs = ["combiner_test.cc"],
exec_properties = LARGE_MACHINE, exec_compatible_with = ["//third_party/toolchains/machine_size:large"],
language = "C++", language = "C++",
tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE tags = ["no_windows"], # machine_size:large is not configured for windows RBE
deps = [ deps = [
"//:gpr", "//:gpr",
"//:grpc", "//:grpc",

@ -14,7 +14,7 @@
licenses(["notice"]) # Apache v2 licenses(["notice"]) # Apache v2
load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE") load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package")
load("//test/cpp/qps:qps_benchmark_script.bzl", "qps_json_driver_batch", "json_run_localhost_batch") load("//test/cpp/qps:qps_benchmark_script.bzl", "qps_json_driver_batch", "json_run_localhost_batch")
grpc_package(name = "test/cpp/qps") grpc_package(name = "test/cpp/qps")
@ -169,8 +169,8 @@ grpc_cc_test(
grpc_cc_test( grpc_cc_test(
name = "qps_openloop_test", name = "qps_openloop_test",
srcs = ["qps_openloop_test.cc"], srcs = ["qps_openloop_test.cc"],
exec_properties = LARGE_MACHINE, exec_compatible_with = ["//third_party/toolchains/machine_size:large"],
tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE tags = ["no_windows"], # machine_size:large is not configured for windows RBE
deps = [ deps = [
":benchmark_config", ":benchmark_config",
":driver_impl", ":driver_impl",

@ -29,11 +29,21 @@ platform(
"@bazel_tools//platforms:windows", "@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:msvc", "@bazel_tools//tools/cpp:msvc",
], ],
exec_properties = { remote_execution_properties = """
"container-image" : "docker://gcr.io/grpc-testing/rbe_windows_toolchain@sha256:75728e7d6d804090f71095e5fec627b18cfa1f47adc52096c209f2a687e06b2e", properties: {
"gceMachineType" : "n1-highmem-2", name: "container-image"
"OSFamily" : "Windows", value:"docker://gcr.io/grpc-testing/rbe_windows_toolchain@sha256:75728e7d6d804090f71095e5fec627b18cfa1f47adc52096c209f2a687e06b2e"
}, }
properties: {
name: "gceMachineType" # Small machines for majority of tests.
value: "n1-highmem-2"
}
properties:{
name: "OSFamily"
value: "Windows"
}
""",
) )
# RBE Ubuntu16_04 r346485 # RBE Ubuntu16_04 r346485
@ -43,13 +53,29 @@ platform(
constraint_values = [ constraint_values = [
"//third_party/toolchains/machine_size:standard", "//third_party/toolchains/machine_size:standard",
], ],
exec_properties = { remote_execution_properties = """
"gceMachineType" : "n1-highmem-2", # Small machines for majority of tests {PARENT_REMOTE_EXECUTION_PROPERTIES}
"dockerSiblingContainers" : "false", properties: {
"dockerNetwork" : "off", name: "gceMachineType" # Small machines for majority of tests.
"dockerAddCapabilities" : "SYS_PTRACE", value: "n1-highmem-2"
"dockerPrivileged" : "true" }
}, properties: {
name: "dockerSiblingContainers"
value: "false"
}
properties: {
name: "dockerNetwork"
value: "off"
}
properties: {
name: "dockerAddCapabilities"
value: "SYS_PTRACE"
}
properties: {
name: "dockerPrivileged"
value: "true"
}
""",
) )
platform( platform(
@ -58,13 +84,29 @@ platform(
constraint_values = [ constraint_values = [
"//third_party/toolchains/machine_size:large", "//third_party/toolchains/machine_size:large",
], ],
exec_properties = { remote_execution_properties = """
"gceMachineType" : "n1-standard-8", # Large machines for some resource demanding tests (TSAN). {PARENT_REMOTE_EXECUTION_PROPERTIES}
"dockerSiblingContainers" : "false", properties: {
"dockerNetwork" : "off", name: "gceMachineType" # Large machines for some resource demanding tests (TSAN).
"dockerAddCapabilities" : "SYS_PTRACE", value: "n1-standard-8"
"dockerPrivileged" : "true" }
}, properties: {
name: "dockerSiblingContainers"
value: "false"
}
properties: {
name: "dockerNetwork"
value: "off"
}
properties: {
name: "dockerAddCapabilities"
value: "SYS_PTRACE"
}
properties: {
name: "dockerPrivileged"
value: "true"
}
""",
) )
platform( platform(

@ -32,7 +32,7 @@ then
exec -a "$0" "${BAZEL_REAL}" "$@" exec -a "$0" "${BAZEL_REAL}" "$@"
fi fi
VERSION=1.0.0 VERSION=0.29.1
echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation." echo "INFO: Running bazel wrapper (see //tools/bazel for details), bazel version $VERSION will be used instead of system-wide bazel installation."

@ -52,7 +52,7 @@ RUN pip install futures==2.2.0 enum34==1.0.4 protobuf==3.5.2.post1 six==1.10.0 t
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel # Must be in sync with tools/bazel
ENV BAZEL_VERSION 1.0.0 ENV BAZEL_VERSION 0.29.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1 ENV DISABLE_BAZEL_WRAPPER 1

@ -95,7 +95,7 @@ ENV CLANG_TIDY=clang-tidy
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel # Must be in sync with tools/bazel
ENV BAZEL_VERSION 1.0.0 ENV BAZEL_VERSION 0.29.1
# The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper. # The correct bazel version is already preinstalled, no need to use //tools/bazel wrapper.
ENV DISABLE_BAZEL_WRAPPER 1 ENV DISABLE_BAZEL_WRAPPER 1

@ -14,7 +14,7 @@
@rem TODO(jtattermusch): make this generate less output @rem TODO(jtattermusch): make this generate less output
@rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync @rem TODO(jtattermusch): use tools/bazel script to keep the versions in sync
choco install bazel -y --version 1.0.0 --limit-output choco install bazel -y --version 0.29.1 --limit-output
cd github/grpc cd github/grpc
set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH% set PATH=C:\tools\msys64\usr\bin;C:\Python27;%PATH%

@ -92,4 +92,4 @@ build:ubsan --test_timeout=3600
# how to update the bazel toolchain for ubsan: # how to update the bazel toolchain for ubsan:
# - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang # - check for the latest released version in https://github.com/bazelbuild/bazel-toolchains/tree/master/configs/experimental/ubuntu16_04_clang
# - you might need to update the bazel_toolchains dependency in grpc_deps.bzl # - you might need to update the bazel_toolchains dependency in grpc_deps.bzl
build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.3/bazel_0.29.1/ubsan:toolchain build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.2/bazel_0.28.0/ubsan:toolchain

Loading…
Cancel
Save