Ubuntu snap: A quick try

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Post by triplus »

I tested this and first i had to enable Pre-released updates (xenial-proposed) archive. After i had to install snapd. This step i guess will go away over time once this part is made default.

After i followed your instructions. Basically issuing:

Code: Select all

sudo snap install freecad
snap connect freecad:home ubuntu-core:home
snap connect freecad:locale-control ubuntu-core:locale-control
/snap/bin/freecad.FreeCAD
Did the job and if i understand correctly in the future this could be further simplified and issuing:

Code: Select all

sudo snap install freecad
Or instead searching for the FreeCAD package in software center and installing it would do. As for the size of the package (200MB) i wonder if next update will decrease the download size as i guess delta updates are available for snap packages. But i am not sure how exactly this works and if there will be any actual size reduction.

As for some issues i noticed:
  • FreeCAD doesn't have default GNOME look and feel. Good thing we have Stylesheets available by default!
  • FreeCAD launcher isn't added. I guess this should be possible in the future?
  • Desktop integration like file association, file icon, thumbnails support... isn't available ATM.
  • Config location can be found in home folder as "snap" folder is created and in it .FreeCAD folder can be found. Settings therefore do persist!
  • I could create Mod folder and for testing purpose i installed TabBar module successfully. There is small issue i would need to investigate as workbench icons are not found. But overall the module works correctly.
  • I noticed when selecting Plot module it tries to check for matplotlib in a standard file system location but permission denied is returned. Probably matplotlib would need to be added to snap package for such use case?
Therefore i guess this could work out and some things could be further ironed out in the future. That is having FreeCAD with all up to date dependencies available in "software center". What i do imagine is maintaining such package in the future will take a lot of effort and knowledge.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Post by triplus »

There is another momentum going on ATM. I was a bit disappointed when FreeCAD 0.16 was released and until today i didn't see any news about that. What you did is you basically packed a full-fledged CAD application in a snap package and got official approval. I feel that this achievement won't be superseded for a while and hopefully this will get some attention in "the media".

As for example "note application" gets packed as snap package and i read about that on random news sites. Hard to imagine your work will go by unnoticed. ;)
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Ubuntu snap: A quick try

Post by Jee-Bee »

triplus wrote:I was a bit disappointed when FreeCAD 0.16 was released and until today i didn't see any news about that.
I can imagine you're feeling but i can also understand even our own mainpage don't tell there is a new version. on the install/compile topic removed new verion 0.15 a few weeks back.

A bit more information on this place should help
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Post by vejmarie »

triplus wrote:I tested this and first i had to enable Pre-released updates (xenial-proposed) archive. After i had to install snapd. This step i guess will go away over time once this part is made default.

After i followed your instructions. Basically issuing:

Code: Select all

sudo snap install freecad
snap connect freecad:home ubuntu-core:home
snap connect freecad:locale-control ubuntu-core:locale-control
/snap/bin/freecad.FreeCAD
Did the job and if i understand correctly in the future this could be further simplified and issuing:

Code: Select all

sudo snap install freecad
Or instead searching for the FreeCAD package in software center and installing it would do. As for the size of the package (200MB) i wonder if next update will decrease the download size as i guess delta updates are available for snap packages. But i am not sure how exactly this works and if there will be any actual size reduction.

As for some issues i noticed:
  • FreeCAD doesn't have default GNOME look and feel. Good thing we have Stylesheets available by default!
  • FreeCAD launcher isn't added. I guess this should be possible in the future?
  • Desktop integration like file association, file icon, thumbnails support... isn't available ATM.
  • Config location can be found in home folder as "snap" folder is created and in it .FreeCAD folder can be found. Settings therefore do persist!
  • I could create Mod folder and for testing purpose i installed TabBar module successfully. There is small issue i would need to investigate as workbench icons are not found. But overall the module works correctly.
  • I noticed when selecting Plot module it tries to check for matplotlib in a standard file system location but permission denied is returned. Probably matplotlib would need to be added to snap package for such use case?
Therefore i guess this could work out and some things could be further ironed out in the future. That is having FreeCAD with all up to date dependencies available in "software center". What i do imagine is maintaining such package in the future will take a lot of effort and knowledge.
Hi Triplus, thanks a lot for the report and the try !. I am not so pessimistic on the maintenance of the package, I agree that it needs a lot of knowledge, but this is doable, in the end I have been able to make the first one. I am trying to tweak a few things if you want help and I will probably insert CalculiX into the package plus some additionnal "unsupported" workbench which are very usefull finding a way to mention that they are not official one (like metal sheet and Assembly2). I am working on the GNOME look and feel, it doesn't have it because I do not know what is needed to be added to be supported, but I will find if some people could give me some help I will really really appreciate ! If fixed today some GSettings issues and some few locales, this is the last issue I have to fix !
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Post by triplus »

vejmarie wrote:I am working on the GNOME look and feel, it doesn't have it because I do not know what is needed to be added to be supported, but I will find if some people could give me some help I will really really appreciate ! If fixed today some GSettings issues and some few locales, this is the last issue I have to fix !
It looks like you can't do much about it for now:

https://bugs.launchpad.net/ubuntu/+sour ... ug/1585332

The same situation can be observed with for example fonts... But as we have 6 high quality themes available by default this is i guess sufficient solution for now. Once the support for snap packages (to use system themes) will be made available the problem will be resolved.
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Post by vejmarie »

triplus wrote:
vejmarie wrote:I am working on the GNOME look and feel, it doesn't have it because I do not know what is needed to be added to be supported, but I will find if some people could give me some help I will really really appreciate ! If fixed today some GSettings issues and some few locales, this is the last issue I have to fix !
It looks like you can't do much about it for now:

https://bugs.launchpad.net/ubuntu/+sour ... ug/1585332

The same situation can be observed with for example fonts... But as we have 6 high quality themes available by default this is i guess sufficient solution for now. Once the support for snap packages (to use system themes) will be made available the problem will be resolved.
Yes I have seen that. I am using freeCAD currently to try to help the snap developers to fix this issue. Apparmor is a "funny" things to configure, without speaking about seccomp. I will stop probably the exercise by the end of the week-end would like to get back on other issues.
By the way I do not understand why matplotlib is not properly configured and doesn't read the environment variable I am setting into the snap that is another issue to address with snap
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Ubuntu snap: A quick try

Post by jmaustpc »

vejmarie wrote:plus some additionnal "unsupported" workbench which are very usefull finding a way to mention that they are not official one (like metal sheet and Assembly2). I
Not a good idea, its best to leave that to one of the plugin loaders etc. which are cross platform. You could package them independently but if I understand snap properly then it might not be able to handle that. I have big doubts about snap, for starters you are talking about a daily PPA that has a substantially larger download. 200mb is a lot if you do it regularly particularly on any sort of limited Internet connection.

FreeCAD should be distributed just as plain official FreeCAD, you will also have to deal with license complications if you start adding some 3rd party code. You will also likely confuse some users over what is FreeCAD and what is not.

With the current package manager system, you could add 3rd party wb as it's own package, but as this would be only functional on Ubuntu, it seems to be a pointless waste of effort when compared to a cross platform plugin loader type approach.

Snap in general seems to me to have some use cases where it could have advantages but I didn't see it being good complete replacement for the current packaging system and I suspect it will fail to be widely accepted....but time will tell.
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Post by vejmarie »

jmaustpc wrote:
vejmarie wrote:plus some additionnal "unsupported" workbench which are very usefull finding a way to mention that they are not official one (like metal sheet and Assembly2). I
Not a good idea, its best to leave that to one of the plugin loaders etc. which are cross platform. You could package them independently but if I understand snap properly then it might not be able to handle that. I have big doubts about snap, for starters you are talking about a daily PPA that has a substantially larger download. 200mb is a lot if you do it regularly particularly on any sort of limited Internet connection.

FreeCAD should be distributed just as plain official FreeCAD, you will also have to deal with license complications if you start adding some 3rd party code. You will also likely confuse some users over what is FreeCAD and what is not.

With the current package manager system, you could add 3rd party wb as it's own package, but as this would be only functional on Ubuntu, it seems to be a pointless waste of effort when compared to a cross platform plugin loader type approach.

Snap in general seems to me to have some use cases where it could have advantages but I didn't see it being good complete replacement for the current packaging system and I suspect it will fail to be widely accepted....but time will tell.
Hi, I have made some test with some of my colleagues who are mechanical engineers and not IT engineers, they never had been successfull at properly install a plugin on FreeCAD, but are really successfull at using it. Including them is a pain I agree, and the licensing issue is a real one that is one you can do it only on a step by step approach. Regarding the download, only differential download are performed between releases.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Post by triplus »

vejmarie wrote:Apparmor is a "funny" things to configure, without speaking about seccomp.
Yes that is correct. ;)
I will stop probably the exercise by the end of the week-end would like to get back on other issues.
Yes i think that makes sense as you provided working snap package for FreeCAD and the only snap alternatives for now are note and clock or calculator applications. :)

Therefore Ubuntu 16.04+ users have now an option to install and try FreeCAD with latest OCCT directly from software center. That is a great thing in the end. I am not sure about daily builds. Maybe latest production release would make more sense for now?
By the way I do not understand why matplotlib is not properly configured and doesn't read the environment variable I am setting into the snap that is another issue to address with snap
To me it looked like FreeCAD tried to use it but permission issue prevented that. Don't worry about it too much for now as i don't actually use this functionality and i do imagine most FreeCAD users don't. I just mentioned it as i detected the issue.

As for installing modules/macros feel free to decide for yourself. If snap package users would like to have some modules available by default and installation in Mod folder won't be possible for that module just pack it along in snap package. I don't see any real issues with that as that is the whole point of snap packages in the end anyway.

P.S. You already did much and this is not something we need to worry about ATM but creating OCCT 7 package on Ubuntu PPA is something we probably will need (or would like to) to address in the future.
User avatar
vejmarie
Posts: 713
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Post by vejmarie »

I just pushed a new version of the snap. I am quite "happy" with that one

https://myapps.developer.ubuntu.com/dev ... a6b3ac0c4/

I roughly fixed:
- Ugly fonts
- Calculix integration
- Assembly is turned on
- Post processing in Fem is done with VTK turned on
- matplotlib issue is fixed.

There might be some small warning at snap startup, but I think it is pretty closed to where I wanted be. I will update tomorrow my PR to re-integrate the update I made regarding automatic integration with vagrant of this snap.
Post Reply