signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.52k stars 410 forks source link

node: binding.gyp, build_node_bridge.py not included in npm package #464

Closed selfisekai closed 2 years ago

selfisekai commented 2 years ago

makes module unusable in case no prebuild is usable, like this:

npm ERR! code 1
npm ERR! path /home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/@signalapp/libsignal-client
npm ERR! command failed
npm ERR! command sh -c node-gyp-build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.0.0
npm ERR! gyp info using node@16.15.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.10.5 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/@signalapp/libsignal-client/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/home/lauren/.cache/node-gyp/16.15.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/home/lauren/.cache/node-gyp/16.15.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/home/lauren/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/@signalapp/libsignal-client',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: binding.gyp not found (cwd: /home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/@signalapp/libsignal-client) while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.48-0-lts
npm ERR! gyp ERR! command "/usr/bin/node" "/home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/lauren/aports/testing/signal-desktop/src/Signal-Desktop-5.46.0/node_modules/@signalapp/libsignal-client
npm ERR! gyp ERR! node -v v16.15.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
jrose-signal commented 2 years ago

The Rust source also isn't included in the NPM package, and indeed it would be tricky to do so because it's located in a sibling directory. (And having the package.json not be at the root of the repository was a deliberate choice to improve the use site.)

I think if you want to use this library for a platform other than the supported ones (where prebuilds are provided) you should depend on the repository directly rather than the NPM package.