Snapcraft builds taking a long time in snap vs run from source

I’m was wanting to update the version of snapcraft I am using and noticed newer versions had only been released as a snap. So I tried to switch to using the snap to get the latest release. I haven’t been able to build my project using snapcraft from a snap. Where a build was taking ~30 minutes, I’ve run the most recent version from the snap and have allowed snapcraft to run for more than 2 hours multiple times without a snap being created.

The steps of the build that are disk IO heavy seem to take considerably longer. Priming has taken the majority of time at 2 hours and counting and the unpack that occurs before a build takes considerably longer than previously as well.

Checking out v2.39 and running from source takes the same amount of time as the older version of snapcraft I’ve been running. So I think this is something related to running snapcraft from the snap.

Smaller projects I’ve built build fine, but still slower. The snap I’m working on ends up around 600MB and uses a good number packages in it’s package. The catkin part is the one that takes a long time, but I think this is related to the size of the part, not that it is a catkin part.

I haven’t found anything in any system logs or output from snapcraft about why this might be taking longer than normal. Does anyone have ideas or suggestions?

Can yo try 2.39.2 in candidate and provide some feedback from that one?

Yeah. I refreshed to candidate and had a build complete. It still takes longer, but the build finished in 53 minutes as opposed to running indefinitely.

Thanks for the fix. Since this is known to be improved in 2.39.2 is there a known cause of the slowdown and ways that might help further improve the performance?

We are doing additional checks on binaries to make sure all the DT_NEEDED entries are in place as well as making sure there are no version mismatches between the linker/libc6 on the base (core) and the snap.

There is a PR to speed this up a bit more over at https://github.com/snapcore/snapcraft/pull/1959

1 Like