z3javascript
z3javascript copied to clipboard
incomplete installation and failed installation with node versions > 10.23.2 (build error)
Hi,
first some information about my setup:
clang version 9.0.1-12nvmwith followingnodeversions installed:v8.17.0 (npm v6.13.4)v10.23.2 (npm v6.14.10)v12.20.1 (npm v6.14.10)v14.15.4 (npm v6.14.10)v15.8.0 (npm v7.5.1)
i tried installing z3javascript with all listed node versions but installation fails completely on versions > v10.23.2. This somehow happens when entering the ref dependency:
> [email protected] install /home/user/Documents/Testing/z3/node_modules/ref
> node-gyp rebuild
make: Entering directory '/home/user/Documents/Testing/z3/node_modules/ref/build'
CXX(target) Release/obj.target/binding/src/binding.o
../src/binding.cc:17: warning: "__STDC_FORMAT_MACROS" redefined
17 | #define __STDC_FORMAT_MACROS
|
<command-line>: note: this is the location of the previous definition
../src/binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE {anonymous}::WriteObject(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cc:222:43: error: no matching function for call to ‘v8::Value::BooleanValue()’
222 | bool persistent = info[3]->BooleanValue();
| ^
[SOME MORE ERRORS...]
make: *** [binding.target.mk:111: Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/home/user/Documents/Testing/z3/node_modules/ref/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/user/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Linux 5.8.0-44-generic
gyp ERR! command "/home/user/.nvm/versions/node/v14.15.4/bin/node" "/home/user/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/Documents/Testing/z3/node_modules/ref
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/home/user/Documents/Testing/z3/package.json'
npm WARN z3 No description
npm WARN z3 No repository field.
npm WARN z3 No README data
npm WARN z3 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2021-02-27T14_08_03_105Z-debug.log
However, installing with node versions v10.23.2 and v8.17.0 finishes without an error but the installation is incomplete. The folder node_modules/z3javascript/bin/ only includes the following files:
libz3.so z3_bindings_built.js z3_bindings_ref.js z3.json
package.js z3_bindings_flat z3_bindings_stripped.js
Context.js, Solver.js etc. are completely missing :(
Hey, could you give it a try now? A nice PR was submitted which migrates to the napi variants of libraries, seemingly solving the issue.
Hi,
I tried it with node v12.6.0 but got the following error:
error /home/user/Documents/testing/node_modules/ffi-napi: Command failed.
Exit code: 1
Command: node-gyp-build
Arguments:
Directory: /home/user/Documents/testing/node_modules/ffi-napi
Output:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args '/home/user/.nvm/versions/node/v12.6.0/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/user/Documents/testing/node_modules/ffi-napi/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/user/.nvm/versions/node/v12.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/user/.node-gyp/12.6.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/user/.node-gyp/12.6.0',
gyp info spawn args '-Dnode_gyp_dir=/home/user/.nvm/versions/node/v12.6.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/user/.node-gyp/12.6.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/user/Documents/testing/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' ]
make: Entering directory '/home/user/Documents/testing/node_modules/ffi-napi/build'
CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
AR(target) Release/obj.target/../node-addon-api/nothing.a
COPY Release/nothing.a
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: In function ‘ffi_java_raw_call’:
../deps/libffi/src/java_raw_api.c:317:3: warning: ‘ffi_java_raw_to_ptrarray’ is deprecated [-Wdeprecated-declarations]
ffi_java_raw_to_ptrarray (cif, raw, avalue);
^~~~~~~~~~~~~~~~~~~~~~~~
../deps/libffi/src/java_raw_api.c:76:1: note: declared here
ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
^~~~~~~~~~~~~~~~~~~~~~~~
../deps/libffi/src/java_raw_api.c: In function ‘ffi_java_translate_args’:
../deps/libffi/src/java_raw_api.c:328:3: warning: ‘ffi_java_raw_size’ is deprecated [-Wdeprecated-declarations]
ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
^~~~~~~~~~~~
../deps/libffi/src/java_raw_api.c:45:1: note: declared here
ffi_java_raw_size (ffi_cif *cif)
^~~~~~~~~~~~~~~~~
../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/src/java_raw_api.c:157:1: note: declared here
ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
^~~~~~~~~~~~~~~~~~~~~~~~
../deps/libffi/src/java_raw_api.c: In function ‘ffi_prep_java_raw_closure’:
../deps/libffi/src/java_raw_api.c:369:3: warning: ‘ffi_prep_java_raw_closure_loc’ is deprecated [-Wdeprecated-declarations]
return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
^~~~~~
../deps/libffi/src/java_raw_api.c:337:1: note: declared here
ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CC(target) Release/obj.target/ffi/deps/libffi/src/closures.o
../deps/libffi/src/closures.c: In function ‘allocate_space’:
../deps/libffi/src/closures.c:748:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
off_t to_write = (len < page_size) ? len : page_size;
^
../deps/libffi/src/closures.c:748:48: warning: signed and unsigned type in conditional expression [-Wsign-compare]
off_t to_write = (len < page_size) ? len : page_size;
^
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffiw64.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/ffi64.o
../deps/libffi/src/x86/ffi64.c: In function ‘classify_argument’:
../deps/libffi/src/x86/ffi64.c:200:18: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
FFI_ASSERT (0);
^
../deps/libffi/src/x86/ffi64.c:175:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
{
^
../deps/libffi/src/x86/ffi64.c:202:5: note: here
case FFI_TYPE_FLOAT:
^~~~
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/unix64.o
CC(target) Release/obj.target/ffi/deps/libffi/src/x86/win64.o
AR(target) Release/obj.target/deps/libffi/libffi.a
COPY Release/libffi.a
CXX(target) Release/obj.target/ffi_bindings/src/ffi.o
In file included from /home/user/Documents/testing/node_modules/node-addon-api/napi.h:2725:0,
from ../src/ffi.h:2,
from ../src/ffi.cc:3:
/home/user/Documents/testing/node_modules/node-addon-api/napi-inl.h: In member function ‘T* Napi::Env::GetInstanceData()’:
/home/user/Documents/testing/node_modules/node-addon-api/napi-inl.h:471:24: error: there are no arguments to ‘napi_get_instance_data’ that depend on a template parameter, so a declaration of ‘napi_get_instance_data’ must be available [-fpermissive]
napi_status status = napi_get_instance_data(_env, &data);
^~~~~~~~~~~~~~~~~~~~~~
/home/user/Documents/testing/node_modules/node-addon-api/napi-inl.h:471:24: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../src/ffi.cc: In static member function ‘static FFI::InstanceData* FFI::InstanceData::Get(Napi::Env)’:
../src/ffi.cc:11:24: error: ‘napi_get_instance_data’ was not declared in this scope
napi_status status = napi_get_instance_data(env, &d);
^~~~~~~~~~~~~~~~~~~~~~
../src/ffi.cc:11:24: note: suggested alternative: ‘napi_new_instance’
napi_status status = napi_get_instance_data(env, &d);
^~~~~~~~~~~~~~~~~~~~~~
napi_new_instance
../src/ffi.cc: In function ‘Napi::Object BindingHook(Napi::Env, Napi::Object)’:
../src/ffi.cc:348:24: error: ‘napi_set_instance_data’ was not declared in this scope
napi_status status = napi_set_instance_data(
^~~~~~~~~~~~~~~~~~~~~~
../src/ffi.cc:348:24: note: suggested alternative: ‘napi_new_instance’
napi_status status = napi_set_instance_data(
^~~~~~~~~~~~~~~~~~~~~~
napi_new_instance
In file included from ../src/ffi.cc:3:0:
../src/ffi.h: At global scope:
../src/ffi.h:151:19: warning: mangled name for ‘Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = char*() throw ()]’ will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]
inline TypedArray WrapPointer(Env env, T* ptr, size_t length = 0) {
^~~~~~~~~~~
../src/ffi.h:151:19: warning: mangled name for ‘Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = void*(void*, const char*) throw ()]’ will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]
../src/ffi.h:151:19: warning: mangled name for ‘Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = int(void*) throw ()]’ will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]
../src/ffi.h:151:19: warning: mangled name for ‘Napi::TypedArray FFI::WrapPointer(Napi::Env, T*, size_t) [with T = void*(const char*, int) throw ()]’ will change in C++17 because the exception specification is part of a function type [-Wnoexcept-type]
ffi_bindings.target.mk:120: recipe for target 'Release/obj.target/ffi_bindings/src/ffi.o' failed
make: Leaving directory '/home/user/Documents/testing/node_modules/ffi-napi/build'
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 (/home/user/.nvm/versions/node/v12.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.15.0-147-generic
gyp ERR! command "/home/user/.nvm/versions/node/v12.6.0/bin/node" "/home/user/.nvm/versions/node/v12.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/Documents/testing/node_modules/ffi-napi
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Thanks for the report, I'll take a look tonight.
Hello @jawline, I understand that it has been a long time since this issue was raised. However, I am encountering problems installing z3javascript using the latest node version v18.17.1 (with npm 9.6.7). The installation succeeded but the folder node_modules/z3javascript/bin/ only includes the 3 files:
package.js
z3_bindings_built.js
z3_bindings_ref.js
I believe other .js files (e.g. Z3.js) are missing as the Z3 import did not work for me. I would really appreciate any advice or solution! Thanks!
Is this for ExpoSE? I think it was the ExpoSE install script rather than z3javascript that was broken. I just pushed a change that might help to the ExpoSE repo with new install instructions.
If I check this repo out locally and npm install it I can npm test with no issues.
This is actually for z3javascript only as I was trying to install it as a dependency for my project. It turns out that local cloning and installation work perfectly fine. Thanks!
It's just weird that the below installation command somehow does not work.
npm install git+ssh://github.com/ExpoSEJS/z3javascript.git