How to access system libraries (/lib and /usr/lib) (read only))

Hi i’m a maintainer of CQtDeployer utility.
My users often face the problem of not being able to access system libraries to deploy their applications.

What plugins or interfaces can I or should use to get recursive access to /usr/lib and /lib read-only.?

1 Like

If I understand it correctly, CQtDeployer compiles a qmake project and creates installers for Windows and Linux? Some of the applications require libraries which are available on the host system and you want access to them in order to put them in the installer? Is this correct?

You might be able to use the system-backup interface, but that will make the libraries available in the directory /var/lib/snapd/hostfs so you will need some way to translate the paths you get from users.

1 Like

yes, you understood me correctly.
I like this solution, but it makes me greatly complicate the program logic.
maybe there are other solutions?

Did I understand correctly that the system libraries will be available under the path
/var/lib/snapd/hostfs/lib and /var/lib/snapd/hostfs/usr/lib?

While there are interfaces that you can apply to access those locations it is not a good idea to use libraries from the host system. The whole point of Snap packages is that they are self-contained and independent of the host setup. If you loaded a library from the host there is no guarantee that it is compatible with your application.

CQtDeployer does not need system libraries.
CQtDeployer is utility for deploying c++ applications. So in some cases, the utility needs to copy the system libraries to the distribution of the user application.


I think the only other solution is to go for classic confinement.

1 Like

I am very negative about the classic mode, it’s not safe. If there would be something like classic mode, but limited read-only access to system files. That would be the perfect solution.

I really like the interface system-files

but it only provides access to the specified files and not the file system,
If you could offer access to the specified folder recursively in this way, that would be ideal.

Pinging @jdstrand to see what he proposes for this use-case.

Well, besides the classic mode, there are no other options?

I wonder if a CQtDeployer plugin is called for.

Since no other solutions have been found besides ‘classic mode’, I create a request for classic mode.

1 Like