So I have been maintaining iproute2 snap for a while now, and when I tried to upgrade from core20 to core22 and add a new app to the snap, it now fails when I try to build through build.snapcraft.io for publishing for different platforms.
However, when I build locally, it builds successfully and it works correctly.
When I looked at the build log from snapcraft.io in my profile, I found this interresting line:
Failed to pull source: command ['git', 'clone', '--recursive', '--branch', 'v6.1.0', 'git://git.kernel.org/pub/scm/network/iproute2/iproute2.git', PosixPath('/build/iproute2-snap/parts/iproute2/src')] exited with code 128.
Make sure sources are correctly specified.
Full execution log: '/root/.cache/snapcraft/log/snapcraft-20230204-063805.286300.log'
The first thing I notice is that the build system is using --branch instead of --tag since I am building based on tag instead of branch in git from git.kernel.org.
I haven’t had this issue in the past, and the only thing I have changed in my snapcraft.yaml is I updated the base from core20 to core22, and I added a new app that is now part of the latest iproute2.
So an update. If I change the base from core22 to core20, it builds successfully. So there must be something I am missing in my snapcraft.yaml to move to the core22 base. I will do some research and then make my changes.
I just find it odd that I can build locally in LXD with the base as core22 and no errors, but when I try to build on build.snapcraft.io it fails unless it is core20.
So I updated the base and the git source to google and it seems to work now.
Interresting that the main repo for this package doesn’t work, but a mirror does. I wonder if it’s the “git://” instead of “https://”?
Thanks for the help. Odd that it has to be called out that way.
So it looks like if I call the source using git:// instead of https:// it fails, but changing it to https:// seems to let me use the core22 base and it build successfully. Not sure why it builds locally with snapcraft but remotely it fails.
At least now it’s updated to core22 base and builds correctly now.
Thank you everyone.