Exploring options - "re-targeting" Apps delivered as SNAPs

This will seem like “heresy” to those who prefer SNAPs.

For those of us who don’t, I would like to explore the following concept.

Would it be possible to take the elements of a SNAP package and re-target them such that they are un-SNAP-ped, having the contents moved to “traditional” non-SNAP locations for such code.

Would such an approach be possible, or are all the paths hardcoded and compiled such that there is no external mechanism (configuration?) which could allow the relocation/re-targetting of all the relevant code?

1 Like

While it is no problem to copy the contents of a snap somewhere, there is a lot more to it than just the contents of the squashfs image file …

Snaps are running on top of their respective base snap and are usually compiled against its libraries and ABIs, you would have to replicate the different base snaps somehow and then make sure that the un-snapped binaries are running top of this… along with this comes that your linker and all the other surrounding bits will need to look in the correct paths to find the necessary libraries, settings, database files etc…

The snaps themselves usually ship so called command-chainscripts that are also setting up specifics for the apps on startup and last but not least there are package hook scripts that a snap could invoke to generate things at install or upgrade time of the software, you would have to adapt all these to match your new install location and runtime setup

As a last point you should take into account that the squashfs files are compressed, if you copy their content to disk (which never happens with actual snaps) that content will be roughly three times the size in average

So yes, it is surely possible, but you would have to put quite some effort in to replicate setup and runtime environment

4 Likes

Thank you, Oliver. I just needed to satisfy my curiosity as to what was possible or not, and while you seem to suggest that it is possible, it is not a task to be attempted by someone who is not intimately familiar with building SNAPs in general. In other words, impractical.

Thank you for taking the time to explain it with enough detail for the “masses”.

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.