Tomcat part missing libc

So I’ve been going somewhat round in circles trying to meet dependancies.
With some help from the community I now know how to provide required dependencies via stage-packages.

The problem is that I’m using a remote part via the ‘after’ clause.
The error I’m getting seems to be suggesting that the remote part is missing libc6.

You can seem my snapcraft.yaml here
https://github.com/bsutton/IrrigationForPi/blob/master/snap-projects/installer/snap/snapcraft.yaml

This is the remote part I’m using:
https://github.com/mhall119/tomcat-snap-part/blob/master/snapcraft.yaml

The error I’m getting is:

Building pi-gation-launch 
Staging pi-gation-launch 
Priming pi-gation-launch
Priming tomcat 
'libc6' is required inside the snap for this part to work properly.
 Add it as a `stage-packages` entry for this part.

You can see from my snapcraft yaml that I have libc6 as a stage-package for the part that includes tomcat by ‘after’.

pi-gation-webapp:
plugin: maven
source: https://github.com/bsutton/IrrigationForPi.git
maven-options:
  [-DskipTests=true]
organize:
  war/irrigation-1.0-SNAPSHOT.war : webapps/pi-gation.war
after: [tomcat]
stage-packages:
  - libc6

The problem seems to be that the stage-packages clause for libc6 in the part doesn’t seem to meet the requirements of tomcat and the remote tomcat part is missing its own stage-packages clause.

So what is the correct solution?

@sergiusens, can you see what’s going wrong here?

libc6 should be provided by core so snapcraft stating that a part specifically needs it staged into the snap seems wrong IMO.

well thats interesting.

It certainly surprised me as this part was previously building without an issue.

snapcraft --version
snapcraft, version 2.39.1+git5.688588a

you are obviously on the edge version, perhaps there was a bad commit ?
try:

sudo snap switch --stable snapcraft

and see if the stable version helps … (if you want to go back, just re-run the command with --edge)

This build seems to be happening on non 16.04. The libc6 in core is not sufficient as it does not have all the symbols required for whatever is being snapped.

I am running on 17.10 but this part was building last week.

As I’m running on snapcraft edge I do wonder if this is an problem with the edge build. Does seem to be the most likely source of change.

If you’re building on a 17.10 host then you need to use a container via LXD to build your snap.

To get LXD running you need to run:

sudo snap install lxd
sudo adduser $USER lxd
# log out and back in for your session to recognise the newly assigned group "lxd"
sudo lxd init # accept all the defaults

Now you can run snapcraft cleanbuild which will use an LXD container based on 16.04, which will use the correct libc version.