ssbc / patchbay

An alternative Secure Scuttlebutt client interface that is fully compatible with Patchwork
http://www.scuttlebutt.nz
386 stars 78 forks source link

Cannot compile patchbay #364

Open christianlupus opened 4 years ago

christianlupus commented 4 years ago

I have the problem that I try to compile patchbay on my Archlinux system. I get a whole lot of errors and warnings. I put it in a gist, as it is too lengthy to put it here.

I think the relevant (and first) error is around line 793 in the log file:

[...]
  CXX(target) Release/obj.target/sodium/src/crypto_stream_xor_wrap.o
In file included from ../src/crypto_hash_sha256_wrap.h:4,
                 from ../src/crypto_hash_sha256_wrap.cc:1:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2298:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../src/crypto_hash_sha256_wrap.cc:2:
../src/crypto_hash_sha256_wrap.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE CryptoHashSha256Wrap::Update(Nan::NAN_METHOD_ARGS_TYPE)':
../src/macros.h:66:46: error: no matching function for call to 'v8::Value::ToObject()'
   66 |   v8::Local<v8::Object> var = name->ToObject();
      |                                              ^
../src/macros.h:69:3: note: in expansion of macro 'ASSERT_BUFFER'
   69 |   ASSERT_BUFFER(name, var) \
      |   ^~~~~~~~~~~~~
../src/crypto_hash_sha256_wrap.cc:18:3: note: in expansion of macro 'ASSERT_BUFFER_SET_LENGTH'
   18 |   ASSERT_BUFFER_SET_LENGTH(info[0], input)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/christian/.cache/node-gyp/13.6.0/include/node/node.h:63,
                 from ../../nan/nan.h:54,
                 from ../src/crypto_hash_sha256_wrap.h:4,
                 from ../src/crypto_hash_sha256_wrap.cc:1:
/home/christian/.cache/node-gyp/13.6.0/include/node/v8.h:2754:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const'
 2754 |   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
      |                                            ^~~~~~~~
/home/christian/.cache/node-gyp/13.6.0/include/node/v8.h:2754:44: note:   candidate expects 1 argument, 0 provided
In file included from ../src/crypto_hash_sha256_wrap.cc:2:
../src/crypto_hash_sha256_wrap.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE CryptoHashSha256Wrap::Final(Nan::NAN_METHOD_ARGS_TYPE)':
../src/macros.h:66:46: error: no matching function for call to 'v8::Value::ToObject()'
[...]

I guess this is due to an incompatible library/binary version. Can you hint me, where I can look? I did not find anything to solve this.

If you need any information about my system, please tell me.

edrex commented 4 years ago

Hi @christianlupus, I can confirm under arch, and have been seeing similar v8 API errors with node projects that compile native modules. I don't know the specific causes, but I gather node-gyp / bundled v8 stuff is in a state of upheaval rn and there are breakages across the ecosystem (possibly related background: https://github.com/nodejs/node-gyp/issues/1791)

For this specific project, I am able to build native deps successfully using node v10 installed via nvm:

nvm install 10
nvm use 10

If anyone can provide further insight into where issues should be filed (can sodium-native do anything about this?) plz chime in.

edrex commented 4 years ago

Upstream: https://github.com/sodium-friends/sodium-native/issues/95

edrex commented 4 years ago

Based on https://github.com/sodium-friends/sodium-native/issues/95#issuecomment-517346840, seems upgrading sodium native to >2.4.3. But there are several copies kicking around in node_modules. Y'all nodejs folks have normalized some pretty scary (for outsiders) dependency trees.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

christianlupus commented 4 years ago

I just tried to rebuild and the problem seems to be still present.

aadilayub commented 4 years ago

I just tried compiling with node versions 14, 12, and 10 and they failed for me as well.

stale[bot] commented 3 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

christianlupus commented 3 years ago

I just tried to compile and it still refused to compile here.