Streampunk / grandiose

Node.JS native bindings to Newtek NDI(tm).
Apache License 2.0
184 stars 47 forks source link

Package is not building on macOS M1 #29

Closed dortanes closed 11 months ago

dortanes commented 11 months ago
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/unnamedperson/Documents/GitHub/casto/ui/node_modules/grandiose
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@16.15.1 | darwin | arm64
gyp info find Python using Python version 3.11.3 found at "/Users/unnamedperson/.pyenv/versions/3.11.3/bin/python3"
gyp info spawn /Users/unnamedperson/.pyenv/versions/3.11.3/bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/local/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   '/Users/unnamedperson/Documents/GitHub/casto/ui/node_modules/grandiose/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/unnamedperson/Library/Caches/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=/Users/unnamedperson/Library/Caches/node-gyp/16.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/unnamedperson/Library/Caches/node-gyp/16.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/unnamedperson/Documents/GitHub/casto/ui/node_modules/grandiose',
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' ]
  COPY ../build/Release/Processing.NDI.Lib.x64.dll
  CXX(target) Release/obj.target/grandiose/src/grandiose_util.o
../src/grandiose_util.cc:48:5: error: use of undeclared identifier 'itoa'
    itoa(errorInfo->error_code, errorCode, 10), errorInfo->error_message);
    ^
../src/grandiose_util.cc:85:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    sprintf(errorMsg, "For method %s, expected %zi arguments and got %zi.",
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
../src/grandiose_util.cc:97:7: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
      sprintf(errorMsg, "For method %s argument %i, expected type %s and got %s.",
      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
../src/grandiose_util.cc:92:23: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
  for ( int x = 0 ; x < argc ; x++ ) {
                    ~ ^ ~~~~
../src/grandiose_util.cc:133:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
    sprintf(extMsg, "In file %s on line %i, found error: %s", file, line, c->errorMsg.c_str());
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
../src/grandiose_util.cc:134:43: error: use of undeclared identifier 'itoa'
    status = napi_create_string_utf8(env, itoa(c->status, errorChars, 10),
                                          ^
4 warnings and 2 errors generated.
make: *** [Release/obj.target/grandiose/src/grandiose_util.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203: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 Darwin 23.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/unnamedperson/Documents/GitHub/casto/ui/node_modules/grandiose
gyp ERR! node -v v16.15.1
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
Julusian commented 11 months ago

Installing from npm or github? Make sure to install from github, the version on npm doesnt currently support macos

Julusian commented 11 months ago

If you use something like this in your package.json it should work:

    "grandiose": "https://github.com/streampunk/grandiose/tarball/c350e0fb6e74bbf2e4b10144fee456aa1af93f47",