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'
Build failed
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.
Using --branch is fine, but the fact that it works locally but fails on the builder with error code 128 is strange â @mr_cal, any idea on what could be happening here?
Whatâs weird is that itâs not a branch though, but a tag. If it were a branch, I think that it would work, but branch and tag are different.
Shouldnât it be a different variable in the source?
git clone returns 128 if it canât reach the repository. I donât know why a core20 vs core22 base would behave differently, but I do know the git:// runs on port 9148. Maybe there is a firewall issue?
What happens if you change your source from git://git.kernel.org/pub/scm/network/iproute2/iproute2.git to https://kernel.googlesource.com/pub/scm/network/iproute2/iproute2?
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.
/r Luke