Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set USE_CLANG_CL=1 to force substitute llvm tools #88

Merged
merged 7 commits into from
Aug 21, 2020
Merged

Set USE_CLANG_CL=1 to force substitute llvm tools #88

merged 7 commits into from
Aug 21, 2020

Conversation

sunjayBhatia
Copy link
Member

@sunjayBhatia sunjayBhatia commented Jul 24, 2020

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 in the future 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).

See bazelbuild/bazel-toolchains#901 for a conversation
started with the bazel-toolchains maintainers.

Also bumps bazel-toolchains dependency to pick up changes from: bazelbuild/bazel-toolchains#904

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 <sunjayb@vmware.com>
Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
Co-authored-by: Sunjay Bhatia <sunjayb@vmware.com>
Co-authored-by: William A Rowe Jr <wrowe@vmware.com>
@sunjayBhatia
Copy link
Member Author

cc @wrowe

@sunjayBhatia
Copy link
Member Author

One theory we have as to why the windows toolchain generation is failing like this is this change: actions/runner-images@95222e0#diff-580bd0ec6b5a6590106c72db0501d8f0 that enabled Windows Subsystem for Linux on the AZP workers, it might be that the bash on the PATH is now for WSL.

wrowe and others added 4 commits August 5, 2020 16:15
Co-authored-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
Co-authored-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Signed-off-by: William A Rowe Jr <wrowe@vmware.com>
@sunjayBhatia
Copy link
Member Author

See bazelbuild/bazel-toolchains#904 which should fix the print format args issue

Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
Co-authored-by: William A Rowe Jr <wrowe@vmware.com>
@sunjayBhatia
Copy link
Member Author

@lizan this should be ready to go when you get a chance

@sunjayBhatia
Copy link
Member Author

@lizan merged master, this should be ready again

@lizan lizan merged commit 4e06e4d into envoyproxy:master Aug 21, 2020
htuch pushed a commit that referenced this pull request Aug 21, 2020
  [skip ci]
  Set USE_CLANG_CL=1 to force substitute llvm tools (#88)

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 <sunjayb@vmware.com>
Co-authored-by: William A Rowe Jr <wrowe@vmware.com>
@wrowe wrowe deleted the clang-cl-add-env-var branch August 21, 2020 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants