nodejs/node-gyp

node-gyp rebuild command failure on cpu-features

shahraship opened this issue · 5 comments

  • Node Version: 20.11.1, 10.8.2

  • Platform: Darwin uname-mbp-2.lan 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64

  • Compiler: Apple clang version 15.0.0 (clang-1500.3.9.4)
    Target: arm64-apple-darwin23.5.0
    Thread model: posix
    InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

  • Module: node-gyp rebuild

> electron-builder install-app-deps
  • electron-builder  version=24.13.3
  • rebuilding native dependencies  dependencies=cpu-features@0.0.10 platform=darwin arch=arm64
  ⨯ cannot execute  cause=exit status 1
                    errorOut=npm error code 1
    npm error path /Users/devuname/Developer/repo-name/node_modules/cpu-features
    npm error command failed
    npm error command sh -c node buildcheck.js > buildcheck.gypi && node-gyp rebuild
    npm error CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_windows.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/hwcaps.o
    npm error   LIBTOOL-STATIC Release/cpu_features.a
    npm error   CXX(target) Release/obj.target/cpufeatures/src/binding.o
    npm error gyp info it worked if it ends with ok
    npm error gyp info using node-gyp@10.1.0
    npm error gyp info using node@20.11.1 | darwin | arm64
    npm error gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
    npm error gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
    npm error gyp info spawn args [
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/node-gyp/gyp/gyp_main.py',
    npm error gyp info spawn args 'binding.gyp',
    npm error gyp info spawn args '-f',
    npm error gyp info spawn args 'make',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/cpu-features/build/config.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/node-gyp/addon.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/.electron-gyp/28.3.3/include/node/common.gypi',
    npm error gyp info spawn args '-Dlibrary=shared_library',
    npm error gyp info spawn args '-Dvisibility=default',
    npm error gyp info spawn args '-Dnode_root_dir=/Users/devuname/.electron-gyp/28.3.3',
    npm error gyp info spawn args '-Dnode_gyp_dir=/Users/devuname/Developer/repo-name/node_modules/node-gyp',
    npm error gyp info spawn args '-Dnode_lib_file=/Users/devuname/.electron-gyp/28.3.3/<(target_arch)/node.lib',
    npm error gyp info spawn args '-Dmodule_root_dir=/Users/devuname/Developer/repo-name/node_modules/cpu-features',
    npm error gyp info spawn args '-Dnode_engine=v8',
    npm error gyp info spawn args '--depth=.',
    npm error gyp info spawn args '--no-parallel',
    npm error gyp info spawn args '--generator-output',
    npm error gyp info spawn args 'build',
    npm error gyp info spawn args '-Goutput_dir=.'
    npm error gyp info spawn args ]
    npm error gyp info spawn make
    npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:688:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
    npm error     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
    npm error                                       ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-isolate.h:1343:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
    npm error   V8_DEPRECATE_SOON(
    npm error   ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8config.h:561:41: note: expanded from macro 'V8_DEPRECATE_SOON'
    npm error #   define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
    npm error                                         ^
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:2548:8: error: no matching member function for call to 'SetAccessor'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^~~~~~~~~~~
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
    npm error   void SetAccessor(
    npm error        ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
    npm error   void SetAccessor(
    npm error        ^
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:2596:8: error: no matching member function for call to 'SetAccessor'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^~~~~~~~~~~
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
    npm error   void SetAccessor(
    npm error        ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
    npm error   void SetAccessor(
    npm error        ^
    npm error 1 warning and 2 errors generated.
    npm error make: *** [Release/obj.target/cpufeatures/src/binding.o] Error 1
    npm error gyp ERR! build error 
    npm error gyp ERR! stack Error: `make` failed with exit code: 2
    npm error gyp ERR! stack at ChildProcess.<anonymous> (/Users/devuname/Developer/repo-name/node_modules/node-gyp/lib/build.js:209:23)
    npm error gyp ERR! System Darwin 23.5.0
    npm error gyp ERR! command "/Users/devuname/.nvm/versions/node/v20.11.1/bin/node" "/Users/devuname/Developer/repo-name/node_modules/.bin/node-gyp" "rebuild"
    npm error gyp ERR! cwd /Users/devuname/Developer/repo-name/node_modules/cpu-features
    npm error gyp ERR! node -v v20.11.1
    npm error gyp ERR! node-gyp -v v10.1.0
    npm error gyp ERR! not ok
    npm error A complete log of this run can be found in: /Users/devuname/.npm/_logs/2024-08-06T16_16_44_793Z-debug-0.log
    
                    command=/Users/devuname/.nvm/versions/node/v20.11.1/bin/node /Users/devuname/.nvm/versions/node/v20.11.1/lib/node_modules/npm/bin/npm-cli.js rebuild cpu-features@0.0.10
                    workingDir=
npm error code 1
npm error path /Users/devuname/Developer/repo-name
npm error command failed
npm error command sh -c electron-builder install-app-deps
npm error A complete log of this run can be found in: /Users/devuname/.npm/_logs/2024-08-06T16_16_02_575Z-debug-0.log

Upgraded the node-gyp version to 10.2.0 as well and had similar error

> electron-builder install-app-deps

  • electron-builder  version=24.13.3
  • rebuilding native dependencies  dependencies=cpu-features@0.0.10 platform=darwin arch=arm64
  ⨯ cannot execute  cause=exit status 1
                    errorOut=npm error code 1
    npm error path /Users/devuname/Developer/repo-name/node_modules/cpu-features
    npm error command failed
    npm error command sh -c node buildcheck.js > buildcheck.gypi && node-gyp rebuild
    npm error CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_windows.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
    npm error   CC(target) Release/obj.target/cpu_features/deps/cpu_features/src/hwcaps.o
    npm error   LIBTOOL-STATIC Release/cpu_features.a
    npm error   CXX(target) Release/obj.target/cpufeatures/src/binding.o
    npm error gyp info it worked if it ends with ok
    npm error gyp info using node-gyp@10.2.0
    npm error gyp info using node@20.11.1 | darwin | arm64
    npm error gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
    npm error gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
    npm error gyp info spawn args [
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/node-gyp/gyp/gyp_main.py',
    npm error gyp info spawn args 'binding.gyp',
    npm error gyp info spawn args '-f',
    npm error gyp info spawn args 'make',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/cpu-features/build/config.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/Developer/repo-name/node_modules/node-gyp/addon.gypi',
    npm error gyp info spawn args '-I',
    npm error gyp info spawn args '/Users/devuname/.electron-gyp/28.3.3/include/node/common.gypi',
    npm error gyp info spawn args '-Dlibrary=shared_library',
    npm error gyp info spawn args '-Dvisibility=default',
    npm error gyp info spawn args '-Dnode_root_dir=/Users/devuname/.electron-gyp/28.3.3',
    npm error gyp info spawn args '-Dnode_gyp_dir=/Users/devuname/Developer/repo-name/node_modules/node-gyp',
    npm error gyp info spawn args '-Dnode_lib_file=/Users/devuname/.electron-gyp/28.3.3/<(target_arch)/node.lib',
    npm error gyp info spawn args '-Dmodule_root_dir=/Users/devuname/Developer/repo-name/node_modules/cpu-features',
    npm error gyp info spawn args '-Dnode_engine=v8',
    npm error gyp info spawn args '--depth=.',
    npm error gyp info spawn args '--no-parallel',
    npm error gyp info spawn args '--generator-output',
    npm error gyp info spawn args 'build',
    npm error gyp info spawn args '-Goutput_dir=.'
    npm error gyp info spawn args ]
    npm error gyp info spawn make
    npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:688:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
    npm error     return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
    npm error                                       ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-isolate.h:1343:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
    npm error   V8_DEPRECATE_SOON(
    npm error   ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8config.h:561:41: note: expanded from macro 'V8_DEPRECATE_SOON'
    npm error #   define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
    npm error                                         ^
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:2548:8: error: no matching member function for call to 'SetAccessor'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^~~~~~~~~~~
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
    npm error   void SetAccessor(
    npm error        ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
    npm error   void SetAccessor(
    npm error        ^
    npm error In file included from ../src/binding.cc:3:
    npm error ../../nan/nan.h:2596:8: error: no matching member function for call to 'SetAccessor'
    npm error   tpl->SetAccessor(
    npm error   ~~~~~^~~~~~~~~~~
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
    npm error   void SetAccessor(
    npm error        ^
    npm error /Users/devuname/.electron-gyp/28.3.3/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
    npm error   void SetAccessor(
    npm error        ^
    npm error 1 warning and 2 errors generated.
    npm error make: *** [Release/obj.target/cpufeatures/src/binding.o] Error 1
    npm error gyp ERR! build error 
    npm error gyp ERR! stack Error: `make` failed with exit code: 2
    npm error gyp ERR! stack at ChildProcess.<anonymous> (/Users/devuname/Developer/repo-name/node_modules/node-gyp/lib/build.js:216:23)
    npm error gyp ERR! System Darwin 23.5.0
    npm error gyp ERR! command "/Users/devuname/.nvm/versions/node/v20.11.1/bin/node" "/Users/devuname/Developer/repo-name/node_modules/.bin/node-gyp" "rebuild"
    npm error gyp ERR! cwd /Users/devuname/Developer/repo-name/node_modules/cpu-features
    npm error gyp ERR! node -v v20.11.1
    npm error gyp ERR! node-gyp -v v10.2.0
    npm error gyp ERR! not ok
    npm error A complete log of this run can be found in: /Users/devuname/.npm/_logs/2024-08-07T17_17_27_276Z-debug-0.log
    
                    command=/Users/devuname/.nvm/versions/node/v20.11.1/bin/node /Users/devuname/.nvm/versions/node/v20.11.1/lib/node_modules/npm/bin/npm-cli.js rebuild cpu-features@0.0.10
                    workingDir=
npm error code 1
npm error path /Users/devuname/Developer/repo-name
npm error command failed
npm error command sh -c electron-builder install-app-deps
npm error A complete log of this run can be found in: /Users/devuname/.npm/_logs/2024-08-07T17_17_22_648Z-debug-0.log