dydxprotocol / v3-client

TypeScript client for dYdX (v3 API).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ffi-napi dependency broken during installation, error occurs

jcardonne opened this issue · comments

Hello,
The ffi-napi Dependency appears and throws a broken error during installation of the Dydx package (which is a dependency of the dydx client package).

ffi-napi seems to be no longer supported (there are forks that have been created since) it would be good to replace it.

CF: node-ffi-napi/node-ffi-napi#267

node_modules/.pnpm/ffi-napi@4.0.3/node_modules/ffi-napi: Running install script, failed in 2.6s
.../ffi-napi@4.0.3/node_modules/ffi-napi install$ node-gyp-build
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@9.4.1
│ gyp info using node@21.7.0 | darwin | arm64
│ gyp info find Python using Python version 3.11.6 found at "/opt/homebrew/opt/python@3.11/bin/python3.11"
│ gyp info spawn /opt/homebrew/opt/python@3.11/bin/python3.11
│ gyp info spawn args [│ gyp info spawn args   '/opt/homebrew/Cellar/pnpm/8.10.5/libexec/dist/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/[username]/[project_path]/node_modules/.pnpm/ffi-napi@4.0.3/node_modules/ffi-napi/build/config.gypi',│ gyp info spawn args   '-I',│ gyp info spawn args   '/opt/homebrew/Cellar/pnpm/8.10.5/libexec/dist/node_modules/node-gyp/addon.gypi',│ gyp info spawn args   '-I',│ gyp info spawn args   '/Users/[username]/Library/Caches/node-gyp/21.7.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=/Users/[username]/Library/Caches/node-gyp/21.7.0',│ gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/pnpm/8.10.5/libexec/dist/node_modules/node-gyp',│ gyp info spawn args   '-Dnode_lib_file=/Users/[username]/Library/Caches/node-gyp/21.7.0/<(target_arch)/node.lib',│ gyp info spawn args   '-Dmodule_root_dir=/Users/[username]/[project_path]/node_modules/.pnpm/ffi-napi@4.0.3/node_modules/ffi-napi',│ 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' ]
│   CC(target) Release/obj.target/nothing/../../../node-addon-api@3.2.1/node_modules/node-addon-api/nothing.o
│   LIBTOOL-STATIC Release/nothing.a
│ warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the …
│   CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o
│   CC(target) Release/obj.target/ffi/deps/libffi/src/types.o
│   CC(target) Release/obj.target/ffi/deps/libffi/src/raw_api.o
│   CC(target) Release/obj.target/ffi/deps/libffi/src/java_raw_api.o
│ ../deps/libffi/src/java_raw_api.c:328:46: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
│   ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
│                                              ^
│ ../deps/libffi/config/mac/arm64/ffi.h:299:56: note: 'ffi_java_raw_size' has been explicitly marked deprecated here
│ size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
│                                                        ^
│ ../deps/libffi/src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
│   ffi_java_ptrarray_to_raw (cif, avalue, raw);
│   ^
│ ../deps/libffi/config/mac/arm64/ffi.h:295:93: note: 'ffi_java_ptrarray_to_raw' has been explicitly marked deprecated here
│ void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
│                                                                                             ^
│ 2 warnings generated.
│   CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
│   CC(target) Release/obj.target/ffi/deps/libffi/src/aarch64/ffi.o
│ ../deps/libffi/src/aarch64/ffi.c:738:17: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
│       if (i + 1 == cif->aarch64_nfixedargs)
│           ~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
│ ../deps/libffi/src/aarch64/ffi.c:991:17: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
│       if (i + 1 == cif->aarch64_nfixedargs)
│           ~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
│ 2 warnings generated.
│   CC(target) Release/obj.target/ffi/deps/libffi/src/aarch64/sysv.o
│   LIBTOOL-STATIC Release/libffi.a
│   CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
│ In file included from ../src/ffi.cc:5:
│ /Users/[username]/[project_path]/node_modules/.pnpm/get-uv-event-loop-napi-h@1.0.6/node_modules/get-uv-event-loop-napi-h/include/get-u…
│   napi_get_uv_event_loop__ = &napi_get_uv_event_loop.
│                              ^~~~~~~~~~~~~~~~~~~~~~~
│ In file included from ../src/ffi.cc:3:
│ In file included from ../src/ffi.h:2:
│ In file included from /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi.h:2725:
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:63:12: error: no match…
│   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr).
│            ^~~~~~~~~~~~~~~~~~
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:1965:29: note: in inst…
│     status = Napi::details::AttachData(env, *result, data).
│                             ^
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:2021:24: note: in inst…
│   napi_status status = CreateFunction(env,
│                        ^
│ ../src/ffi.cc:58:38: note: in instantiation of function template specialization 'Napi::Function::New<Napi::Value (*)(const Napi::CallbackInfo &)…
│   target["ffi_prep_cif"] = Function::New(env, FFIPrepCif).
│                                      ^
│ /Users/[username]/Library/Caches/node-gyp/21.7.0/include/node/js_native_api.h:520:1: note: candidate function not viable: no known conversion fro…
│ napi_add_finalizer(napi_env env,
│ ^
│ In file included from ../src/ffi.cc:3:
│ In file included from ../src/ffi.h:2:
│ In file included from /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi.h:2725:
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:63:12: error: no match…
│   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr).
│            ^~~~~~~~~~~~~~~~~~
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:1965:29: note: in inst…
│     status = Napi::details::AttachData(env, *result, data).
│                             ^
│ /Users/[username]/[project_path]/node_modules/.pnpm/node-addon-api@3.2.1/node_modules/node-addon-api/napi-inl.h:2021:24: note: in inst…
│   napi_status status = CreateFunction(env,
│                        ^
│ ../src/ffi.cc:60:34: note: in instantiation of function template specialization 'Napi::Function::New<void (*)(the Napi::CallbackInfo &)>' requ…
│   target["ffi_call"] = Function::New(env, FFICall).
│                                  ^
│ /Users/[username]/Library/Caches/node-gyp/21.7.0/include/node/js_native_api.h:520:1: note: candidate function not viable: no known conversion fro…
│ napi_add_finalizer(napi_env env,
│ ^
│ 3 errors generated.
│ make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
│ gyp ERR! build error 
│ gyp ERR! stack Error: `make` failed with exit code: 2
│ gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/Cellar/pnpm/8.10.5/libexec/dist/node_modules/node-gyp/lib/build.js:203:23)
│ gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
│ gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Darwin 23.1.0
│ gyp ERR! command "/opt/homebrew/Cellar/node/21.7.0/bin/node" "/opt/homebrew/Cellar/pnpm/8.10.5/libexec/dist/node_modules/node-gyp/bin/node-gyp.j…
│ gyp ERR! cwd /Users/[username]/[project_path]/node_modules/.pnpm/ffi-napi@4.0.3/node_modules/ffi-napi
│ gyp ERR! node -v v21.7.0
│ gyp ERR! node-gyp -v v9.4.1
│ gyp ERR! not ok 
└─ Failed in 2.6s at /Users/[username]/[project_path]/node_modules/.pnpm/ffi-napi@4.0.3/node_modules/ffi-napi
 ELIFECYCLE  Command failed with exit code 1.