signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.65k stars 2.67k forks source link

yarn install fails for signal-client #5320

Closed cryptomilk closed 3 years ago

cryptomilk commented 3 years ago

Bug Description

Since 5.3.0 yarn install fails for me, as node-gyp rebuild can't find binding.gyp in node_modules/@signalapp/signal-client

Directory: /tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/node_modules/@signalapp/signal-client                                                                                [132/96140]
Output:                                                                                                                                                                                      
gyp info it worked if it ends with ok                                                                                                                                                        
gyp info using node-gyp@8.0.0                  
gyp info using node@15.14.0 | linux | x64                                                     
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"                  
gyp http GET https://nodejs.org/download/release/v15.14.0/node-v15.14.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v15.14.0/node-v15.14.0-headers.tar.gz                                                                                                       
gyp http GET https://nodejs.org/download/release/v15.14.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v15.14.0/SHASUMS256.txt            
gyp info spawn /usr/bin/python3                                                               
gyp info spawn args [                                                                         
gyp info spawn args   '/home/asn/.config/yarn/global/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   '/tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/node_modules/@signalapp/signal-client/build/config.gypi',
gyp info spawn args   '-I',                                                                   
gyp info spawn args   '/home/asn/.config/yarn/global/node_modules/node-gyp/addon.gypi',       
gyp info spawn args   '-I',                                                                   
gyp info spawn args   '/tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/vendor/cache/node-gyp/15.14.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=/tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/vendor/cache/node-gyp/15.14.0',
gyp info spawn args   '-Dnode_gyp_dir=/home/asn/.config/yarn/global/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/vendor/cache/node-gyp/15.14.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/node_modules/@signalapp/signal-client',
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: binding.gyp not found (cwd: /tmp/signal-desktop-yFaJEkLA/Signal-Desktop-5.4.0/node_modules/@signalapp/signal-client) while trying to load binding.gyp
gyp ERR! configure error

When the npm install is finished, it runs node-gyp rebuild which fails for signal-client.

Steps to Reproduce

  1. Run yarn install
EvanHahn-Signal commented 3 years ago

I'm not able to reproduce this on macOS, Windows, or Ubuntu. What operating system are you using? Did you follow all of the instructions in CONTRIBUTING.md?

cryptomilk commented 3 years ago

I'm on openSUSE Tumbleweed.

To cache all node_modules for a reproducible build without internet access, I wrote

https://build.opensuse.org/package/view_file/network:im:signal/signal-desktop/prepare_vendor.sh?expand=1

EvanHahn-Signal commented 3 years ago

We don't officially support openSUSE, so it's possible something funny is happening there.

I perused your script and it looks reasonable, though it does look like you're changing the source code a bit. For example, you're changing the Node version requirement in package.json, and rewriting our node-gyp dependency.

Does the error persist if you rm -rf node_modules && yarn?

cryptomilk commented 3 years ago

I know what the issue is:

export npm_config_build_from_source=true

I want to build everything from source, however signal-client is using prebuilds. And rebuilding the source doesn't work, as it isn't provided :-(

Interestingly it works fine for ringrtc and zkgroup ...

cryptomilk commented 3 years ago

Also it worked with signal-desktop 5.2.0 ... hmm

EvanHahn-Signal commented 3 years ago

You may be able to find the source for Signal Client at signalapp/libsignal-client.

cryptomilk commented 3 years ago

Yeah, the problem with that is that it needs unstable rust features :-(

However thanks for your help!

xloem commented 7 months ago

@cryptomilk , do you know how I would install Signal Desktop on RHEL7 with glibc 217? I have node 20 already. But the binary libsignal-client is linked to too new a glibc. I see you made a package repository, but it seems only for newer systems.