diff --git a/test/distrib/bazel/test_single_bazel_version.sh b/test/distrib/bazel/test_single_bazel_version.sh index 663d9b19580..264c6dd8e91 100755 --- a/test/distrib/bazel/test_single_bazel_version.sh +++ b/test/distrib/bazel/test_single_bazel_version.sh @@ -35,7 +35,7 @@ EXCLUDED_TARGETS=( # This appears to be a legitimately broken BUILD file. There's a reference to # a non-existent "link_dynamic_library.sh". - "-//third_party/toolchains/bazel_0.26.0_rbe_windows:all" + "-//third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019:all" # TODO(jtattermusch): add back once fixed "-//examples/android/binder/..." diff --git a/third_party/toolchains/BUILD b/third_party/toolchains/BUILD index a78d4e1bc6e..cc536ba7ab5 100644 --- a/third_party/toolchains/BUILD +++ b/third_party/toolchains/BUILD @@ -32,7 +32,7 @@ platform( ], exec_properties = create_rbe_exec_properties_dict( # See rbe_win2019/Dockerfile for image details - container_image = "docker://gcr.io/grpc-testing/rbe_windows2019_withdbg_toolchain@sha256:7b04ee7e29f942adbf4f70edd2ec4ba20a3e7237e1b54f5cae4b239c6ca41105", + container_image = "docker://gcr.io/grpc-testing/rbe_windows2019@sha256:41772e8eeb9dd8c8b996bf32d58164d84b2315c8e81e634bbff5a0216b7f52fd", os_family = "Windows", labels = {"os": "windows_2019", "machine_size": "small"}, ), diff --git a/third_party/toolchains/README.md b/third_party/toolchains/README.md index 4a268256463..b60c1c02864 100644 --- a/third_party/toolchains/README.md +++ b/third_party/toolchains/README.md @@ -1,5 +1,8 @@ # Windows RBE toolchain configuration -- bazel_0.26.0_rbe_windows: The autogenerated toolchain for windows RBE. See go/rbe-windows-user-guide +- rbe_windows_bazel_5.2.0_vs2019: The autogenerated toolchain configuration for windows RBE. + Note that the bazel version denotes the bazel version that was used to generate the toolchain configuration. The configuration + can be use with different bazel versions (as long as it works). + See go/rbe-windows-user-guide - rbe_win2019: The windows dockerfile to rebuild the docker image we use on RBE workers. See go/rbe-windows-user-guide \ No newline at end of file diff --git a/third_party/toolchains/bazel_0.26.0_rbe_windows/BUILD b/third_party/toolchains/bazel_0.26.0_rbe_windows/BUILD deleted file mode 100644 index 975a6d51571..00000000000 --- a/third_party/toolchains/bazel_0.26.0_rbe_windows/BUILD +++ /dev/null @@ -1,187 +0,0 @@ -# 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. - -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 = [ - "@platforms//cpu:x86_64", - "@platforms//os:windows", - "@bazel_tools//tools/cpp:msys", - ], - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os: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 = [ - "@platforms//cpu:x86_64", - "@platforms//os:windows", - "@bazel_tools//tools/cpp:mingw", - ], - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os: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 = [ - "@platforms//cpu:x86_64", - "@platforms//os:windows", - ], - target_compatible_with = [ - "@platforms//cpu:x86_64", - "@platforms//os: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 = [ - "@platforms//cpu:arm", - "@platforms//os:android", - ], - toolchain = ":cc-compiler-armeabi-v7a", - toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", -) - -filegroup( - name = "link_dynamic_library", - srcs = ["link_dynamic_library.sh"], -) diff --git a/third_party/toolchains/bazel_0.26.0_rbe_windows/cc_toolchain_config.bzl b/third_party/toolchains/bazel_0.26.0_rbe_windows/cc_toolchain_config.bzl deleted file mode 100644 index 3b1c6a41f38..00000000000 --- a/third_party/toolchains/bazel_0.26.0_rbe_windows/cc_toolchain_config.bzl +++ /dev/null @@ -1,1718 +0,0 @@ -# Copyright 2019 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. - -"""A Starlark cc_toolchain configuration rule""" - -load( - "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", - "action_config", - "artifact_name_pattern", - "env_entry", - "env_set", - "feature", - "feature_set", - "flag_group", - "flag_set", - "make_variable", - "tool", - "tool_path", - "variable_with_value", - "with_feature_set", -) -load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") - -all_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.clif_match, - ACTION_NAMES.lto_backend, -] - -all_cpp_compile_actions = [ - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.clif_match, -] - -preprocessor_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.clif_match, -] - -codegen_compile_actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, -] - -all_link_actions = [ - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, -] - -def _windows_msvc_impl(ctx): - toolchain_identifier = "msvc_x64" - host_system_name = "local" - target_system_name = "local" - target_cpu = "x64_windows" - target_libc = "msvcrt" - compiler = "msvc-cl" - abi_version = "local" - abi_libc_version = "local" - cc_target_os = None - builtin_sysroot = None - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - cpp_link_nodeps_dynamic_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_nodeps_dynamic_library, - implies = [ - "nologo", - "shared_flag", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - "has_configured_linker_path", - "def_file", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - cpp_link_static_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_static_library, - implies = [ - "nologo", - "archiver_flags", - "input_param_flags", - "linker_param_file", - "msvc_env", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/lib.exe")], - ) - - assemble_action = action_config( - action_name = ACTION_NAMES.assemble, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "nologo", - "msvc_env", - "sysroot", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe")], - ) - - preprocess_assemble_action = action_config( - action_name = ACTION_NAMES.preprocess_assemble, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "nologo", - "msvc_env", - "sysroot", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe")], - ) - - c_compile_action = action_config( - action_name = ACTION_NAMES.c_compile, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "default_compile_flags", - "nologo", - "msvc_env", - "parse_showincludes", - "user_compile_flags", - "sysroot", - "unfiltered_compile_flags", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")], - ) - - cpp_compile_action = action_config( - action_name = ACTION_NAMES.cpp_compile, - implies = [ - "compiler_input_flags", - "compiler_output_flags", - "default_compile_flags", - "nologo", - "msvc_env", - "parse_showincludes", - "user_compile_flags", - "sysroot", - "unfiltered_compile_flags", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe")], - ) - - cpp_link_executable_action = action_config( - action_name = ACTION_NAMES.cpp_link_executable, - implies = [ - "nologo", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - cpp_link_dynamic_library_action = action_config( - action_name = ACTION_NAMES.cpp_link_dynamic_library, - implies = [ - "nologo", - "shared_flag", - "linkstamps", - "output_execpath_flags", - "input_param_flags", - "user_link_flags", - "default_link_flags", - "linker_subsystem_flag", - "linker_param_file", - "msvc_env", - "no_stripping", - "has_configured_linker_path", - "def_file", - ], - tools = [tool(path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe")], - ) - - action_configs = [ - assemble_action, - preprocess_assemble_action, - c_compile_action, - cpp_compile_action, - cpp_link_executable_action, - cpp_link_dynamic_library_action, - cpp_link_nodeps_dynamic_library_action, - cpp_link_static_library_action, - ] - - msvc_link_env_feature = feature( - name = "msvc_link_env", - env_sets = [ - env_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - env_entries = [env_entry(key = "LIB", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB\\amd64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.10240.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x64;")], - ), - ], - ) - - shared_flag_feature = feature( - name = "shared_flag", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [flag_group(flags = ["/DLL"])], - ), - ], - ) - - determinism_feature = feature( - name = "determinism", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [ - flag_group( - flags = [ - "/wd4117", - "-D__DATE__=\"redacted\"", - "-D__TIMESTAMP__=\"redacted\"", - "-D__TIME__=\"redacted\"", - ], - ), - ], - ), - ], - ) - - sysroot_feature = feature( - name = "sysroot", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["--sysroot=%{sysroot}"], - iterate_over = "sysroot", - expand_if_available = "sysroot", - ), - ], - ), - ], - ) - - unfiltered_compile_flags_feature = feature( - name = "unfiltered_compile_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["%{unfiltered_compile_flags}"], - iterate_over = "unfiltered_compile_flags", - expand_if_available = "unfiltered_compile_flags", - ), - ], - ), - ], - ) - - compiler_param_file_feature = feature( - name = "compiler_param_file", - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - input_param_flags_feature = feature( - name = "input_param_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["/IMPLIB:%{interface_library_output_path}"], - expand_if_available = "interface_library_output_path", - ), - ], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{libopts}"], - iterate_over = "libopts", - expand_if_available = "libopts", - ), - ], - ), - flag_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - iterate_over = "libraries_to_link", - flag_groups = [ - flag_group( - iterate_over = "libraries_to_link.object_files", - flag_groups = [flag_group(flags = ["%{libraries_to_link.object_files}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file_group", - ), - ), - flag_group( - flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "object_file", - ), - ), - flag_group( - flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "interface_library", - ), - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["%{libraries_to_link.name}"], - expand_if_false = "libraries_to_link.is_whole_archive", - ), - flag_group( - flags = ["/WHOLEARCHIVE:%{libraries_to_link.name}"], - expand_if_true = "libraries_to_link.is_whole_archive", - ), - ], - expand_if_equal = variable_with_value( - name = "libraries_to_link.type", - value = "static_library", - ), - ), - ], - expand_if_available = "libraries_to_link", - ), - ], - ), - ], - ) - - fastbuild_feature = feature( - name = "fastbuild", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Od", "/Z7"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEBUG:FASTLINK", "/INCREMENTAL:NO"], - ), - ], - ), - ], - implies = ["generate_pdb_file"], - ) - - user_compile_flags_feature = feature( - name = "user_compile_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["%{user_compile_flags}"], - iterate_over = "user_compile_flags", - expand_if_available = "user_compile_flags", - ), - ], - ), - ], - ) - - archiver_flags_feature = feature( - name = "archiver_flags", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - flags = ["/OUT:%{output_execpath}"], - expand_if_available = "output_execpath", - ), - flag_group( - flags = ["/MACHINE:X64"], - ), - ], - ), - ], - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/MACHINE:X64"])], - ), - ], - ) - - static_link_msvcrt_feature = feature(name = "static_link_msvcrt") - - dynamic_link_msvcrt_debug_feature = feature( - name = "dynamic_link_msvcrt_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MDd"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrtd.lib"])], - ), - ], - requires = [feature_set(features = ["dbg"])], - ) - - dbg_feature = feature( - name = "dbg", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Od", "/Z7"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEBUG:FULL", "/INCREMENTAL:NO"], - ), - ], - ), - ], - implies = ["generate_pdb_file"], - ) - - opt_feature = feature( - name = "opt", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/O2"])], - ), - ], - implies = ["frame_pointer"], - ) - - supports_interface_shared_libraries_feature = feature( - name = "supports_interface_shared_libraries", - enabled = True, - ) - - user_link_flags_feature = feature( - name = "user_link_flags", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{user_link_flags}"], - iterate_over = "user_link_flags", - expand_if_available = "user_link_flags", - ), - ], - ), - ], - ) - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = [ - flag_group( - flags = [ - "/DCOMPILER_MSVC", - "/DNOMINMAX", - "/D_WIN32_WINNT=0x0601", - "/D_CRT_SECURE_NO_DEPRECATE", - "/D_CRT_SECURE_NO_WARNINGS", - "/bigobj", - "/Zm500", - "/EHsc", - "/wd4351", - "/wd4291", - "/wd4250", - "/wd4996", - ], - ), - ], - ), - ], - ) - - msvc_compile_env_feature = feature( - name = "msvc_compile_env", - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ], - env_entries = [env_entry(key = "INCLUDE", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt;")], - ), - ], - ) - - preprocessor_defines_feature = feature( - name = "preprocessor_defines", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ], - flag_groups = [ - flag_group( - flags = ["/D%{preprocessor_defines}"], - iterate_over = "preprocessor_defines", - ), - ], - ), - ], - ) - - generate_pdb_file_feature = feature( - name = "generate_pdb_file", - requires = [ - feature_set(features = ["dbg"]), - feature_set(features = ["fastbuild"]), - ], - ) - - output_execpath_flags_feature = feature( - name = "output_execpath_flags", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/OUT:%{output_execpath}"], - expand_if_available = "output_execpath", - ), - ], - ), - ], - ) - - dynamic_link_msvcrt_no_debug_feature = feature( - name = "dynamic_link_msvcrt_no_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MD"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrt.lib"])], - ), - ], - requires = [ - feature_set(features = ["fastbuild"]), - feature_set(features = ["opt"]), - ], - ) - - disable_assertions_feature = feature( - name = "disable_assertions", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/DNDEBUG"])], - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - has_configured_linker_path_feature = feature(name = "has_configured_linker_path") - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - no_stripping_feature = feature(name = "no_stripping") - - linker_param_file_feature = feature( - name = "linker_param_file", - flag_sets = [ - flag_set( - actions = all_link_actions + - [ACTION_NAMES.cpp_link_static_library], - flag_groups = [ - flag_group( - flags = ["@%{linker_param_file}"], - expand_if_available = "linker_param_file", - ), - ], - ), - ], - ) - - ignore_noisy_warnings_feature = feature( - name = "ignore_noisy_warnings", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.cpp_link_static_library], - flag_groups = [flag_group(flags = ["/ignore:4221"])], - ), - ], - ) - - no_legacy_features_feature = feature(name = "no_legacy_features") - - parse_showincludes_feature = feature( - name = "parse_showincludes", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_header_parsing, - ], - flag_groups = [flag_group(flags = ["/showIncludes"])], - ), - ], - ) - - static_link_msvcrt_no_debug_feature = feature( - name = "static_link_msvcrt_no_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MT"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmt.lib"])], - ), - ], - requires = [ - feature_set(features = ["fastbuild"]), - feature_set(features = ["opt"]), - ], - ) - - treat_warnings_as_errors_feature = feature( - name = "treat_warnings_as_errors", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/WX"])], - ), - ], - ) - - windows_export_all_symbols_feature = feature(name = "windows_export_all_symbols") - - no_windows_export_all_symbols_feature = feature(name = "no_windows_export_all_symbols") - - include_paths_feature = feature( - name = "include_paths", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ], - flag_groups = [ - flag_group( - flags = ["/I%{quote_include_paths}"], - iterate_over = "quote_include_paths", - ), - flag_group( - flags = ["/I%{include_paths}"], - iterate_over = "include_paths", - ), - flag_group( - flags = ["/I%{system_include_paths}"], - iterate_over = "system_include_paths", - ), - ], - ), - ], - ) - - linkstamps_feature = feature( - name = "linkstamps", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["%{linkstamp_paths}"], - iterate_over = "linkstamp_paths", - expand_if_available = "linkstamp_paths", - ), - ], - ), - ], - ) - - targets_windows_feature = feature( - name = "targets_windows", - enabled = True, - implies = ["copy_dynamic_libraries_to_binary"], - ) - - linker_subsystem_flag_feature = feature( - name = "linker_subsystem_flag", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/SUBSYSTEM:CONSOLE"])], - ), - ], - ) - - static_link_msvcrt_debug_feature = feature( - name = "static_link_msvcrt_debug", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/MTd"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmtd.lib"])], - ), - ], - requires = [feature_set(features = ["dbg"])], - ) - - frame_pointer_feature = feature( - name = "frame_pointer", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Oy-"])], - ), - ], - ) - - compiler_output_flags_feature = feature( - name = "compiler_output_flags", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.assemble], - flag_groups = [ - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fo%{output_file}", "/Zi"], - expand_if_available = "output_file", - expand_if_not_available = "output_assembly_file", - ), - ], - expand_if_not_available = "output_preprocess_file", - ), - ], - ), - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fo%{output_file}"], - expand_if_not_available = "output_preprocess_file", - ), - ], - expand_if_available = "output_file", - expand_if_not_available = "output_assembly_file", - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["/Fa%{output_file}"], - expand_if_available = "output_assembly_file", - ), - ], - expand_if_available = "output_file", - ), - flag_group( - flag_groups = [ - flag_group( - flags = ["/P", "/Fi%{output_file}"], - expand_if_available = "output_preprocess_file", - ), - ], - expand_if_available = "output_file", - ), - ], - ), - ], - ) - - nologo_feature = feature( - name = "nologo", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - flag_groups = [flag_group(flags = ["/nologo"])], - ), - ], - ) - - smaller_binary_feature = feature( - name = "smaller_binary", - enabled = True, - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [flag_group(flags = ["/Gy", "/Gw"])], - with_features = [with_feature_set(features = ["opt"])], - ), - flag_set( - actions = all_link_actions, - flag_groups = [flag_group(flags = ["/OPT:ICF", "/OPT:REF"])], - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - compiler_input_flags_feature = feature( - name = "compiler_input_flags", - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ], - flag_groups = [ - flag_group( - flags = ["/c", "%{source_file}"], - expand_if_available = "source_file", - ), - ], - ), - ], - ) - - def_file_feature = feature( - name = "def_file", - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = [ - flag_group( - flags = ["/DEF:%{def_file_path}", "/ignore:4070"], - expand_if_available = "def_file_path", - ), - ], - ), - ], - ) - - msvc_env_feature = feature( - name = "msvc_env", - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\amd64;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x64;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86;;C:\\Windows\\system32"), - env_entry(key = "TMP", value = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp"), - env_entry(key = "TEMP", value = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp"), - ], - ), - ], - implies = ["msvc_compile_env", "msvc_link_env"], - ) - - features = [ - no_legacy_features_feature, - nologo_feature, - has_configured_linker_path_feature, - no_stripping_feature, - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - default_compile_flags_feature, - msvc_env_feature, - msvc_compile_env_feature, - msvc_link_env_feature, - include_paths_feature, - preprocessor_defines_feature, - parse_showincludes_feature, - generate_pdb_file_feature, - shared_flag_feature, - linkstamps_feature, - output_execpath_flags_feature, - archiver_flags_feature, - input_param_flags_feature, - linker_subsystem_flag_feature, - user_link_flags_feature, - default_link_flags_feature, - linker_param_file_feature, - static_link_msvcrt_feature, - static_link_msvcrt_no_debug_feature, - dynamic_link_msvcrt_no_debug_feature, - static_link_msvcrt_debug_feature, - dynamic_link_msvcrt_debug_feature, - dbg_feature, - fastbuild_feature, - opt_feature, - frame_pointer_feature, - disable_assertions_feature, - determinism_feature, - treat_warnings_as_errors_feature, - smaller_binary_feature, - ignore_noisy_warnings_feature, - user_compile_flags_feature, - sysroot_feature, - unfiltered_compile_flags_feature, - compiler_param_file_feature, - compiler_output_flags_feature, - compiler_input_flags_feature, - def_file_feature, - windows_export_all_symbols_feature, - no_windows_export_all_symbols_feature, - supports_dynamic_linker_feature, - supports_interface_shared_libraries_feature, - ] - - artifact_name_patterns = [ - artifact_name_pattern( - category_name = "object_file", - prefix = "", - extension = ".obj", - ), - artifact_name_pattern( - category_name = "static_library", - prefix = "", - extension = ".lib", - ), - artifact_name_pattern( - category_name = "alwayslink_static_library", - prefix = "", - extension = ".lo.lib", - ), - artifact_name_pattern( - category_name = "executable", - prefix = "", - extension = ".exe", - ), - artifact_name_pattern( - category_name = "dynamic_library", - prefix = "", - extension = ".dll", - ), - artifact_name_pattern( - category_name = "interface_library", - prefix = "", - extension = ".if.lib", - ), - ] - - make_variables = [] - - tool_paths = [ - tool_path(name = "ar", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/lib.exe"), - tool_path(name = "ml", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/ml64.exe"), - tool_path(name = "cpp", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"), - tool_path(name = "gcc", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"), - tool_path(name = "gcov", path = "wrapper/bin/msvc_nop.bat"), - tool_path(name = "ld", path = "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/link.exe"), - tool_path(name = "nm", path = "wrapper/bin/msvc_nop.bat"), - tool_path( - name = "objcopy", - path = "wrapper/bin/msvc_nop.bat", - ), - tool_path( - name = "objdump", - path = "wrapper/bin/msvc_nop.bat", - ), - tool_path( - name = "strip", - path = "wrapper/bin/msvc_nop.bat", - ), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = None, - ) - -def _windows_msys_mingw_impl(ctx): - toolchain_identifier = "msys_x64_mingw" - host_system_name = "local" - target_system_name = "local" - target_cpu = "x64_windows" - target_libc = "mingw" - compiler = "mingw-gcc" - abi_version = "local" - abi_libc_version = "local" - cc_target_os = None - builtin_sysroot = None - action_configs = [] - - targets_windows_feature = feature( - name = "targets_windows", - implies = ["copy_dynamic_libraries_to_binary"], - enabled = True, - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - gcc_env_feature = feature( - name = "gcc_env", - enabled = True, - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "c:/tools/msys64/mingw64/bin"), - ], - ), - ], - ) - - msys_mingw_flags = [ - "-std=gnu++0x", - ] - msys_mingw_link_flags = [ - "-lstdc++", - ] - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - ), - flag_set( - actions = [ - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = msys_mingw_flags)] if msys_mingw_flags else []), - ), - ], - ) - - compiler_param_file_feature = feature( - name = "compiler_param_file", - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = msys_mingw_link_flags)] if msys_mingw_link_flags else []), - ), - ], - ) - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - features = [ - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - gcc_env_feature, - default_compile_flags_feature, - compiler_param_file_feature, - default_link_flags_feature, - supports_dynamic_linker_feature, - ] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "c:/tools/msys64/mingw64/", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - artifact_name_patterns = [ - artifact_name_pattern( - category_name = "executable", - prefix = "", - extension = ".exe", - ), - ] - - make_variables = [] - tool_paths = [ - tool_path(name = "ar", path = "c:/tools/msys64/mingw64/bin/ar"), - tool_path(name = "compat-ld", path = "c:/tools/msys64/mingw64/bin/ld"), - tool_path(name = "cpp", path = "c:/tools/msys64/mingw64/bin/cpp"), - tool_path(name = "dwp", path = "c:/tools/msys64/mingw64/bin/dwp"), - tool_path(name = "gcc", path = "c:/tools/msys64/mingw64/bin/gcc"), - tool_path(name = "gcov", path = "c:/tools/msys64/mingw64/bin/gcov"), - tool_path(name = "ld", path = "c:/tools/msys64/mingw64/bin/ld"), - tool_path(name = "nm", path = "c:/tools/msys64/mingw64/bin/nm"), - tool_path(name = "objcopy", path = "c:/tools/msys64/mingw64/bin/objcopy"), - tool_path(name = "objdump", path = "c:/tools/msys64/mingw64/bin/objdump"), - tool_path(name = "strip", path = "c:/tools/msys64/mingw64/bin/strip"), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = cc_target_os, - ) - -def _armeabi_impl(ctx): - toolchain_identifier = "stub_armeabi-v7a" - host_system_name = "armeabi-v7a" - target_system_name = "armeabi-v7a" - target_cpu = "armeabi-v7a" - target_libc = "armeabi-v7a" - compiler = "compiler" - abi_version = "armeabi-v7a" - abi_libc_version = "armeabi-v7a" - cc_target_os = None - builtin_sysroot = None - action_configs = [] - - supports_pic_feature = feature(name = "supports_pic", enabled = True) - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - features = [supports_dynamic_linker_feature, supports_pic_feature] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - ] - artifact_name_patterns = [] - make_variables = [] - - tool_paths = [ - tool_path(name = "ar", path = "/bin/false"), - tool_path(name = "compat-ld", path = "/bin/false"), - tool_path(name = "cpp", path = "/bin/false"), - tool_path(name = "dwp", path = "/bin/false"), - tool_path(name = "gcc", path = "/bin/false"), - tool_path(name = "gcov", path = "/bin/false"), - tool_path(name = "ld", path = "/bin/false"), - tool_path(name = "nm", path = "/bin/false"), - tool_path(name = "objcopy", path = "/bin/false"), - tool_path(name = "objdump", path = "/bin/false"), - tool_path(name = "strip", path = "/bin/false"), - ] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = toolchain_identifier, - host_system_name = host_system_name, - target_system_name = target_system_name, - target_cpu = target_cpu, - target_libc = target_libc, - compiler = compiler, - abi_version = abi_version, - abi_libc_version = abi_libc_version, - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = builtin_sysroot, - cc_target_os = cc_target_os, - ) - -def _impl(ctx): - if ctx.attr.cpu == "armeabi-v7a": - return _armeabi_impl(ctx) - elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "msvc-cl": - return _windows_msvc_impl(ctx) - elif ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "mingw-gcc": - return _windows_msys_mingw_impl(ctx) - - tool_paths = [ - tool_path(name = "ar", path = "c:/tools/msys64/usr/bin/ar"), - tool_path(name = "compat-ld", path = "c:/tools/msys64/usr/bin/ld"), - tool_path(name = "cpp", path = "c:/tools/msys64/usr/bin/cpp"), - tool_path(name = "dwp", path = "c:/tools/msys64/usr/bin/dwp"), - tool_path(name = "gcc", path = "c:/tools/msys64/usr/bin/gcc"), - tool_path(name = "gcov", path = "c:/tools/msys64/usr/bin/gcov"), - tool_path(name = "ld", path = "c:/tools/msys64/usr/bin/ld"), - tool_path(name = "nm", path = "c:/tools/msys64/usr/bin/nm"), - tool_path(name = "objcopy", path = "c:/tools/msys64/usr/bin/objcopy"), - tool_path(name = "objdump", path = "c:/tools/msys64/usr/bin/objdump"), - tool_path(name = "strip", path = "c:/tools/msys64/usr/bin/strip"), - ] - - cxx_builtin_include_directories = [ - # This is a workaround for https://github.com/bazelbuild/bazel/issues/5087. - "C:\\botcode\\w", - "c:/tools/msys64/usr/", - "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE", - "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10240.0\\ucrt", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um", - "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt", - ] - - action_configs = [] - - compile_flags = [ - ] - - dbg_compile_flags = [ - ] - - opt_compile_flags = [ - ] - - cxx_flags = [ - "-std=gnu++0x", - ] - - link_flags = [ - "-lstdc++", - ] - - opt_link_flags = [ - ] - - unfiltered_compile_flags = [ - ] - - targets_windows_feature = feature( - name = "targets_windows", - implies = ["copy_dynamic_libraries_to_binary"], - enabled = True, - ) - - copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") - - gcc_env_feature = feature( - name = "gcc_env", - enabled = True, - env_sets = [ - env_set( - actions = [ - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ACTION_NAMES.cpp_link_static_library, - ], - env_entries = [ - env_entry(key = "PATH", value = "c:/tools/msys64/usr/bin"), - ], - ), - ], - ) - - windows_features = [ - targets_windows_feature, - copy_dynamic_libraries_to_binary_feature, - gcc_env_feature, - ] - - supports_pic_feature = feature( - name = "supports_pic", - enabled = True, - ) - supports_start_end_lib_feature = feature( - name = "supports_start_end_lib", - enabled = True, - ) - - default_compile_flags_feature = feature( - name = "default_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = compile_flags)] if compile_flags else []), - ), - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = dbg_compile_flags)] if dbg_compile_flags else []), - with_features = [with_feature_set(features = ["dbg"])], - ), - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = opt_compile_flags)] if opt_compile_flags else []), - with_features = [with_feature_set(features = ["opt"])], - ), - flag_set( - actions = [ - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = cxx_flags)] if cxx_flags else []), - ), - ], - ) - - default_link_flags_feature = feature( - name = "default_link_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = link_flags)] if link_flags else []), - ), - flag_set( - actions = all_link_actions, - flag_groups = ([flag_group(flags = opt_link_flags)] if opt_link_flags else []), - with_features = [with_feature_set(features = ["opt"])], - ), - ], - ) - - dbg_feature = feature(name = "dbg") - - opt_feature = feature(name = "opt") - - sysroot_feature = feature( - name = "sysroot", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ACTION_NAMES.cpp_link_executable, - ACTION_NAMES.cpp_link_dynamic_library, - ACTION_NAMES.cpp_link_nodeps_dynamic_library, - ], - flag_groups = [ - flag_group( - flags = ["--sysroot=%{sysroot}"], - expand_if_available = "sysroot", - ), - ], - ), - ], - ) - - fdo_optimize_feature = feature( - name = "fdo_optimize", - flag_sets = [ - flag_set( - actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], - flag_groups = [ - flag_group( - flags = [ - "-fprofile-use=%{fdo_profile_path}", - "-fprofile-correction", - ], - expand_if_available = "fdo_profile_path", - ), - ], - ), - ], - provides = ["profile"], - ) - - supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) - - user_compile_flags_feature = feature( - name = "user_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = [ - flag_group( - flags = ["%{user_compile_flags}"], - iterate_over = "user_compile_flags", - expand_if_available = "user_compile_flags", - ), - ], - ), - ], - ) - - unfiltered_compile_flags_feature = feature( - name = "unfiltered_compile_flags", - enabled = True, - flag_sets = [ - flag_set( - actions = [ - ACTION_NAMES.assemble, - ACTION_NAMES.preprocess_assemble, - ACTION_NAMES.linkstamp_compile, - ACTION_NAMES.c_compile, - ACTION_NAMES.cpp_compile, - ACTION_NAMES.cpp_header_parsing, - ACTION_NAMES.cpp_module_compile, - ACTION_NAMES.cpp_module_codegen, - ACTION_NAMES.lto_backend, - ACTION_NAMES.clif_match, - ], - flag_groups = ([flag_group(flags = unfiltered_compile_flags)] if unfiltered_compile_flags else []), - ), - ], - ) - - features = windows_features + [ - supports_pic_feature, - default_compile_flags_feature, - default_link_flags_feature, - fdo_optimize_feature, - supports_dynamic_linker_feature, - dbg_feature, - opt_feature, - user_compile_flags_feature, - sysroot_feature, - unfiltered_compile_flags_feature, - ] - - artifact_name_patterns = [ - artifact_name_pattern(category_name = "executable", prefix = "", extension = ".exe"), - ] - - make_variables = [] - - return cc_common.create_cc_toolchain_config_info( - ctx = ctx, - features = features, - action_configs = action_configs, - artifact_name_patterns = artifact_name_patterns, - cxx_builtin_include_directories = cxx_builtin_include_directories, - toolchain_identifier = "msys_x64", - host_system_name = "local", - target_system_name = "local", - target_cpu = "x64_windows", - target_libc = "msys", - compiler = "msys-gcc", - abi_version = "local", - abi_libc_version = "local", - tool_paths = tool_paths, - make_variables = make_variables, - builtin_sysroot = "", - cc_target_os = None, - ) - -cc_toolchain_config = rule( - implementation = _impl, - attrs = { - "cpu": attr.string(mandatory = True), - "compiler": attr.string(), - }, - provides = [CcToolchainConfigInfo], -) diff --git a/third_party/toolchains/rbe_win2019/Dockerfile b/third_party/toolchains/rbe_win2019/Dockerfile index b6efe2fb0dc..eb1d018ca6c 100644 --- a/third_party/toolchains/rbe_win2019/Dockerfile +++ b/third_party/toolchains/rbe_win2019/Dockerfile @@ -1,94 +1,83 @@ # This dockerfile is taken from go/rbe-windows-user-guide -# (including the fix --compilation_mode=dbg) +# Local modifications: +# * install VS2019 (instead of VS2022) +# TODO(jtattermusch): check the --compilation_mode=dbg fix -# This Dockerfile creates an image that: -# - Has the correct MTU setting for networking from inside the container to work. -# - Has Visual Studio 2015 Build Tools installed. -# - Has msys2 + git, curl, zip, unzip installed. -# - Has Python 2.7 installed. -# TODO(jsharpe): Consider replacing "ADD $URI $DEST" with "Invoke-WebRequest -Method Get -Uri $URI -OutFile $DEST" -# Use the latest Windows Server Core image. -# -# WARNING: What's the `:ltsc2019` about? -# There are two versions of Windows Server 2019: -# 1. A "regular" one (corresponding to `mcr.microsoft.com/windows/servercore:ltsc2019`) -# is on a slow release cadence and is the Long-Term Servicing Channel. -# Mainstream support for this image will end on 1/9/2024. -# 2. A "fast" release cadence one (corresponding to -# `mcr.microsoft.com/windows/servercore:1909`) is the Semi-Annual Channel. -# Mainstream support for this image will end on 5/11/2021. -# -# If you choose a different -# image than described above, change the `:ltsc2019` tag. -# Start a temporary container in which we install 7-Zip to extract msys2 -FROM mcr.microsoft.com/windows/servercore:ltsc2019 as extract-msys2 -SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; $VerbosePreference = 'Continue';"] -# Install 7-Zip and add it to the path. -ADD https://www.7-zip.org/a/7z1801-x64.msi C:\\TEMP\\7z.msi -RUN Start-Process msiexec.exe -ArgumentList \"/i C:\\TEMP\\7z.msi /qn /norestart /log C:\\TEMP\\7z_install_log.txt\" -wait -RUN $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path; \ - $newpath = \"$oldpath;C:\Program Files\7-Zip\"; \ - Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath -# Extract msys2 -ADD http://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20181211.tar.xz C:\\TEMP\\msys2.tar.xz -RUN 7z x C:\TEMP\msys2.tar.xz -oC:\TEMP\msys2.tar -RUN 7z x C:\TEMP\msys2.tar -oC:\tools -# Start building the actual image +# This Dockerfile creates an image that has the following: +# * correct MTU setting for networking from inside the container to work. +# * metadata server routes correctly installed +# * VC++ redistributable installed +# * Visual Studio 2019 Build Tools installed +# * msys2 + git, curl, zip, unzip installed +# * Python 3.10.4 installed +# * JDK 17.0.2 installed +# Use the latest stable Windows Server Core image (mainstream support ends 1/9/2024). FROM mcr.microsoft.com/windows/servercore:ltsc2019 +# Set default powershell policy for this script (ProgressPreference='SilentlyContinue' makes +# downloads with Invoke-WebRequest not show the progress bar and is MUCH faster). SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command", "$ErrorActionPreference='Stop'; $ProgressPreference='SilentlyContinue'; $VerbosePreference = 'Continue';"] -# TODO(b/112379377): Workaround until bug is fixed. -RUN Get-NetAdapter | Where-Object Name -like "*Ethernet*" | ForEach-Object { & netsh interface ipv4 set subinterface $_.InterfaceIndex mtu=1460 store=persistent } +# Workaround for networking (b/112379377) was closed as won't fix for MTU setting. +# Remaining lines handle making the metadata server on the VM accessible inside docker. +RUN Get-NetAdapter | Where-Object Name -like "*Ethernet*" | ForEach-Object { \ + & netsh interface ipv4 set subinterface $_.InterfaceIndex mtu=1460 store=persistent }; \ + $gateway = (Get-NetRoute | Where { $_.DestinationPrefix -eq \"0.0.0.0/0\" } | Sort-Object RouteMetric \ + | Select NextHop).NextHop; \ + $ifIndex = (Get-NetAdapter -InterfaceDescription \"Hyper-V Virtual Ethernet*\" | Sort-Object \ + | Select ifIndex).ifIndex; \ + New-NetRoute -DestinationPrefix 169.254.169.254/32 -InterfaceIndex $ifIndex -NextHop $gateway # Enable Long Paths for Win32 File/Folder APIs. -RUN New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -Value 1 -PropertyType DWORD -Force - -# Install Visual Studio 2015 Build Tools. -RUN Invoke-WebRequest "https://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe" \ - -OutFile visualcppbuildtools_full.exe -UseBasicParsing ; \ - Start-Process -FilePath 'visualcppbuildtools_full.exe' -ArgumentList '/quiet', '/NoRestart', '/InstallSelectableItems "Win10SDK_VisibleV1"' -Wait ; \ - Remove-Item .\visualcppbuildtools_full.exe; -# Add ucrtbased.dll to the system directory to allow --compilation_mode=dbg to -# work. This DLL should be automatically copied to C:\Windows\System32 by the -# installer, but isn't when the installer is run on Docker, for some reason. -RUN Copy-Item \"C:\Program Files (x86)\Windows Kits\10\bin\x64\ucrt\ucrtbased.dll\" C:\Windows\System32 - +RUN New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem \ + -Name LongPathsEnabled -Value 1 -PropertyType DWORD -Force +# Install Visual C++ Redistributable for Visual Studio 2015-2022. +RUN New-Item -Path "C:/" -Name "TEMP" -ItemType "directory"; \ + Invoke-WebRequest "https://aka.ms/vs/17/release/vc_redist.x64.exe" \ + -OutFile C:/TEMP/vc_redist.x64.exe -UseBasicParsing; \ + Start-Process -filepath C:/TEMP/vc_redist.x64.exe -ArgumentList '/install', '/passive', '/norestart' -Wait; \ + Remove-Item C:/TEMP/vc_redist.x64.exe -# TODO(jsharpe): Alternate install for msys2: https://github.com/StefanScherer/dockerfiles-windows/issues/30 -# From the temporary extract-msys2 container, copy the tools directory to this container -COPY --from=extract-msys2 ["C:/tools", "C:/tools"] -# Add msys2 to the PATH variable -RUN $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path; \ - $newpath = \"$oldpath;C:\tools\msys64;C:\tools\msys64\usr\bin\"; \ - Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath -# Bazel documentation says to use -Syuu but this doesn't work in Docker. See -# http://g/foundry-windows/PDMVXbGew7Y -RUN bash.exe -c \"pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys && pacman --noconfirm -Syy git curl zip unzip\" -# Install Visual C++ Redistributable for Visual Studio 2015: -ADD https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe C:\\TEMP\\vc_redist.x64.exe -RUN C:\TEMP\vc_redist.x64.exe /quiet /install -# Install Python 2.7. -ADD https://www.python.org/ftp/python/2.7.14/python-2.7.14.amd64.msi C:\\TEMP\\python.msi -RUN Start-Process msiexec.exe -ArgumentList \"/i C:\\TEMP\\python.msi /qn /norestart /log C:\\TEMP\\python_install_log.txt\" -wait -RUN $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path; \ - $newpath = \"$oldpath;C:\Python27\"; \ - Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath -RUN \ - Add-Type -AssemblyName \"System.IO.Compression.FileSystem\"; \ - $zulu_url = \"https://cdn.azul.com/zulu/bin/zulu8.28.0.1-jdk8.0.163-win_x64.zip\"; \ - $zulu_zip = \"c:\\temp\\zulu8.28.0.1-jdk8.0.163-win_x64.zip\"; \ - $zulu_extracted_path = \"c:\\temp\\\" + [IO.Path]::GetFileNameWithoutExtension($zulu_zip); \ - $zulu_root = \"c:\\openjdk\"; \ - (New-Object Net.WebClient).DownloadFile($zulu_url, $zulu_zip); \ - [System.IO.Compression.ZipFile]::ExtractToDirectory($zulu_zip, \"c:\\temp\"); \ - Move-Item $zulu_extracted_path -Destination $zulu_root; \ - Remove-Item $zulu_zip; \ - $env:PATH = [Environment]::GetEnvironmentVariable(\"PATH\", \"Machine\") + \";${zulu_root}\\bin\"; \ - [Environment]::SetEnvironmentVariable(\"PATH\", $env:PATH, \"Machine\"); \ - $env:JAVA_HOME = $zulu_root; \ - [Environment]::SetEnvironmentVariable(\"JAVA_HOME\", $env:JAVA_HOME, \"Machine\") +# Install Visual Studio 2019 Build Tools. +RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_buildtools.exe" \ + -OutFile C:/TEMP/vs_buildtools.exe -UseBasicParsing; \ + Start-Process -FilePath C:/TEMP/vs_buildtools.exe -ArgumentList "--installPath", "C:/VS", \ + "--quiet", "--wait", "--nocache", \ + "--add", "Microsoft.VisualStudio.Workload.VCTools", \ + "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", \ + "--add", "Microsoft.VisualStudio.Component.Windows10SDK.19041" -Wait; \ + Remove-Item C:/TEMP/vs_buildtools.exe; \ + [Environment]::SetEnvironmentVariable(\"BAZEL_VC\", \"C:\VS\VC\", \"Machine\") +# Install msys2 and add to path. +RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest "https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20220319.sfx.exe" \ + -OutFile msys2_install.exe -UseBasicParsing; \ + .\msys2_install.exe -y -oC:\; \ + Remove-Item msys2_install.exe; \ + function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } \ + msys ' '; \ + msys 'pacman --noconfirm -Syy zstd'; \ + msys 'pacman --noconfirm -Syy git curl zip unzip'; \ + $old_path = [Environment]::GetEnvironmentVariable(\"PATH\", \"Machine\"); \ + [Environment]::SetEnvironmentVariable(\"PATH\", $old_path + \";C:\msys64;C:\msys64\usr\bin\", \"Machine\"); +# Install Python 3. +RUN Invoke-WebRequest "https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe" \ + -OutFile C:/TEMP/python_install.exe -UseBasicParsing; \ + Start-Process C:/TEMP/python_install.exe -ArgumentList "/quiet", "/log", "C:/TEMP/python_install_log.txt", \ + "InstallAllUsers=1", "PrependPath=1" -wait; \ + Remove-Item C:/TEMP/python_install.exe; \ + Remove-Item C:/TEMP/python_install_log.txt +# Install JDK 17 +RUN Add-Type -AssemblyName "System.IO.Compression.FileSystem"; \ + $zulu_url = \"https://cdn.azul.com/zulu/bin/zulu17.32.13-ca-jdk17.0.2-win_x64.zip\"; \ + $zulu_zip = \"c:/temp/jdk_install.zip\"; \ + $zulu_extracted_path = \"c:/temp/\" + [IO.Path]::GetFileNameWithoutExtension($zulu_url); \ + $zulu_root = \"c:/openjdk\"; \ + (New-Object Net.WebClient).DownloadFile($zulu_url, $zulu_zip); \ + [System.IO.Compression.ZipFile]::ExtractToDirectory($zulu_zip, \"c:/temp\"); \ + Move-Item $zulu_extracted_path -Destination $zulu_root; \ + Remove-Item $zulu_zip; \ + $old_path = [Environment]::GetEnvironmentVariable(\"PATH\", \"Machine\"); \ + [Environment]::SetEnvironmentVariable(\"PATH\", $old_path + \";${zulu_root}\bin\", \"Machine\"); \ + [Environment]::SetEnvironmentVariable(\"JAVA_HOME\", $zulu_root, \"Machine\") # Restore default shell for Windows containers. SHELL ["cmd.exe", "/s", "/c"] # Default to PowerShell if no other command specified. CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] - - - diff --git a/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/BUILD b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/BUILD new file mode 100644 index 00000000000..37d9cad9277 --- /dev/null +++ b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/BUILD @@ -0,0 +1,620 @@ +# 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. + +load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite", "cc_library") +load(":windows_cc_toolchain_config.bzl", "cc_toolchain_config") +load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") + +package(default_visibility = ["//visibility:public"]) + +cc_library( + name = "malloc", +) + +filegroup( + name = "empty", + srcs = [], +) + +filegroup( + name = "mingw_compiler_files", + srcs = [":builtin_include_directory_paths_mingw"] +) + +filegroup( + name = "clangcl_compiler_files", + srcs = [":builtin_include_directory_paths_clangcl"] +) + +filegroup( + name = "msvc_compiler_files", + srcs = [":builtin_include_directory_paths_msvc"] +) + +# 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_x86_windows|msvc-cl": ":cc-compiler-x64_x86_windows", + "x64_arm_windows|msvc-cl": ":cc-compiler-x64_arm_windows", + "x64_arm64_windows|msvc-cl": ":cc-compiler-arm64_windows", + "arm64_windows|msvc-cl": ":cc-compiler-arm64_windows", + "x64_windows|msys-gcc": ":cc-compiler-x64_windows_msys", + "x64_windows|mingw-gcc": ":cc-compiler-x64_windows_mingw", + "x64_windows|clang-cl": ":cc-compiler-x64_windows-clang-cl", + "x64_windows_msys": ":cc-compiler-x64_windows_msys", + "x64_windows": ":cc-compiler-x64_windows", + "x64_x86_windows": ":cc-compiler-x64_x86_windows", + "x64_arm_windows": ":cc-compiler-x64_arm_windows", + "x64_arm64_windows": ":cc-compiler-arm64_windows", + "arm64_windows": ":cc-compiler-arm64_windows", + "x64_arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl", + "arm64_windows|clang-cl": ":cc-compiler-arm64_windows-clang-cl", + "armeabi-v7a": ":cc-compiler-armeabi-v7a", + }, +) + +cc_toolchain( + name = "cc-compiler-x64_windows_msys", + toolchain_identifier = "msys_x64", + toolchain_config = ":msys_x64", + all_files = ":empty", + ar_files = ":empty", + as_files = ":mingw_compiler_files", + compiler_files = ":mingw_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "msys_x64", + cpu = "x64_windows", + compiler = "msys-gcc", + host_system_name = "local", + target_system_name = "local", + target_libc = "msys", + abi_version = "local", + abi_libc_version = "local", + cxx_builtin_include_directories = [ "c:/msys64/usr/", + ], + tool_paths = {"ar": "c:/msys64/usr/bin/ar", + "compat-ld": "c:/msys64/usr/bin/compat-ld", + "cpp": "c:/msys64/usr/bin/cpp", + "dwp": "c:/msys64/usr/bin/dwp", + "gcc": "c:/msys64/usr/bin/gcc", + "gcov": "c:/msys64/usr/bin/gcov", + "ld": "c:/msys64/usr/bin/ld", + "nm": "c:/msys64/usr/bin/nm", + "objcopy": "c:/msys64/usr/bin/objcopy", + "objdump": "c:/msys64/usr/bin/objdump", + "strip": "c:/msys64/usr/bin/strip"}, + tool_bin_path = "c:/msys64/usr/bin", + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", +) + +toolchain( + name = "cc-toolchain-x64_windows_msys", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@bazel_tools//tools/cpp:msys", + ], + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_windows_msys", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-x64_windows_mingw", + toolchain_identifier = "msys_x64_mingw", + toolchain_config = ":msys_x64_mingw", + all_files = ":empty", + ar_files = ":empty", + as_files = ":mingw_compiler_files", + compiler_files = ":mingw_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 0, +) + +cc_toolchain_config( + name = "msys_x64_mingw", + cpu = "x64_windows", + compiler = "mingw-gcc", + host_system_name = "local", + target_system_name = "local", + target_libc = "mingw", + abi_version = "local", + abi_libc_version = "local", + tool_bin_path = "c:/msys64/mingw64/bin", + cxx_builtin_include_directories = [ "c:/msys64/mingw64/", + ], + tool_paths = {"ar": "c:/msys64/mingw64/bin/ar", + "compat-ld": "c:/msys64/mingw64/bin/compat-ld", + "cpp": "c:/msys64/mingw64/bin/cpp", + "dwp": "c:/msys64/mingw64/bin/dwp", + "gcc": "c:/msys64/mingw64/bin/gcc", + "gcov": "c:/msys64/mingw64/bin/gcov", + "ld": "c:/msys64/mingw64/bin/ld", + "nm": "c:/msys64/mingw64/bin/nm", + "objcopy": "c:/msys64/mingw64/bin/objcopy", + "objdump": "c:/msys64/mingw64/bin/objdump", + "strip": "c:/msys64/mingw64/bin/strip"}, + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", +) + +toolchain( + name = "cc-toolchain-x64_windows_mingw", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@bazel_tools//tools/cpp:mingw", + ], + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_windows_mingw", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-x64_windows", + toolchain_identifier = "msvc_x64", + toolchain_config = ":msvc_x64", + all_files = ":empty", + ar_files = ":empty", + as_files = ":msvc_compiler_files", + compiler_files = ":msvc_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "msvc_x64", + cpu = "x64_windows", + compiler = "msvc-cl", + host_system_name = "local", + target_system_name = "local", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "msvc_x64", + msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", + msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", + msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt", + msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x64", + msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", + msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe", + msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe", + msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe", + cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"], + tool_paths = { + "ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/lib.exe", + "ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/ml64.exe", + "cpp": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", + "gcc": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/link.exe", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:X64"], + default_link_flags = ["/MACHINE:X64"], + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", +) + +toolchain( + name = "cc-toolchain-x64_windows", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_windows", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-x64_x86_windows", + toolchain_identifier = "msvc_x64_x86", + toolchain_config = ":msvc_x64_x86", + all_files = ":empty", + ar_files = ":empty", + as_files = ":msvc_compiler_files", + compiler_files = ":msvc_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "msvc_x64_x86", + cpu = "x64_windows", + compiler = "msvc-cl", + host_system_name = "local", + target_system_name = "local", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "msvc_x64_x86", + msvc_env_tmp = "C:\\Users\\ContainerAdministrator\\AppData\\Local\\Temp", + msvc_env_path = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x86;C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64;C:\\VS\\Common7\\IDE\\VC\\VCPackages;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow;C:\\VS\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer;C:\\VS\\MSBuild\\Current\\bin\\Roslyn;C:\\VS\\Common7\\Tools\\devinit;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64;C:\\VS\\\\MSBuild\\Current\\Bin;C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\VS\\Common7\\IDE\\;C:\\VS\\Common7\\Tools\\;;C:\\Windows\\system32", + msvc_env_include = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt", + msvc_env_lib = "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x86;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x86", + msvc_cl_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe", + msvc_ml_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe", + msvc_link_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe", + msvc_lib_path = "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe", + cxx_builtin_include_directories = [ "C:\\VS\\VC\\Tools\\MSVC\\14.29.30133\\include", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\winrt", + "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt"], + tool_paths = { + "ar": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/lib.exe", + "ml": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/ml.exe", + "cpp": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe", + "gcc": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/cl.exe", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "C:/VS/VC/Tools/MSVC/14.29.30133/bin/HostX64/x86/link.exe", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:X86"], + default_link_flags = ["/MACHINE:X86"], + dbg_mode_debug_flag = "/DEBUG:FULL", + fastbuild_mode_debug_flag = "/DEBUG:FASTLINK", +) + +toolchain( + name = "cc-toolchain-x64_x86_windows", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + target_compatible_with = [ + "@platforms//cpu:x86_32", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_x86_windows", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-x64_arm_windows", + toolchain_identifier = "msvc_x64_arm", + toolchain_config = ":msvc_x64_arm", + all_files = ":empty", + ar_files = ":empty", + as_files = ":msvc_compiler_files", + compiler_files = ":msvc_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "msvc_x64_arm", + cpu = "x64_windows", + compiler = "msvc-cl", + host_system_name = "local", + target_system_name = "local", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "msvc_x64_arm", + msvc_env_tmp = "msvc_not_found", + msvc_env_path = "msvc_not_found", + msvc_env_include = "msvc_not_found", + msvc_env_lib = "msvc_not_found", + msvc_cl_path = "vc_installation_error_arm.bat", + msvc_ml_path = "vc_installation_error_arm.bat", + msvc_link_path = "vc_installation_error_arm.bat", + msvc_lib_path = "vc_installation_error_arm.bat", + cxx_builtin_include_directories = [], + tool_paths = { + "ar": "vc_installation_error_arm.bat", + "ml": "vc_installation_error_arm.bat", + "cpp": "vc_installation_error_arm.bat", + "gcc": "vc_installation_error_arm.bat", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "vc_installation_error_arm.bat", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:ARM"], + default_link_flags = ["/MACHINE:ARM"], + dbg_mode_debug_flag = "/DEBUG", + fastbuild_mode_debug_flag = "/DEBUG", +) + +toolchain( + name = "cc-toolchain-x64_arm_windows", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + target_compatible_with = [ + "@platforms//cpu:arm", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_arm_windows", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-arm64_windows", + toolchain_identifier = "msvc_arm64", + toolchain_config = ":msvc_arm64", + all_files = ":empty", + ar_files = ":empty", + as_files = ":msvc_compiler_files", + compiler_files = ":msvc_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "msvc_arm64", + cpu = "x64_windows", + compiler = "msvc-cl", + host_system_name = "local", + target_system_name = "local", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "msvc_arm64", + msvc_env_tmp = "msvc_not_found", + msvc_env_path = "msvc_not_found", + msvc_env_include = "msvc_not_found", + msvc_env_lib = "msvc_not_found", + msvc_cl_path = "vc_installation_error_arm64.bat", + msvc_ml_path = "vc_installation_error_arm64.bat", + msvc_link_path = "vc_installation_error_arm64.bat", + msvc_lib_path = "vc_installation_error_arm64.bat", + cxx_builtin_include_directories = [], + tool_paths = { + "ar": "vc_installation_error_arm64.bat", + "ml": "vc_installation_error_arm64.bat", + "cpp": "vc_installation_error_arm64.bat", + "gcc": "vc_installation_error_arm64.bat", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "vc_installation_error_arm64.bat", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:ARM64"], + default_link_flags = ["/MACHINE:ARM64"], + dbg_mode_debug_flag = "/DEBUG", + fastbuild_mode_debug_flag = "/DEBUG", +) + +toolchain( + name = "cc-toolchain-arm64_windows", + exec_compatible_with = [ + "@platforms//os:windows", + ], + target_compatible_with = [ + "@platforms//cpu:arm64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-arm64_windows", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + + +cc_toolchain( + name = "cc-compiler-x64_windows-clang-cl", + toolchain_identifier = "clang_cl_x64", + toolchain_config = ":clang_cl_x64", + all_files = ":empty", + ar_files = ":empty", + as_files = ":clangcl_compiler_files", + compiler_files = ":clangcl_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "clang_cl_x64", + cpu = "x64_windows", + compiler = "clang-cl", + host_system_name = "local", + target_system_name = "local", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "clang_cl_x64", + msvc_env_tmp = "clang_cl_not_found", + msvc_env_path = "clang_cl_not_found", + msvc_env_include = "clang_cl_not_found", + msvc_env_lib = "clang_cl_not_found", + msvc_cl_path = "clang_installation_error.bat", + msvc_ml_path = "clang_installation_error.bat", + msvc_link_path = "clang_installation_error.bat", + msvc_lib_path = "clang_installation_error.bat", + cxx_builtin_include_directories = [], + tool_paths = { + "ar": "clang_installation_error.bat", + "ml": "clang_installation_error.bat", + "cpp": "clang_installation_error.bat", + "gcc": "clang_installation_error.bat", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "clang_installation_error.bat", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:X64"], + default_link_flags = ["/MACHINE:X64", "/DEFAULTLIB:clang_rt.builtins-x86_64.lib"], + dbg_mode_debug_flag = "/DEBUG", + fastbuild_mode_debug_flag = "/DEBUG", +) + +toolchain( + name = "cc-toolchain-x64_windows-clang-cl", + exec_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + "@bazel_tools//tools/cpp:clang-cl", + ], + target_compatible_with = [ + "@platforms//cpu:x86_64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-x64_windows-clang-cl", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-arm64_windows-clang-cl", + toolchain_identifier = "clang_cl_arm64", + toolchain_config = ":clang_cl_arm64", + all_files = ":empty", + ar_files = ":empty", + as_files = ":clangcl_compiler_files", + compiler_files = ":clangcl_compiler_files", + dwp_files = ":empty", + linker_files = ":empty", + objcopy_files = ":empty", + strip_files = ":empty", + supports_param_files = 1, +) + +cc_toolchain_config( + name = "clang_cl_arm64", + cpu = "arm64_windows", + compiler = "clang-cl", + host_system_name = "local", + target_system_name = "aarch64-pc-windows-msvc", + target_libc = "msvcrt", + abi_version = "local", + abi_libc_version = "local", + toolchain_identifier = "clang_cl_arm64", + msvc_env_tmp = "clang_cl_not_found", + msvc_env_path = "clang_cl_not_found", + msvc_env_include = "clang_cl_not_found", + msvc_env_lib = "clang_cl_not_found", + msvc_cl_path = "vc_installation_error_arm64.bat", + msvc_ml_path = "vc_installation_error_arm64.bat", + msvc_link_path = "vc_installation_error_arm64.bat", + msvc_lib_path = "vc_installation_error_arm64.bat", + cxx_builtin_include_directories = [], + tool_paths = { + "ar": "vc_installation_error_arm64.bat", + "ml": "vc_installation_error_arm64.bat", + "cpp": "vc_installation_error_arm64.bat", + "gcc": "vc_installation_error_arm64.bat", + "gcov": "wrapper/bin/msvc_nop.bat", + "ld": "vc_installation_error_arm64.bat", + "nm": "wrapper/bin/msvc_nop.bat", + "objcopy": "wrapper/bin/msvc_nop.bat", + "objdump": "wrapper/bin/msvc_nop.bat", + "strip": "wrapper/bin/msvc_nop.bat", + }, + archiver_flags = ["/MACHINE:ARM64"], + default_link_flags = ["/MACHINE:ARM64"], + dbg_mode_debug_flag = "/DEBUG", + fastbuild_mode_debug_flag = "/DEBUG", +) + +toolchain( + name = "cc-toolchain-arm64_windows-clang-cl", + exec_compatible_with = [ + "@platforms//os:windows", + "@bazel_tools//tools/cpp:clang-cl", + ], + target_compatible_with = [ + "@platforms//cpu:arm64", + "@platforms//os:windows", + ], + toolchain = ":cc-compiler-arm64_windows-clang-cl", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) + +cc_toolchain( + name = "cc-compiler-armeabi-v7a", + toolchain_identifier = "stub_armeabi-v7a", + toolchain_config = ":stub_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, +) + +armeabi_cc_toolchain_config(name = "stub_armeabi-v7a") + +toolchain( + name = "cc-toolchain-armeabi-v7a", + exec_compatible_with = [ + ], + target_compatible_with = [ + "@platforms//cpu:arm", + "@platforms//os:android", + ], + toolchain = ":cc-compiler-armeabi-v7a", + toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", +) diff --git a/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/armeabi_cc_toolchain_config.bzl b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/armeabi_cc_toolchain_config.bzl new file mode 100644 index 00000000000..94e0720bf6c --- /dev/null +++ b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/armeabi_cc_toolchain_config.bzl @@ -0,0 +1,82 @@ +# Copyright 2019 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. + +"""A Starlark cc_toolchain configuration rule""" + +load( + "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", + "feature", + "tool_path", +) + +def _impl(ctx): + toolchain_identifier = "stub_armeabi-v7a" + host_system_name = "armeabi-v7a" + target_system_name = "armeabi-v7a" + target_cpu = "armeabi-v7a" + target_libc = "armeabi-v7a" + compiler = "compiler" + abi_version = "armeabi-v7a" + abi_libc_version = "armeabi-v7a" + cc_target_os = None + builtin_sysroot = None + action_configs = [] + + supports_pic_feature = feature(name = "supports_pic", enabled = True) + supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) + features = [supports_dynamic_linker_feature, supports_pic_feature] + + cxx_builtin_include_directories = [] + artifact_name_patterns = [] + make_variables = [] + + tool_paths = [ + tool_path(name = "ar", path = "/bin/false"), + tool_path(name = "compat-ld", path = "/bin/false"), + tool_path(name = "cpp", path = "/bin/false"), + tool_path(name = "dwp", path = "/bin/false"), + tool_path(name = "gcc", path = "/bin/false"), + tool_path(name = "gcov", path = "/bin/false"), + tool_path(name = "ld", path = "/bin/false"), + tool_path(name = "nm", path = "/bin/false"), + tool_path(name = "objcopy", path = "/bin/false"), + tool_path(name = "objdump", path = "/bin/false"), + tool_path(name = "strip", path = "/bin/false"), + ] + + return cc_common.create_cc_toolchain_config_info( + ctx = ctx, + features = features, + action_configs = action_configs, + artifact_name_patterns = artifact_name_patterns, + cxx_builtin_include_directories = cxx_builtin_include_directories, + toolchain_identifier = toolchain_identifier, + host_system_name = host_system_name, + target_system_name = target_system_name, + target_cpu = target_cpu, + target_libc = target_libc, + compiler = compiler, + abi_version = abi_version, + abi_libc_version = abi_libc_version, + tool_paths = tool_paths, + make_variables = make_variables, + builtin_sysroot = builtin_sysroot, + cc_target_os = cc_target_os, + ) + +armeabi_cc_toolchain_config = rule( + implementation = _impl, + attrs = {}, + provides = [CcToolchainConfigInfo], +) diff --git a/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/builtin_include_directory_paths_msvc b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/builtin_include_directory_paths_msvc new file mode 100644 index 00000000000..08734ee5632 --- /dev/null +++ b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/builtin_include_directory_paths_msvc @@ -0,0 +1,5 @@ +This file is generated by cc_configure and contains builtin include directories +that msvc reported. This file is a dependency of every compilation action and +changes to it will be reflected in the action cache key. When some of these +paths change, Bazel will make sure to rerun the action, even though none of +declared action inputs or the action commandline changes. diff --git a/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/windows_cc_toolchain_config.bzl b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/windows_cc_toolchain_config.bzl new file mode 100644 index 00000000000..f0233ceafbc --- /dev/null +++ b/third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019/windows_cc_toolchain_config.bzl @@ -0,0 +1,1367 @@ +# Copyright 2019 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. + +"""A Starlark cc_toolchain configuration rule for Windows""" + +load( + "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl", + "action_config", + "artifact_name_pattern", + "env_entry", + "env_set", + "feature", + "feature_set", + "flag_group", + "flag_set", + "tool", + "tool_path", + "variable_with_value", + "with_feature_set", +) +load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES") + +all_compile_actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.clif_match, + ACTION_NAMES.lto_backend, +] + +all_cpp_compile_actions = [ + ACTION_NAMES.cpp_compile, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.clif_match, +] + +preprocessor_compile_actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.clif_match, +] + +codegen_compile_actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.lto_backend, +] + +all_link_actions = [ + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, +] + +def _use_msvc_toolchain(ctx): + return ctx.attr.cpu in ["x64_windows", "arm64_windows"] and (ctx.attr.compiler == "msvc-cl" or ctx.attr.compiler == "clang-cl") + +def _impl(ctx): + if _use_msvc_toolchain(ctx): + artifact_name_patterns = [ + artifact_name_pattern( + category_name = "object_file", + prefix = "", + extension = ".obj", + ), + artifact_name_pattern( + category_name = "static_library", + prefix = "", + extension = ".lib", + ), + artifact_name_pattern( + category_name = "alwayslink_static_library", + prefix = "", + extension = ".lo.lib", + ), + artifact_name_pattern( + category_name = "executable", + prefix = "", + extension = ".exe", + ), + artifact_name_pattern( + category_name = "dynamic_library", + prefix = "", + extension = ".dll", + ), + artifact_name_pattern( + category_name = "interface_library", + prefix = "", + extension = ".if.lib", + ), + ] + else: + artifact_name_patterns = [ + artifact_name_pattern( + category_name = "executable", + prefix = "", + extension = ".exe", + ), + ] + + if _use_msvc_toolchain(ctx): + cpp_link_nodeps_dynamic_library_action = action_config( + action_name = ACTION_NAMES.cpp_link_nodeps_dynamic_library, + implies = [ + "nologo", + "shared_flag", + "linkstamps", + "output_execpath_flags", + "input_param_flags", + "user_link_flags", + "default_link_flags", + "linker_subsystem_flag", + "linker_param_file", + "msvc_env", + "no_stripping", + "has_configured_linker_path", + "def_file", + ], + tools = [tool(path = ctx.attr.msvc_link_path)], + ) + + cpp_link_static_library_action = action_config( + action_name = ACTION_NAMES.cpp_link_static_library, + implies = [ + "nologo", + "archiver_flags", + "input_param_flags", + "linker_param_file", + "msvc_env", + ], + tools = [tool(path = ctx.attr.msvc_lib_path)], + ) + + assemble_action = action_config( + action_name = ACTION_NAMES.assemble, + implies = [ + "compiler_input_flags", + "compiler_output_flags", + "nologo", + "msvc_env", + "sysroot", + ], + tools = [tool(path = ctx.attr.msvc_ml_path)], + ) + + preprocess_assemble_action = action_config( + action_name = ACTION_NAMES.preprocess_assemble, + implies = [ + "compiler_input_flags", + "compiler_output_flags", + "nologo", + "msvc_env", + "sysroot", + ], + tools = [tool(path = ctx.attr.msvc_ml_path)], + ) + + c_compile_action = action_config( + action_name = ACTION_NAMES.c_compile, + implies = [ + "compiler_input_flags", + "compiler_output_flags", + "default_compile_flags", + "nologo", + "msvc_env", + "parse_showincludes", + "user_compile_flags", + "sysroot", + "unfiltered_compile_flags", + ], + tools = [tool(path = ctx.attr.msvc_cl_path)], + ) + + cpp_compile_action = action_config( + action_name = ACTION_NAMES.cpp_compile, + implies = [ + "compiler_input_flags", + "compiler_output_flags", + "default_compile_flags", + "nologo", + "msvc_env", + "parse_showincludes", + "user_compile_flags", + "sysroot", + "unfiltered_compile_flags", + ], + tools = [tool(path = ctx.attr.msvc_cl_path)], + ) + + cpp_link_executable_action = action_config( + action_name = ACTION_NAMES.cpp_link_executable, + implies = [ + "nologo", + "linkstamps", + "output_execpath_flags", + "input_param_flags", + "user_link_flags", + "default_link_flags", + "linker_subsystem_flag", + "linker_param_file", + "msvc_env", + "no_stripping", + ], + tools = [tool(path = ctx.attr.msvc_link_path)], + ) + + cpp_link_dynamic_library_action = action_config( + action_name = ACTION_NAMES.cpp_link_dynamic_library, + implies = [ + "nologo", + "shared_flag", + "linkstamps", + "output_execpath_flags", + "input_param_flags", + "user_link_flags", + "default_link_flags", + "linker_subsystem_flag", + "linker_param_file", + "msvc_env", + "no_stripping", + "has_configured_linker_path", + "def_file", + ], + tools = [tool(path = ctx.attr.msvc_link_path)], + ) + + action_configs = [ + assemble_action, + preprocess_assemble_action, + c_compile_action, + cpp_compile_action, + cpp_link_executable_action, + cpp_link_dynamic_library_action, + cpp_link_nodeps_dynamic_library_action, + cpp_link_static_library_action, + ] + else: + action_configs = [] + + if _use_msvc_toolchain(ctx): + msvc_link_env_feature = feature( + name = "msvc_link_env", + env_sets = [ + env_set( + actions = all_link_actions + + [ACTION_NAMES.cpp_link_static_library], + env_entries = [env_entry(key = "LIB", value = ctx.attr.msvc_env_lib)], + ), + ], + ) + + shared_flag_feature = feature( + name = "shared_flag", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [flag_group(flags = ["/DLL"])], + ), + ], + ) + + determinism_feature = feature( + name = "determinism", + enabled = True, + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [ + flag_group( + flags = [ + "/wd4117", + "-D__DATE__=\"redacted\"", + "-D__TIMESTAMP__=\"redacted\"", + "-D__TIME__=\"redacted\"", + ] + (["-Wno-builtin-macro-redefined"] if ctx.attr.compiler == "clang-cl" else []), + ), + ], + ), + ], + ) + + sysroot_feature = feature( + name = "sysroot", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [ + flag_group( + flags = ["--sysroot=%{sysroot}"], + iterate_over = "sysroot", + expand_if_available = "sysroot", + ), + ], + ), + ], + ) + + unfiltered_compile_flags_feature = feature( + name = "unfiltered_compile_flags", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ], + flag_groups = [ + flag_group( + flags = ["%{unfiltered_compile_flags}"], + iterate_over = "unfiltered_compile_flags", + expand_if_available = "unfiltered_compile_flags", + ), + ], + ), + ], + ) + + compiler_param_file_feature = feature( + name = "compiler_param_file", + ) + + copy_dynamic_libraries_to_binary_feature = feature( + name = "copy_dynamic_libraries_to_binary", + ) + + input_param_flags_feature = feature( + name = "input_param_flags", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [ + flag_group( + flags = ["/IMPLIB:%{interface_library_output_path}"], + expand_if_available = "interface_library_output_path", + ), + ], + ), + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = ["%{libopts}"], + iterate_over = "libopts", + expand_if_available = "libopts", + ), + ], + ), + flag_set( + actions = all_link_actions + + [ACTION_NAMES.cpp_link_static_library], + flag_groups = [ + flag_group( + iterate_over = "libraries_to_link", + flag_groups = [ + flag_group( + iterate_over = "libraries_to_link.object_files", + flag_groups = [flag_group(flags = ["%{libraries_to_link.object_files}"])], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "object_file_group", + ), + ), + flag_group( + flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "object_file", + ), + ), + flag_group( + flag_groups = [flag_group(flags = ["%{libraries_to_link.name}"])], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "interface_library", + ), + ), + flag_group( + flag_groups = [ + flag_group( + flags = ["%{libraries_to_link.name}"], + expand_if_false = "libraries_to_link.is_whole_archive", + ), + flag_group( + flags = ["/WHOLEARCHIVE:%{libraries_to_link.name}"], + expand_if_true = "libraries_to_link.is_whole_archive", + ), + ], + expand_if_equal = variable_with_value( + name = "libraries_to_link.type", + value = "static_library", + ), + ), + ], + expand_if_available = "libraries_to_link", + ), + ], + ), + ], + ) + + fastbuild_feature = feature( + name = "fastbuild", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/Od", "/Z7"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = [ctx.attr.fastbuild_mode_debug_flag, "/INCREMENTAL:NO"], + ), + ], + ), + ], + implies = ["generate_pdb_file"], + ) + + user_compile_flags_feature = feature( + name = "user_compile_flags", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ], + flag_groups = [ + flag_group( + flags = ["%{user_compile_flags}"], + iterate_over = "user_compile_flags", + expand_if_available = "user_compile_flags", + ), + ], + ), + ], + ) + + archiver_flags_feature = feature( + name = "archiver_flags", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.cpp_link_static_library], + flag_groups = [ + flag_group( + flags = ["/OUT:%{output_execpath}"], + expand_if_available = "output_execpath", + ), + flag_group( + flags = ctx.attr.archiver_flags, + ), + ], + ), + ], + ) + + default_link_flags_feature = feature( + name = "default_link_flags", + enabled = True, + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ctx.attr.default_link_flags)], + ), + ], + ) + + static_link_msvcrt_feature = feature(name = "static_link_msvcrt") + + dynamic_link_msvcrt_debug_feature = feature( + name = "dynamic_link_msvcrt_debug", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/MDd"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrtd.lib"])], + ), + ], + requires = [feature_set(features = ["dbg"])], + ) + + dbg_feature = feature( + name = "dbg", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/Od", "/Z7"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = [ctx.attr.dbg_mode_debug_flag, "/INCREMENTAL:NO"], + ), + ], + ), + ], + implies = ["generate_pdb_file"], + ) + + opt_feature = feature( + name = "opt", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/O2"])], + ), + ], + implies = ["frame_pointer"], + ) + + supports_interface_shared_libraries_feature = feature( + name = "supports_interface_shared_libraries", + enabled = True, + ) + + user_link_flags_feature = feature( + name = "user_link_flags", + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = ["%{user_link_flags}"], + iterate_over = "user_link_flags", + expand_if_available = "user_link_flags", + ), + ], + ), + ], + ) + + default_compile_flags_feature = feature( + name = "default_compile_flags", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.lto_backend, + ACTION_NAMES.clif_match, + ], + flag_groups = [ + flag_group( + flags = [ + "/DCOMPILER_MSVC", + "/DNOMINMAX", + "/D_WIN32_WINNT=0x0601", + "/D_CRT_SECURE_NO_DEPRECATE", + "/D_CRT_SECURE_NO_WARNINGS", + "/bigobj", + "/Zm500", + "/EHsc", + "/wd4351", + "/wd4291", + "/wd4250", + "/wd4996", + ], + ), + ], + ), + ], + ) + + msvc_compile_env_feature = feature( + name = "msvc_compile_env", + env_sets = [ + env_set( + actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ], + env_entries = [env_entry(key = "INCLUDE", value = ctx.attr.msvc_env_include)], + ), + ], + ) + + preprocessor_defines_feature = feature( + name = "preprocessor_defines", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ], + flag_groups = [ + flag_group( + flags = ["/D%{preprocessor_defines}"], + iterate_over = "preprocessor_defines", + ), + ], + ), + ], + ) + + generate_pdb_file_feature = feature( + name = "generate_pdb_file", + ) + + output_execpath_flags_feature = feature( + name = "output_execpath_flags", + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = ["/OUT:%{output_execpath}"], + expand_if_available = "output_execpath", + ), + ], + ), + ], + ) + + dynamic_link_msvcrt_no_debug_feature = feature( + name = "dynamic_link_msvcrt_no_debug", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/MD"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/DEFAULTLIB:msvcrt.lib"])], + ), + ], + requires = [ + feature_set(features = ["fastbuild"]), + feature_set(features = ["opt"]), + ], + ) + + disable_assertions_feature = feature( + name = "disable_assertions", + enabled = True, + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/DNDEBUG"])], + with_features = [with_feature_set(features = ["opt"])], + ), + ], + ) + + has_configured_linker_path_feature = feature(name = "has_configured_linker_path") + + supports_dynamic_linker_feature = feature(name = "supports_dynamic_linker", enabled = True) + + no_stripping_feature = feature(name = "no_stripping") + + linker_param_file_feature = feature( + name = "linker_param_file", + flag_sets = [ + flag_set( + actions = all_link_actions + + [ACTION_NAMES.cpp_link_static_library], + flag_groups = [ + flag_group( + flags = ["@%{linker_param_file}"], + expand_if_available = "linker_param_file", + ), + ], + ), + ], + ) + + ignore_noisy_warnings_feature = feature( + name = "ignore_noisy_warnings", + enabled = True, + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.cpp_link_static_library], + flag_groups = [flag_group(flags = ["/ignore:4221"])], + ), + ], + ) + + no_legacy_features_feature = feature(name = "no_legacy_features") + + parse_showincludes_feature = feature( + name = "parse_showincludes", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_header_parsing, + ], + flag_groups = [flag_group(flags = ["/showIncludes"])], + ), + ], + ) + + static_link_msvcrt_no_debug_feature = feature( + name = "static_link_msvcrt_no_debug", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/MT"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmt.lib"])], + ), + ], + requires = [ + feature_set(features = ["fastbuild"]), + feature_set(features = ["opt"]), + ], + ) + + treat_warnings_as_errors_feature = feature( + name = "treat_warnings_as_errors", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/WX"])], + ), + ], + ) + + windows_export_all_symbols_feature = feature(name = "windows_export_all_symbols") + + no_windows_export_all_symbols_feature = feature(name = "no_windows_export_all_symbols") + + include_paths_feature = feature( + name = "include_paths", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ], + flag_groups = [ + flag_group( + flags = ["/I%{quote_include_paths}"], + iterate_over = "quote_include_paths", + ), + flag_group( + flags = ["/I%{include_paths}"], + iterate_over = "include_paths", + ), + flag_group( + flags = ["/I%{system_include_paths}"], + iterate_over = "system_include_paths", + ), + ], + ), + ], + ) + + linkstamps_feature = feature( + name = "linkstamps", + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = ["%{linkstamp_paths}"], + iterate_over = "linkstamp_paths", + expand_if_available = "linkstamp_paths", + ), + ], + ), + ], + ) + + targets_windows_feature = feature( + name = "targets_windows", + enabled = True, + implies = ["copy_dynamic_libraries_to_binary"], + ) + + linker_subsystem_flag_feature = feature( + name = "linker_subsystem_flag", + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/SUBSYSTEM:CONSOLE"])], + ), + ], + ) + + static_link_msvcrt_debug_feature = feature( + name = "static_link_msvcrt_debug", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/MTd"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/DEFAULTLIB:libcmtd.lib"])], + ), + ], + requires = [feature_set(features = ["dbg"])], + ) + + frame_pointer_feature = feature( + name = "frame_pointer", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/Oy-"])], + ), + ], + ) + + compiler_output_flags_feature = feature( + name = "compiler_output_flags", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.assemble], + flag_groups = [ + flag_group( + flag_groups = [ + flag_group( + flags = ["/Fo%{output_file}", "/Zi"], + expand_if_available = "output_file", + expand_if_not_available = "output_assembly_file", + ), + ], + expand_if_not_available = "output_preprocess_file", + ), + ], + ), + flag_set( + actions = [ + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ], + flag_groups = [ + flag_group( + flag_groups = [ + flag_group( + flags = ["/Fo%{output_file}"], + expand_if_not_available = "output_preprocess_file", + ), + ], + expand_if_available = "output_file", + expand_if_not_available = "output_assembly_file", + ), + flag_group( + flag_groups = [ + flag_group( + flags = ["/Fa%{output_file}"], + expand_if_available = "output_assembly_file", + ), + ], + expand_if_available = "output_file", + ), + flag_group( + flag_groups = [ + flag_group( + flags = ["/P", "/Fi%{output_file}"], + expand_if_available = "output_preprocess_file", + ), + ], + expand_if_available = "output_file", + ), + ], + ), + ], + ) + + nologo_feature = feature( + name = "nologo", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ACTION_NAMES.cpp_link_static_library, + ], + flag_groups = [flag_group(flags = ["/nologo"])], + ), + ], + ) + + smaller_binary_feature = feature( + name = "smaller_binary", + enabled = True, + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["/Gy", "/Gw"])], + with_features = [with_feature_set(features = ["opt"])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["/OPT:ICF", "/OPT:REF"])], + with_features = [with_feature_set(features = ["opt"])], + ), + ], + ) + + compiler_input_flags_feature = feature( + name = "compiler_input_flags", + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ], + flag_groups = [ + flag_group( + flags = ["/c", "%{source_file}"], + expand_if_available = "source_file", + ), + ], + ), + ], + ) + + def_file_feature = feature( + name = "def_file", + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [ + flag_group( + flags = ["/DEF:%{def_file_path}", "/ignore:4070"], + expand_if_available = "def_file_path", + ), + ], + ), + ], + ) + + msvc_env_feature = feature( + name = "msvc_env", + env_sets = [ + env_set( + actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ACTION_NAMES.cpp_link_static_library, + ], + env_entries = [ + env_entry(key = "PATH", value = ctx.attr.msvc_env_path), + env_entry(key = "TMP", value = ctx.attr.msvc_env_tmp), + env_entry(key = "TEMP", value = ctx.attr.msvc_env_tmp), + ], + ), + ], + implies = ["msvc_compile_env", "msvc_link_env"], + ) + features = [ + no_legacy_features_feature, + nologo_feature, + has_configured_linker_path_feature, + no_stripping_feature, + targets_windows_feature, + copy_dynamic_libraries_to_binary_feature, + default_compile_flags_feature, + msvc_env_feature, + msvc_compile_env_feature, + msvc_link_env_feature, + include_paths_feature, + preprocessor_defines_feature, + parse_showincludes_feature, + generate_pdb_file_feature, + shared_flag_feature, + linkstamps_feature, + output_execpath_flags_feature, + archiver_flags_feature, + input_param_flags_feature, + linker_subsystem_flag_feature, + user_link_flags_feature, + default_link_flags_feature, + linker_param_file_feature, + static_link_msvcrt_feature, + static_link_msvcrt_no_debug_feature, + dynamic_link_msvcrt_no_debug_feature, + static_link_msvcrt_debug_feature, + dynamic_link_msvcrt_debug_feature, + dbg_feature, + fastbuild_feature, + opt_feature, + frame_pointer_feature, + disable_assertions_feature, + determinism_feature, + treat_warnings_as_errors_feature, + smaller_binary_feature, + ignore_noisy_warnings_feature, + user_compile_flags_feature, + sysroot_feature, + unfiltered_compile_flags_feature, + compiler_param_file_feature, + compiler_output_flags_feature, + compiler_input_flags_feature, + def_file_feature, + windows_export_all_symbols_feature, + no_windows_export_all_symbols_feature, + supports_dynamic_linker_feature, + supports_interface_shared_libraries_feature, + ] + else: + targets_windows_feature = feature( + name = "targets_windows", + implies = ["copy_dynamic_libraries_to_binary"], + enabled = True, + ) + + copy_dynamic_libraries_to_binary_feature = feature(name = "copy_dynamic_libraries_to_binary") + + gcc_env_feature = feature( + name = "gcc_env", + enabled = True, + env_sets = [ + env_set( + actions = [ + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ACTION_NAMES.cpp_link_static_library, + ], + env_entries = [ + env_entry(key = "PATH", value = ctx.attr.tool_bin_path), + ], + ), + ], + ) + + default_compile_flags_feature = feature( + name = "default_compile_flags", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.lto_backend, + ACTION_NAMES.clif_match, + ], + flag_groups = [flag_group(flags = ["-std=gnu++0x"])], + ), + ], + ) + + default_link_flags_feature = feature( + name = "default_link_flags", + enabled = True, + flag_sets = [ + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["-lstdc++"])], + ), + ], + ) + + supports_dynamic_linker_feature = feature( + name = "supports_dynamic_linker", + enabled = True, + ) + + dbg_feature = feature( + name = "dbg", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = ["-g", "-Og"])], + ), + ], + ) + + opt_feature = feature( + name = "opt", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [flag_group(flags = [ + "-g0", + "-O3", + "-DNDEBUG", + "-ffunction-sections", + "-fdata-sections", + ])], + ), + flag_set( + actions = all_link_actions, + flag_groups = [flag_group(flags = ["-Wl,--gc-sections"])], + ), + ], + ) + + if ctx.attr.cpu == "x64_windows" and ctx.attr.compiler == "mingw-gcc": + compiler_param_file_feature = feature( + name = "compiler_param_file", + ) + + features = [ + targets_windows_feature, + copy_dynamic_libraries_to_binary_feature, + gcc_env_feature, + default_compile_flags_feature, + compiler_param_file_feature, + default_link_flags_feature, + supports_dynamic_linker_feature, + dbg_feature, + opt_feature, + ] + else: + supports_pic_feature = feature( + name = "supports_pic", + enabled = True, + ) + supports_start_end_lib_feature = feature( + name = "supports_start_end_lib", + enabled = True, + ) + + sysroot_feature = feature( + name = "sysroot", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.lto_backend, + ACTION_NAMES.clif_match, + ACTION_NAMES.cpp_link_executable, + ACTION_NAMES.cpp_link_dynamic_library, + ACTION_NAMES.cpp_link_nodeps_dynamic_library, + ], + flag_groups = [ + flag_group( + flags = ["--sysroot=%{sysroot}"], + expand_if_available = "sysroot", + ), + ], + ), + ], + ) + + fdo_optimize_feature = feature( + name = "fdo_optimize", + flag_sets = [ + flag_set( + actions = [ACTION_NAMES.c_compile, ACTION_NAMES.cpp_compile], + flag_groups = [ + flag_group( + flags = [ + "-fprofile-use=%{fdo_profile_path}", + "-fprofile-correction", + ], + expand_if_available = "fdo_profile_path", + ), + ], + ), + ], + provides = ["profile"], + ) + + user_compile_flags_feature = feature( + name = "user_compile_flags", + enabled = True, + flag_sets = [ + flag_set( + actions = [ + ACTION_NAMES.assemble, + ACTION_NAMES.preprocess_assemble, + ACTION_NAMES.linkstamp_compile, + ACTION_NAMES.c_compile, + ACTION_NAMES.cpp_compile, + ACTION_NAMES.cpp_header_parsing, + ACTION_NAMES.cpp_module_compile, + ACTION_NAMES.cpp_module_codegen, + ACTION_NAMES.lto_backend, + ACTION_NAMES.clif_match, + ], + flag_groups = [ + flag_group( + flags = ["%{user_compile_flags}"], + iterate_over = "user_compile_flags", + expand_if_available = "user_compile_flags", + ), + ], + ), + ], + ) + + features = [ + targets_windows_feature, + copy_dynamic_libraries_to_binary_feature, + gcc_env_feature, + supports_pic_feature, + default_compile_flags_feature, + default_link_flags_feature, + fdo_optimize_feature, + supports_dynamic_linker_feature, + dbg_feature, + opt_feature, + user_compile_flags_feature, + sysroot_feature, + ] + + tool_paths = [ + tool_path(name = name, path = path) + for name, path in ctx.attr.tool_paths.items() + ] + + return cc_common.create_cc_toolchain_config_info( + ctx = ctx, + features = features, + action_configs = action_configs, + artifact_name_patterns = artifact_name_patterns, + cxx_builtin_include_directories = ctx.attr.cxx_builtin_include_directories, + toolchain_identifier = ctx.attr.toolchain_identifier, + host_system_name = ctx.attr.host_system_name, + target_system_name = ctx.attr.target_system_name, + target_cpu = ctx.attr.cpu, + target_libc = ctx.attr.target_libc, + compiler = ctx.attr.compiler, + abi_version = ctx.attr.abi_version, + abi_libc_version = ctx.attr.abi_libc_version, + tool_paths = tool_paths, + ) + +cc_toolchain_config = rule( + implementation = _impl, + attrs = { + "cpu": attr.string(mandatory = True), + "compiler": attr.string(), + "toolchain_identifier": attr.string(), + "host_system_name": attr.string(), + "target_system_name": attr.string(), + "target_libc": attr.string(), + "abi_version": attr.string(), + "abi_libc_version": attr.string(), + "tool_paths": attr.string_dict(), + "cxx_builtin_include_directories": attr.string_list(), + "archiver_flags": attr.string_list(default = []), + "default_link_flags": attr.string_list(default = []), + "msvc_env_tmp": attr.string(default = "msvc_not_found"), + "msvc_env_path": attr.string(default = "msvc_not_found"), + "msvc_env_include": attr.string(default = "msvc_not_found"), + "msvc_env_lib": attr.string(default = "msvc_not_found"), + "msvc_cl_path": attr.string(default = "vc_installation_error.bat"), + "msvc_ml_path": attr.string(default = "vc_installation_error.bat"), + "msvc_link_path": attr.string(default = "vc_installation_error.bat"), + "msvc_lib_path": attr.string(default = "vc_installation_error.bat"), + "dbg_mode_debug_flag": attr.string(), + "fastbuild_mode_debug_flag": attr.string(), + "tool_bin_path": attr.string(default = "not_found"), + }, + provides = [CcToolchainConfigInfo], +) diff --git a/tools/remote_build/windows.bazelrc b/tools/remote_build/windows.bazelrc index ceef31cfed7..63e7f7a95df 100644 --- a/tools/remote_build/windows.bazelrc +++ b/tools/remote_build/windows.bazelrc @@ -1,16 +1,16 @@ import %workspace%/tools/remote_build/include/rbe_remote_execution.bazelrc # Next section is windows-specific RBE configuration -build --host_crosstool_top=//third_party/toolchains/bazel_0.26.0_rbe_windows:toolchain -build --crosstool_top=//third_party/toolchains/bazel_0.26.0_rbe_windows:toolchain -build --extra_toolchains=//third_party/toolchains/bazel_0.26.0_rbe_windows:cc-toolchain-x64_windows +build --host_crosstool_top=//third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019:toolchain +build --crosstool_top=//third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019:toolchain +build --extra_toolchains=//third_party/toolchains/rbe_windows_bazel_5.2.0_vs2019: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 +# Needs to match the location of binaries in the RBE docker container +build --shell_executable=C:\\msys64\\usr\\bin\\bash.exe +build --python_path="C:\\Program Files\\Python310\\python.exe" build --test_tag_filters=-no_windows build --build_tag_filters=-no_windows