FreeCAD Snap and Flatpack package error reading folders

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

FreeCAD Snap and Flatpack package error reading folders

Post by easyw-fc »

Hi recently I had two users of my kicadStepUp WB reporting the inability to read a specific directory written by the installer of KiCAD.
Here a link to the issue:
https://github.com/easyw/kicadStepUpMod/issues/140
FreeCAD cannot open the following file folder:

Code: Select all

/usr/share/kicad/3dmodels/
If I click on the three small dots to look for the path, the kicad folder is not present in the window:
Image
I can open /usr/share/kicad/3dmodels/Resistor_SMD.3dshapes/R_0805_2012Metric.step with a text editor.
the same file path is not readable with Snap or Flatpack Application
Freecad was installed via Flatpak (version 0.20).
Here instead the same issue with Snap package:
https://github.com/easyw/kicadStepUpMod/issues/145

Is that a normal sandbox behavior that the App is not able to read in special filesystems paths?
neildarlow
Posts: 42
Joined: Mon Mar 17, 2014 1:29 pm

Re: FreeCAD Snap and Flatpack package error reading folders

Post by neildarlow »

I can't speak for Snap but I use Flatpak extensively (fedora Silverblue).

flatpaks are isolated from the underlying operating system. /usr is present in the flatpak environment but it is provided by so-called runtimes and SDKs.

Generally, the user's home directory is accessible but directories like ~/.cache ~/.config and ~/.local/share are referenced under e.g ~/.var/app/org.freecadweb.FreeCAD/cache ~/.var/app/.org.freecadweb.FreeCAD/config and ~/.var/app/org.freecadweb.FreeCAD/data respectively.

Internally, within the flatpak, application related files are present under /app/.

Special files and other system resources are accessed either through permissions set for the flatpak or "portals" which implement special functionality.

Under a flatpak environment, an installed workbench would be found under ~/.var/app/org.freecadweb.FreeCAD/data/FreeCAD/Mod/ and the files you would expect under /usr/share/ would reside under /app/share/.

If you want to poke around a flatpak to examine its contents, after installation, execute e.g. flatpak run --command=sh org.freecadweb.FreeCAD and use regular Linux ls etc. commands to look at things. To finish just execute exit
User avatar
easyw-fc
Veteran
Posts: 3633
Joined: Thu Jul 09, 2015 9:34 am

Re: FreeCAD Snap and Flatpack package error reading folders

Post by easyw-fc »

neildarlow wrote: Sun Aug 21, 2022 4:54 pm I can't speak for Snap but I use Flatpak extensively (fedora Silverblue).

flatpaks are isolated from the underlying operating system. /usr is present in the flatpak environment but it is provided by so-called runtimes and SDKs.

Generally, the user's home directory is accessible but directories like ~/.cache ~/.config and ~/.local/share are referenced under e.g ~/.var/app/org.freecadweb.FreeCAD/cache ~/.var/app/.org.freecadweb.FreeCAD/config and ~/.var/app/org.freecadweb.FreeCAD/data respectively.

Internally, within the flatpak, application related files are present under /app/.

Special files and other system resources are accessed either through permissions set for the flatpak or "portals" which implement special functionality.
@neildarlow ,
a file in
/usr/share/kicad/3dmodels/Resistor_SMD.3dshapes/R_0805_2012Metric.step
location would be enabled to be accessed from the FreeCAD flatpack open menu?
neildarlow
Posts: 42
Joined: Mon Mar 17, 2014 1:29 pm

Re: FreeCAD Snap and Flatpack package error reading folders

Post by neildarlow »

@easyw-fc You have a problem because someone using FreeCAD in flatpak format might also be using KiCad in flatpak format. The resources contained in one flatpak wouldn't be available in the other.

One possibility that might help you is that KiCad as a flatpak is composed of a number of extension packages. There might be some method to access those extensions from the FreeCAD flatpak by some modification.

Here is the output from flatpak list | grep -i kicad on my system:

Code: Select all

KiCad	org.kicad.KiCad	6.0.7	stable	flathub	system
KiCad Footprint Libraries	org.kicad.KiCad.Library.Footprints		stable	flathub	system
KiCad 3D Model Libraries	org.kicad.KiCad.Library.Packages3D		stable	flathub	system
KiCad Schematic Symbol Libraries	org.kicad.KiCad.Library.Symbols		stable	flathub	system
KiCad Templates	org.kicad.KiCad.Library.Templates		stable	flathub	system
You can see that the various KiCad components which would normally be separate packages on a traditional GNU/Linux distribution are also packaged separately for the KiCad flatpak. How you would perform the integration I cannot help you with unfortunately.
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCAD Snap and Flatpack package error reading folders

Post by adrianinsaval »

perhaps it's better to open an issue in the flatpak repo for this: github.com/flathub/org.freecadweb.FreeCAD
I'm not sure how flatpak can get permission for such directories, IIRC the openscad flatpak can be used from within the freecad flatpak so it might be posible to do the same with kicad, it might just need to be declared somehwere in the freecad flatpak.
Post Reply