electron-installer-snap icon indicating copy to clipboard operation
electron-installer-snap copied to clipboard

How to use this package in 2024?

Open Igloczek opened this issue 1 year ago • 20 comments

inb4 sorry for not following the issue template, but it's not necessarily an issue, just discussion

How to use this package in 2024?

  • It doesn't work with Snapcraft v8, that was released in December 2023
  • It doesn't produce a snap package that would be accepted by the Snap Store, because of sandbox issues found errors in file output: unusual mode 'rwsr-xr-x' for entry './project-name/chrome-sandbox' security-snap-v2_squashfs_files
  • There are no docs or guides stating that user is required to do anything besides installing the package, providing paths and running it, optionally customizing the Snapcraft config, but since there are no recommendations, I assume that clean Electron app, doesn't need any customization to work properly

I see a bunch of issues and PRs related to topic of sandboxing issues, it seems to be merged, but it doesn't work (at lest now), an no one ever in the comments confirmed it did, not even a single thumb up.

Is topic publishing app for Linux that niche, that no one care whether it works or not?

Is there some other user friendly (which means I don't have to get master degree in snapcraft.yaml to make a snap) way to publish Electron app as a Snap package or do I really have to do it like VS Code and handle everything manually, since no one maintains it anymore?

Igloczek avatar May 07 '24 05:05 Igloczek

👋 Thanks for opening your first issue here! If you have a question about using electron-installer-snap, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

welcome[bot] avatar May 07 '24 05:05 welcome[bot]

@Igloczek I am novice in snapcraft and electron snap here.

I tried very hard to make it work with electronforge, by patching a lot a files. I finally handled to make the snap creation file works, but I'm stuck when publishing with the following error too:

Issues while processing snap:
- found errors in file output: unusual mode 'rwsr-xr-x' for entry './tiana-tables/chrome-sandbox'

I saw that https://github.com/electron-userland/electron-installer-snap/pull/141 should have resolved this, and in fact the command output does contain the --no-sandbox

command: bin/electron-launch $SNAP/tiana-tables/Tiana Tables --no-sandbox

(in fact that is the same fix that vscode did in their code base).

But the file is still present in the snap package, and with the weird mode

image

I'm stuck too here if you ever find a way out !

jdeniau avatar Oct 15 '24 23:10 jdeniau

@Igloczek I saw that you did 👍 Does it means that you are still stuck too or did you find a way out of these?

jdeniau avatar Oct 16 '24 06:10 jdeniau

@jdeniau Stuck, just accepted the fact it's broken and probably never be fixed, because no one care.

Igloczek avatar Oct 16 '24 07:10 Igloczek

Did you publish using snapcraft.yaml file or did you drop snapcraft support?

jdeniau avatar Oct 16 '24 07:10 jdeniau

Shipping only .zip for linux users. Ain't great, but works.

Igloczek avatar Oct 16 '24 07:10 Igloczek

After investigating a little bit, it seems that vscode is publish behind the "classic" confinement.

If you try to install it without it, you get the following error talking about security sandbox

sudo snap install code
error: This revision of snap "code" was published using classic confinement and thus may
       perform arbitrary system changes outside of the security sandbox that snaps are
       usually confined to, which may put your system at risk.

       If you understand and want to proceed repeat the command including --classic.

I will try to make it work with the classic confinement too to see if I manage to do something ¯_(ツ)_/¯

jdeniau avatar Oct 16 '24 09:10 jdeniau

i was trying the classic too, and it wasn't working either, but don't remember what was the exact reason

Igloczek avatar Oct 16 '24 09:10 Igloczek

OK with the classic, there is an issue with desktop-gtk3 as the snapcraft are not the same classic.yaml an strict.yaml.

But I did manage to make the "unusual mode 'rwsr-xr-x' for entry" disappear following this message on snapcraft forums 🎉

cd  out/make/snap/x64/
unsquashfs <appFile>_amd64.snap
chmod 755 ./squashfs-root/<appName>/chrome-sandbox
snapcraft pack ./squashfs-root
snapcraft push --release=latest/edge --verbose <filePath>.snap

It is now available here : https://snapcraft.io/tiana-tables

I still have issues though I need to handle :

  • the command in the snapcraft file is "Tiana Tables", but the file is named "tiana-tables"
  • I an on a Windows WSL and not on a proper Linux, so there is a lot of library missing, I will install a VM to test that

jdeniau avatar Oct 16 '24 09:10 jdeniau

are you still using forge and this package or just calling Snapcraft directly using handcrafted snapcraft.conf?

i do have a full Ubuntu 24.10 install, but as a VM inside Proxmox, and i'm facing bunch of issues when using this package

  • firstly it works only with Snapcraft 7.x, because there is hardcoded core18 (Ubuntu 18.04)
  • then it tries to use Multipass, which at least in my case doesn't work either (some weird errors related to QEMU + last log says that some directory is missing)
  • after switching to LXD (snap set snapcraft provider=lxd) it seems to be actually building some stuff, but then it fails because can't determine the source-type of the /out directory content provided as a source param

So right I can't even get to the place where I have any sort of Snap package, even a broken one, just on my local drive 😬

Igloczek avatar Oct 16 '24 13:10 Igloczek

Any news?

mahnunchik avatar Jan 23 '25 23:01 mahnunchik

@Igloczek I tried a lot of things, but did put snapcraft aside for now. Even with snapcraft directly is not really working.

@mahnunchik not really on my side

jdeniau avatar Feb 02 '25 20:02 jdeniau

@jdeniau so you just ship ZIPs like me, or you go with something else like a Flatpak?

Igloczek avatar Feb 03 '25 14:02 Igloczek

For now I do ship a rpm and Deb files with no auto upgrade for Linux

jdeniau avatar Feb 03 '25 15:02 jdeniau

@Igloczek Can you please explain further what you meant by ship ZIPs?

I am not really particular about the format I ship, whatever supports auto-update without relying on electron-builder. So my question really is that is there a way I can ship ZIPs and my Linux users will get auto-updates?

damms005 avatar Mar 30 '25 12:03 damms005

@damms005 https://www.electronforge.io/config/makers/zip https://www.electronjs.org/docs/latest/api/auto-updater

auto-updates doesn't work on Linux, unless you put the app to some store/package manager that will add this feature on their end

Igloczek avatar Mar 30 '25 12:03 Igloczek

Really don't mind going that route, but couldn't figure a way to automate it. Do you have recommendations for achieving this?

damms005 avatar Mar 30 '25 13:03 damms005

https://www.electronforge.io/config/makers/flatpak

Igloczek avatar Mar 30 '25 13:03 Igloczek

I checked that out already but unsure how to manage updates. The page you linked above referenced the Flatpack docs for more info. The relevant one for me is the Ubuntu option and it referenced some Flathub without any details on how to push updates there. I was hoping you can help me with that?

damms005 avatar Mar 30 '25 13:03 damms005

bro... just put a minimal amount of effort and read the docs before spamming with questions in completely unrelated github issue

https://docs.flatpak.org/en/latest/

Igloczek avatar Mar 30 '25 13:03 Igloczek

@malept @MarshallOfSound is there any chance of this receiving some updates to work?

RobbieTheWagner avatar Nov 04 '25 17:11 RobbieTheWagner