Trying to build sigrok snap

Hi, I’m trying to build a sigrok snap. I have run into several problems while doing this:

  1. The sigrok software is spread across multiple git repos, so building based on pushes to the repo with snapcraft.yaml is not sufficient.

  2. The repo containing snapcraft.yaml is purely for packaging scripts like appimage, cross compiling with mingw etc, so it also receives pushes which should NOT trigger a rebuild.

  3. The snapcraft.yaml will be in a subdirectory of the repo. build.snapcraft.io does not seem to understand this and claims the repo does not have a snapcraft.yaml. Upstream will not be happy about dropping it in the root of their repo.

  4. Upstream project is not hosted on github, so will not work with build.snapcraft.io.

This is the upstream repo where the snapcraft.yaml will live: http://sigrok.org/gitweb/?p=sigrok-util.git;a=summary

This is my fork of the repo on github launchpad with the snapcraft.yaml: https://git.launchpad.net/sigrok-snap-test

The snapcraft.yaml lists all the other repos which are needed to build. Notice in particular that the repo containing the snapcraft.yaml isn’t actually one of them.

Aside from these building problems sigrok itself works fine when confined.

This project doesn’t sound like a good fit for https://build.snapcraft.io. Instead, I’d suggest using Launchpad directly.

Once you have a snap build set up in Launchpad, you can then create a Git hook to trigger builds using lp-build-snap (snap install lp-build-snap):

$ lp-build-snap -h
usage: lp-build-snap [-h] [--lpname LPNAME] [--arch ARCH] [--series SERIES]
                     snap_name

Trigger a Snap build in Launchpad

positional arguments:
  snap_name        Name of the Snap package being built

optional arguments:
  -h, --help       show this help message and exit
  --lpname LPNAME  Launchpad user or team to build from (default: ev)
  --arch ARCH      Build architecture to target (default: amd64)
  --series SERIES  Ubuntu release to build against (default: xenial)

Okay I did that and it failed to build because of problem 3.

For this to work you need to put the snapcraft.yaml in the root of the repo. This is a fairly standard requirement of such tools (1, 2, 3, 4, …).

Okay. It still does not work. I get:

sigrok.org: Name or service not known

when trying to fetch the source repositories.

It looks like you got it working. Is that correct?

Not really. In order to make it work I had to modify the repo to the point where upstream will not accept it, and I don’t plan to maintain this myself. I also had to fork all of upstream’s repos anyway, since the builders can’t pull from remote git.

I also encountered several bugs including:




Also I have about three more I need to report.

Launchpad builders now have access to remote repositories over git://, so you should be able to simplify things.

4 Likes