c++v8embedded-v8gn

Issues with building Google V8 versions 10.x/11.x with Visual Studio 2019 (9.x is ok)


I'm currently having issues to build V8 version 11.x on Windows, specifically every version beyond 10.0 does not build on Visual Studio 2019 (16.11.22) due to different build errors. V8 version 9.99 builds for me successfully using the steps described below.

Does V8 above version 10 still support a Visual Studio build, or has the V8 team switched to using clang on Windows entirely? Because from the build issues of the 10.x or 11.x versions I get the impression that V8 is not CI tested on Visual Studio anymore.

I'm further explaining my issues in detail on the example of V8 version 11.1.55 (f7c642b0d7).

I set my environment variables as following:

set vs2019_install=[path to your \Microsoft Visual Studio\2019\Community]
set WINDOWSSDKDIR=[path to your \Windows Kits\10]
set DEPOT_TOOLS_WIN_TOOLCHAIN=0

I invoke the build with following commands:

cd v8
git checkout 11.1.55
gclient sync
gn args out/x64.debug
ninja -C out/x64.debug v8_monolith

Following arguments are passed to gn (when the editor opens due to gn args)

is_component_build = false
is_debug = true
symbol_level = 0
target_cpu = "x64"
use_goma = false
v8_enable_backtrace = false
v8_enable_fast_mksnapshot = true
v8_enable_slow_dchecks = true
v8_optimized_debug = true
enable_iterator_debugging = true
v8_static_library = true
v8_monolithic = true
v8_use_external_startup_data = false
use_custom_libcxx = false
is_clang = false
use_lld = false
use_cxx17 = true

The first build error is:

[816/1906] CXX obj/v8_compiler/js-native-context-specialization.obj
FAILED: obj/v8_compiler/js-native-context-specialization.obj
ninja -t msvc -e environment.x64 -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133
\bin\Hostx64\x64\cl.exe" /c ../../src/compiler/js-native-context-specialization.cc /Foobj/v8_compiler/js-native-context-spec
ialization.obj /nologo /showIncludes -DUSE_AURA=1 -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_HAS_EXCEPT
IONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAI
N_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2 -DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_M
EAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_
ANNOTATIONS_ENABLED=1 -DCPPGC_VERIFY_HEAP -DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DOBJECT_PRINT -DVERIFY
_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH -DV8_ENABLE_DOUBLE_CONST_STORE_CHECK -DV8_I
NTL_SUPPORT -DENABLE_HANDLE_ZAPPING -DV8_CODE_COMMENTS -DV8_ENABLE_DEBUG_CODE -DV8_ENABLE_HEAP_SNAPSHOT_VERIFY -DV8_SNAPSHOT
_NATIVE_CODE_COUNTERS -DV8_ATOMIC_OBJECT_FIELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWIN
DING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH -DV8_SHORT_BUILTIN_CALLS -DV8_EXTERNAL_CODE_SPACE -DV8_ENABLE_MAG
LEV -DV8_ENABLE_SYSTEM_INSTRUMENTATION -DV8_ENABLE_ETW_STACK_WALKING -DV8_ENABLE_WEBASSEMBLY -DV8_ALLOCATION_FOLDING -DV8_AL
LOCATION_SITE_TRACKING -DV8_ADVANCED_BIGINT_ALGORITHMS -DV8_STATIC_ROOTS -DV8_USE_ZLIB -DV8_ENABLE_WASM_SIMD256_REVEC -DV8_E
NABLE_CHECKS -DV8_COMPRESS_POINTERS -DV8_COMPRESS_POINTERS_IN_SHARED_CAGE -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_ENABLE_SANDBOX
-DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DEPRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DCPPGC_POINTER_COM
PRESSION -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS -DV8_TARGET_OS_WIN -DDEBUG -DENABLE_SLOW_DCHECKS -DV8_RUNTIME_CALL_STATS -
DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STA
TIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -I../.. -Igen -I../../include -Igen/include -I../../third_party/i
cu/source/common -I../../third_party/icu/source/i18n /WX /wd4244 /Gy /FS /bigobj /utf-8 /Zc:sizedDealloc- /wd4117 /D__DATE__
= /D__TIME__= /D__TIMESTAMP__= /MDd /wd4245 /wd4267 /wd4324 /wd4701 /wd4702 /wd4703 /wd4709 /wd4714 /wd4715 /wd4718 /wd4723
/wd4724 /wd4800 /wd4506 /wd4091 /wd4127 /wd4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4
121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4200 /wd4201 /wd4204
/wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /wd4702 /wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /O2 /Ob2 /Oy- /Zc:inline /Gw /std:c+
+17 /TP /GR- /std:c++17 /Fd"obj/v8_compiler_cc.pdb"
../..\src/execution/isolate-data.h(279): error C2607: static assertion failed
../..\src/execution/isolate-data.h(281): error C2607: static assertion failed
../..\src/execution/isolate-data.h(284): error C2607: static assertion failed
../..\src/execution/isolate-data.h(286): error C2607: static assertion failed

Another build error is the following:

[4/1099] CXX obj/v8_compiler/js-operator.obj
FAILED: obj/v8_compiler/js-operator.obj
ninja -t msvc -e environment.x64 -- "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133
\bin\Hostx64\x64\cl.exe" /c ../../src/compiler/js-operator.cc /Foobj/v8_compiler/js-operator.obj /nologo /showIncludes -DUSE
_AURA=1 -D_CRT_NONSTDC_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECU
RE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=2
-DWIN32 -D_SECURE_ATL -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDD
I_VERSION=NTDDI_WIN10_FE -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DCPPGC_VERIFY_HEAP
-DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATI
ON_TIMEOUT -DV8_ENABLE_FORCE_SLOW_PATH -DV8_ENABLE_DOUBLE_CONST_STORE_CHECK -DV8_INTL_SUPPORT -DENABLE_HANDLE_ZAPPING -DV8_C
ODE_COMMENTS -DV8_ENABLE_DEBUG_CODE -DV8_ENABLE_HEAP_SNAPSHOT_VERIFY -DV8_SNAPSHOT_NATIVE_CODE_COUNTERS -DV8_ATOMIC_OBJECT_F
IELD_WRITES -DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_SHARED_RO_HEAP -DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_T
HREADED_DISPATCH -DV8_SHORT_BUILTIN_CALLS -DV8_EXTERNAL_CODE_SPACE -DV8_ENABLE_MAGLEV -DV8_ENABLE_SYSTEM_INSTRUMENTATION -DV
8_ENABLE_ETW_STACK_WALKING -DV8_ENABLE_WEBASSEMBLY -DV8_ALLOCATION_FOLDING -DV8_ALLOCATION_SITE_TRACKING -DV8_ADVANCED_BIGIN
T_ALGORITHMS -DV8_STATIC_ROOTS -DV8_USE_ZLIB -DV8_ENABLE_WASM_SIMD256_REVEC -DV8_ENABLE_CHECKS -DV8_COMPRESS_POINTERS -DV8_C
OMPRESS_POINTERS_IN_SHARED_CAGE -DV8_31BIT_SMIS_ON_64BIT_ARCH -DV8_ENABLE_SANDBOX -DV8_DEPRECATION_WARNINGS -DV8_IMMINENT_DE
PRECATION_WARNINGS -DCPPGC_CAGED_HEAP -DCPPGC_YOUNG_GENERATION -DCPPGC_POINTER_COMPRESSION -DV8_TARGET_ARCH_X64 -DV8_HAVE_TA
RGET_OS -DV8_TARGET_OS_WIN -DDEBUG -DENABLE_SLOW_DCHECKS -DV8_RUNTIME_CALL_STATS -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD
=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=IC
U_UTIL_DATA_FILE -I../.. -Igen -I../../include -Igen/include -I../../third_party/icu/source/common -I../../third_party/icu/s
ource/i18n /WX /wd4244 /Gy /FS /bigobj /utf-8 /Zc:sizedDealloc- /wd4117 /D__DATE__= /D__TIME__= /D__TIMESTAMP__= /MDd /wd424
5 /wd4267 /wd4324 /wd4701 /wd4702 /wd4703 /wd4709 /wd4714 /wd4715 /wd4718 /wd4723 /wd4724 /wd4800 /wd4506 /wd4091 /wd4127 /w
d4251 /wd4275 /wd4312 /wd4324 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd461
0 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4200 /wd4201 /wd4204 /wd4221 /wd4245 /wd4267 /wd4305 /wd4389 /w
d4702 /wd4701 /wd4703 /wd4661 /wd4706 /wd4715 /O2 /Ob2 /Oy- /Zc:inline /Gw /std:c++17 /TP /GR- /std:c++17 /Fd"obj/v8_compile
r_cc.pdb"
../..\src/compiler/node.h(341): error C3615: constexpr function 'v8::internal::compiler::Effect::Effect' cannot result in a
constant expression
../..\src/compiler/node.h(343): note: failure was caused by call of undefined function or one not declared 'constexpr'
../..\src/compiler/node.h(343): note: see usage of 'v8::internal::FlagValue<bool>::operator T'
        with
        [
            T=bool
        ]
../..\src/compiler/node.h(357): error C3615: constexpr function 'v8::internal::compiler::Control::Control' cannot result in
a constant expression
../..\src/compiler/node.h(359): note: failure was caused by call of undefined function or one not declared 'constexpr'
../..\src/compiler/node.h(359): note: see usage of 'v8::internal::FlagValue<bool>::operator T'
        with
        [
            T=bool
        ]

Is V8 version 11.x still buildable using Visual Studio (2019)? Or what needs to be done to build it?

The overall build procedure described here is probably ok since v8 9.99 builds and runs without any issues using the steps above.


Solution

  • (V8 developer here.)

    has the V8 team switched to using clang on Windows entirely?

    Yes, a long time ago.

    I get the impression that V8 is not CI tested on Visual Studio anymore.

    That impression is incorrect, there's an MSVC builder and it is being kept happy. I'm not sure which version of Visual Studio it's using, could be 2019.

    Configurations beyond the one used by this builder are community-supported. You are welcome to contribute a patch.


    Side note: there is nothing special to "version 10". Release branches are created on a calendar-based schedule, and we simply use "10.0" after "9.9" (and there never was a "9.99"); see here for more.