You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My gyp build is defaulting to x86 despite my Windows machine being a x64 machine.
I tried passing -march=x86_64 and cflags=-m64 but nothing changes. If you look at the log you will see that cl.exe is using HostX64/x86. Here's my binding.gyp file too.
{
'targets': [
{
'target_name': 'keyring-go',
'sources': [ 'src/keyring.cc' ],
'include_dirs': ["<!@(node -p "require('node-addon-api').include")"],
'dependencies': ["<!(node -p "require('node-addon-api').gyp")"],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '12'
},
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'RuntimeLibrary': 2
},
},
'conditions': [
['OS=="win"', {
'cflags': [
'-m64'
],
'defines': [
'_MSC_VER=1935',
],
'sources': [ 'src/c_build/win/keyring.cc' ],
"libraries": [
"<!(cd)/keyring.dll"
],
}]
]
}
]
}
> @archwayhq/[email protected] build:node
> node-gyp configure build --verbose
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli 'C:\\Program Files (x86)\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\dharr\\philabs\\keyring-go\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'configure',
gyp verb cli 'build',
gyp verb cli '--verbose'
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - "python3" is not in PATH or produced an error
gyp verb find Python checking if "python" can be used
gyp verb find Python - executing "python" to get executable path
gyp verb find Python - "python" is not in PATH or produced an error
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python39\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python39\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python39\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python39\python.exe
gyp verb find Python - executing "C:\Program Files\Python39\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python39\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python39-32\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python39-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python39-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python38\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python38\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python38\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python38\python.exe
gyp verb find Python - executing "C:\Program Files\Python38\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python38\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python38-32\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python38-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python38-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python37\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python37\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python37\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python37\python.exe
gyp verb find Python - executing "C:\Program Files\Python37\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python37\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python37-32\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python37-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python37-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python36\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python36\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python36\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python36\python.exe
gyp verb find Python - executing "C:\Program Files\Python36\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python36\python.exe" could not be run
gyp verb find Python checking if Python is C:\Users\dharr\AppData\Local\Programs\Python\Python36-32\python.exe
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Users\dharr\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files\Python36-32\python.exe
gyp verb find Python - executing "C:\Program Files\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Program Files\Python36-32\python.exe" could not be run
gyp verb find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
gyp verb find Python - executing "C:\Program Files (x86)\Python36-32\python.exe" to get version
gyp verb find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
gyp verb find Python checking if the py launcher can be used to find Python 3
gyp verb find Python - executing "py.exe" to get Python 3 executable path
gyp verb find Python - executable path is "C:\Users\dharr\AppData\Local\Programs\Python\Python311\python.exe"
gyp verb find Python - executing "C:\Users\dharr\AppData\Local\Programs\Python\Python311\python.exe" to get version
gyp verb find Python - version is "3.11.2"
gyp info find Python using Python version 3.11.2 found at "C:\Users\dharr\AppData\Local\Programs\Python\Python311\python.exe"
gyp verb get node dir no --target version specified, falling back to host node version: 18.15.0
gyp verb command install [ '18.15.0' ]
gyp verb install input version string "18.15.0"
gyp verb install installing version: 18.15.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 18.15.0
gyp verb build dir attempting to create "build" dir: C:\Users\dharr\philabs\keyring-go\build
gyp verb build dir "build" dir needed to be created? No
gyp verb find VS msvs_version not set from command line or npm config
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp verb find VS checking VS2022 (17.5.33414.496) found at:
gyp verb find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - missing any VC++ toolset
gyp verb find VS checking VS2022 (17.5.33424.131) found at:
gyp verb find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - found VC++ toolset: v143
gyp verb find VS - found Windows SDK: 10.0.22000.0
gyp info find VS using VS2022 (17.5.33424.131) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\dharr\philabs\keyring-go\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users\dharr\philabs\keyring-go\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\dharr\philabs\keyring-go\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\Users\dharr\AppData\Local\Programs\Python\Python311\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\dharr\\philabs\\keyring-go\\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 '-I',
gyp info spawn args 'C:\\Users\\dharr\\philabs\\keyring-go\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\dharr\\philabs\\keyring-go\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\dharr\\AppData\\Local\\node-gyp\\Cache\\18.15.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\\dharr\\AppData\\Local\\node-gyp\\Cache\\18.15.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\dharr\\philabs\\keyring-go\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\dharr\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.15.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\dharr\\philabs\\keyring-go',
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:\\Users\\dharr\\philabs\\keyring-go\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
Warning: Missing input files:
C:\Users\dharr\philabs\keyring-go\build\..\src\c_build\win\keyring.cc
gyp verb command build []
gyp verb build type Release
gyp verb architecture ia32
gyp verb node dev dir C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0
gyp verb found first Solution file build/binding.sln
gyp verb using MSBuild: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=Win32'
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 3/9/2023 9:02:42 AM.
Included response file: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.rsp
Project "C:\Users\dharr\philabs\keyring-go\build\binding.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
Building solution configuration "Release|Win32".
Project "C:\Users\dharr\philabs\keyring-go\build\binding.sln" (1) is building "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj.metaproj" (2) on node 1 (default targets).
Project "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj.metaproj" (2) is building "C:\Users\dharr\philabs\keyring-go\node_modules\node-addon-api\src\nothing.vcxproj" (3) on node 1 (default targets
).
InitializeBuildStatus:
Creating "Release\obj\nothing\nothing.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
All outputs are up-to-date.
All outputs are up-to-date.
Lib:
All outputs are up-to-date.
nothing.vcxproj -> C:\Users\dharr\philabs\keyring-go\build\Release\\nothing.lib
FinalizeBuildStatus:
Deleting file "Release\obj\nothing\nothing.tlog\unsuccessfulbuild".
Touching "Release\obj\nothing\nothing.tlog\nothing.lastbuildstate".
Done Building Project "C:\Users\dharr\philabs\keyring-go\node_modules\node-addon-api\src\nothing.vcxproj" (default targets).
Project "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj.metaproj" (2) is building "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj" (4) on node 1 (default targets).
InitializeBuildStatus:
Touching "Release\obj\keyring-go\keyring-go.tlog\unsuccessfulbuild".
ClCompile:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\bin\HostX64\x86\CL.exe /c /I"C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0\include\node" /I"C:\Users\dharr\AppData\Loc
al\node-gyp\Cache\18.15.0\src" /I"C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0\deps\openssl\config" /I"C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0\deps\openssl\openssl\include" /I"C:\Users\dh
arr\AppData\Local\node-gyp\Cache\18.15.0\deps\uv\include" /I"C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0\deps\zlib" /I"C:\Users\dharr\AppData\Local\node-gyp\Cache\18.15.0\deps\v8\include" /I"C:\User
s\dharr\philabs\keyring-go\node_modules\node-addon-api" /Z7 /nologo /W3 /WX- /diagnostics:column /MP /Ox /Ob2 /Oi /Ot /Oy /GL /D "NODE_GYP_MODULE_NAME=keyring-go" /D USING_UV_SHARED=1 /D USING_V8_SHARED=1 /
D V8_DEPRECATION_WARNINGS=1 /D V8_DEPRECATION_WARNINGS /D V8_IMMINENT_DEPRECATION_WARNINGS /D _GLIBCXX_USE_CXX11_ABI=1 /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0
/D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D _MSC_VER=1935 /D BUILDING_NODE_EXTENSION /D "HOST_BINARY=\"node.exe\"" /D _WINDLL /GF /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR
- /Fo"Release\obj\keyring-go\\src\keyring.obj" /Fd"Release\obj\keyring-go\vc143.pdb" /external:W3 /Gd /TP /wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /analyze- /FC /errorReport:queue /Zc:__cplus
plus -std:c++17 ..\src\keyring.cc
keyring.cc
C:\Users\dharr\philabs\keyring-go\build\cgo-gcc-export-header-prolog(31,82): error C2118: negative subscript [C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj]
Done Building Project "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\Users\dharr\philabs\keyring-go\build\binding.sln" (default targets) -- FAILED.
Build FAILED.
"C:\Users\dharr\philabs\keyring-go\build\binding.sln" (default target) (1) ->
"C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj.metaproj" (default target) (2) ->
"C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj" (default target) (4) ->
(ClCompile target) ->
C:\Users\dharr\philabs\keyring-go\build\cgo-gcc-export-header-prolog(31,82): error C2118: negative subscript [C:\Users\dharr\philabs\keyring-go\build\keyring-go.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.90
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\dharr\philabs\keyring-go\node_modules\node-gyp\lib\build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Windows_NT 10.0.22621
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\dharr\\philabs\\keyring-go\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "build" "--verbose"
gyp ERR! cwd C:\Users\dharr\philabs\keyring-go
gyp ERR! node -v v18.15.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
The text was updated successfully, but these errors were encountered:
For those who need it, I found the defining the flag CXX=<path to x64 cl.exe> helped. This forces the use of target x64 to build and gets rid of the negative subscript error.
My gyp build is defaulting to x86 despite my Windows machine being a x64 machine.
I tried passing
-march=x86_64
andcflags=-m64
but nothing changes. If you look at the log you will see thatcl.exe
is usingHostX64/x86
. Here's mybinding.gyp
file too.{
'targets': [
{
'target_name': 'keyring-go',
'sources': [ 'src/keyring.cc' ],
'include_dirs': ["<!@(node -p "require('node-addon-api').include")"],
'dependencies': ["<!(node -p "require('node-addon-api').gyp")"],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '12'
},
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': 1,
'RuntimeLibrary': 2
},
},
'conditions': [
['OS=="win"', {
'cflags': [
'-m64'
],
'defines': [
'_MSC_VER=1935',
],
'sources': [ 'src/c_build/win/keyring.cc' ],
"libraries": [
"<!(cd)/keyring.dll"
],
}]
]
}
]
}
The text was updated successfully, but these errors were encountered: