midi2-dev / MIDI2.0Workbench

MIDI 2.0 Testing Tool
MIT License
45 stars 5 forks source link

Build fails on Linux #2

Closed cbix closed 10 months ago

cbix commented 10 months ago

When trying to build, the error pasted below is thrown.

Some includes seem to be missing e.g. for BString as well.

error /home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.15.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   '/home/florian/.nvm/versions/node/v16.15.1/lib/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   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/florian/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/florian/.cache/node-gyp/16.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=/home/florian/.cache/node-gyp/16.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/home/florian/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/florian/.cache/node-gyp/16.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2',
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/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2/build'
  CXX(target) Release/obj.target/ALSA/alsabindings.o
../alsabindings.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE get_UMP_Endpoints(Nan::NAN_METHOD_ARGS_TYPE)’:
../alsabindings.cc:210:49: error: invalid conversion from ‘int’ to ‘const snd_seq_client_info_t*’ {aka ‘const _snd_seq_client_info*’} [-fpermissive]
  210 |         int card = snd_seq_client_info_get_card(client);
      |                                                 ^~~~~~
      |                                                 |
      |                                                 int
In file included from /usr/include/alsa/asoundlib.h:64,
                 from ../alsabindings.cc:4:
/usr/include/alsa/seq.h:153:63: note:   initializing argument 1 of ‘int snd_seq_client_info_get_card(const snd_seq_client_info_t*)’
  153 | int snd_seq_client_info_get_card(const snd_seq_client_info_t *info);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
../alsabindings.cc:212:13: error: ‘BString’ was not declared in this scope
  212 |             BString hwname = BString::format("hw:%d", card);
      |             ^~~~~~~
../alsabindings.cc:214:48: error: ‘hwname’ was not declared in this scope; did you mean ‘tzname’?
  214 |             snd_ctl_open(&card_control_handle, hwname.toUTF8(), 0);
      |                                                ^~~~~~
      |                                                tzname
../alsabindings.cc:216:20: error: expected ‘;’ before ‘location’
  216 |             BString location(getLocation(card, card_info));
      |                    ^~~~~~~~~
      |                    ;
../alsabindings.cc:217:20: error: expected ‘;’ before ‘manufacturer’
  217 |             BString manufacturer(getManufacturer(location));
      |                    ^~~~~~~~~~~~~
      |                    ;
../alsabindings.cc:218:78: error: ‘manufacturer’ was not declared in this scope
  218 |             Nan::Set(port,Nan::New("manufacturer").ToLocalChecked(),Nan::New(manufacturer.toUTF8()));
      |                                                                              ^~~~~~~~~~~~
../alsabindings.cc:202:13: warning: unused variable ‘errEP’ [-Wunused-variable]
  202 |         int errEP = snd_seq_get_ump_endpoint_info(seq, client, ep);
      |             ^~~~~
../alsabindings.cc:262:14: warning: unused variable ‘err’ [-Wunused-variable]
  262 |          int err = snd_seq_connect_from(seq, localPort, client, portNum);
      |              ^~~
../alsabindings.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE sendUMP(Nan::NAN_METHOD_ARGS_TYPE)’:
../alsabindings.cc:392:9: warning: unused variable ‘senRes’ [-Wunused-variable]
  392 |     int senRes = snd_seq_ump_event_output(seq, &ev);
      |         ^~~~~~
In file included from ../../nan/nan.h:62,
                 from ../alsabindings.cc:1:
../alsabindings.cc: At global scope:
/home/florian/.cache/node-gyp/16.15.1/include/node/node.h:847: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]
  847 |       (node::addon_register_func) (regfunc),                          \
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/florian/.cache/node-gyp/16.15.1/include/node/node.h:881:3: note: in expansion of macro ‘NODE_MODULE_X’
  881 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../alsabindings.cc:417:1: note: in expansion of macro ‘NODE_MODULE’
  417 | NODE_MODULE(ALSA, Initialize)
      | ^~~~~~~~~~~
make: *** [ALSA.target.mk:115: Release/obj.target/ALSA/alsabindings.o] Error 1
make: Leaving directory '/home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/florian/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 6.6.8-arch1-1
gyp ERR! command "/home/florian/.nvm/versions/node/v16.15.1/bin/node" "/home/florian/.nvm/versions/node/v16.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/florian/build/MIDI2.0Workbench/node_modules/usb_midi_2
starfishmod commented 10 months ago

Yes sorry I forgot to replace some bad code. It is now fixed and is running :)

cbix commented 10 months ago

Perfect, thanks @starfishmod, it now builds and starts :) Would you mind adding a release tag for 1.5.5? I'd like to package this for Arch Linux. Also, does the p suffix in 1.5.5p have any meaning or are all these considered stable releases?

starfishmod commented 10 months ago

@cbix tag made for 1.5.5p The 'p' signifies this is the public release. There is a MIDI Association members only release that contains experimental specifications. Is the 'p' a problem?

cbix commented 10 months ago

Thanks for the explanation, just thought it meant sth like "prerelease" saying it's unstable. Not a problem, we can easily filter that :)