Ubuntu snap: A quick try

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Ubuntu snap: A quick try

Postby vejmarie » Sat May 28, 2016 8:45 pm

Hi Guys (and girls),

There is a major benefit to be stuck by flooding, this is forcing you to work ;). So I have finally finished to pack FreeCAD within a snap under ubuntu Xenial (16.04). There is probably still a lot of works, but this snap includes the state of the art (I mean the latest version of each libraries etc) version of FreeCAD (but this is coming from my branch, it does include ickby VTK post, and Netgen, I am trying to add Calculix into the bundle). It needs testesr (do expect bugs), patience etc ....

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

Just keep me posted if you see room for improvement. I am really interested to know on which graphical environment you have been able to make it work. Ubuntu snap is a new packaging technology, and I might have missed some dependencies.

Jm
mandeep7
Posts: 93
Joined: Wed Mar 23, 2016 10:16 am
Location: Punjab, India
Contact:

Re: Ubuntu snap: A quick try

Postby mandeep7 » Sun May 29, 2016 10:26 am

vejmarie wrote:Hi Guys (and girls),

There is a major benefit to be stuck by flooding, this is forcing you to work ;). So I have finally finished to pack FreeCAD within a snap under ubuntu Xenial (16.04). There is probably still a lot of works, but this snap includes the state of the art (I mean the latest version of each libraries etc) version of FreeCAD (but this is coming from my branch, it does include ickby VTK post, and Netgen, I am trying to add Calculix into the bundle). It needs testesr (do expect bugs), patience etc ....

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

Just keep me posted if you see room for improvement. I am really interested to know on which graphical environment you have been able to make it work. Ubuntu snap is a new packaging technology, and I might have missed some dependencies.

Jm
Hi vejmarie,

I tried searching it just now again. But I can't find it there on the "Software" center.
And the above website says: "Package status is Pending review". I think we have to wait. Right?
blacey
Posts: 367
Joined: Tue Dec 08, 2015 11:28 pm

Re: Ubuntu snap: A quick try

Postby blacey » Sun May 29, 2016 5:53 pm

vejmarie wrote:So I have finally finished to pack FreeCAD within a snap under ubuntu Xenial (16.04). There is probably still a lot of works, but this snap includes the state of the art (I mean the latest version of each libraries etc) version of FreeCAD (but this is coming from my branch, it does include ickby VTK post, and Netgen, I am trying to add Calculix into the bundle).
Excellent work JM! We should consider adding snap packages to the Travis jobs and deploy them to the GitHub Releases section in the same fashion that we do for OS X and Windows so users have instantaneous access to new features as soon as they are committed and built.

Other than having to work, I hope that you are not adversely affected by the floods.
mandeep7
Posts: 93
Joined: Wed Mar 23, 2016 10:16 am
Location: Punjab, India
Contact:

Re: Ubuntu snap: A quick try

Postby mandeep7 » Mon May 30, 2016 9:28 pm

Automated review for version 0.17: failed
2 fails:
reserved interface 'locale-control' for vetted applications only security-snap-v2_app_plug_safe (FreeCAD, locale-control)
reserved interface 'home' for vetted applications only security-snap-v2_app_plug_safe (FreeCAD, home)
0 Warnings
40 Passes
https://myapps.developer.ubuntu.com/dev ... 104/rev/1/
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Postby vejmarie » Tue May 31, 2016 7:07 am

Hi Mandeep,

The two auto test which fails are related to home directory use access needs and network stack access needs which requires configuration at snapcraft level. So they are implying a need of manual review from ubuntu but they shall be fine and will be there for ever.

By the way I will need to patch FreeCAD as there is a "hardcoded" value detection which create the .FreeCAD directory for parameter storage into the home directory from the user, which I believe is mostly the proper way but doesn't fit the snap approach from ubuntu which is protecting a lot the user data. We shall either detect if SNAP_USER_DATA environment variable is set or define a FREECAD_USER_DATA environment variable which can be set by snap launch wrapper to SNAP_USER_DATA into a snap environment.

What do you think about that ?

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

Re: Ubuntu snap: A quick try

Postby vejmarie » Tue May 31, 2016 7:11 am

blacey wrote:
vejmarie wrote:So I have finally finished to pack FreeCAD within a snap under ubuntu Xenial (16.04). There is probably still a lot of works, but this snap includes the state of the art (I mean the latest version of each libraries etc) version of FreeCAD (but this is coming from my branch, it does include ickby VTK post, and Netgen, I am trying to add Calculix into the bundle).
Excellent work JM! We should consider adding snap packages to the Travis jobs and deploy them to the GitHub Releases section in the same fashion that we do for OS X and Windows so users have instantaneous access to new features as soon as they are committed and built.

Other than having to work, I hope that you are not adversely affected by the floods.
Hi blacey,

I am travelling really often in Texas, but this time has been an experience we got flooded with 4 feet of water into the house we rented and ended up to start our travel back home using a canoe, which was the first time for me, at least to go to an airport. Hopefully we were safe, which was much better than others who have been really hits by the flooding.

I am working on getting this stuff integrated into the source tree. There is something which worries me with Travis CI is that they are using Trusty and I am not sure that ubuntu backported snapcraft for this version, this is why I am using vagrant as CI currently. I will publish the whole "CI" within a Vagrant directory and see if a PR could be accepted. I currently have the full build including the snap creation made in a single command which is vagrant up ;)

vejmarie
triplus
Posts: 8752
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Postby triplus » Tue May 31, 2016 11:59 pm

Ubuntu 16.04 is needed to install snap packages. As for testing the package i clicked on the link but i guess i would need to register first to download it?

Anyway what is your plan? To produce FreeCAD snap package and after users can install it on Ubuntu 16.04 through regular software channels?

P.S. Good to hear you managed to escape flooding. It is interesting how much flooding is going on ATM.
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Postby vejmarie » Wed Jun 01, 2016 4:07 pm

triplus wrote:Ubuntu 16.04 is needed to install snap packages. As for testing the package i clicked on the link but i guess i would need to register first to download it?

Anyway what is your plan? To produce FreeCAD snap package and after users can install it on Ubuntu 16.04 through regular software channels?

P.S. Good to hear you managed to escape flooding. It is interesting how much flooding is going on ATM.
Hi Triplus,

If people agree, I might try to maintain a "snap" FreeCAD build. It won't work on Travis as it needs Xenial (16.04) as you mentionned this is why I used vagrant as CI. I need to check how can sync up with a build and push the snap on FreeCAD website if core developer wish. It will be currently pushed into the beta part of the ubuntu store.

I have fixed the remaining bugs (--devmode install, which needs a patch into FreeCAD Application.cpp source code, GTK Warning at startup and locale issues, so I am good to go). The key thing is that it is currently compiling my own branch (occt7 PR), and I will wait a little to promote the build or make an independant PR to integrate the needed script into the source tree plus the patch.

Snappy in the end is really relevant to distribute FreeCAD as we have everything in a box. The image is 200MB not that big.

It still need a lot of testing, I am trying to get some testers from Open Compute Project and from Ubuntu, but believe it might be working.

vejmarie
triplus
Posts: 8752
Joined: Mon Dec 12, 2011 4:45 pm

Re: Ubuntu snap: A quick try

Postby triplus » Wed Jun 01, 2016 11:05 pm

I guess having a snap package would be nice. I didn't investigate much but are there any issues with config files (location) and macro/module installation location?
vejmarie
Posts: 551
Joined: Mon Jan 04, 2016 4:52 pm
Location: Somewhere between France, USA and Taiwan
Contact:

Re: Ubuntu snap: A quick try

Postby vejmarie » Thu Jun 02, 2016 1:28 pm

triplus wrote:I guess having a snap package would be nice. I didn't investigate much but are there any issues with config files (location) and macro/module installation location?
My build process is not really conventional, as I didn't build the application with snapcraft, but within a vagrant VM, and then I use the copy module from snapcraft to build up the snap. THis is the easiest way to make it happen and integrate what you want into it.

By the way my snap went through Ubunutu/Canonical validation process and you can now install freecad 0.17 through snap install freecad as root, and issue 2 additionnal command which are:
snap connect freecad:home ubuntu-core:home
snap connect freecad:locale-control ubuntu-core:locale-control

The just kick /snap/bin/freecad.FreeCAD and you are good to go.

I still have a few issues to fix but I hope to have a full working bundle pretty soon

vejmarie