Use incus instead of LXD to build snaps

Hello, I migrated from LXD to Incus for couple months now, I want to build my application and I received

LXD is required but not installed. Do you wish to install LXD and configure it with the defaults? [y/N]:                                                                           
craft-providers error: LXD is required, but not installed. Visit https://snapcraft.io/lxd for instructions on how to install the LXD snap for your distribution                    
Full execution log: '/home/xlmnxp/.local/state/snapcraft/log/snapcraft-20240126-101130.859660.log'                                                                                 

Is there a way to make snapcraft use Incus instead of LXD? (Incus is API compatible with LXD)

Probably a question for @sergiusens. I suspect putting a PR together for this would be pretty easy… but would it be accepted?

Was any followup action taken? I would like to know the outcome

I think there no action

thanks for bringing this to my attention @kyrofa

I suppose it can be, but someone would need to commit to supporting it and tracking its changes. Additionally, the image server it uses will need to host the buildd image type we have.

A python package that expands on Craft Providers would be ideal perhaps even dynamically pluggable to ensure the domains of responsibility are clear, we will probably need to do some work so this is all smooth, but it should allow any provider to be used in the future

For what it’s worth, my only excuse for the late response is that I take lots of time off during the summer time :slight_smile:

Doing slight ping. Since incus is currently stable, in 6.0 version as LTS until 2029 it seems working continuing discussion, additionally since it’s in Ubuntu 24.04 repos.

I don’t think there’s anyone to ping at this point, @KhazAkar. There is little incentive for Canonical themselves to do this work. @sergiusens did imply that he’s up for accepting it, but ultimately someone from the community (or Incus) will need to step up to add and maintain the feature. If you’re up for it, go for it!

For craft-providers or somewhere else? I can try Python, but not golang

Snapcraft is still all python to the length of my knowledge. It sounds like @sergiusens has a preference for the approach:

Then, don’t quote me on that, but I might try working on it some time, some day. I need more time in my life :smiley:

In the meantime, it’s possible to build snaps inside incus container when using snapcraft --destructive-mode before I will start working on including incus in craft-providers project :slight_smile: