Snaps as build dependencies

Hello folks,

For a while now there has been discussion of the possibility of using snaps as build dependencies (with the issue being tracked at

I wonder if I might ping on what the status (and blockers, if any) are here, as I haven’t seen this issue in the roadmaps for upcoming snapcraft versions. I have a quite concrete case for a snapcraft plugin that I intend to submit, where the ideal would be able to allow the user to specify choices of compiler (and compiler version) to use with that plugin, with the snap being downloaded from the corresponding channel.

Can anyone update me? :slight_smile:

Thanks & best wishes,

-- Joe
1 Like

The main thing that needs to get done is to have support on CI, if not many people wanting to use this will later feel blocked by that. If we get buildd’s (launchpad builders) working with snaps, then can add the functionality to snapcraft.

Also it’s important to take into account travis, which uses docker for the clean build and we can’t yet install snaps in docker.

@sergiusens @elopio makes sense. Are these things that community developers can meaningfully assist with in any way, or is it best to just let you and your colleagues get on with it?

We’ve agreed to move forward with that sort of relationship in the recent sprint we had. The most likely approach we’ll use to begin with is to bundle the snap and its respective assertions inside a respective deb, so that installing the deb is guaranteed to hold the intended functionality after installation.

@slangasek, can you provide some more details about how this is going, and whether Joseph might be able to help moving that forward?

This is solving a different problem. See discussion below.

@joseph.wakeling your help is very welcome. As @sergiusens mentioned, the main thing to do first is buildd, which is a free software project where you can contribute too:

The forum post I linked earlier has information of what would be required to get snaps working in docker:

And for snapcraft itself, we have to add a new entry to the yaml, which will be very similar to build-packages but calling snap install instead of apt-get install.

I might be confused @niemeyer, but what you mention sounds like the work required to transition from a deb to a snap. Which, by the way, will be very appreciated to get rid of the snapcraft deb.

What we are discussing here is, for example, to be able to use the go snap in order to build other snaps that use the go snapcraft plugin. For this scenario, debs are not needed at all.

@elopio Thanks, you’re right. My comment above (now striked) is about using snaps as build dependencies of debs. I misunderstood the context, sorry.

Hi all – belated thanks for all the advice, thoughts and feedback here. I don’t know if/when I’ll really have a moment to make a contribution here, but if I do get the free time, it’s good to know where to start work :slight_smile: