Discussion: State of the snap (Snap Packaging)

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
Post Reply
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Discussion: State of the snap (Snap Packaging)

Post by ppd »

I have a few problems with FreeCAD's snap package (https://snapcraft.io/freecad) and would like to start a discussion on how to improve from here. Experience wise, I'm the author of SolveSpace's snap packaging (https://snapcraft.io/solvespace).
  1. Organization: The snap is not published by an organization account (i.e. "FreeCAD"), but by Jean-Marie Verdun (vejmarie). It should be transferred to such an account and vejmarie should then be added as a collaborator. Additionally, more than one person should have access to its administration interfaces to increase the bus factor.
  2. Development: I have not been able to find the packaging's sources. It goes (hopefully) without saying that this is far from ideal.
  3. Functionality: The snap does not display fonts for me (Ubuntu 20.04) and is thus non-functioning.
  4. Presentation: The store page has neither a proper description nor any pictures attached. The snap has no proper desktop-file set and is consequently not searchable in the user's desktop environment. All far from ideal.
  5. Packaging: The snap is not based on a current platform (core18 or soon core20) and does not employ best practice for desktop applications, e.g. using the kde-neon extension for an updated Qt and not having to bundle all Qt libraries. I couldn't test any further, for the reasons outlined above.
  6. Publishing: Currently, no nightly/daily/master builds are being published. The snap model with its channels would be very suited to publishing stable and experimental revisions at the same time.
I have sketched an implementation in my FreeCAD fork: https://github.com/ppd/FreeCAD/tree/snap/snap and it works well for me. Obviously, much can be cleaned up and improved. But for that we need a better structure and some healthy discourse.

I'm open for suggestions and criticism.
Last edited by Kunda1 on Tue May 26, 2020 6:01 pm, edited 3 times in total.
Reason: Augmented thread title for better clarity
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: State of the snap

Post by Kunda1 »

vejmarie wrote::bell:
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Discussion: State of the snap (Snap Packaging)

Post by triplus »

Hi @ppd

If i look at your proposed snapcraft.yaml file it in general looks good to me. The one thing that i slightly worry about is building all the (heavy) dependencies. As that likely takes a very long time? For stable builds that likely makes sense. As for more frequent builds, if we would have working snapcraft.yaml in place and i guess would would be building only FreeCAD, providing the latest snap package should likely become a possibility:

https://snapcraft.io/blog/we-are-changi ... thub-repos

P.S. One addition thing is the maintenance of the snapcraft.yaml on the long run.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Discussion: State of the snap (Snap Packaging)

Post by vocx »

ppd wrote: Tue May 26, 2020 1:04 pm I have a few problems with FreeCAD's snap package (https://snapcraft.io/freecad) and would like to start a discussion on how to improve from here. ...
Thanks for looking into this. Ultimately somebody needs to step in if they want to get things done.

I've never felt the need to use snaps since they appeared in Ubuntu, but that doesn't mean that they don't have benefits.

The current Debian/Ubuntu maintainer produces daily FreeCAD debian packages for Ubuntu, and the Conda maintainers do the same for AppImages, so the situation is good at the moment. Adding Snaps to the ecosystem would be good if somebody can put in the work to maintain them.

If you are able to, I suggest you document the process in the wiki, under packaging, so that more people can learn about it.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Discussion: State of the snap (Snap Packaging)

Post by ppd »

triplus wrote: Tue May 26, 2020 9:09 pm The one thing that i slightly worry about is building all the (heavy) dependencies.
Several possible solutions:
  1. Split each bigger dependency into its own snap and either stage them together, i.e. merge them at build-time, or link them at run-time via the content interface (https://snapcraft.io/docs/content-interface).
  2. Use what's available on the base in use. In this case: core18 = bionic. We would change to core20 at some point.
  3. Use the PPA as a source
triplus wrote: Tue May 26, 2020 9:09 pm P.S. One addition thing is the maintenance of the snapcraft.yaml on the long run.
That's the reason why I spoke about increasing the bus factor. If we keep the package as simple as possible and also document the processes thoroughly, the packaging should be quite stable and easy to update.
vocx wrote: Tue May 26, 2020 9:44 pm The current Debian/Ubuntu maintainer produces daily FreeCAD debian packages for Ubuntu, and the Conda maintainers do the same for AppImages, so the situation is good at the moment.
That's quite good indeed. However, I want to emphasize how much more accessible snaps are for novice users. They are just there in the software store on Ubuntu and no fiddling with PPAs or using outdated versions is required.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
kkremitzki
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Discussion: State of the snap (Snap Packaging)

Post by kkremitzki »

Hi ppd, thanks for your effort in improving the snap package.

I should have permissions to edit/etc the freecad snap as well as Jean-Marie, but I don't see any options on the snap page itself, the interface seems different from when I looked at it.

I agree re: the organizational account as owner of the snap. It would be nice if we could re-use https://launchpad.net/~freecad-maintainers

I am not sure where the sources for the snap are located.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Discussion: State of the snap (Snap Packaging)

Post by ppd »

kkremitzki wrote: Wed May 27, 2020 8:23 am I should have permissions to edit/etc the freecad snap as well as Jean-Marie, but I don't see any options on the snap page itself, the interface seems different from when I looked at it.
You should be able to edit the snap here: https://dashboard.snapcraft.io/snaps/freecad/
kkremitzki wrote: Wed May 27, 2020 8:23 am I agree re: the organizational account as owner of the snap. It would be nice if we could re-use https://launchpad.net/~freecad-maintainers
You can log into the Snap Store with any Ubuntu One account. I don't think a launchpad team is represented by one though. So I'd suggest creating a dummy account with the appropriate display name "FreeCAD" or "FreeCAD Maintainers".

And another thing I'd like to say: I'm not looking to compete with vejmarie's packaging, I just wanted to get in touch with him and the FreeCAD maintainers.
vejmarie's input is crucial, as he has the most experience with the particular difficulties and pain points regarding this snap.
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
kkremitzki
Veteran
Posts: 2509
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: Discussion: State of the snap (Snap Packaging)

Post by kkremitzki »

ppd wrote: Wed May 27, 2020 9:37 am
kkremitzki wrote: Wed May 27, 2020 8:23 am I should have permissions to edit/etc the freecad snap as well as Jean-Marie, but I don't see any options on the snap page itself, the interface seems different from when I looked at it.
You should be able to edit the snap here: https://dashboard.snapcraft.io/snaps/freecad/
Great, dashboard.snapcraft.io is what I was looking for, for some reason the "Developer account" link doesn't guide me towards there...

kkremitzki wrote: Wed May 27, 2020 8:23 am I agree re: the organizational account as owner of the snap. It would be nice if we could re-use https://launchpad.net/~freecad-maintainers
You can log into the Snap Store with any Ubuntu One account. I don't think a launchpad team is represented by one though. So I'd suggest creating a dummy account with the appropriate display name "FreeCAD" or "FreeCAD Maintainers".
Hmm, is there no formal way to have an organizational account? I don't really like the idea of shared credentials being passed around with snap publishing powers since snap has no way for end-users to turn off receiving updates AFAIK.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Discussion: State of the snap (Snap Packaging)

Post by ppd »

kkremitzki wrote: Wed May 27, 2020 10:55 am Hmm, is there no formal way to have an organizational account? I don't really like the idea of shared credentials being passed around with snap publishing powers since snap has no way for end-users to turn off receiving updates AFAIK.
The host account's credentials are not to be shared. You add individual collaborators to the snap, and they can act as admins. See https://dashboard.snapcraft.io/snaps/fr ... aboration/
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
User avatar
ppd
Posts: 108
Joined: Tue Feb 26, 2019 12:01 pm
Location: Munich, Germany

Re: Discussion: State of the snap (Snap Packaging)

Post by ppd »

An alternative, based on the PPA and without compiling all those external dependencies: https://github.com/ppd/FreeCAD/tree/snap-ppa/snap
Try FreeCAD from the Snap Store: Stable releases (in latest/stable) & daily builds (in latest/edge). Supports installing additional python packages via pip!
Image
Post Reply