Howto build the snap tools?

We are running our own linux distro. It’s based on source only (
We cannot and we do not want to use apt/rpm or something else.

We would like to test the snap tools - but i cannot find any documentation how to build the snap tools.

Any help here?

best regards,

Well most components for snapd are in Go, so you can just build the Go code, the complicated bits are that:

  • snap-exec, snapctl, and snap-update-ns must all be statically linked
  • snap-seccomp might need to be statically linked against libseccomp on your system, we do that for Ubuntu, not sure if that will be needed for your OS
  • snap-confine is C code, that needs to be built manually

You might find the Makefile in the ./cmd directory of snapd useful.

Hi Ian,

thanks for your fast answer. My problem was: I could not find the source. I see now it is on GitHub: - right ? is the official build documentation for Linux distro maintainers (like me)?

You also refer to “libsecomp”: Does this mean that we must install libsecomp in case we want to use snapcraft? fyi: We cannot use any software from NSA - so any SE parts in our Linux kernel are disabled and we cannot change this (no SE-Linux here for good reason).

And one last question: There is a folder “docker” in the snapcraft tree. Does that mean that snapd/snapcraft relies on docker? (I’m sorry but we cannot use docker and we won’t change this).

best regards,

I dont think libseccomp has anything to do with selinux :wink:

and no, snaps do not use any docker technology or use docker in any way …

Hi Ogra,

upps. Sorry - i was misleaded by the libs name (and too lazy to read the libsecomp docs).

So snaps do not use docker? Great news! I think i will give it a try :slight_smile:

best regards, Michael

1 Like

If all you are trying to do is use snapcraft, you can build a local package of that without snapd, it will be a less featureful snapcraft, but snapcraft is just python through and through