sodium-friends/sodium-native

Build Error / Prebuilds for Node 12

Closed this issue · 13 comments

I'm getting this when trying to build:

In file included from ../src/crypto_pwhash_async.cc:2:0,
from ../binding.cc:12:
../binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE crypto_secretstream_xchacha20poly1305_rekey(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/macros.h:123:60: error: no matching function for call to ‘v8::Value::ToObject()’
type* var = Nan::ObjectWrap::Unwrap(name->ToObject());

We would like to figure out why it is building in the first place. Please provide exact node version, sodium-native and OS version. We have a canary setup for Linux, macOS and Windows that runs every night with all the supported node versions and that hasn't reported any issues, but other people have filed issues with the prebuilds on Linux, however without any resolve

$ npm i sodium-native

> sodium-native@2.3.0 install /cms/server/node_modules/sodium-native
> node-gyp-build "node preinstall.js" "node postinstall.js"

From the npm log:

85 verbose stack Error: sodium-native@2.3.0 install: `node-gyp-build "node preinstall.js" "node postinstall.js"

85 verbose stack Exit status 1

85 verbose stack     at EventEmitter.<anonymous> 
(/usr/local/n/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)

85 verbose stack     at EventEmitter.emit (events.js:196:13)

85 verbose stack     at ChildProcess.<anonymous> (/usr/local/n/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)

85 verbose stack     at ChildProcess.emit (events.js:196:13)

85 verbose stack     at maybeClose (internal/child_process.js:1000:16)

85 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)

86 verbose pkgid sodium-native@2.3.0

88 verbose Linux 4.15.0-47-generic

89 verbose argv "/usr/local/n/bin/node" "/usr/local/n/bin/npm" "i" "sodium-native"

90 verbose node v12.0.0

91 verbose npm  v6.9.0

$ lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

Ah sorry, I should have paid attention to the node version. We do not yet have prebuilds for 12. We need to add it here https://github.com/lgeiger/node-abi/blob/9c5acd11ae297c4eabb29c531334dec4b09ebdf3/index.js#L58

Some of the native bindings code may need to be adapted to this version. I may get around to that later this week

@emilbayes no worries, just trying to test out Node 12 and I had this dependency. So far, I'm seeing a 1.33x speedup on startup times across multiple apps with the latest v8/node changes, so it's worth the upgrade for me.

Tried building myself but it will take quite a substantial amount of work, so it will be a bit delayed

node-abi PR is not merged yet electron/node-abi#62

Node12's ABI is also required for Electron 5 which was released two days ago (just cheering you on for additional motivation, maybe)

@vladimiry it is now!

Any progress on this issue?

@orbitlens Nothing beyond simple experiments. Getting to terms with N-API over here first: https://github.com/hyperdivision/hid

I’m seeing this as well.

See #104 as a poc

Fixed in 2.4.3