craft_platforms.charm¶
Charm-specific module for craft-platforms.
- craft_platforms.charm.get_platforms_charm_build_plan(base, platforms, build_base=None)[source]¶
Generate the build plan for a platforms-based charm.
Platforms-based charms are charms that don’t use the deprecated
basesfield in theircharmcraft.yaml.Multi-base recipes are supported. A multi-base recipe defines the base within the
platformfield instead of definingbaseandbuild-base. For each platform, the base is either prefixed to the platform name or prefixed to everybuild-onandbuild-for` entry. In both cases, the prefixed base is delimited with a colon (``<base>:).- Parameters:
base (
str|None) – The run-time environment for the charm, formatted asdistribution@series. If thebuild-baseis unset, then thebasedetermines the build environment.build_base (
str|None, default:None) – The build environment to using when building the charm, formatted asdistribution@series.platforms (
Dict[DebianArchitecture|str,PlatformDict|None] |None) – The mapping of platform names toPlatformDicts. If thebaseandbuild-baseare unset, then the base must be defined in the platforms.
- Raises:
ValueError – If the build plan can’t be created due to invalid base and platform definitions.
- Returns:
Sequence[BuildInfo] – A build plan describing the environments where the charm can build and where the charm can run.