snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

Install base snap if declared as `build-base`

Open dilyn-corner opened this issue 1 year ago • 2 comments

What needs to get done

A base snap, when declared as the build-base for a snap, should be installed in the build environment as it is with regular bases declared as base: coreXX.

I would only expect this installation to occur just in case the build-base snap actually exists. For instance, devel is a special case, where that base only sometimes exists (currently devel is 24.10, but that base doesn't exist (and won't). Likewise, this should not apply to interim releases in general (as those will one day be supported for kernel snaps).

Why it needs to get done

As the build-base defines a build-time environment, it arguably makes more sense that the build-base is installed than the base. Indeed, kernel snaps are only ever built with a build-base, and installing the build-base into the environment will improve support for e.g. the new initrd plugin (which copies /etc/os-release from the build-base).

dilyn-corner avatar Aug 18 '24 23:08 dilyn-corner

This is a good idea, but it may become moot when #4879 is implemented, where we will not allow combinations like base: core22, build-base: core24 in a snapcraft.yaml.

With #4879, we will have a well-defined behavior where a base in the snapcraft.yaml determines the schema and codepath used by Snapcraft. Whether it is defined via base: or build-base: in the snapcraft.yaml, that base should be the base installed in the build environment.

We will need special handling for kernel snaps that use build-base: ubuntu@<series>, if #4868 is merged into main.

mr-cal avatar Aug 19 '24 14:08 mr-cal

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-3265.

This message was autogenerated