I’ve tried the snapcraft package from apt and also snapcraft standard and snapcraft --edge from snapd to create a simple web server in Python 3.6. When I do get to the part when I need to prime it (server), I keep getting this message about GLIBC which I don’t remember getting in Ubuntu 16.04:
The GLIBC version of the targeted core is 2.23. A newer libc will be required for the following files:
/home/teg/testserver/snaps/prime/lib/x86_64-linux-gnu/libexpat.so.1.6.7 (requires GLIBC 2.25)
‘libc6’ is required inside the snap for this part to work properly.
Add it as a stage-packages entry for this part.
It seems weird to have to manually add stage-packages: [libc6] to that Python part since this plugin is a base one with Snapcraft.
You’re not running the snapcraft CLI on Xenial, and the core snap (which contains libc) is based on Xenial. As a result, the only way we can ensure your snap runs on all operating systems is for you to stage the version of libc you’re using (since what you built requires a version newer than that in the core snap).
You might consider using snapcraft cleanbuild instead, which will use a Xenial container for building.
Coming in the pipeline is the ability to specify a base snap which you’re building against. Currently almost all snaps are built against the xenial-based base snap (16-series) but work is ongoing to introduce a bionic equivalent (18-series) which can be selected per build. Multiple base-snaps should be able to be installed in parallel when they’re ready so each application snap can choose whichever has the dependencies they need.
I think the current implementation of snapcraft has no way to bundle your own libc. It will be overridden by the libc from the “core” package. The only way to use newer version is change to use core18 but it is missing several features than the “core” package.