signalapp / Signal-Desktop

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

Installing signal-desktop from yarn offline cache yields missing dependencies #6886

Closed skykanin closed 18 hours ago

skykanin commented 1 month ago

Using a supported version?

Overall summary

I'm attempting to package the signal desktop app for the nix package manager on linux. In that context I need to be able to install signal-desktop from yarn using an offline cache since you don't have internet access when building a package through nix. However, when I do this the resulting binary crashes with an exception Error: Cannot find module '../../build/linux/libringrtc-x64.node'. I can see from the build result that @signalapp/ringrtc is missing from the app.asar archive that gets built even though the package exists in the offline cache. However when building signal-desktop without an offline cache @signalapp/ringrtc isn't missing from app.asar.

Steps to reproduce

$ git clone https://github.com/signalapp/Signal-Desktop
$ cd Signal-Desktop
$ mkdir cache
$ yarn config --offline set yarn-offline-mirror cache
$ yarn install
$ rm -rf node_modules
$ yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts
$ # To run the next script with --offline remove 'build:dns-fallback' from 'generate' script in the package.json file
$ yarn --offline run generate
$ yarn --offline run build:esbuild:prod
$ yarn --offline run build:release \
      -- --linux dir \
      --config.npmRebuild=false
$ ls -l release/linux-unpacked/resources/app.asar.unpacked/node_modules/@signalapp # missing deps
drwxr-xr-x 3 skykanin users 4096 May 19 14:21 libsignal-client
$ ./release/linux-unpacked/signal-desktop # crashes with error linked below

Expected result

Expected ./release/linux-unpacked/signal-desktop to run without crashing.

Actual result

signal-desktop crashes with Error: Cannot find module '../../build/linux/libringrtc-x64.node'

Signal version

7.5.1

Operating system

NixOS 24.05.20240427.58a1abd (Uakari): "x86_64-linux"

ayumi-signal commented 1 month ago

Hi, sorry this is happening for you and thanks for the issue. We don't have a good workflow for this condition so it will be hard to support but we'll do our best.

Installing libringrtc might require a connection -- can you check the output of some of commands (maybe yarn install) to see if there's any errors related to downloading?

skykanin commented 1 month ago

Hi, sorry this is happening for you and thanks for the issue. We don't have a good workflow for this condition so it will be hard to support but we'll do our best.

Installing libringrtc might require a connection -- can you check the output of some of commands (maybe yarn install) to see if there's any errors related to downloading?

yes, I do see an error when running yarn install --offline, I thought it was unrelated, but maybe it's not. I'm not super familiar with the electron toolchain. I would've thought libringrtc is just installed like any other npm package, but maybe that's not the case?

brjsp commented 1 day ago

Yarn offline cache is hopelessly broken since it makes it impossible to patch dependencies.

You can start with the vendor script we use at openSUSE to see how it can be done.

scottnonnenberg-signal commented 18 hours ago

I'm gonna close this, as it's not a bug in the product itself, or even a goal of our development workflows. Feel free to continue talking about it here or in the forums: https://community.signalusers.org/c/beta-feedback/25