Revert "Revert "Upgrade to bazel 1.0.0""

pull/20732/head
Jan Tattermusch 5 years ago committed by Jan Tattermusch
parent 456f08a064
commit e5e3f70a1a
  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

@ -27,6 +27,8 @@ 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,6 +31,10 @@ 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": [],
@ -165,7 +169,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 = []): 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 = {}):
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"])
@ -179,6 +183,7 @@ 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
@ -207,6 +212,7 @@ 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

@ -174,11 +174,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 = "22ca5b8115c8673ecb627a02b606529e813961e447933863fccdf325cc5f999f", sha256 = "e9bab54199722935f239cb1cd56a80be2ac3c3843e1a6d3492e2bc11f9c21daf",
strip_prefix = "bazel-toolchains-0.29.5", strip_prefix = "bazel-toolchains-1.0.0",
urls = [ urls = [
"https://github.com/bazelbuild/bazel-toolchains/releases/download/0.29.5/bazel-toolchains-0.29.5.tar.gz", "https://github.com/bazelbuild/bazel-toolchains/releases/download/1.0.0/bazel-toolchains-1.0.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/0.29.5.tar.gz", "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.0.0.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 0.29.1 ENV BAZEL_VERSION 1.0.0
# 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") load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE")
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_compatible_with = ["//third_party/toolchains/machine_size:large"], exec_properties = LARGE_MACHINE,
language = "C++", language = "C++",
tags = ["no_windows"], # machine_size:large is not configured for windows RBE tags = ["no_windows"], # LARGE_MACHINE 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") load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE")
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_compatible_with = ["//third_party/toolchains/machine_size:large"], exec_properties = LARGE_MACHINE,
language = "C++", language = "C++",
tags = ["no_windows"], # machine_size:large is not configured for windows RBE tags = ["no_windows"], # LARGE_MACHINE 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") load("//bazel:grpc_build_system.bzl", "grpc_cc_test", "grpc_cc_library", "grpc_cc_binary", "grpc_package", "LARGE_MACHINE")
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_compatible_with = ["//third_party/toolchains/machine_size:large"], exec_properties = LARGE_MACHINE,
tags = ["no_windows"], # machine_size:large is not configured for windows RBE tags = ["no_windows"], # LARGE_MACHINE is not configured for windows RBE
deps = [ deps = [
":benchmark_config", ":benchmark_config",
":driver_impl", ":driver_impl",

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

@ -74,7 +74,7 @@ RUN python3.6 -m ensurepip && \
# Bazel installation # Bazel installation
# Must be in sync with tools/bazel # Must be in sync with tools/bazel
ENV BAZEL_VERSION 0.29.1 ENV BAZEL_VERSION 1.0.0
# 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 0.29.1 ENV BAZEL_VERSION 1.0.0
# 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 0.29.1 --limit-output choco install bazel -y --version 1.0.0 --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.2/bazel_0.28.0/ubsan:toolchain build:ubsan --crosstool_top=@bazel_toolchains//configs/experimental/ubuntu16_04_clang/1.3/bazel_0.29.1/ubsan:toolchain

Loading…
Cancel
Save