Description:
I am trying to upgrade dependencies of an electron application. It requires dockerode which depends on cpu-features. While trying to build packages using electron-build it fails at rebuilding cp-features step.
package.json:
```
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.config.js",
"prestart": "npm run build",
"start": "electron ./app/main.js --devtools",
"dist:linux": "electron-builder -l",
"dist:mac": "electron-builder -m",
"dist:win": "electron-builder -w",
"dist:all": "electron-builder -wml",
"dist": "electron-builder -wml",
"lint": "eslint src/ --ext .ts,.js"
},
"build": {
"appId": "vlab",
"files": [
{
"from": "app",
"to": "./"
},
"build",
"package.json"
],
"mac": {
"category": "public.app-category.education",
"target": [
{
"target": "dmg",
"arch": [
"arm64",
"x64"
]
}
]
},
"linux": {
"target": [
"deb",
"snap",
"zip"
]
},
"deb": {
"depends": [
"git",
"python3"
]
},
"rpm": {
"fpm": [
"--iteration=1.0.0"
],
"depends": [
"git",
"python3"
]
},
"win": {
"target": [
"nsis",
"portable"
]
},
"asarUnpack": "./src/python_scripts/**",
"extraResources": "./src/python_scripts/**"
},
"devDependencies": {
"@types/dockerode": "^3.3.24",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"babel-loader": "^9.1.3",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.10.0",
"electron": "^29.0.1",
"electron-builder": "^24.12.0",
"eslint": "^8.57.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-webpack-plugin": "^4.0.1",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.6.0",
"node-loader": "^2.0.0",
"style-loader": "^3.3.4",
"ts-loader": "^9.5.1",
"typescript": "^5.3.3",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"bent": "^7.3.12",
"codemirror": "^6.0.1",
"dockerode": "^4.0.2",
"jquery": "^3.7.1",
"js-yaml": "^4.1.0",
"markdown-it": "^14.0.0",
"mkdirp": "^3.0.1",
"open": "^10.0.3",
"python-shell": "^5.0.0",
"simple-git": "^3.22.0",
"split.js": "^1.6.5",
"targz": "^1.0.1",
"uikit": "^3.18.3",
"xterm": "^5.3.0",
"xterm-addon-attach": "^0.9.0",
"xterm-addon-fit": "^0.8.0"
}
```
Verbose output (from npm or node-gyp):
```
> vlab@1.5.5 dist:linux
> electron-builder -l
• electron-builder version=24.12.0 os=6.6.10-1-MANJARO
• loaded configuration file=package.json ("build" field)
• rebuilding native dependencies dependencies=cpu-features@0.0.9 platform=linux arch=x64
⨯ cannot execute cause=exit status 1
errorOut=npm ERR! code 1
npm ERR! path /home/abdev/projects/iitbra/vlab/node_modules/cpu-features
npm ERR! command failed
npm ERR! command sh -c node buildcheck.js > buildcheck.gypi && node-gyp rebuild
npm ERR! make: Entering directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build'
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
npm ERR! rm -f Release/obj.target/deps/cpu_features/cpu_features.a Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/cpu_features/cpu_features.a`
npm ERR! ar crs Release/obj.target/deps/cpu_features/cpu_features.a @Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list
npm ERR! COPY Release/cpu_features.a
npm ERR! CXX(target) Release/obj.target/cpufeatures/src/binding.o
npm ERR! make: Leaving directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@10.0.1
npm ERR! gyp info using node@18.19.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/abdev/.electron-gyp/29.0.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/abdev/.electron-gyp/29.0.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/abdev/.electron-gyp/29.0.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/abdev/projects/iitbra/vlab/node_modules/cpu-features',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from /home/abdev/.electron-gyp/29.0.1/include/node/v8-object.h:10,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8-array-buffer.h:13,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8.h:24,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/node.h:79,
npm ERR! from ../src/binding.cc:1:
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-persistent-handle.h:245:44: warning: ‘template struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
npm ERR! 245 | using CopyablePersistent = Persistent>;
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-persistent-handle.h:244:48: note: declared here
npm ERR! 244 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from ../src/binding.cc:3:
npm ERR! ../../nan/nan.h:208:16: warning: ‘template struct v8::CopyablePersistentTraits’ is deprecated: Use v8::Global instead [-Wdeprecated-declarations]
npm ERR! 208 | public v8::CopyablePersistentTraits {};
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-persistent-handle.h:244:48: note: declared here
npm ERR! 244 | struct V8_DEPRECATED("Use v8::Global instead") CopyablePersistentTraits {
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan.h: In function ‘bool Nan::IdleNotification(int)’:
npm ERR! ../../nan/nan.h:688:63: warning: ‘bool v8::Isolate::IdleNotificationDeadline(double)’ is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
npm ERR! 688 | return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
npm ERR! 689 | idle_time_in_ms * 0.001);
npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! In file included from /home/abdev/.electron-gyp/29.0.1/include/node/v8-snapshot.h:9,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8-context.h:15,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8.h:26:
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-isolate.h:1380:8: note: declared here
npm ERR! 1380 | bool IdleNotificationDeadline(double deadline_in_seconds);
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
npm ERR! ../../nan/nan.h:2548:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local&, void (*&)(v8::Local, const v8::PropertyCallbackInfo&), void (*&)(v8::Local, v8::Local, const v8::PropertyCallbackInfo&), v8::Local&, v8::AccessControl&, v8::PropertyAttribute&)’
npm ERR! 2548 | tpl->SetAccessor(
npm ERR! | ~~~~~~~~~~~~~~~~^
npm ERR! 2549 | name
npm ERR! | ~~~~
npm ERR! 2550 | , getter_
npm ERR! | ~~~~~~~~~
npm ERR! 2551 | , setter_
npm ERR! | ~~~~~~~~~
npm ERR! 2552 | , obj
npm ERR! | ~~~~~
npm ERR! 2553 | , settings
npm ERR! | ~~~~~~~~~~
npm ERR! 2554 | , attribute
npm ERR! | ~~~~~~~~~~~
npm ERR! 2555 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)
npm ERR! | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! 2556 | , signature
npm ERR! | ~~~~~~~~~~~
npm ERR! 2557 | #endif
npm ERR! | ~~~~~~
npm ERR! 2558 | );
npm ERR! | ~
npm ERR! In file included from /home/abdev/.electron-gyp/29.0.1/include/node/v8-function.h:15,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8.h:33:
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:800:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! 800 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:803:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm ERR! 803 | Local data = Local(), PropertyAttribute attribute = None,
npm ERR! | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:806:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! 806 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:809:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm ERR! 809 | Local data = Local(), PropertyAttribute attribute = None,
npm ERR! | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute)’:
npm ERR! ../../nan/nan.h:2594:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local&, void (*&)(v8::Local, const v8::PropertyCallbackInfo&), void (*&)(v8::Local, v8::Local, const v8::PropertyCallbackInfo&), v8::Local&, v8::AccessControl&, v8::PropertyAttribute&)’
npm ERR! 2594 | tpl->SetAccessor(
npm ERR! | ~~~~~~~~~~~~~~~~^
npm ERR! 2595 | name
npm ERR! | ~~~~
npm ERR! 2596 | , getter_
npm ERR! | ~~~~~~~~~
npm ERR! 2597 | , setter_
npm ERR! | ~~~~~~~~~
npm ERR! 2598 | , obj
npm ERR! | ~~~~~
npm ERR! 2599 | , settings
npm ERR! | ~~~~~~~~~~
npm ERR! 2600 | , attribute
npm ERR! | ~~~~~~~~~~~
npm ERR! 2601 | );
npm ERR! | ~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:800:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! 800 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:803:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm ERR! 803 | Local data = Local(), PropertyAttribute attribute = None,
npm ERR! | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:806:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm ERR! 806 | void SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-template.h:809:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
npm ERR! 809 | Local data = Local(), PropertyAttribute attribute = None,
npm ERR! | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
npm ERR! ../../nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local, v8::Local, GetterCallback, SetterCallback, v8::Local, v8::AccessControl, v8::PropertyAttribute)’:
npm ERR! ../../nan/nan.h:2638:26: warning: ‘v8::Maybe v8::Object::SetAccessor(v8::Local, v8::Local, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::MaybeLocal, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’ is deprecated: Use SetNativeDataProperty instead [-Wdeprecated-declarations]
npm ERR! 2638 | return obj->SetAccessor(
npm ERR! | ~~~~~~~~~~~~~~~~^
npm ERR! 2639 | GetCurrentContext()
npm ERR! | ~~~~~~~~~~~~~~~~~~~
npm ERR! 2640 | , name
npm ERR! | ~~~~~~
npm ERR! 2641 | , getter_
npm ERR! | ~~~~~~~~~
npm ERR! 2642 | , setter_
npm ERR! | ~~~~~~~~~
npm ERR! 2643 | , dataobj
npm ERR! | ~~~~~~~~~
npm ERR! 2644 | , settings
npm ERR! | ~~~~~~~~~~
npm ERR! 2645 | , attribute).FromMaybe(false);
npm ERR! | ~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-object.h:345:37: note: declared here
npm ERR! 345 | V8_WARN_UNUSED_RESULT Maybe SetAccessor(
npm ERR! | ^~~~~~~~~~~
npm ERR! In file included from ../../nan/nan.h:2950:
npm ERR! ../../nan/nan_scriptorigin.h: In constructor ‘Nan::ScriptOrigin::ScriptOrigin(v8::Local)’:
npm ERR! ../../nan/nan_scriptorigin.h:19:55: warning: ‘v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local, int, int, bool, int, v8::Local, bool, bool, bool, v8::Local)’ is deprecated: Use constructor without the isolate. [-Wdeprecated-declarations]
npm ERR! 19 | v8::ScriptOrigin(v8::Isolate::GetCurrent(), name) {}
npm ERR! | ^
npm ERR! In file included from /home/abdev/.electron-gyp/29.0.1/include/node/v8-script.h:20,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8-debug.h:10,
npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8-isolate.h:18:
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-message.h:65:13: note: declared here
npm ERR! 65 | V8_INLINE ScriptOrigin(Isolate* isolate, Local resource_name,
npm ERR! | ^~~~~~~~~~~~
npm ERR! ../../nan/nan_scriptorigin.h: In constructor ‘Nan::ScriptOrigin::ScriptOrigin(v8::Local, v8::Local)’:
npm ERR! ../../nan/nan_scriptorigin.h:25:52: warning: ‘v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local, int, int, bool, int, v8::Local, bool, bool, bool, v8::Local)’ is deprecated: Use constructor without the isolate. [-Wdeprecated-declarations]
npm ERR! 25 | , To(line).FromMaybe(0)) {}
npm ERR! | ^
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-message.h:65:13: note: declared here
npm ERR! 65 | V8_INLINE ScriptOrigin(Isolate* isolate, Local resource_name,
npm ERR! | ^~~~~~~~~~~~
npm ERR! ../../nan/nan_scriptorigin.h: In constructor ‘Nan::ScriptOrigin::ScriptOrigin(v8::Local, v8::Local, v8::Local)’:
npm ERR! ../../nan/nan_scriptorigin.h:33:54: warning: ‘v8::ScriptOrigin::ScriptOrigin(v8::Isolate*, v8::Local, int, int, bool, int, v8::Local, bool, bool, bool, v8::Local)’ is deprecated: Use constructor without the isolate. [-Wdeprecated-declarations]
npm ERR! 33 | , To(column).FromMaybe(0)) {}
npm ERR! | ^
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-message.h:65:13: note: declared here
npm ERR! 65 | V8_INLINE ScriptOrigin(Isolate* isolate, Local resource_name,
npm ERR! | ^~~~~~~~~~~~
npm ERR! ../src/binding.cc: At global scope:
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/node.h:1200:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local, v8::Local, void*)’} [-Wcast-function-type]
npm ERR! 1200 | (node::addon_register_func) (regfunc), \
npm ERR! | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/node.h:1234:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR! 1234 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
npm ERR! | ^~~~~~~~~~~~~
npm ERR! ../src/binding.cc:151:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR! 151 | NODE_MODULE(cpufeatures, init)
npm ERR! | ^~~~~~~~~~~
npm ERR! make: *** [cpufeatures.target.mk:138: Release/obj.target/cpufeatures/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess. (/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 6.6.10-1-MANJARO
npm ERR! gyp ERR! command "/home/abdev/.nvm/versions/node/v18.19.1/bin/node" "/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/abdev/projects/iitbra/vlab/node_modules/cpu-features
npm ERR! gyp ERR! node -v v18.19.1
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in: /home/abdev/.npm/_logs/2024-02-25T08_53_24_524Z-debug-0.log
command=/home/abdev/.nvm/versions/node/v18.19.1/bin/node /home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/bin/npm-cli.js rebuild cpu-features@0.0.9
workingDir=
```
Note:
If I do node-gyp rebuild inside node_modules/cpu-features folder, it succeeds !
node-gyp rebuild output:
```
❯ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@10.0.1
gyp info using node@18.19.1 | linux | x64
gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/abdev/.cache/node-gyp/18.19.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=/home/abdev/.cache/node-gyp/18.19.1',
gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/abdev/.cache/node-gyp/18.19.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/abdev/projects/iitbra/vlab/node_modules/cpu-features',
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 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build'
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
rm -f Release/obj.target/deps/cpu_features/cpu_features.a Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/cpu_features/cpu_features.a`
ar crs Release/obj.target/deps/cpu_features/cpu_features.a @Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list
COPY Release/cpu_features.a
CXX(target) Release/obj.target/cpufeatures/src/binding.o
In file included from ../src/binding.cc:1:
/home/abdev/.cache/node-gyp/18.19.1/include/node/node.h:1014:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local, v8::Local, void*)’} [-Wcast-function-type]
1014 | (node::addon_register_func) (regfunc), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/abdev/.cache/node-gyp/18.19.1/include/node/node.h:1048:3: note: in expansion of macro ‘NODE_MODULE_X’
1048 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
| ^~~~~~~~~~~~~
../src/binding.cc:151:1: note: in expansion of macro ‘NODE_MODULE’
151 | NODE_MODULE(cpufeatures, init)
| ^~~~~~~~~~~
SOLINK_MODULE(target) Release/obj.target/cpufeatures.node
COPY Release/cpufeatures.node
make: Leaving directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build'
gyp info ok
```
cc -v output:
Description: I am trying to upgrade dependencies of an electron application. It requires dockerode which depends on cpu-features. While trying to build packages using
electron-build
it fails at rebuilding cp-features step.package.json:
``` "main": "main.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "webpack --config webpack.config.js", "prestart": "npm run build", "start": "electron ./app/main.js --devtools", "dist:linux": "electron-builder -l", "dist:mac": "electron-builder -m", "dist:win": "electron-builder -w", "dist:all": "electron-builder -wml", "dist": "electron-builder -wml", "lint": "eslint src/ --ext .ts,.js" }, "build": { "appId": "vlab", "files": [ { "from": "app", "to": "./" }, "build", "package.json" ], "mac": { "category": "public.app-category.education", "target": [ { "target": "dmg", "arch": [ "arm64", "x64" ] } ] }, "linux": { "target": [ "deb", "snap", "zip" ] }, "deb": { "depends": [ "git", "python3" ] }, "rpm": { "fpm": [ "--iteration=1.0.0" ], "depends": [ "git", "python3" ] }, "win": { "target": [ "nsis", "portable" ] }, "asarUnpack": "./src/python_scripts/**", "extraResources": "./src/python_scripts/**" }, "devDependencies": { "@types/dockerode": "^3.3.24", "@typescript-eslint/eslint-plugin": "^6.4.0", "babel-loader": "^9.1.3", "clean-webpack-plugin": "^4.0.0", "css-loader": "^6.10.0", "electron": "^29.0.1", "electron-builder": "^24.12.0", "eslint": "^8.57.0", "eslint-config-standard-with-typescript": "^43.0.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^16.6.2", "eslint-plugin-promise": "^6.1.1", "eslint-webpack-plugin": "^4.0.1", "file-loader": "^6.2.0", "html-webpack-plugin": "^5.6.0", "node-loader": "^2.0.0", "style-loader": "^3.3.4", "ts-loader": "^9.5.1", "typescript": "^5.3.3", "webpack": "^5.90.3", "webpack-cli": "^5.1.4" }, "dependencies": { "bent": "^7.3.12", "codemirror": "^6.0.1", "dockerode": "^4.0.2", "jquery": "^3.7.1", "js-yaml": "^4.1.0", "markdown-it": "^14.0.0", "mkdirp": "^3.0.1", "open": "^10.0.3", "python-shell": "^5.0.0", "simple-git": "^3.22.0", "split.js": "^1.6.5", "targz": "^1.0.1", "uikit": "^3.18.3", "xterm": "^5.3.0", "xterm-addon-attach": "^0.9.0", "xterm-addon-fit": "^0.8.0" } ```Verbose output (from npm or node-gyp):
``` > vlab@1.5.5 dist:linux > electron-builder -l • electron-builder version=24.12.0 os=6.6.10-1-MANJARO • loaded configuration file=package.json ("build" field) • rebuilding native dependencies dependencies=cpu-features@0.0.9 platform=linux arch=x64 ⨯ cannot execute cause=exit status 1 errorOut=npm ERR! code 1 npm ERR! path /home/abdev/projects/iitbra/vlab/node_modules/cpu-features npm ERR! command failed npm ERR! command sh -c node buildcheck.js > buildcheck.gypi && node-gyp rebuild npm ERR! make: Entering directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build' npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o npm ERR! CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o npm ERR! rm -f Release/obj.target/deps/cpu_features/cpu_features.a Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/cpu_features/cpu_features.a` npm ERR! ar crs Release/obj.target/deps/cpu_features/cpu_features.a @Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list npm ERR! COPY Release/cpu_features.a npm ERR! CXX(target) Release/obj.target/cpufeatures/src/binding.o npm ERR! make: Leaving directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@10.0.1 npm ERR! gyp info using node@18.19.1 | linux | x64 npm ERR! gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/abdev/.electron-gyp/29.0.1/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/abdev/.electron-gyp/29.0.1', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/abdev/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/abdev/.electron-gyp/29.0.1/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/abdev/projects/iitbra/vlab/node_modules/cpu-features', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! In file included from /home/abdev/.electron-gyp/29.0.1/include/node/v8-object.h:10, npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8-array-buffer.h:13, npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/v8.h:24, npm ERR! from /home/abdev/.electron-gyp/29.0.1/include/node/node.h:79, npm ERR! from ../src/binding.cc:1: npm ERR! /home/abdev/.electron-gyp/29.0.1/include/node/v8-persistent-handle.h:245:44: warning: ‘templateNote: If I do
node-gyp rebuild
insidenode_modules/cpu-features
folder, it succeeds !node-gyp rebuild output:
``` ❯ node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@10.0.1 gyp info using node@18.19.1 | linux | x64 gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3" gyp info spawn /usr/bin/python3 gyp info spawn args [ gyp info spawn args '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/abdev/.cache/node-gyp/18.19.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=/home/abdev/.cache/node-gyp/18.19.1', gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/home/abdev/.cache/node-gyp/18.19.1/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/home/abdev/projects/iitbra/vlab/node_modules/cpu-features', 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 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/home/abdev/projects/iitbra/vlab/node_modules/cpu-features/build' CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o rm -f Release/obj.target/deps/cpu_features/cpu_features.a Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/cpu_features/cpu_features.a` ar crs Release/obj.target/deps/cpu_features/cpu_features.a @Release/obj.target/deps/cpu_features/cpu_features.a.ar-file-list COPY Release/cpu_features.a CXX(target) Release/obj.target/cpufeatures/src/binding.o In file included from ../src/binding.cc:1: /home/abdev/.cache/node-gyp/18.19.1/include/node/node.h:1014:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local