Github/snapcraft CI builds failing to add ppa to `stage-packages` & `build-packages`

Hi,

My snap has a dependency that resides in a ppa, when building a snap image on a single amd machine the Makefile that adds the ppa & repository is enough to allow snap to compile the dependency.

However, when I use snapcraft.io’s github CI to build the snaps all of them fail; the logs show these failures are due to the CI containers inability to find the ppa’s package & one other dependency

Here’s some of the project files, shortened for readability

Makefile

...
snap: deps compile

deps:
	apt-add-repository ppa:yubico/stable -y
	apt update -y
	apt install libfido2-1 libfido2-dev libcbor0.6 -y
	apt upgrade -y

compile:
	$(CC) $(CFLAGS) $(OUT_DIR)/$(MOD_NAME)
...

snapcraft.yaml

...
parts:
  make-build:
    plugin: make
    source: .
    artifacts: [fcat]
    stage-packages: [libudev-dev, udev, apt-utils, software-properties-common, curl, pkg-config, libcrypto++-dev, libssl-dev, gcc, git, libfido2-dev, libfido2-1, libcbor0.6, openssl, jq, binutils, trace-cmd, make]
    build-packages: [libudev-dev, udev, apt-utils, software-properties-common, curl, pkg-config, libcrypto++-dev, libssl-dev, gcc, git, libfido2-dev, libfido2-1, libcbor0.6, openssl, jq, binutils, trace-cmd, make]
    make-parameters: [snap]
...

So running this on my machine

snapcraft --use-lxd --enable-manifest

results in:

Staging make-build 
+ snapcraftctl stage
Priming make-build 
+ snapcraftctl prime
'grade' property not specified: defaulting to 'stable'.
Determining the version from the project repo (version: git).
The version has been set to '0+git.5b75ad5'
Snapping |                                                                                         
Snapped libfcat_0+git.5b75ad5_amd64.snap

Then running on the CI infrastructre I get the errors:

Reading package lists...
Could not find a required package in 'build-packages': libcbor0.6 libfido2-dev libfido2-1
Build failed

Not sure what I’m missing, any help would be appreciated.

Resolved it by adding the ppa in snapcraft.yaml

package-repositories:
  - type: apt
    ppa: yubico/stable
1 Like