lib* files in $SNAP/usr/lib/ links to /usr/lib/
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_
GROUP ( /lib/x86_
The result of this is that we can build the package…
For actions to reproduce this issue: https:/
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.
The core snap should already contain libm.so.6. What happens if you remove it from the snap (using the stage/prime keywords)?