<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/02/17 12:41, Loïc Minier wrote:<br>
</div>
<blockquote
cite="mid:CA+gR0s99G16gfCebj67o6JDq+w7PBv-j8yt9F2kN1JVtzt5owA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi,
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Feb 3, 2017 at 11:20 AM,
Roberto Mier Escandón <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:roberto.escandon@canonical.com"
target="_blank">roberto.escandon@canonical.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">I'm
having a problem with a snap which start certain daemon
when<br>
installed. This daemon tries to load certain shared
library but it's not<br>
able to do it even in devmode [1]. However it loads it
well in classic<br>
mode. The library is in a rw path, provided directly to a
dlopen method<br>
[1]. Have anybody hit this kind of issue before?<br>
</blockquote>
<div><br>
</div>
<div>In classic mode, you see libraries from your classic
Ubuntu system including X11; in devmode/confined mode, you
only see system libraries from the core snap which doesn't
contain X11.</div>
<div><br>
</div>
<div>I suggest you embed X11 and other libs that your
dlopen-ed library depends on.</div>
</div>
</div>
</div>
</blockquote>
<br>
Loic is correct, but let me give a slightly less compressed answer
:)<br>
<br>
The snap sees a filesystem that is constructed specially for it, out
of a bunch of other filesystems. Just like you can mount a set of
disks at particular paths, for the snap, a set of "disks" are
mounted at particular locations. So what the snap processes "see" as
their disk is specially constructed just for that snap.<br>
<br>
In the case of a devmode or strictly confined snap, the root of the
filesystem ("/") is the core snap. That is a tiny heart of Ubuntu
(in future could be Fedora or Debian too) that just has the very
core libraries and binaries. It does not have X11 or any desktop
libraries.<br>
<br>
So when you switched to devode, your snap processes stop seeing your
"normal hard disk" at / and start seeing the minimal core snap at /.<br>
<br>
If you 'ls -l /snap/core/current' on a classic desktop you will see
the filesystem that your snap sees at /. There are no X libraries
there :)<br>
<br>
That's why you need either:<br>
<br>
* to bundle your X libraries. snapcraft will try to do this for you
automatically. if you are handcrafting your snap then you need to
pay attention to the files in the snap and the loading paths that
the linker uses.<br>
<br>
* to use libraries from another snap which might have shared
content that lots of snaps reuse, in which case if that other snap
changes you might break<br>
<br>
Hope that's clearer,<br>
Mark<br>
</body>
</html>