Bug 1224133 - element-desktop: garbage in app.asar
Summary: element-desktop: garbage in app.asar
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: X11 Applications (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Bruno Pitrus
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-10 16:49 UTC by Bruno Pitrus
Modified: 2024-05-29 13:21 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bruno Pitrus 2024-05-10 16:49:30 UTC
app.asar contains files that should not be shipped (source codes etc.)

In particular the directories `npm-packages-offline-cache` and `.hak` take up several hundred MB.

I suggest not using asar and instead shipping the app unpacked. Then many such problems would be detected by rpmlint. (Would help build reproducibility, too.)
Comment 1 sergio Basto 2024-05-10 20:22:49 UTC
I build yours package on Fedora copr on https://copr.fedorainfracloud.org/coprs/sergiomb/electrons/

Fedora  moved (almost) all communications to matrix 
so I use element-desktop on daily basis

I notice the package element-desktop has grown and element-desktop-1.11.65-1.1.x86_64.rpm have 235M and unpacked have 929M .

I had fix this and I like to know what is the best way to send you the patches 

you can check it out https://copr-dist-git.fedorainfracloud.org/cgit/sergiomb/electrons/element-desktop.git/tree/
Comment 2 Dominik Heidler 2024-05-13 08:42:46 UTC
If you are familiar with osc, you could

osc branch devel:languages:nodejs/element-desktop
osc checkout <BRANCH LOCATION>
cd <BRANCH LOCATION>
<MAKE YOUR CHANGES>
osc add <IF YOU ADDED FILES>
osc rm <IF YOU REMOVED FILES>
osc checkin
osc submitrequest

to make a submit request on build.opensuse.org.
The account is the same as your bugzilla account.

Or you could attach the patches to this bug.
Comment 3 sergio Basto 2024-05-14 21:58:01 UTC
created request id 1174089

for element-web
Comment 4 sergio Basto 2024-05-14 22:17:54 UTC
created request id 1174092
for element-desktop 


I sent the all package , I don't know if you want split that in various requests  

element-web :

move element-web data to {_datadir}/element/webapp/

jitsi_external_api.min.js (removed) is already provide by element-web
element-logo.svg is provide by element-web not eleement-desktop , but I didn't found if is used
config.sample.json is in place ( _datadir/element/webapp/ ) no need to move or be copied


element-desktop: 

use electron-builder as element-desktop pre 1.11.54

Drop BuildRequires: element-web
LD_PRELOAD=/usr/lib64/libsqlcipher.so to fix private messages search (https://github.com/element-hq/element-desktop/issues/904)
Comment 5 sergio Basto 2024-05-15 10:51:13 UTC
BTW, to build on Fedora we need :

+BuildRequires:  nodejs
 BuildRequires:  nodejs-electron-devel
-BuildRequires:  yarn
+BuildRequires:  yarnpkg
 BuildRequires:  rust
 BuildRequires:  cargo
 BuildRequires:  python3
+BuildRequires:  python3-setuptools
Comment 6 Bruno Pitrus 2024-05-15 19:47:52 UTC
(In reply to sergio Basto from comment #5)
> BTW, to build on Fedora we need :

I'm doing a genereal cleanup of this package (thanks to macros i've introduced to nodejs-electron-devel) and was going to fix Fedora builds anyway.
Comment 7 sergio Basto 2024-05-26 20:28:32 UTC
completely broken changes 


+BuildRequires:  element-web = %{version}  , wrong

fedora got yarnpkg-1.22.21-2.fc39.x86_64

-  %{_isa} should have "?" %{?_isa} 

etc 

support to i686 ?!?
Comment 8 sergio Basto 2024-05-26 20:31:28 UTC
app-builder package does not exist in Fedora
Comment 9 Bruno Pitrus 2024-05-26 20:34:48 UTC
> BuildRequires:  element-web = %{version}

It's needed only because element-web provides some directories we install into. We don't use element-web during build otherwise.

> -  %{_isa} should have "?" %{?_isa} 

It does not really need it. All versions of RPM without the _isa macro have been unsupported long ago.


[Also closing this since https://build.opensuse.org/request/show/1175898 got accepted into factory]
Comment 10 Bruno Pitrus 2024-05-26 20:36:05 UTC
(In reply to sergio Basto from comment #8)
> app-builder package does not exist in Fedora

This package should work

https://build.opensuse.org/package/show/devel:languages:nodejs/app-builder
Comment 11 sergio Basto 2024-05-29 13:21:04 UTC
Fedora also don't have cargo-vendor-filterer, neither cargo-auditable 
and cargo-packaging conflicts with rust-srpm-macros or something like that . 

fedora element-desktop-1.11.67-2.fc39.x86_64.rpm size is now 3.1M while src.rpm is 212M 

you check it out here: https://build.opensuse.org/package/rdiff/home:sergiomb/element-desktop?linkrev=base&rev=3

but I can't find a way to run `yarn run hak build` offline , it give me an error 

I'd like that Suse and Fedora goes in same way , I see that Rust / cargo  packaging it is different , and IMO that is bad , because if we use the same structure we may help each other . (virtualbox is an example where I'm evolved) 

I'm proven packager on Fedora , I can fix any package if you need any thing from Fedora let me know