I need some software packages that are available in an external repository. It woks on my machine but I would like it to work in a cleanbuild environment to make it easier to reproduce.
I have a ppa part that includes the repository and an after dependency in my main app part.
Building with LXD (in an Ubuntu 16.04 container) gives:
--- 8< ---
snapcraft 2.42 from 'canonical' installed
Setting up container with project assets
./
./test.yml
./snap/
./snap/snapcraft.yaml
Could not find a required package in 'build-packages': some-package-from-some-ppa
When I try to debug in the container it indeed didn’t add the repository (yet).
The snapcraftctl build is unnecessary for the nil plugin
snapcraft can’t find some-package-from-some-ppa due to the fact that you haven’t updated the APT local package cache, to do so add apt-get update after the add-apt-repository call
The -u in the add-apt-repository -yu ppa:some/ppa line does exactly that.
-u, --update After adding the repository, update the package cache with packages from this repository (avoids need to apt-get update)
Removing the snapcraftctl build line as you mention did however get me a little bit farther in the build process:
--- 8< ---
Setting up container with project assets
./
./snap/
./snap/snapcraft.yaml
./snap/.snapcraft/
./snap/.snapcraft/state
./parts/
Could not find a required package in 'build-packages': some-package-from-some-ppa
Thank for helping me out Lin-Buo-Ren but still no luck.
Using the override-build or override-pull in the same part as the one where I build my application is too late. Snapcraft fails before it even reaches that step. I think it looks for the needed build packages earlier in the process.
I need a way to tell Snapcraft: include this repository before doing anything else. It has to be possible and I am missing something… but what?!