Compiling the snapcraft tool


#1

I’m trying to compile snapcraft in order to better understand the behaviour of certain plugins by following this document HACKING.md.

Once inside the environment (lxc exec snapcraft-dev -- sudo -iu ubuntu bash) how should the compilation be launched? I’ve seen there’s a snap folder, should this be leveraged to create a new snapcraft snap?


#2

I followed that guide and then navigated to ./snapcraft and used snapcraft --destructive-mode to build inside the lxd container. If you just snapcraft it will try to use multipass inside the lxd container which seems overkill to nest a VM inside the container.

--destructive-mode is intended to be used in CI systems where the machine is ephemeral, and clean before the application is built.

That worked…

Staging bash-completion 
Skipping stage snapcraft-libs (already ran)
Staging legacy-snapcraft 
Staging patchelf 
Staging snapcraft 
Priming bash-completion 
Priming snapcraft-libs 
Priming legacy-snapcraft 
Priming patchelf 
Priming snapcraft 
Compiling pyc files...
Snapping 'snapcraft' |                                                                                                                                                                       
Snapped snapcraft_3.7.2+git35.gfa5fbf5_amd64.snap
(snapcraft) ubuntu@snapcraft-dev:~/snapcraft$ 

#3

@popey , thank you very much, that did the trick.