-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
build: add option to enable clang-cl on Windows #52870
Conversation
Review requested:
|
Stopping for now. Locally, current error is:
|
Rebased on #52873 so I can use what it does. |
First of all, I'm very glad to see this new PR that aims to remove hardcoded stuff. Second, about the ICU hack, please see my comment from the original PR. Since that project is compiled for host architecture, for cross-compilation we cannot use |
I have no simple idea to fix it then. If we look at Chromium, I think they just prebuild the data files and add them to source control: |
Originally posted by @StefanStojanovic in #35433 (review) |
I ported everything from the previous PR. Build works on my Windows PC. |
When building locally, I noticed a lot of warnings on the OpenSSL side. Should we care about them? @nodejs/crypto Unknown escape sequence:
Unused function:
You can see them all here: https://github.com/nodejs/node/actions/runs/8989345480/job/24692243725 |
This switches the builds to ClangCL, correct? Meaning it is not an option, it just does it... right? (Not an objection, I just want to clarify the intention.) |
It's what it does for now, but my intention is to refactor to add an option. |
I'll look into these links and the ICU issue generally in much more detail, but for us
This should be the way to go. Eventually, we can move to using Clang in the CI, but this should be done in phases and while maintaining MSVC. |
Added an option in 58a7bf7 |
Rebased, squashed into a single commit, removed the ICU hack. |
CI is green. |
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.
RSLGTM
@@ -1042,8 +1049,9 @@ def get_gas_version(cc): | |||
# quite prepared to go that far yet. | |||
def check_compiler(o): | |||
if sys.platform == 'win32': | |||
o['variables']['clang'] = 0 |
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.
I made a mistake here, sorry. I'll keep the lines setting to 0 when the flag isn't passed
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.
Fixed
Most changes are gated by the `clang==1` condition to avoid breaking MSVC builds. Select C/C++ language standard with ClCompile options. This avoids passing the `-std:c++20` flag while compiling C code. Do it only under clang option to avoid breaking addons until node-gyp supports the new LanguageStandard options. Disable precompiled header configuration for now as it doesn't seem to work with clang-cl. Disable C++20 warnings emitted by the Visual Studio C++ STL. They're very noisy and not our responsibility to fix. Co-authored-by: Daniel Lemire <daniel@lemire.me> Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Just a note on this, Most likely, after landing V8 v12.4 (last change to V8) there is an error cross-compiling to ARM64 with ClangCL. I'm certain that previously I could build it if I just changed I'm currently working on that ICU issue, so I'll also investigate this as part of that. The error I'm getting btw is this:
|
This needs a new approval after my force-push |
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.
Let's give it a try, although my approval is gray so I doubt it will help you...
@lemire Can you give me another green tick? |
FWIW I found that support for |
Why is this not using std::bit_cast? |
Landed in efa63f3 |
I already have a PR in FP16 not to use
The FP16 is a header-only library and states |
Most changes are gated by the `clang==1` condition to avoid breaking MSVC builds. Select C/C++ language standard with ClCompile options. This avoids passing the `-std:c++20` flag while compiling C code. Do it only under clang option to avoid breaking addons until node-gyp supports the new LanguageStandard options. Disable precompiled header configuration for now as it doesn't seem to work with clang-cl. Disable C++20 warnings emitted by the Visual Studio C++ STL. They're very noisy and not our responsibility to fix. Co-authored-by: Daniel Lemire <daniel@lemire.me> Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> PR-URL: #52870 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Most changes are gated by the `clang==1` condition to avoid breaking MSVC builds. Select C/C++ language standard with ClCompile options. This avoids passing the `-std:c++20` flag while compiling C code. Do it only under clang option to avoid breaking addons until node-gyp supports the new LanguageStandard options. Disable precompiled header configuration for now as it doesn't seem to work with clang-cl. Disable C++20 warnings emitted by the Visual Studio C++ STL. They're very noisy and not our responsibility to fix. Co-authored-by: Daniel Lemire <daniel@lemire.me> Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> PR-URL: nodejs#52870 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Most changes are gated by the `clang==1` condition to avoid breaking MSVC builds. Select C/C++ language standard with ClCompile options. This avoids passing the `-std:c++20` flag while compiling C code. Do it only under clang option to avoid breaking addons until node-gyp supports the new LanguageStandard options. Disable precompiled header configuration for now as it doesn't seem to work with clang-cl. Disable C++20 warnings emitted by the Visual Studio C++ STL. They're very noisy and not our responsibility to fix. Co-authored-by: Daniel Lemire <daniel@lemire.me> Co-authored-by: Stefan Stojanovic <stefan.stojanovic@janeasystems.com> PR-URL: nodejs#52870 Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
The goal here is to do the right changes with lessons learned from #35433.