Node: compilation errors trying to build `v11.x-staging` or `master` on Windows

Created on 9 Nov 2018  路  17Comments  路  Source: nodejs/node

  • Version: v11.x-staging/master
  • Platform: 64-bit Windows 10
  • Subsystem: build


I'm running into compilation errors trying to build v11.x-staging or master on Windows:

C:\work\node\github\node>vcbuild projgen openssl-no-asm release
...
..\src\compiler\wasm-compiler.cc(5071): error C2248: 'v8::internal::wasm::Result<v8::internal::wa
sm::DecodeStruct *>::operator =': cannot access private member declared in class 'v8::internal::w
asm::Result<v8::internal::wasm::DecodeStruct *>' [C:\work\node\github\node\deps\v8\gypfiles\v8_ba
se_0.vcxproj]

Full build log

Building v10.x-staging succeeds on the same machine (only difference is git checkout and I have tried git clean -fdX between checkouts).

cc @nodejs/platform-windows

build windows

All 17 comments

@richardlau can you paste the version of CL (running cl will print it and err)

DEV D:\code\4node\gyp>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27023.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

DEV D:\code\4node\gyp>

Also you can try generating the configuration with:

python configure  --with-pch --dest-cpu=x64 --verbose

(that is with no ltcg and with-pch)?

Not for a while. It's my work machine and I'm now out of the office until 19th Nov. (Only ran into this while trying to test https://github.com/nodejs/node/pull/24265#issuecomment-437437576).

At first I thought it might be set up but I checked I could still build v10.x-staging. The machine definitely had Visual Studio 2017 but I'd need to be on it to get the exact compiler version.

I'll try to reproduce some other way...
Enjoy your time OOO.

@richardlau can you paste the version of CL (running cl will print it and err)

DEV D:\code\4node\gyp>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27023.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

DEV D:\code\4node\gyp>
C:\work\node\github\node>cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25017 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

C:\work\node\github\node>

Also you can try generating the configuration with:

python configure  --with-pch --dest-cpu=x64 --verbose

(that is with no ltcg and with-pch)?

C:\work\node\github\node>python configure  --with-pch --dest-cpu=x64 --verbose
WARNING: No acceptable ASM compiler found!
         Please make sure you have installed NASM from http://www.nasm.us
         and refer BUILDING.md.
ERROR: Did not find a new enough assembler, install one or build with
       --openssl-no-asm.
       Please refer to BUILDING.md

C:\work\node\github\node>python configure  --with-pch --dest-cpu=x64 --verbose --openssl-no-asm
WARNING: --openssl-no-asm will result in binaries that do not take advantage
         of modern CPU cryptographic instructions and will therefore be slower.
         Please refer to BUILDING.md
creating icu_config.gypi
* Using ICU in deps/icu-small
creating icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'build_v8_with_gn': 'false',
                 'coverage': 'false',
                 'debug_nghttp2': 'false',
                 'enable_lto': 'false',
                 'enable_pgo_generate': 'false',
                 'enable_pgo_use': 'false',
                 'force_dynamic_crt': 0,
                 'host_arch': 'x64',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt63l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '63',
                 'node_byteorder': 'little',
                 'node_debug_lib': 'false',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_experimental_http_parser': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 67,
                 'node_no_browser_globals': 'false',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared': 'false',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_nghttp2': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_target_type': 'executable',
                 'node_use_bundled_v8': 'true',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'true',
                 'node_use_large_pages': 'false',
                 'node_use_openssl': 'true',
                 'node_use_pch': 'true',
                 'node_use_v8_platform': 'true',
                 'node_with_ltcg': 'false',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.67',
                 'target_arch': 'x64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 1,
                 'v8_promise_internal_field_count': 1,
                 'v8_random_seed': 0,
                 'v8_trace_maps': 0,
                 'v8_typed_array_max_size_in_heap': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0}}
creating config.gypi
creating config.status
creating config.mk
running:
    python tools/gyp_node.py --no-parallel -f msvs -G msvs_version=auto

C:\work\node\github\node>

Attempting to compile now with vcbuild noprojgen openssl-no-asm release (I think noprojgen is the way to reuse the manually run configure above).

Attempting to compile now with vcbuild noprojgen openssl-no-asm release (I think noprojgen is the way to reuse the manually run configure above).

Still failed with same error.

Attempting to compile now with vcbuild noprojgen openssl-no-asm release (I think noprojgen is the way to reuse the manually run configure above).

Yep.

Still failed with same error.

I'm at a loss.

Could you replace vcbuild.bat with a direct call to MSBuild:

python configure  --with-pch --dest-cpu=x64 --verbose
msbuild /m:1 /t:Build /p:Configuration=Release /p:Platform=x64 /nologo node.sln

This give a more verbose output, and at some point it should output the exact call that compiles ..\src\compiler\wasm-compiler.cc

Mine is (after /s/ /\n/):

D:\code\3party\clcache\dist\clcache_main\cl.exe
/c
/I..
/I..\..\..
/ID:\code\node\deps\v8\gypfiles\Release\obj\global_intermediate
/I..\include
/I"..\..\..\deps\icu-small\source\i18n"
/I"..\..\..\deps\icu-small\source\common"
/Z7
/nologo
/W3
/WX-
/diagnostics:classic
/MP
/O2
/Ob2
/Oi
/Oy
/D V8_DEPRECATION_WARNINGS
/D V8_IMMINENT_DEPRECATION_WARNINGS
/D V8_GYP_BUILD
/D V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=0
/D WIN32
/D _CRT_SECURE_NO_DEPRECATE
/D _CRT_NONSTDC_NO_DEPRECATE
/D _HAS_EXCEPTIONS=0
/D BUILDING_V8_SHARED=1
/D BUILDING_UV_SHARED=1
/D OPENSSL_THREADS
/D V8_TARGET_ARCH_X64
/D "V8_EMBEDDER_STRING=\"-node.1\""
/D ENABLE_DISASSEMBLER
/D V8_PROMISE_INTERNAL_FIELD_COUNT=1
/D V8_INTL_SUPPORT
/D V8_CONCURRENT_MARKING
/D DISABLE_UNTRUSTED_CODE_MITIGATIONS
/D V8_EMBEDDED_BUILTINS
/D V8_EMBEDDED_BYTECODE_HANDLERS
/D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED
/D UCONFIG_NO_SERVICE=1
/D U_ENABLE_DYLOAD=0
/D U_STATIC_IMPLEMENTATION=1
/D U_HAVE_STD_STRING=1
/D UCONFIG_NO_BREAK_ITERATION=0
/D _UNICODE
/D UNICODE
/GF
/Gm-
/MT
/GS
/Gy
/fp:precise
/Zc:wchar_t
/Zc:forScope
/Zc:inline
/GR-
/Yu"pch_v8_base.h"
/Fp"Release\obj\v8_base\v8_base.pch"
/Fo"Release\obj\v8_base\.cc\\"
/Fd"Release\obj\v8_base\v8_base.pdb"
/Gd
/TP
/wd4351
/wd4355
/wd4800
/wd4251
/wd4275
/wd4244
/wd4267
/wd4245
/wd4324
/wd4701
/wd4702
/wd4703
/wd4709
/wd4714
/wd4715
/wd4718
/wd4723
/wd4724
/FIpch_v8_base.h
/FC
/errorReport:queue 
MANYMANYOTHERFILES
"..\src\compiler\wasm-compiler.cc"
MANYMANYMOREFILES
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\CL.exe
/c
/I..
/I..\..\..
/IC:\work\node\github\node\Release\obj\global_intermediate
/I..\include
/I"..\..\..\deps\icu-small\source\i18n"
/I"..\..\..\deps\icu-small\source\common"
/Z7
/nologo
/W3
/WX-
/diagnostics:classic
/MP
/O2
/Ob2
/Oi
/Oy
/D V8_DEPRECATION_WARNINGS
/D V8_IMMINENT_DEPRECATION_WARNINGS
/D V8_GYP_BUILD
/D V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=0
/D WIN32
/D _CRT_SECURE_NO_DEPRECATE
/D _CRT_NONSTDC_NO_DEPRECATE
/D _HAS_EXCEPTIONS=0
/D BUILDING_V8_SHARED=1
/D BUILDING_UV_SHARED=1
/D OPENSSL_THREADS
/D OPENSSL_NO_ASM
/D V8_TARGET_ARCH_X64
/D "V8_EMBEDDER_STRING=\"-node.11\""
/D ENABLE_DISASSEMBLER
/D V8_PROMISE_INTERNAL_FIELD_COUNT=1
/D V8_INTL_SUPPORT
/D V8_CONCURRENT_MARKING
/D DISABLE_UNTRUSTED_CODE_MITIGATIONS
/D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED
/D UCONFIG_NO_SERVICE=1
/D U_ENABLE_DYLOAD=0
/D U_STATIC_IMPLEMENTATION=1
/D U_HAVE_STD_STRING=1
/D UCONFIG_NO_BREAK_ITERATION=0
/D _UNICODE
/D UNICODE
/GF
/Gm-
/MT
/GS
/Gy
/fp:precise
/Zc:wchar_t
/Zc:forScope
/Zc:inline
/GR-
/Yu"pch_v8_base.h"
/Fp"Release\obj\v8_base\v8_base.pch"
/Fo"Release\obj\v8_base\.cc\\"
/Fd"Release\obj\v8_base\v8_base.pdb"
/Gd
/TP
/wd4351
/wd4355
/wd4800
/wd4251
/wd4275
/wd4244
/wd4267
/wd4245
/wd4324
/wd4701
/wd4702
/wd4703
/wd4709
/wd4714
/wd4715
/wd4718
/wd4723
/wd4724
/FIpch_v8_base.h
/errorReport:queue
"..\src\compiler\wasm-compiler.cc"
"..\src\wasm\module-compiler.cc"
"..\src\wasm\module-decoder.cc"
"..\src\wasm\wasm-objects.cc"

I don't see anything of significant that's different.
Only thing I see is that you use the 14.10.25017 version of the compiler:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64\CL.exe

So it might be a bug in the compiler...

I've slowly been bisecting master and it looks like the update to V8 7.0 (0e7ddbd3d7e9439c67573b854c49cf82c398ae82) was the one that broke on my system (I can build commits prior to that one).

Since nobody else has reported anything similar I'm going with a potential compiler issue and will try to update that and see if that fixes things.

@richardlau does it still fail with the new V8 7.1?

@targos I'll try on Monday.

Yes, still fails with current master (a91293d4d9).

Going to update my installation of VS2017.

@richardlau I can't reproduce this, using cl 19.16.27024.1 and openssl-no-asm. I'm expecting this to be because the outdated VS version, I've seen similar issues. If that doesn't work, make sure all Windows updates are installed (not really expecting this to make a difference, but it's possible) and make sure there are no corrupted files:

rm .git/index
git reset
git status

@joaocgreis Thanks, I'm more or less expecting the same. I have updated VS2017 to the latest cumulative fixes and just need to run a build through to completion to verify.

Update (to cl 19.16.27024.1) has fixed it 馃帀.

Thanks everyone, and sorry for the noise.

Was this page helpful?
0 / 5 - 0 ratings