Suitability of snaps when making (and using) changes to source code

I’m busy setting up a new production cluster. So far, I’ve installed LXC/LXD using snaps.

However, I envision a scenario where I want to implement a fix or new feature myself. Obviously I can (and probably will) upstream it. But upstreaming it may take time. As such, I’m looking to have the ability ‘upgrade’ the binaries on my server to my own in the future (so I can use my own changes right-away).

Given this consideration, would you advise to install LXD using snap on my servers? What would the best strategy be?

You can place a custom binary at /var/snap/lxd/common/lxd.debug and then reload with systemctl reload snap.lxd.daemon.

This will then be run instead of the binary included in the snap and a warning will be logged to remind you that it’s happening.

The same can be done for the CLI by using lxc.debug instead.

Note that you’ll ideally want this binaries to be built on an Ubuntu 20.04 system so the shared libraries line up with those in the snap.

Thanks @stgraber . I was already looking to build my own packages using this project:

But your solution is more straight-forward (and requires less work from me for now :)) so that’s perfect!