lib* files in $SNAP/usr/lib/ links to /usr/lib/

Bug #1724972 reported by Mikael Hakansson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Expired
Undecided
Unassigned

Bug Description

We have an IoT gateway Agent developed using node.js. The Agent is generic, small and can’t do much part from communicating with an IoT hub.
All necessary logic, for instance reading sensors, is provisioned from the IoT management portal to the Agent, after which the Agent runs the code.

In most cases the downloaded code has dependencies to other NPM packages (Node Package Manager), in which case these packages are downloaded from the npmjs.org site. Some of these packages, such as the SerialPort package require to be compiled on the system using the package (the gateway in our case), and this is where the problem starts…

The Snap gets installed with its own usr folder located in the write protected snap directory (/snap/[OUR SNAP]/x1/usr). These are all kernel files and can also be located in the root directory (/usr). However SOME of these files are not visible for the root user running the Snap. So far so good, as all files are available in the equivalent Snap directory.
-However… at least one of the files in the /snap/…/usr directory is referencing files in the root (/usr), which of course is no accessible from the Snap.

The file in question is libm.so:
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libm.so.6 AS_NEEDED ( /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a /lib/x86_64-linux-gnu/libmvec.so.1 ) )

The result of this is that we can build the package…

For actions to reproduce this issue: https://github.com/snapcore/snapcraft/issues/1605

Looking forward to hear from you
Mikael Hakansson

PS: Some might argue the SerialPort package could be precompiled when creating the snap, but it would be impossible to foresee all necessary package for every customer and gateway. Also worth mentioning that the Agent runs on many other platforms part from Snap.

Tags: iot snap
Revision history for this message
Kyle Fazzari (kyrofa) wrote :

The core snap should already contain libm.so.6. What happens if you remove it from the snap (using the stage/prime keywords)?

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snapcraft because there has been no activity for 60 days.]

Changed in snapcraft:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.