bazel RBE Windows build

pull/18546/head
Bill Feng 6 years ago
parent e7d09ecb63
commit df89d8e157
  1. 1
      BUILD
  2. 2
      WORKSPACE
  3. 5
      test/core/end2end/generate_tests.bzl
  4. 4
      test/core/handshake/BUILD
  5. 1
      test/core/network_benchmarks/BUILD
  6. 1
      test/core/util/BUILD
  7. 30
      third_party/toolchains/BUILD
  8. 188
      third_party/toolchains/bazel_0.23.2/BUILD
  9. 1704
      third_party/toolchains/bazel_0.23.2/cc_toolchain_config.bzl
  10. 23
      third_party/toolchains/bazel_0.23.2/dummy_toolchain.bzl
  11. 2
      tools/internal_ci/linux/grpc_bazel_build_in_docker.sh
  12. 48
      tools/remote_build/windows.bazelrc

@ -2347,6 +2347,7 @@ grpc_cc_library(
":google_api_upb",
":proto_gen_validate_upb",
],
tags = ["no_windows"],
)
grpc_cc_library(

@ -11,10 +11,12 @@ grpc_test_only_deps()
register_execution_platforms(
"//third_party/toolchains:rbe_ubuntu1604",
"//third_party/toolchains:rbe_ubuntu1604_large",
"//third_party/toolchains:rbe_windows",
)
register_toolchains(
"//third_party/toolchains:cc-toolchain-clang-x86_64-default",
"//third_party/toolchains/bazel_0.23.2:cc-toolchain-x64_windows",
)
# TODO(https://github.com/grpc/grpc/issues/18331): Move off of this dependency.

@ -385,6 +385,7 @@ def grpc_end2end_tests():
":proxy",
":local_util",
],
tags = ["no_windows"],
)
for f, fopt in END2END_FIXTURES.items():
@ -398,6 +399,7 @@ def grpc_end2end_tests():
"//:grpc",
"//:gpr",
],
tags = ["no_windows"],
)
for t, topt in END2END_TESTS.items():
#print(_compatible(fopt, topt), f, t, fopt, topt)
@ -413,6 +415,7 @@ def grpc_end2end_tests():
t,
poller,
],
tags = ["no_windows"],
)
def grpc_end2end_nosec_tests():
@ -435,6 +438,7 @@ def grpc_end2end_nosec_tests():
":proxy",
":local_util",
],
tags = ["no_windows"],
)
for f, fopt in END2END_NOSEC_FIXTURES.items():
@ -450,6 +454,7 @@ def grpc_end2end_nosec_tests():
"//:grpc_unsecure",
"//:gpr",
],
tags = ["no_windows"],
)
for t, topt in END2END_TESTS.items():
#print(_compatible(fopt, topt), f, t, fopt, topt)

@ -32,6 +32,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_library(
@ -43,6 +44,7 @@ grpc_cc_library(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -60,6 +62,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(
@ -77,6 +80,7 @@ grpc_cc_test(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)
grpc_cc_test(

@ -33,4 +33,5 @@ grpc_cc_binary(
"//:grpc",
"//test/core/util:grpc_test_util",
],
tags = ["no_windows"],
)

@ -133,6 +133,7 @@ grpc_cc_library(
":grpc_test_util",
"//:grpc",
],
tags = ["no_windows"],
)
grpc_cc_test(

@ -28,6 +28,36 @@ alias(
actual = ":rbe_ubuntu1604_r346485_large",
)
alias(
name = "rbe_windows",
actual = ":rbe_windows_1803",
)
# RBE Windows
platform(
name = "rbe_windows_1803",
constraint_values = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:msvc",
],
remote_execution_properties = """
properties: {
name: "container-image"
value:"docker://gcr.io/grpc-testing/rbe_windows_toolchain@sha256:689b177e4a157c431c7077d19d043de27922c37de835031f29c9093b8d5c6370"
}
properties: {
name: "gceMachineType" # Small machines for majority of tests.
value: "n1-highmem-2"
}
properties:{
name: "OSFamily"
value: "Windows"
}
""",
)
# RBE Ubuntu16_04 r346485
platform(
name = "rbe_ubuntu1604_r346485",

@ -0,0 +1,188 @@
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This becomes the BUILD file for @local_config_cc// under Windows.
licenses(["notice"]) # Apache v2
package(default_visibility = ["//visibility:public"])
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
# Hardcoded toolchain, legacy behaviour.
cc_toolchain_suite(
name = "toolchain",
toolchains = {
"armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a",
"x64_windows|msvc-cl": ":cc-compiler-x64_windows",
"x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys",
"x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw",
"x64_windows_msys": ":cc-compiler-x64_windows_msys",
"x64_windows": ":cc-compiler-x64_windows",
"armeabi-v7a": ":cc-compiler-armeabi-v7a",
},
)
cc_toolchain(
name = "cc-compiler-x64_windows_msys",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msys_x64",
toolchain_identifier = "msys_x64",
)
cc_toolchain_config(
name = "msys_x64",
compiler = "msys-gcc",
cpu = "x64_windows",
)
toolchain(
name = "cc-toolchain-x64_windows_msys",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:msys",
],
target_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows_msys",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows_mingw",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 0,
toolchain_config = ":msys_x64_mingw",
toolchain_identifier = "msys_x64_mingw",
)
cc_toolchain_config(
name = "msys_x64_mingw",
compiler = "mingw-gcc",
cpu = "x64_windows",
)
toolchain(
name = "cc-toolchain-x64_windows_mingw",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
"@bazel_tools//tools/cpp:mingw",
],
target_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows_mingw",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-x64_windows",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":msvc_x64",
toolchain_identifier = "msvc_x64",
)
cc_toolchain_config(
name = "msvc_x64",
compiler = "msvc-cl",
cpu = "x64_windows",
)
toolchain(
name = "cc-toolchain-x64_windows",
exec_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
],
target_compatible_with = [
"@bazel_tools//platforms:x86_64",
"@bazel_tools//platforms:windows",
],
toolchain = ":cc-compiler-x64_windows",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
cc_toolchain(
name = "cc-compiler-armeabi-v7a",
all_files = ":empty",
ar_files = ":empty",
as_files = ":empty",
compiler_files = ":empty",
dwp_files = ":empty",
linker_files = ":empty",
objcopy_files = ":empty",
strip_files = ":empty",
supports_param_files = 1,
toolchain_config = ":stub_armeabi-v7a",
toolchain_identifier = "stub_armeabi-v7a",
)
cc_toolchain_config(
name = "stub_armeabi-v7a",
compiler = "compiler",
cpu = "armeabi-v7a",
)
toolchain(
name = "cc-toolchain-armeabi-v7a",
exec_compatible_with = [
],
target_compatible_with = [
"@bazel_tools//platforms:arm",
"@bazel_tools//platforms:android",
],
toolchain = ":cc-compiler-armeabi-v7a",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
filegroup(
name = "link_dynamic_library",
srcs = ["link_dynamic_library.sh"],
)

File diff suppressed because it is too large Load Diff

@ -0,0 +1,23 @@
# pylint: disable=g-bad-file-header
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Skylark rule that stubs a toolchain."""
def _dummy_toolchain_impl(ctx):
ctx = ctx # unused argument
toolchain = platform_common.ToolchainInfo()
return [toolchain]
dummy_toolchain = rule(_dummy_toolchain_impl, attrs = {})

@ -25,4 +25,4 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc
${name}')
cd /var/local/git/grpc
#TODO(yfen): add back examples/... to build targets once python rules issues are resolved
bazel build --spawn_strategy=standalone --genrule_strategy=standalone :all test/...
bazel build --spawn_strategy=standalone --genrule_strategy=standalone :all test/...

@ -1,3 +1,51 @@
# TODO(yfen): Merge with rbe_common.bazelrc and enable Windows RBE
startup --host_jvm_args=-Dbazel.DigestFunction=SHA256
build --remote_cache=remotebuildexecution.googleapis.com
build --remote_executor=remotebuildexecution.googleapis.com
build --tls_enabled=true
build --host_crosstool_top=//third_party/toolchains/bazel_0.23.2:toolchain
build --crosstool_top=//third_party/toolchains/bazel_0.23.2:toolchain
build --extra_toolchains=//third_party/toolchains/bazel_0.23.2:cc-toolchain-x64_windows
# Use custom execution platforms defined in third_party/toolchains
build --extra_execution_platforms=//third_party/toolchains:rbe_windows
build --host_platform=//third_party/toolchains:rbe_windows
build --platforms=//third_party/toolchains:rbe_windows
build --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe
build --python_path=C:\\Python27\\python.exe
build --spawn_strategy=remote
build --strategy=Javac=remote
build --strategy=Closure=remote
build --genrule_strategy=remote
build --remote_timeout=3600
build --remote_instance_name=projects/grpc-testing/instances/grpc-windows-rbe-test
build --verbose_failures=true
build --experimental_strict_action_env=true
build --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
# don't use port server
build --define GRPC_PORT_ISOLATED_RUNTIME=1
build --test_tag_filters=-no_windows
build --build_tag_filters=-no_windows
# without verbose gRPC logs the test outputs are not very useful
test --test_env=GRPC_VERBOSITY=debug
# Set flags for uploading to BES in order to view results in the Bazel Build
# Results UI.
build --bes_backend="buildeventservice.googleapis.com"
build --bes_timeout=60s
build --bes_results_url="https://source.cloud.google.com/results/invocations/"
build --project_id=grpc-testing
build --jobs=30
# print output for tests that fail (default is "summary")
build --test_output=errors

Loading…
Cancel
Save