You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like this might just an issue of Bazel fixing the structure of the BUILD file template and how it is generated on Windows to match Linux, but is there anything we can do in bazel-toolchains in the mean time/instead? If we could take in the cpu and target compiler and use that to determine the toolchain config target that would help. Currently we are using the Bazel hack to set USE_CLANG_CL=1 in the environment to make the msvc-cl toolchain use clang-cl tools but we would rather use a properly named toolchain config etc.
Just looking for ideas/thoughts, and if you think we should focus on getting Bazel to structure its builtin C++ toolchain BUILD files differently
My suggestion would be to point this out to the Bazel team and see if they're interested in fixing it or accepting a contribution that restructures the Windows toolchain to look like the Linux toolchain. If Bazel refuses, I would be open to considering patching up the Windows case here but I really hope it won't be necessary.
In the meantime, does continuing to use your workaround work for you? Otherwise, maybe a Skylark macro that takes the Windows toolchain target and extracts the compiler specific toolchain target from it in your repo? I'm not sure how the compiler is auto-determined/specified on Linux so I'm not sure how this macro would look like.
bazel-toolchains
generates a hard coded toolchain identifier:bazel-toolchains/configs/ubuntu16_04_clang/11.0.0/bazel_3.4.1/config/BUILD
Line 32 in e45491b
This works for Linux toolchains as when the toolchain config
BUILD
file is always generated (from here: https://github.com/bazelbuild/bazel/blob/e4e06c0293bda20ad8c2b8db131ce821316b8d12/tools/cpp/BUILD.tpl#L47-L55) with an appropriate cpu and compiler combination only the target compiler:bazel-toolchains/configs/ubuntu16_04_clang/11.0.0/bazel_3.4.1/cc/BUILD
Line 56 in e45491b
On Windows however, the
BUILD
file that is generated (from here: https://github.com/bazelbuild/bazel/blob/e4e06c0293bda20ad8c2b8db131ce821316b8d12/tools/cpp/BUILD.windows.tpl#L47-L59) is not structured specifically for the target compiler, rather it has a toolchain suite for all supported toolchain configs: https://github.com/envoyproxy/envoy-build-tools/blob/c4d2fe1a46a1e173c3dad245b4bbc772a75b5db7/toolchains/configs/windows/msvc-cl/bazel_3.4.1/cc/BUILD#L47-L59It seems like this might just an issue of Bazel fixing the structure of the
BUILD
file template and how it is generated on Windows to match Linux, but is there anything we can do in bazel-toolchains in the mean time/instead? If we could take in the cpu and target compiler and use that to determine the toolchain config target that would help. Currently we are using the Bazel hack to setUSE_CLANG_CL=1
in the environment to make themsvc-cl
toolchain useclang-cl
tools but we would rather use a properly named toolchain config etc.Just looking for ideas/thoughts, and if you think we should focus on getting Bazel to structure its builtin C++ toolchain
BUILD
files differentlyAlso see:
bazel-toolchains/rules/rbe_repo/build_gen.bzl
Lines 101 to 127 in e45491b
bazel-toolchains/rules/rbe_repo/build_gen.bzl
Lines 25 to 28 in e45491b
The text was updated successfully, but these errors were encountered: