silverwind / default-gateway

Get the default network gateway, cross-platform.
86 stars 19 forks source link

idbconnector dependency #10

Closed GitNomster closed 5 years ago

GitNomster commented 5 years ago

When i install default-gateway 3.1.0 console warns about:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: idb-connector@1.1.8 (node_modules\idb-connector):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for idb-connector@1.1.8: wanted {"os":"aix","arch":"any"} (current: {"os":"win32","arch":"x64"})

and then, when i try to install deps with npm ci it starts to install idb-connector. And result is:

> idb-connector@1.1.8 install C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector
> node-pre-gyp install --fallback-to-build

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@10.15.1 | win32 | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\lib\binding\Release\node-v64-ibmi-x64\db2ia.node" (not found)
node-pre-gyp http GET https://github.com/IBM/nodejs-idb-connector/releases/download/1.1.8/db2ia-v1.1.8-node-v64-ibmi-x64.tar.gz
node-pre-gyp http 404 https://github.com/IBM/nodejs-idb-connector/releases/download/1.1.8/db2ia-v1.1.8-node-v64-ibmi-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://github.com/IBM/nodejs-idb-connector/releases/download/1.1.8/db2ia-v1.1.8-node-v64-ibmi-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for idb-connector@1.1.8 and node@10.15.1 (node-v64 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/IBM/nodejs-idb-connector/releases/download/1.1.8/db2ia-v1.1.8-node-v64-ibmi-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.1 | win32 | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.1 | win32 | x64
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\user\\AppData\\Roaming\\npm\\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=2015',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\user\\.node-gyp\\10.15.1\\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\\user\\.node-gyp\\10.15.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\user\\.node-gyp\\10.15.1\\<(target_arch)\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector',
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\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.15.1 | win32 | x64
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.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' ]
  db2ia.cc
  dbconn.cc
  dbstmt.cc
  win_delay_load_hook.cc
c:\users\user\desktop\aa\electron-quick-start\node_modules\idb-connector\src\db2ia\dbconn.h(13): fatal error C1083: Cannot open include file: 'sqlcli.h': No such file or directory (compiling source file ..\src
\db2ia\db2ia.cc) [C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\build\db2ia.vcxproj]
c:\users\user\desktop\aa\electron-quick-start\node_modules\idb-connector\src\db2ia\dbconn.h(13): fatal error C1083: Cannot open include file: 'sqlcli.h': No such file or directory (compiling source file ..\src
\db2ia\dbconn.cc) [C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\build\db2ia.vcxproj]
c:\users\user\desktop\aa\electron-quick-start\node_modules\idb-connector\src\db2ia\dbconn.h(13): fatal error C1083: Cannot open include file: 'sqlcli.h': No such file or directory (compiling source file ..\src
\db2ia\dbstmt.cc) [C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\build\db2ia.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector\\lib\\binding\\Release\\node-v64-ibmi-x64\\db2ia.node" "--module_name=db2ia" "--module_path=C:\\Users\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector\\lib\\binding\\Release\\node-v64-ibmi-x64" "--napi_version=3" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\lib\binding\Release\node-v64-ibmi-x64\db2ia.node --module_name=db2ia --module_path=C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\lib\binding\Release\node-v64-ibmi-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\Desktop\\aa\\electron-quick-start\\node_modules\\idb-connector\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector
node-pre-gyp ERR! node -v v10.15.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\lib\binding\Release\node-v64-ibmi-x64\db2ia.node --module_name=db2ia --module_path=C:\Users\user\Desktop\aa\electron-quick-start\node_modules\idb-connector\lib\binding\Release\node-v64-ibmi-x64 --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)

With default-gateway v3.0.1 all is ok.

silverwind commented 5 years ago

idb-connector is a AIX only dependency. Seems like two distinct bugs in npm ci to me:

silverwind commented 5 years ago

https://npm.community/t/npm-ci-ignores-the-os-field-of-package-json/5607

GitNomster commented 5 years ago

awesome, thank you.

silverwind commented 5 years ago

I'm considering dropping AIX support (until a JS-only solution is found) again if npm ci has any widespread use, this is quite unacceptable.

cc: @patrickhrastnik

silverwind commented 5 years ago

Really sorry, but I had to remove AIX support again, I can't accept breaking builds on other platforms for something that maybe a handful of people are going to use. Happy to take a PR that does the same but with JS only.

ThePrez commented 5 years ago

Related to this idb-connector issue: https://github.com/IBM/nodejs-idb-connector/issues/54

The problem is that the idb-connector package only builds on the IBM i platform's variant of AIX. There's not a good way to condition the build for only IBM i and not all AIXes

silverwind commented 5 years ago

https://github.com/sindresorhus/internal-ip/pull/25 is pending to propagate this fix upstream.