simdjson_nodejs: Windows build failure on outdated node-gyp (msvs_version=2015) @ Windows 7 x64
I’m eager to test this out on my project rurudb, a prototypal db which currently uses JSON.parse
against loaded db file JSON string.
Sad thing is I don’t know shit about C++ so this might be tricky.
I’m on Win7 x64 with visual studio build tools, and have existing packages in my projects which are also built using node-gyp.
C:\Users\1234>npm config get python
C:\Users\1234\.windows-build-tools\python27\python.exe
C:\Users\1234>npm config get msvs_version
2015
yarn add simdjson
yarn add v1.13.0-20181107.1254
warning ..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > ts-jest@23.10.5" has incorrect peer dependency "jest@>=22 <24".
[4/4] Building fresh packages...
error C:\cygwin64\home\1234\rurudb\node_modules\simdjson: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: C:\cygwin64\home\1234\rurudb\node_modules\simdjson
Output:
C:\cygwin64\home\1234\rurudb\node_modules\simdjson>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.10.0 | win32 | x64
gyp info spawn C:\Python27\python.EXE
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'C:\\cygwin64\\home\\1234\\rurudb\\node_modules\\simdjson\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\1234\\.node-gyp\\10.10.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\1234\\.node-gyp\\10.10.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\1234\\.node-gyp\\10.10.0\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\cygwin64\\home\\1234\\rurudb\\node_modules\\simdjson',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\cygwin64\\home\\1234\\rurudb\\node_modules\\simdjson\\build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\Release\\nothing.lib
main.cpp
bindings.cpp
win_delay_load_hook.cc
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(42): warning C4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(46): warning C4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(42): warning C4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data (compiling source file ..\simdjson\main.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(46): warning C4244: 'return': conversion from 'unsigned __int64' to 'int', possible loss of data (compiling source file ..\simdjson\main.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C2039: 'string_view': is not a member of 'std' (compiling source file ..\simdjson\main.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sstream(12): note: see declaration of 'std' (compiling source file ..\simdjson\main.cpp)
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C2039: 'string_view': is not a member of 'std' (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
(compiling source file ..\simdjson\main.cpp)C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\sstream(12): note: see declaration of 'std' (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
(compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C2146: syntax error: missing ';' before identifier 'get_corpus' (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(462): error C2146: syntax error: missing ';' before identifier 'get_corpus' (compiling source file ..\simdjson\main.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(35739): fatal error C1021: invalid preprocessor command 'warning' (compiling source file ..\simdjson\main.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
c:\cygwin64\home\1234\rurudb\node_modules\simdjson\simdjson\src/simdjson.h(35739): fatal error C1021: invalid preprocessor command 'warning' (compiling source file ..\simdjson\bindings.cpp) [C:\cygwin64\home\1234\rurudb\node_modules\simdjson\build\simdjson.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\cygwin64\home\1234\rurudb\node_modules\simdjson
gyp ERR! node -v v10.10.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (25 by maintainers)
So yeah, it turns out that the main issue here (despite my recently updated Visual Studio Build Tools 2017 for latest node-gyp) is that my workstation processor (AMD A8 6XXX) does not support AVX2 instructions.
We’ve discovered this during a teamviewer session where we tried installing other npm modules that also uses AVX2 and noticed that all their build phases during installation are failing.
Long story short, the following must be in check:
node-gyp
’sYou will also need to install:...
sectionThanks @luizperes for your time and support!
Hi @luizperes, seems that you’re right. Tested the
issue-6
branch and the latestmaster
branch and both shows the initialc++17
error I had before.I’m currently installing VS build tools 2017 for
node-gyp
, will get back to you if it works out!