js-ipld-ethereum icon indicating copy to clipboard operation
js-ipld-ethereum copied to clipboard

Any chance of moving to js-sha3?

Open daviddias opened this issue 7 years ago • 4 comments

Currently, this module brings in a Native dep [email protected]. Would it be possible to move to js-sha3, the same used in js-multihashing-async, so that it doesn't represent a blocker for js-ipfs electron users

> [email protected] install /Users/koruza/code/js-ipld-eth-star/node_modules/fsevents
> node install

[fsevents] Success: "/Users/koruza/code/js-ipld-eth-star/node_modules/fsevents/lib/binding/Release/node-v51-darwin-x64/fse.node" is installed via remote

> [email protected] install /Users/koruza/code/js-ipld-eth-star/node_modules/sha3
> node-gyp rebuild

  CXX(target) Release/obj.target/sha3/src/addon.o
../src/addon.cpp:59:36: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
                        info.GetReturnValue().Set(cons->NewInstance(argc, argv));
                                                        ^
/Users/koruza/.node-gyp/7.10.0/include/node/v8.h:3658:31: note: 'NewInstance' has been explicitly marked deprecated
      here
                Local<Object> NewInstance(int argc, Local<Value> argv[]) const);
                              ^
1 warning generated.
  CXX(target) Release/obj.target/sha3/src/displayIntermediateValues.o
  CXX(target) Release/obj.target/sha3/src/KeccakF-1600-reference.o
  CXX(target) Release/obj.target/sha3/src/KeccakNISTInterface.o
  CXX(target) Release/obj.target/sha3/src/KeccakSponge.o
  SOLINK_MODULE(target) Release/sha3.node

> [email protected] install /Users/koruza/code/js-ipld-eth-star/node_modules/keccak
> prebuild-install || node-gyp rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."

Thanks!

daviddias avatar Jul 23 '17 18:07 daviddias

@kumavis ping

daviddias avatar Aug 25 '17 08:08 daviddias

@diasdavid This is set up so that you get the js implementation when targeting the browser, and c++ on node (with failover to js). So is there some error with the failover when targeting electron?

kumavis avatar Sep 17 '17 21:09 kumavis

echo "Keccak bindings compilation fail. Pure JS implementation will be used."

kumavis avatar Sep 17 '17 21:09 kumavis

I'm still investigating, but as far as I understand electron-rebuild is not super friendly to deps in Node.js that fail. It doesn't work well with the failover.

daviddias avatar Oct 18 '17 17:10 daviddias