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...)
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 »

@vejmarie Thanks for your work. I was occupied in the last weeks, but I will catch up on your updates and comment on your suggestions.
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 »

vejmarie wrote: Sat Jun 20, 2020 11:17 pm I can set it up without any issue, if somebody could explain me how to setup such organization.
I think you just create an account with the name FreeCAD or similar. Then you request a transfer of ownership from your personal account to this new account on the snapcraft forum (https://forum.snapcraft.io/). Finally, you add your current account as a collaborator here: https://dashboard.snapcraft.io/snaps/fr ... aboration/

vejmarie wrote: Sat Jun 20, 2020 11:17 pm It is hidden into FreeCAD source tree.
Good to see. But I think the separate implementation in the traditional sense (snap/snapcraft.yaml) makes the most sense. Especially if we want to use upstream's build tooling.
vejmarie wrote: Sat Jun 20, 2020 11:17 pm That is weird. Which desktop environment do you use ? The snap is currently built with gnome in mind. Probably a mistacke from me
I use GNOME. I believe it's an incompatibility of the font cache produced by different versions of fontconfig & freetype on host vs. snap.
vejmarie wrote: Sat Jun 20, 2020 11:17 pm Last but not least, I made it for a month at the beginning and people were complaining about the download implication it had for the one using a daily built.
Snaps are distributed as binary diffs after the first download. So it's not really that huge of a data transfer.

vejmarie wrote: I do have a use case which prohibits me to switch the snap to core18, as I am running it into a docker environment in server mode for the CADCloud project. core18 is not able to run in docker properly (or I never had been able to make it work properly).
I see. That's rather unfortunate. The vast majority of users does not have this requirement and would benefit greatly from a more modern (gnome extension) base.

There is the possibility to use snaps in ephemeral LXD containers, which might be a possible alternative to docker/podman.
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
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

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

Post by vejmarie »

Hi,

I just updated the snap with PPD guidance. You can find the build script here
https://github.com/CADCloud/CADCloud/tr ... er/freecad

It doesn't include everything that was recommended, but it is getting closer. 0.18.4 and 0.19 beta shall both works from Xenial to latest ubuntu. The font bug was related to a newer version of fontconfig which was not compatible with the one used to build the snap originally. I fixed that bug within the launch script (one environment variable was missing).

The build works like this:

- I recompile, VTK, OCCT, Netgen, FreeCAD , pivy from scrath. It is now supporting python 3 and QT5 with both version. After the compilation, a deb package of the result is created.
- The snap process works only with Deb packages and is not involved into the compilation process.

Everything is built into a VM which is based on vagrant and virtualbox as a backend.

The majority of the snap users are still using Xenial (about 60%), which explain why I am still building from it.

vejmarie
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

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

Post by vejmarie »

ppd wrote: Wed Jul 01, 2020 3:17 pm
vejmarie wrote: Sat Jun 20, 2020 11:17 pm I can set it up without any issue, if somebody could explain me how to setup such organization.
I think you just create an account with the name FreeCAD or similar. Then you request a transfer of ownership from your personal account to this new account on the snapcraft forum (https://forum.snapcraft.io/). Finally, you add your current account as a collaborator here: https://dashboard.snapcraft.io/snaps/fr ... aboration/
My snap account is dedicated to FreeCAD, and I added kkrimitzi as a collaborator. I can add you without any issues !
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 »

vejmarie wrote: Wed Jul 01, 2020 11:19 pm My snap account is dedicated to FreeCAD, and I added kkrimitzi as a collaborator. I can add you without any issues !
Well, there's no need if you have it under control. My main point regarding this was recognizability for the user and the proper branding. If it represents FreeCAD in a (semi-)official way, it should be published under "FreeCAD".
vejmarie wrote: Wed Jul 01, 2020 11:18 pm The majority of the snap users are still using Xenial (about 60%), which explain why I am still building from it.
The snap is supposed to decouple (as far as possible in reality) the host OS and the application environment. So I'm curious what benefits relying on a very old base provides in this case. I'm also amazed about your user distribution. In my other desktop snaps, 18.04, 20.04 and 19.10 maintain a very commanding lead over 16.04 regarding user distribution. Very interesting.

Anyway, I tested your latest update and found my font issue resolved. It also shows an icon/proper desktop entry, so that's good too. :)
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
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

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

Post by vejmarie »

Thanks for your feedback ! If you want to give it a try, I liked to find a way to integrate the documentation. I have seen your remark on how to do it, but I am not sure to have fully understood how to associate a snap with another one.
I avoided to pack the documentation, mostly because I found it outdated in many places (at least the one generated at build time).

There is also something frustrating with snap, bug report is not that easy for end users. I am receiving emails, which is ok, but might be better if they could setup an end user "forum" approach.
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 »

vejmarie wrote: Thu Jul 02, 2020 12:22 pm If you want to give it a try, I liked to find a way to integrate the documentation. I have seen your remark on how to do it, but I am not sure to have fully understood how to associate a snap with another one.
I avoided to pack the documentation, mostly because I found it outdated in many places (at least the one generated at build time).
A rather simple way to do it: https://forum.snapcraft.io/t/the-content-interface/1074

You'd need one snap "freecad-doc" that provides a slot like so:

Code: Select all

slots:
  freecad-doc:
    interface: content
    content: freecad-doc
    read: [$SNAP/doc]
In this case, it will expose files in $SNAP/doc under the slot "freecad-doc". So you dump the doc files into $SNAP/doc.

Then you consume it in freecad:

Code: Select all

plugs:
  freecad-doc:
    interface: content
    target: $SNAP/the/path/where/freecad/expects/its/doc
If you add "default-provider: freecad-doc" to the plug definition, snapd automatically downloads "freecad-doc" when you install/refresh freecad. But that's probably not what you want.

It's also a good idea to version such dependencies, so you don't end up with 0.19 docs attached to 0.18 snaps etc.
E.g. "freecad-doc-0-19" as snap name and slot name. Maybe even add the build env if necessary (e.g. because of changing bases later on or including executables): "freecad-doc-0-19-core".
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
Ivo Cavalcante
Posts: 3
Joined: Wed Jun 24, 2020 12:46 am

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

Post by Ivo Cavalcante »

vejmarie wrote: Sun Jun 28, 2020 12:38 am Hello Ivo,

Welcome to FreeCAD forum. Can you give a try to the latest build I made ?

vejmarie
Hi vejmarie,

Tested beta channel (0.19), working great so far. Great job! (and now we have a dash launcher!)



Thanks!!
JulianStirling
Posts: 61
Joined: Sun May 29, 2016 2:19 pm
Contact:

Addon manager not working in v0.19 beta snap

Post by JulianStirling »

I have installed the beta of v0.19 as I wanted to play with Assembly 4. I am on Kubuntu 20.04 so I can't the freecad-daily PPA. So I have installed with snap.

When I open the add-on manager I can see all the packages, but if I click to "Install selected" the program hangs at "Cloning module". There is no output in the terminal.

A clue as to what it might be is if I go to the macro tab in the addon manager it tells me:
"Something went wrong with the Git Macro Retrieval, possibly the Git executable is not in the path"

Git is definitely on the PATH, I use it every day from the terminal. Perhaps this is a snap sandboxing issue? I don't really understand snap, I have tried to avoid the things in the past, but it is becoming more difficult.



OS: Ubuntu Core 16 (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21777 (Git)
Build type: Unknown
Branch: master
Hash: 478823b90967a9b76796c64f74b8e3a5440150fa
Python version: 3.5.2
Qt version: 5.5.1
Coin version: 4.0.0a
OCC version: 7.4.0
Locale: English/UnitedStates (en_US)

Mod Edit: merged this thread from another.
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: Thu Jul 02, 2020 2:08 pm ping
vejmarie wrote: Thu Jul 02, 2020 12:22 pm ping
I checked the Snapcraft store and it seems that FreeCAD is listed as LGPL3. It should be LGPL2. The difference is important.

https://snapcraft.io/freecad
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.
Post Reply