Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#73382 - [signal-desktop] use system electron instead of bundling it yourself

Attached to Project: Community Packages
Opened by Mynacol (mynacol) - Monday, 17 January 2022, 00:29 GMT
Last edited by Andreas Radke (AndyRTR) - Monday, 17 January 2022, 06:12 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To kpcyrd (kpcyrd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 2
Private No

Details

Description:
Although signal-desktop is an electron application, it does not depend on electron. Instead, it bundles its own version.
To improve reusage of programs and libraries, signal-desktop should depend on the fitting system electron version, currently 16, therefore `electron16`.

As a side note, I noticed that the file tree of this package contains `app.asar` and `app.asar.unpacked/` (under `/usr/lib/signal-desktop/resources/`), hinting at duplicate data. And I believe `resources.pak` is not needed either.

After a short visit, I would kindly ask the maintainer of this package to review the package guidelines for electron applications again, https://wiki.archlinux.org/title/Electron_package_guidelines

With these changes I believe we can easily reduce the package size from ~320MB to ~120MB.

Additional info:
* package version: signal-desktop 5-28.0-1

Maybe see the `Required-By` tag on the arch package website for electron to get some ideas how other maintainers package their electron applications.
This task depends upon

Comment by Mynacol (mynacol) - Saturday, 29 January 2022, 15:00 GMT
Hey, I created a PoC-type PKGBUILD. I attached the diff.

I am not quite happy with the result, maybe you can improve upon it.

The main idea is that we only package the `app.asar`, but then `preload.js` is missing. That file has to be essentially `preload.bundle.js`, else other JS dependencies are missing. So I just symlinked that file after extraction of the asar (after electron-builder just packaged it...).

The next problem is the configuration. The default build process seems to include the development config which connects to the staging servers. So I include the production config in the "default" one (just using `production.json` is missing some parameters, namely `enableCI`). Then I disable automatic updates.

The build is running since some days on my computer. The client unfortunately has some other issues, which were partly fixed with version 5.29.1.
Comment by Alexandre Bouvier (doskoi) - Friday, 10 June 2022, 10:22 GMT

Loading...