From 83f611a5eb584a80766def672e44c2109060527f Mon Sep 17 00:00:00 2001 From: William A Rowe Jr Date: Fri, 24 Jul 2020 16:00:59 -0400 Subject: [PATCH 1/3] Set USE_CLANG_CL=1 to force substitute llvm tools It seems bazel-toolchains does not as of yet let us choose the actual compiler we are targeting so the cc-compiler-x64_windows always points to msvc-cl while on Linux, cc-compiler-k8 points to the correct compiler (gcc or clang etc.). With this change, we are in fact still using the compiler named msvc-cl but the toolchain config points to llvm tools rather than MSVC tools. The MSVC cl.exe and link.exe command syntax is what is common. We may be able to undo this if either Bazel itself is able to change its CC toolchain rules for Windows to match the better Linux pattern (and do away with the USE_CLANG_CL logic) or bazel-toolchains has a good way of specifying a target cpu and compiler (so we can for example specify x64_windows and clang-cl or x64_windows and msvc-cl to get the correct toolchain). Signed-off-by: Sunjay Bhatia Signed-off-by: William A Rowe Jr Co-authored-by: Sunjay Bhatia Co-authored-by: William A Rowe Jr --- toolchains/rbe_toolchains_config.bzl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolchains/rbe_toolchains_config.bzl b/toolchains/rbe_toolchains_config.bzl index 12f80817..675633ff 100644 --- a/toolchains/rbe_toolchains_config.bzl +++ b/toolchains/rbe_toolchains_config.bzl @@ -44,7 +44,9 @@ _GCC_ENV = { _MSVC_CL_ENV = {} -_CLANG_CL_ENV = {} +_CLANG_CL_ENV = { + "USE_CLANG_CL": "1", +} _TOOLCHAIN_CONFIG_SUITE_SPEC_LINUX = { "container_registry": _ENVOY_BUILD_IMAGE_REGISTRY, From b7399d8ff011835501b2a1e340ff713cea1a63d8 Mon Sep 17 00:00:00 2001 From: William A Rowe Jr Date: Thu, 13 Aug 2020 09:59:18 -0400 Subject: [PATCH 2/3] No change, tickle CI to work around unexpected failure Co-authored-by: Sunjay Bhatia Signed-off-by: Sunjay Bhatia Signed-off-by: William A Rowe Jr From 57d909ea36ffda3271abef2b867ea2252e609b74 Mon Sep 17 00:00:00 2001 From: Sunjay Bhatia Date: Fri, 14 Aug 2020 13:13:00 -0400 Subject: [PATCH 3/3] Bump bazel-toolchains to pick up fix Signed-off-by: Sunjay Bhatia Co-authored-by: William A Rowe Jr --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 5670f7be..d4c7f7f6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,9 +4,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "bazel_toolchains", - sha256 = "882fecfc88d3dc528f5c5681d95d730e213e39099abff2e637688a91a9619395", - strip_prefix = "bazel-toolchains-3.4.0", - urls = ["https://github.com/bazelbuild/bazel-toolchains/releases/download/3.4.0/bazel-toolchains-3.4.0.tar.gz"], + sha256 = "09642745581d071c7cd670e57589ea1ba78c99e9d7edb8b7478bda2640773e90", + strip_prefix = "bazel-toolchains-022dcbb331a80548cefecc289f3741b98b882307", + urls = ["https://github.com/bazelbuild/bazel-toolchains/archive/022dcbb331a80548cefecc289f3741b98b882307.tar.gz"], ) load(