-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Correct windows build flags for clang-cl/msvc-cl under opt/fastbuild/dbg #13133
Correct windows build flags for clang-cl/msvc-cl under opt/fastbuild/dbg #13133
Conversation
@envoyproxy/windows-dev note the resolution to Nick and Randy's observations about omitting -config msvc-cl, this should now work. |
/retest |
Retrying Azure Pipelines, to retry CircleCI checks, use |
/retest |
Retrying Azure Pipelines, to retry CircleCI checks, use |
@envoyproxy/windows-dev for your inspection, this looks ready to run better msvc-cl and new clang-cl pipelines, and defaults should be more sensible for invoking bazel from the command line |
@htuch Just FYI that this has progressed r.e. #11974 It may be unwise to simply drop msvc-cl from the matrix, because that compiler is giving us additional insight into mistaken assumptions about C++ inherited from gcc/clang, but we'll zero in on one-or-the-other as "official binaries" coming from the project. |
@wrowe great, I think this will pay off with our Chromium interop and other OSS libs, thanks, seems awesome progress. |
- Move what were '--config=msvc-cl' settings out of .bazelrc into the default cflags for Windows compilation. This enables bazel build ... and bazel test ... to simply work out of the box. - Cleans up .bazelrc lists of windows vs. clang-cl settings, dividing the list into desired toggles vs. bazel or envoy bug workarounds - Fix errors in curl library creation in fastbuild on Windows - Introduce toggles and defaults for alwayslink argument to library objects. Defaults remain the same for now. - Introduce, but do not toggle clang-cl flags (this will arrive in a later PR when we resolve the opt build errors missing intrinsic base class destructors in the mock classes) Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]> Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]>
This patch has been greatly simplified, it adds the minimal support for introducing some new features in future patches (such as exposing linkalways flags for potential overrides) and relocates a number of flags without changing the behaviors significantly. It should continue to permit building fastbuild out-of-the-box by default without invoking ci/windows_build_steps.sh, but it will no longer introduce release 'opt' build debug .pdb's on Windows due to the memory constraints of the GCP RBE environment. We'll address that in a later patch in sync with changes to the GCP worker pool, and wait to introduce clang-cl build pipeline until those opt build bugs are sorted out. The idea is to facilitate kicking off |
…ld-default Signed-off-by: William A Rowe Jr <[email protected]>
Correct flag '--features' typo Signed-off-by: William A Rowe Jr <[email protected]>
- The CMP0091 rule cannot simply be disabled, it breaks any build where that rule isn't recognized by the installed cmake. - Applying a limit of rules applicable to CMake 3.16 breaks corrections made to later versions of CMake. - Using -U0 for the delta of this patch decreases the likelyhood it might not apply cleanly to the next iteration of curl. - This now corrects both windows msvc-cl fastbuild and all clang-cl builds. - All of this becomes irrelevant once this issue is addressed; #11816 Signed-off-by: William A Rowe Jr <[email protected]>
…ld-default Signed-off-by: William A Rowe Jr <[email protected]>
- With the correct CFLAGS handling, the flags are correctly passed from bazel while building curl using rules_foreign_cc. This override is no longer applicable. Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: William A Rowe Jr <[email protected]>
…ld-default Signed-off-by: William A Rowe Jr <[email protected]>
Note, this PR is a https://github.com/envoyproxy/envoy/milestone/16 dependency |
@lizan could you give this a final pass so we can move on to the clang-cl pipeline PR which depends on these updates? |
# Drop the determinism feature (-DDATE etc are a no-op in msvc-cl) | ||
build:msvc-cl --action_env=USE_CLANG_CL="" | ||
build:msvc-cl --define clang_cl=0 | ||
build:msvc-cl --features=-determinism |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is needed? it wasn't here before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three things going on.
Config msvc-cl is no longer strictly needed, those flags moved to bazel/envoy_*.bzl
When specifically requesting msvc-cl, we will disable clang-cl even if it the default in the dev's environment
We mark the build non-deterministic because the DATE and other timestamp overrides do absolutely nothing in msvc-cl, and that build cannot be deterministic. We are in a different, better situation with clang-cl, it is very noisy about overriding these intrinsic macros, but the reassignment takes place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sgtm
PR #13133 disabled various tests as they failed or flaked when compiled with clang-cl. Given we have some significant other blockers to adding clang-cl support and enabling as many tests to run in CI as possible is important to progress to beta/GA support, we can un-skip these tests. We could be "clever" and use a select to only tag tests to be skipped when built with a specific compiler and compilation mode as well as an alternative. Signed-off-by: Sunjay Bhatia <[email protected]>
Commit Message: Clean up build flags for clang + msvc opt/fastbuild/dbg
Additional Description:
Move what were '--config=msvc-cl' settings out of .bazelrc into the
default cflags for Windows compilation. This enables bazel build ...
and bazel test ... to simply work out of the box.
Cleans up .bazelrc lists of windows vs. clang-cl settings, dividing
the list into desired toggles vs. bazel or envoy bug workarounds
Fix errors in curl library creation in fastbuild on Windows
Introduce toggles and defaults for alwayslink argument to library objects.
Defaults remain the same for now.
Introduce, but do not toggle clang-cl flags (this will arrive in a
later PR when we resolve the opt build errors missing intrinsic base
class destructors in the mock classes)
Risk Level: low
Testing: local, msvc and clang-cl on windows
Docs Changes: n/a
Release Notes: n/a