eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.55k stars 2.46k forks source link

Build fails #13882

Closed ThatOneCalculator closed 1 week ago

ThatOneCalculator commented 1 week ago

Bug Description:

On Arch Linux x86_64, the build fails when doing yarn build or yarn all

Steps to Reproduce:

  1. git clone https://github.com/eclipse-theia/theia
  2. cd theia
  3. yarn install
  4. yarn all
Exit code: 1
Command: node buildcheck.js > buildcheck.gypi && node-gyp rebuild
Arguments: 
Directory: /tmp/theia/node_modules/cpu-features
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.1
gyp info using node@22.4.0 | linux | x64
(node:359427) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info find Python using Python version 3.12.4 found at \"/usr/bin/python3\"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/tmp/theia/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   '/tmp/theia/node_modules/cpu-features/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/tmp/theia/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kainoa/.cache/node-gyp/22.4.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=/home/kainoa/.cache/node-gyp/22.4.0',
gyp info spawn args   '-Dnode_gyp_dir=/tmp/theia/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/kainoa/.cache/node-gyp/22.4.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/theia/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 '/tmp/theia/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 /home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-array-buffer.h:12,
                 from /home/kainoa/.cache/node-gyp/22.4.0/include/node/v8.h:24,
                 from /home/kainoa/.cache/node-gyp/22.4.0/include/node/node.h:73,
                 from ../src/binding.cc:1:
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-local-handle.h:401:30: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
  401 |   V8_INLINE explicit Local<T>(const LocalBase<T>& other)
      |                              ^
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-local-handle.h:401:30: note: remove the ‘< >’
In file included from ../src/binding.cc:3:
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
../../nan/nan.h:2548:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2548 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2549 |       name
      |       ~~~~         
 2550 |     , getter_
      |     ~~~~~~~~~      
 2551 |     , setter_
      |     ~~~~~~~~~      
 2552 |     , obj
      |     ~~~~~          
 2553 |     , settings
      |     ~~~~~~~~~~     
 2554 |     , attribute
      |     ~~~~~~~~~~~    
 2555 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2556 |     , signature
      |     ~~~~~~~~~~~    
 2557 | #endif
      | ~~~~~~             
 2558 |   );
      |   ~                
In file included from /home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-function.h:15,
                 from /home/kainoa/.cache/node-gyp/22.4.0/include/node/v8.h:33:
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1049 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1055 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../../nan/nan.h:2594:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
 2594 |   tpl->SetAccessor(
      |   ~~~~~~~~~~~~~~~~^
 2595 |       name
      |       ~~~~         
 2596 |     , getter_
      |     ~~~~~~~~~      
 2597 |     , setter_
      |     ~~~~~~~~~      
 2598 |     , obj
      |     ~~~~~          
 2599 |     , settings
      |     ~~~~~~~~~~     
 2600 |     , attribute
      |     ~~~~~~~~~~~    
 2601 |   );
      |   ~                
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1049 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
 1055 |   void SetAccessor(
      |        ^~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
 1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
      |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
../src/binding.cc: At global scope:
/home/kainoa/.cache/node-gyp/22.4.0/include/node/node.h:1228:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
 1228 |       (node::addon_register_func) (regfunc),                          \\\n      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kainoa/.cache/node-gyp/22.4.0/include/node/node.h:1262:3: note: in expansion of macro ‘NODE_MODULE_X’
 1262 |   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)
      | ^~~~~~~~~~~
make: *** [cpufeatures.target.mk:115: Release/obj.target/cpufeatures/src/binding.o] Error 1
make: Leaving directory '/tmp/theia/node_modules/cpu-features/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/tmp/theia/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Linux 6.9.7-AMD-znver3
gyp ERR! command \"/usr/bin/node\" \"/tmp/theia/node_modules/.bin/node-gyp\" \"rebuild\"
gyp ERR! cwd /tmp/theia/node_modules/cpu-features
gyp ERR! node -v v22.4.0
gyp ERR! node-gyp -v v9.4.1
gyp ERR! not ok"
error Command failed with exit code 1.

Additional Information

msujew commented 1 week ago

Hey @ThatOneCalculator,

Due to the native dependencies (that fail the build on your end), we have very specific version ranges that we support. See also our prerequisites. Downgrading to node 20 or 18 (LTS) should fix this.

Additionally, due a missing dependency starting with Python 3.12 (in case you're using that), you either need to build it with 3.11. or install the distutils package manually.

ThatOneCalculator commented 1 week ago

Got it, sorry I didn't read that more clearly