nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
106.57k stars 29.05k forks source link

Cannot build on Win 8.1 (x86) #21402

Closed ghost closed 6 years ago

ghost commented 6 years ago

I've installed VS2017 and fetched the latest version of Node. When I tried to build, I got some errors below:

Pre-installed:Python 2.7.0 (x86)

D:\Projects\node>vcbuild test openssl-no-asm
Looking for Python 2.x
Looking for Visual Studio 2017
calling: "C:\Program Files\VSCommunity2017\VC\\Auxiliary\Build\vcvarsall.bat" x86_x64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86_x64'
Found MSVS version 15.0
configure  --dest-cpu=x64 --openssl-no-asm
?[1m?[93mWARNING?[0m: --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',
                 'force_dynamic_crt': 0,
                 'host_arch': 'ia32',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt61l.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': '61',
                 'node_byteorder': 'little',
                 'node_debug_lib': 'false',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 64,
                 '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_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.64',
                 'target_arch': 'x64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 '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': 1}}
creating config.gypi
creating config.mk
?[1m?[93mWARNING?[0m: warnings were emitted in the configure phase
Warning: Missing input files:
deps\v8\gypfiles\..\src\parsing\preparse-data-format.h
deps\v8\gypfiles\..\include\v8-debug.h
Project files generated.
  cares.vcxproj -> D:\Projects\node\Release\lib\cares.lib
  http_parser.vcxproj -> D:\Projects\node\Release\lib\http_parser.lib
  gtest.vcxproj -> D:\Projects\node\Release\lib\gtest.lib
  libuv.vcxproj -> D:\Projects\node\Release\lib\libuv.lib
  nghttp2.vcxproj -> D:\Projects\node\Release\lib\nghttp2.lib
  node_js2c
  openssl.vcxproj -> D:\Projects\node\Release\lib\openssl.lib
  v8_init.vcxproj -> D:\Projects\node\Release\lib\v8_init.lib
  v8_initializers.vcxproj -> D:\Projects\node\Release\lib\v8_initializers.lib
  v8_libbase.vcxproj -> D:\Projects\node\Release\lib\v8_libbase.lib
  v8_libplatform.vcxproj -> D:\Projects\node\Release\lib\v8_libplatform.lib
  v8_libsampler.vcxproj -> D:\Projects\node\Release\lib\v8_libsampler.lib
  zlib.vcxproj -> D:\Projects\node\Release\lib\zlib.lib
  v8_nosnapshot.vcxproj -> D:\Projects\node\Release\lib\v8_nosnapshot.lib
  openssl-cli.vcxproj -> D:\Projects\node\Release\\openssl-cli.exe
  icustubdata.vcxproj -> D:\Projects\node\Release\lib\icustubdata.lib
  icutools.vcxproj -> D:\Projects\node\Release\lib\icutools.lib
  icui18n.vcxproj -> D:\Projects\node\Release\lib\icui18n.lib
  icuucx.vcxproj -> D:\Projects\node\Release\lib\icuucx.lib
  iculslocs.vcxproj -> D:\Projects\node\Release\\iculslocs.exe
  genccode.vcxproj -> D:\Projects\node\Release\\genccode.exe
  genrb.vcxproj -> D:\Projects\node\Release\\genrb.exe
  icupkg.vcxproj -> D:\Projects\node\Release\\icupkg.exe
  icutrim
  该版本的 D:\Projects\node\Release\icupkg.exe 与你运行的 Windows 版本不兼容。请查看计算机的系统信息,然后联系软件发布者。
  Options: {'verbose': 1, 'filterfile': 'icu_small.json', 'toolpath': 'D:\\Projects\\node\\Release\\', 'deltmpdir': 1
  , 'outfile': 'icudt61l.dat', 'datfile': '..\\..\\deps\\icu-small\\source\\data\\in\\icudt61l.dat', 'locales': 'en,r
  oot', 'endian': 'little', 'tmpdir': 'D:\\Projects\\node\\Release\\obj\\global_intermediate\\icutmp'}
  icu_small.json: icutrim.py config: Trim down ICU to just a certain locale set, needed for node.js use.
  FAILED: D:\Projects\node\Release\icupkg -tl ..\..\deps\icu-small\source\data\in\icudt61l.dat D:\Projects\node\Relea
  se\obj\global_intermediate\icutmp\icudt61l.dat
C:\Program Files\VSCommunity2017\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: “cmd.exe

”已退出,代码为 1。 [D:\Projects\node\tools\icu\icudata.vcxproj]

It told me that D:\Projects\node\Release\icupkg.exe isn't compatable with my current running Windows……How to solve that? I searched for the whole Issues but not found anything about x86 configuration modifications……?

Thanks anyway!

refack commented 6 years ago

Hello @Maledong and thank you for the report.

I have two intuitions:

  1. This might be because you are trying to build a 64bit binary (the default) on a 32bit machine (see the call to ...vcvarsall.bat" x86_x64).
    Try to run vcbuild test openssl-no-asm x86

  2. This might be because of your ASCII codepage. Cloud you try to run:

    > CHCP 65001
    > configure  --dest-cpu=x64 --openssl-no-asm

    or even CHCP 437 (ref https://ss64.com/nt/chcp.html)

@srl295 @nodejs/intl

ghost commented 6 years ago

@refack : Sorry I tried several times but nope :(

D:\Projects\node>vcbuild test openssl-no-asm x86
Looking for Python 2.x
Looking for Visual Studio 2017
calling: "C:\Program Files\VSCommunity2017\VC\\Auxiliary\Build\vcvarsall.bat" x86_x86
[ERROR:vcvarsall.bat] Invalid argument found : x86_x86
[ERROR:vcvarsall.bat] Error in script usage. The correct usage is:
Syntax:
    vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version]
where :
    [arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
    [platform_type]: {empty} | store | uwp
    [winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
    [vc_version] : {none} for default VS 2017 VC++ compiler toolset |
                   "14.0" for VC++ 2015 Compiler Toolset |
                   "14.1x" for the latest 14.1x.yyyyy toolset installed (e.g. "14.11") |
                   "14.1x.yyyyy" for a specific full version number (e.g. 14.11.25503)

The store parameter sets environment variables to support Universal Windows Platform application
development and is an alias for 'uwp'.

For example:
    vcvarsall.bat x86_amd64
    vcvarsall.bat x86_amd64 10.0.10240.0
    vcvarsall.bat x86_arm uwp 10.0.10240.0
    vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
    vcvarsall.bat x64 8.1
    vcvarsall.bat x64 store 8.1

Please make sure either Visual Studio or C++ Build SKU is installed.
Found MSVS version
configure  --dest-cpu=x86 --openssl-no-asm
?[1m?[93mWARNING?[0m: --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',
                 'force_dynamic_crt': 0,
                 'host_arch': 'ia32',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt61l.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': '61',
                 'node_byteorder': 'little',
                 'node_debug_lib': 'false',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 64,
                 '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_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.64',
                 'target_arch': 'ia32',
                 'v8_enable_gdbjit': 0,
Active code page: 65001

D:\Projects\node>configure  --dest-cpu=x64 --openssl-no-asm
'configure' is not recognized as an internal or external command,
operable program or batch file.

D:\Projects\node>vcbuild test openssl-no-asm x86
Looking for Python 2.x
Looking for Visual Studio 2017
calling: "C:\Program Files\VSCommunity2017\VC\\Auxiliary\Build\vcvarsall.bat" x86_x86
[ERROR:vcvarsall.bat] Invalid argument found : x86_x86
[ERROR:vcvarsall.bat] Error in script usage. The correct usage is:
Syntax:
    vcvarsall.bat [arch] [platform_type] [winsdk_version] [-vcvars_ver=vc_version]
where :
    [arch]: x86 | amd64 | x86_amd64 | x86_arm | x86_arm64 | amd64_x86 | amd64_arm | amd64_arm64
    [platform_type]: {empty} | store | uwp
    [winsdk_version] : full Windows 10 SDK number (e.g. 10.0.10240.0) or "8.1" to use the Windows 8.1 SDK.
    [vc_version] : {none} for default VS 2017 VC++ compiler toolset |
                   "14.0" for VC++ 2015 Compiler Toolset |
                   "14.1x" for the latest 14.1x.yyyyy toolset installed (e.g. "14.11") |
                   "14.1x.yyyyy" for a specific full version number (e.g. 14.11.25503)

The store parameter sets environment variables to support Universal Windows Platform application
development and is an alias for 'uwp'.

For example:
    vcvarsall.bat x86_amd64
    vcvarsall.bat x86_amd64 10.0.10240.0
    vcvarsall.bat x86_arm uwp 10.0.10240.0
    vcvarsall.bat x86_arm onecore 10.0.10240.0 -vcvars_ver=14.0
    vcvarsall.bat x64 8.1
    vcvarsall.bat x64 store 8.1

Please make sure either Visual Studio or C++ Build SKU is installed.
Found MSVS version
configure  --dest-cpu=x86 --openssl-no-asm
[1m[93mWARNING[0m: --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',
                 'force_dynamic_crt': 0,
                 'host_arch': 'ia32',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt61l.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': '61',
                 'node_byteorder': 'little',
                 'node_debug_lib': 'false',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 64,
                 '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_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.64',
                 'target_arch': 'ia32',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 '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.mk
[1m[93mWARNING[0m: warnings were emitted in the configure phase
Warning: Missing input files:
deps\v8\gypfiles\..\src\parsing\preparse-data-format.h
deps\v8\gypfiles\..\include\v8-debug.h
Project files generated.
'msbuild' is not recognized as an internal or external command,
operable program or batch file.
bzoz commented 6 years ago

Looks like bug in vcbuild: [ERROR:vcvarsall.bat] Invalid argument found : x86_x86

refack commented 6 years ago

Warning: it seems like we don't test building on x86 (32bit), so there might be a bug in building V8 on a 32bit host.


@Maledong as a work around to the bug, you could run:

C:\Program Files\VSCommunity2017\VC\Auxiliary\Build\vcvarsall.bat" x86
vcbuild test openssl-no-asm

Calling vcvarsall.bat explicit should get vcbuild to skip trying to run it itself.

If that doesn't work, you could just run the whole sequence manually:

C:\Program Files\VSCommunity2017\VC\Auxiliary\Build\vcvarsall.bat" x86
python configure  --dest-cpu=x86 --openssl-no-asm
msbuild node.sln /t:Build /p:Configuration=Debug
ghost commented 6 years ago

Hey:

For your 2nd way, it gives me this:

D:\Projects\node>"C:\Program Files\VSCommunity2017\VC\Auxiliary\Build\vcvarsall.bat" x86
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.7.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

D:\Projects\node>python configure  --dest-cpu=x86 --openssl-no-asm
?[1m?[93mWARNING?[0m: --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-smallcreating 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',
                 'force_dynamic_crt': 0,
                 'host_arch': 'ia32',
                 'icu_data_in': '..\\..\\deps/icu-small\\source/data/in\\icudt61l.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': '61',
                 'node_byteorder': 'little',
                 'node_debug_lib': 'false',
                 'node_enable_d8': 'false',
                 'node_enable_v8_vtunejit': 'false',
                 'node_install_npm': 'true',
                 'node_module_version': 64,
                 '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_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'node_use_v8_platform': 'true',
                 'node_without_node_options': 'false',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.64',
                 'target_arch': 'ia32',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_enable_inspector': 1,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 '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.mk
?[1m?[93mWARNING?[0m: warnings were emitted in the configure phase
Warning: Missing input files:
deps\v8\gypfiles\..\src\parsing\preparse-data-format.h
deps\v8\gypfiles\..\include\v8-debug.h

D:\Projects\node>msbuild node.sln /t:Build /p:Configuration=Debug
用于 .NET Framework 的 Microsoft (R) 生成引擎版本 15.7.179.6572
版权所有(C) Microsoft Corporation。保留所有权利。

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
生成启动时间为 2018年6年22日 15:20:00。
项目“D:\Projects\node\node.sln”在节点 1 上(Build 个目标)。
D:\Projects\node\node.sln.metaproj : error MSB4126: 指定的解决方案配置“Debug|x86”无效。请使用 Configurat
ion 和 Platform 属
性指定有效的解决方案配置(例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"),或者将这些属性保留为空,以使用默认的
解决方案配置。 [D:\Projects\node\node.sln]
已完成生成项目“D:\Projects\node\node.sln”(Build 个目标)的操作 - 失败。

生成失败。

“D:\Projects\node\node.sln”(Build 目标) (1) ->
(ValidateSolutionConfiguration 目标) ->
  D:\Projects\node\node.sln.metaproj : error MSB4126: Configuration for “Debug|x86” is useless. 请使用 Configuration And Platform(e.g: MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"),Or keep them blanks to use a default configuration. [D:\Projects\node\node.sln]

  1 Error(s)
  0 Warning(s)
ghost commented 6 years ago

For your 1st way, an Error occurs saying Not compatable with your current working system version (Like my 1st post).

Now I'm going to check the Bug-Fixed way of #21437, and then report to you all:)

ghost commented 6 years ago

After applying to the fix, it seems that everything is OK with me EXCEPT for that it tells me "Out of Memory when compiling for 2nd time for V8". Is there anything I should do to change this cache?