node-v8 icon indicating copy to clipboard operation
node-v8 copied to clipboard

Support clang build on windows.

Open gengjiawen opened this issue 5 years ago • 6 comments

We have run into multi issues using msvc compiler. Is it possible we add clang support for windows too. Some benefits:

  • v8 use clang on windows too, v8 build will be less problematic.
  • clang is small compared to visual studio
  • ninja support

cc @nodejs/v8 @nodejs/build

gengjiawen avatar Jun 29 '20 11:06 gengjiawen

It's possible if someone does the work to enable it.

targos avatar Jun 29 '20 11:06 targos

@gengjiawen it sounds like a major win. As @targos said, I hope someone finds the time and energy to make this happen.

ryzokuken avatar Jun 29 '20 11:06 ryzokuken

This is probably one for @nodejs/platform-windows (in particular @joaocgreis and @bzoz). As long as Node.js supports building with MSVC we'll need to continue building on it so adding an additional toolchain (clang) doesn't avoid us having to fix the build with MSVC.

richardlau avatar Jun 29 '20 12:06 richardlau

an additional toolchain (clang) doesn't avoid us having to fix the build with MSVC.

Actually v8 doesn't use msvc bring too much trouble when we building Node.js.If this is doable, we can move msvc support to second layer ?

The biggest problem with msvc is that, it's very hard to debug with all those mistery. It often take many days to debug a msvc-only problem like in this repo and https://github.com/bnoordhuis/v8-cmake/issues/10.

gengjiawen avatar Jun 29 '20 12:06 gengjiawen

It would be amazing if we could do so, and it had been suggested before by V8. One thing to consider is that such a change would be semver-major, and the biggest challenge is ensuring native modules still work (and I'm not sure if native modules would need a different toolchain with clang instead of msvc, @nodejs/platform-windows might know it). As soon as we had this working it would be feasible for us to use clang to test this repo, since V8 updates are semver-major by default.

mmarchini avatar Jun 29 '20 16:06 mmarchini

I started experimenting with ClangCL here: https://github.com/targos/node/commits/clang-cl Currently blocked on ICU: https://github.com/nodejs/node/issues/34201

targos avatar Jul 13 '20 14:07 targos

Work is happening on https://github.com/nodejs/node/pull/35433

targos avatar Jan 10 '24 13:01 targos